Open panacekcz opened 6 years ago
a
is @LongerThanEq(value="b")
, then a.length - b.length
is @NonNegative
a
is @LongerThanEq(value="b")
, and b
is @MinLen(x)
, then a
could be treated as @MinLen(x)
(this probably cannot be done because of the order of index subcheckers)
The index checker has no way to express that one sequence is at least as long as another sequence. This is useful when indexing a longer sequence by an index for a shorter sequence.
@LongerThanEq(value, offset)
would mean that the annotated sequence is at least as long asvalue
plus offset (ifa
is@LongerThanEq(value="b", offset="o")
, thena.length >= b.length + o
)a
is@LongerThanEq(value="b", offset="o")
andi
is@LTLengthOf(value="b", offset="p")
, theni
can be treated as@LTLengthOf(value="a", offset="o+p")
@ShorterThanEq
is probably less useful. If it is added, then the glb of@LongerThanEq("a")
and@ShorterThanEq("a")
should be@SameLen("a")
@SameLen("a")
should be a subtype of@LongerThanEq("a")
a
is@LongerThanEq(value="b", offset="o")
andb
is@LongerThanEq(value="b", offset="p")
, thena
can be treated as@LongerThanEq(value="c", offset="o+p")
(transitivity)This issue was reported before as kelloggm#43 and panacekcz#11. The annotations were originally proposed in kelloggm#158. The difference between these issues is that kelloggm#158 is about relations of integer variables representing indices, while this is about relations of sequence variables. Related: kelloggm#132.