Basically, what I need is a function of the following type:
fun
{a:t@ype}
{n:int}
{i,j:nat | i+j <= n}
list_get_segment(list(a, n), int(i), int(j)): list(a, j)
where i
is the starting index of the segment and j
the length of the segment.
Basically, what I need is a function of the following type:
fun
{a:t@ype}
{n:int}
{i,j:nat | i+j <= n}
list_get_segment(list(a, n), int(i), int(j)): list(a, j)
where i
is the starting index of the segment and j
the length of the segment.
I was able to do it with the following code