From 787dc13c837f0955fbd85b8f26a05d720d361333 Mon Sep 17 00:00:00 2001 From: Shinya Sato Date: Sun, 24 Oct 2021 23:04:45 +0900 Subject: Upload the comparison directory --- comparison/Inpla/src/bsort-40000.in | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 comparison/Inpla/src/bsort-40000.in (limited to 'comparison/Inpla/src/bsort-40000.in') diff --git a/comparison/Inpla/src/bsort-40000.in b/comparison/Inpla/src/bsort-40000.in new file mode 100644 index 0000000..0120900 --- /dev/null +++ b/comparison/Inpla/src/bsort-40000.in @@ -0,0 +1,24 @@ +// Bubble sort +BS(ret) >< [] => ret~[]; +BS(ret) >< x:xs => BS(ret)~cnt, B(cnt, x)~xs; +BS(ret) >< M(x) => ret~x; + +B(ret, int x) >< [] => ret~M([x]); +B(ret, int x) >< M(w) => ret~M(x:w); +B(ret, int x) >< (int y):ys +| x ret~(x:cnt), B(cnt, y)~ys +| _ => ret~(y:cnt), B(cnt, x)~ys; + + + + +const LIST_ELEM=40000; + +MkRandList(ret) >< (int n) +| n>0 => ret~(rd:cnt), MkRandList(cnt)~(n-1) + where rd=rand(10000) +| _ => ret~[]; + +MkRandList(cnt)~(LIST_ELEM), +BS(ret)~cnt; +ret; -- cgit v1.2.3