aboutsummaryrefslogtreecommitdiff
path: root/comparison/Inpla/src/qsort-800000-reuse.in
diff options
context:
space:
mode:
authorShinya Sato <shinnya.sato@gmail.com>2022-09-17 22:25:50 +0900
committerShinya Sato <shinnya.sato@gmail.com>2022-09-17 22:25:50 +0900
commitd90c10cd95e399dd7614df76ee06acd1bf721833 (patch)
tree42fd557836de39d4a32a303c40f42393906a6e4c /comparison/Inpla/src/qsort-800000-reuse.in
parent4b0da2732d7adcaa7d85db2ee329f8a52ef88c42 (diff)
parentb10fccefe9a6435328ff9d554995fb5710f74f26 (diff)
downloadinpla-d90c10cd95e399dd7614df76ee06acd1bf721833.tar.gz
inpla-d90c10cd95e399dd7614df76ee06acd1bf721833.zip
Merge branch 'develop'
Diffstat (limited to 'comparison/Inpla/src/qsort-800000-reuse.in')
-rw-r--r--comparison/Inpla/src/qsort-800000-reuse.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/comparison/Inpla/src/qsort-800000-reuse.in b/comparison/Inpla/src/qsort-800000-reuse.in
index 7f41045..b1e2ae1 100644
--- a/comparison/Inpla/src/qsort-800000-reuse.in
+++ b/comparison/Inpla/src/qsort-800000-reuse.in
@@ -5,6 +5,7 @@ qsort(ret) >< (int x):xs =>
(*L)qsort(cntl)~left, qsort(cntr)~right,
Append(ret, x:cntl)~cntr;
+
// Note: `Append' is implemented as built-in.
@@ -12,6 +13,10 @@ part(int x, a, b) >< [] => a~(*L)[], b~(*R)[];
part(int x, a, b) >< (int y):ys
| y<x => b~(*R)(y:cnt), (*L)part(x, a, cnt)~ys
| _ => a~(*R)(y:cnt), (*L)part(x, cnt, b)~ys;
+//| y<x => (*L)part(x, a, cnt)~ys, b~(*R)(y:cnt) // quite BAD!
+//| _ => (*L)part(x, cnt, b)~ys, a~(*R)(y:cnt); // quite BAD!
+
+
// creates a random list
@@ -22,7 +27,7 @@ make_RandList(ret) >< (int n)
// validation checks
-valid(ret) >< [] => ret~False;
+valid(ret) >< [] => ret~True;
valid(ret) >< x:xs => (*L)valid_Cons(ret,x)~xs;
valid_Cons(ret, int x) >< [] => ret~True;