diff options
Diffstat (limited to 'comparison/Inpla/src/isort-40000-reuse.in')
| -rw-r--r-- | comparison/Inpla/src/isort-40000-reuse.in | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/comparison/Inpla/src/isort-40000-reuse.in b/comparison/Inpla/src/isort-40000-reuse.in new file mode 100644 index 0000000..00f0ecc --- /dev/null +++ b/comparison/Inpla/src/isort-40000-reuse.in @@ -0,0 +1,22 @@ +// Insertion sort +IS(ret) >< [] => ret~[]; +IS(ret) >< x:xs => (*L)I(ret, x)~cnt, (*R)IS(cnt)~xs; + +I(ret, int x) >< [] => ret~[x]; +I(ret, int x) >< (int y):ys +| x<=y => ret~(*L)(x:(*R)(y:ys)) +| _ => ret~(*L)(y:cnt), (*R)I(cnt, x)~ys; + + +const LIST_ELEM=40000; + +MkRandList(ret) >< (int n) +| n>0 => ret~(rd:cnt), (*L)MkRandList(cnt)~(n-1) + where rd=rand(10000) +| _ => ret~[]; + +MkRandList(cnt)~(LIST_ELEM), +IS(ret)~cnt; +ret; + + |
