Builtin

loop

loop{from:int, size:int, to:int, seq:int}

A relation generator. Yields a sequence of seqs depending on the arguments given.

If size is provided it is used to select the length of the sequence.

If from is provided it is used to select the staring seq otherwise 0 is used.

If to is provided it is used to select the ending seq.

Examples

size
loop(size:=3)
fromtoseq
020
021
022

from and size
loop(size:=3, from:=10)
toseq
1210
1211
1212

from and to
loop(from:=1, to:=3)
sizeseq
31
32
33

to and size
loop(size:=3, to:=4)
fromseq
22
23
24

to
loop(to:=2)
fromsizeseq
030
031
032

nested loop
loop(size:=3){i:=seq} * loop(size:=3){j:=seq}
ij
00
01
02
10
11
12
20
21
22