From 1145fc2f0ebd7777eee69b18fc700502b9210a8e Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 21 Jun 2008 17:30:56 +0200 Subject: [PATCH] sort generating system before printing We don't want the tests to depend on the ordering inside PolyLib (or any other tool). --- Formel/gen_syst.ml | 19 +++++++++--------- Test/enum.result | 2 +- Test/omega.result | 50 +++++++++++++++++++++++------------------------ Test/omega2.result | 20 +++++++++---------- Test/omega3.result | 10 +++++----- Test/rextest.result | 32 +++++++++++++++--------------- Test/test_gen_syst.result | 28 +++++++++++++------------- 7 files changed, 81 insertions(+), 80 deletions(-) rewrite Test/omega.result (68%) rewrite Test/omega2.result (83%) rewrite Test/test_gen_syst.result (70%) diff --git a/Formel/gen_syst.ml b/Formel/gen_syst.ml index c0fbb5f..5e38253 100644 --- a/Formel/gen_syst.ml +++ b/Formel/gen_syst.ml @@ -1303,15 +1303,16 @@ let print_gen_ineq i = let print_gen_syst s = pp_open_hovbox (!current_formatter) 1; pp_print_string (!current_formatter) "{"; - begin match s with - | [] -> () - | h::[] -> print_gen_ineq h - | h::t -> print_gen_ineq h; - List.iter (fun i -> - pp_print_string (!current_formatter) ","; - pp_print_space (!current_formatter) (); - print_gen_ineq i) t - end; + let ss = List.sort compare s in + begin match ss with + | [] -> () + | h::[] -> print_gen_ineq h + | h::t -> print_gen_ineq h; + List.iter (fun i -> + pp_print_string (!current_formatter) ","; + pp_print_space (!current_formatter) (); + print_gen_ineq i) t + end; pp_print_cut (!current_formatter) (); pp_print_string (!current_formatter) "}"; pp_close_box (!current_formatter) ();; diff --git a/Test/enum.result b/Test/enum.result index 9a9c69f..9c8119e 100644 --- a/Test/enum.result +++ b/Test/enum.result @@ -1 +1 @@ -{({({n >= 1, m >= 1}, {ray(n), ray(m), vertex(m+n)})}, m*n)} +{({({m >= 1, n >= 1}, {ray(n), ray(m), vertex(m+n)})}, m*n)} diff --git a/Test/omega.result b/Test/omega.result dissimilarity index 68% index 926329c..e69ce07 100644 --- a/Test/omega.result +++ b/Test/omega.result @@ -1,25 +1,25 @@ -{ [], False } -{ [], True } -{ [i; j] -> [i'; j'], {i = i', j = j'} } -{ [i; j], True } -{ [i; j], False } -{ [i; j] -> [j''], {j = j''} } -{ [i; j] -> [i'; j'], Exists beta : {i = i', j = j', i' <= j'} Or - {j >= j', j >= 2, i+j <= i'+j', j <= m, i <= n, i >= i', i >= 4, - 10*beta-i = -4} } -{ [i; j] -> [i'; j'], Exists beta : - {i = i', i' <= n, j >= 3, j <= m, i' >= 1, 10*beta-j = -3} } -false -false -true -truefalse[ ] -[ "i" ; "j" ] -[ "i'" ; "j'" ] -{unknown_1 i j i' j' = 0}{i = i', j = j', i' <= j'} -{ [i; j] -> [i'; j'], {i' = j, i = j'} Or {i = i', j = j'} } -{ [i; j] -> [i'; j'], {i' = j', j = j', i = j} } -{ [i; j] -> [i'; j'], {i = i', j = j', i'-j' <= -1} Or - {i = i', j = j', i'-j' >= 1} } -{ [i; j], {i-j <= -1, j <= n, i >= 0} } -{ [i; j] -> [i'; j'], {j = j', i-i' <= -1} } -{ [i; j] -> [i'; j'], {i = i', i' <= n, j >= 1, j <= m, i' >= 1} } +{ [], False } +{ [], True } +{ [i; j] -> [i'; j'], {i = i', j = j'} } +{ [i; j], True } +{ [i; j], False } +{ [i; j] -> [j''], {j = j''} } +{ [i; j] -> [i'; j'], Exists beta : {i' <= j', i = i', j = j'} Or + {i >= 4, j >= 2, i+j <= i'+j', i <= n, i >= i', j <= m, j >= j', + 10*beta-i = -4} } +{ [i; j] -> [i'; j'], Exists beta : + {j >= 3, i' >= 1, i' <= n, j <= m, 10*beta-j = -3, i = i'} } +false +false +true +truefalse[ ] +[ "i" ; "j" ] +[ "i'" ; "j'" ] +{unknown_1 i j i' j' = 0}{i' <= j', i = i', j = j'} +{ [i; j] -> [i'; j'], {i = j', i' = j} Or {i = i', j = j'} } +{ [i; j] -> [i'; j'], {i = j, i' = j', j = j'} } +{ [i; j] -> [i'; j'], {i'-j' <= -1, i = i', j = j'} Or + {i'-j' >= 1, i = i', j = j'} } +{ [i; j], {i-j <= -1, i >= 0, j <= n} } +{ [i; j] -> [i'; j'], {i-i' <= -1, j = j'} } +{ [i; j] -> [i'; j'], {i' >= 1, j >= 1, i' <= n, j <= m, i = i'} } diff --git a/Test/omega2.result b/Test/omega2.result dissimilarity index 83% index a654541..7498e84 100644 --- a/Test/omega2.result +++ b/Test/omega2.result @@ -1,10 +1,10 @@ -{ [i; j] -> [i'; j'], {i' = j, i = j'} Or {i = i', j = j'} } -{ [i; j] -> [i'; j'], {j = j', i-i' <= -1} } -{ [i; j] -> [i'; j'], Exists beta : {i = i', j = j', i' <= j'} Or - {j >= j', j >= 2, i+j <= i'+j', j <= m, i <= n, i >= i', i >= 4, - 10*beta-i = -4} } -[ "m" ; "n" ] -[ "i" ; "j" ] -[ "i'" ; "j'" ] -{i = i', j = j', i' <= j'}{j >= j', j >= 2, i+j <= i'+j', j <= m, i <= n, - i >= i', i >= 4, 10*beta-i = -4} +{ [i; j] -> [i'; j'], {i = j', i' = j} Or {i = i', j = j'} } +{ [i; j] -> [i'; j'], {i-i' <= -1, j = j'} } +{ [i; j] -> [i'; j'], Exists beta : {i' <= j', i = i', j = j'} Or + {i >= 4, j >= 2, i+j <= i'+j', i <= n, i >= i', j <= m, j >= j', + 10*beta-i = -4} } +[ "m" ; "n" ] +[ "i" ; "j" ] +[ "i'" ; "j'" ] +{i' <= j', i = i', j = j'}{i >= 4, j >= 2, i+j <= i'+j', i <= n, i >= i', + j <= m, j >= j', 10*beta-i = -4} diff --git a/Test/omega3.result b/Test/omega3.result index edd19bf..2fe6773 100644 --- a/Test/omega3.result +++ b/Test/omega3.result @@ -1,7 +1,7 @@ -{ [i; j] -> [i'; j'], {i = i', i' <= n, j >= 1, j <= m, i' >= 1} } +{ [i; j] -> [i'; j'], {i' >= 1, j >= 1, i' <= n, j <= m, i = i'} } { [i; j] -> [i'; j'], Exists beta : - {i = i', i' <= n, j >= 3, j <= m, i' >= 1, 10*beta-j = -3} } -{ [i; j], {j <= n, j >= 0, i <= n, i >= 0} } -{ [i; j], {i <= j, j <= n, i >= 0} } + {j >= 3, i' >= 1, i' <= n, j <= m, 10*beta-j = -3, i = i'} } +{ [i; j], {i <= n, i >= 0, j <= n, j >= 0} } +{ [i; j], {i <= j, i >= 0, j <= n} } { [i; j], {i >= j} Or {i <= j} } -{ [i; j] -> [i'; j'], {j = j', i-i' <= -1} } +{ [i; j] -> [i'; j'], {i-i' <= -1, j = j'} } diff --git a/Test/rextest.result b/Test/rextest.result index e5716e7..360640a 100644 --- a/Test/rextest.result +++ b/Test/rextest.result @@ -3,53 +3,53 @@ [ i , j ] <- [ 3*i+j , i-j ] [ i , j ] <- [ i-j , 3*i+j ] [ i ] <- [ 2+i ] -{3*i+j >= 10, i >= 1, i <= n, j >= 1, j <= m} -{i = j, i >= 1, i <= n, j >= 1, j <= m} +{3*i+j >= 10, i >= 1, j >= 1, i <= n, j <= m} +{i >= 1, j >= 1, i <= n, j <= m, i = j} { - ({j <= m, j >= 1, i <= n, i >= 1, 3*i+j >= 10}, + ({3*i+j >= 10, i >= 1, j >= 1, i <= n, j <= m}, {ray(m), ray(n), vertex(i+7*j+7*m+n), ray(j+m), ray(i+n), vertex( 3*i+j+m+3*n)}) } { - ({i = j, j <= m, j >= 1, j <= n}, + ({j >= 1, j <= m, j <= n, i = j}, {ray(m), ray(n), vertex(i+j+m+n), ray(i+j+m+n)}) } -{({7*k = 4, 2*i+3*j <= 5}, {line(3*i-2*j), ray(-j), vertex((35*j+12*k)/21)})} -{({7*k = 4, 2*i+3*j <= 5}, {line(3*i-2*j), ray(-j), vertex((35*j+12*k)/21)})} +{({2*i+3*j <= 5, 7*k = 4}, {line(3*i-2*j), ray(-j), vertex((35*j+12*k)/21)})} +{({2*i+3*j <= 5, 7*k = 4}, {line(3*i-2*j), ray(-j), vertex((35*j+12*k)/21)})} { - ({3*i+j >= 10, i >= 1, i <= n, j >= 1, j <= m}, + ({3*i+j >= 10, i >= 1, j >= 1, i <= n, j <= m}, {ray(m), ray(n), vertex(i+7*j+7*m+n), ray(j+m), ray(i+n), vertex( 3*i+j+m+3*n)}) } { - ({i = j, j <= n, j <= m, 2*j >= 5}, + ({2*j >= 5, j <= m, j <= n, i = j}, {ray(n), ray(i+j+m+n), ray(m), vertex(5*(i+j+m+n)/2)}) } { - ({i = j, j <= m, j >= 1, j <= n}, + ({j >= 1, j <= m, j <= n, i = j}, {ray(m), ray(n), vertex(i+j+m+n), ray(i+j+m+n)}) - ({j <= m, j >= 1, i <= n, i >= 1, 3*i+j >= 10}, + ({3*i+j >= 10, i >= 1, j >= 1, i <= n, j <= m}, {ray(m), ray(n), vertex(i+7*j+7*m+n), ray(j+m), ray(i+n), vertex( 3*i+j+m+3*n)}) } { - ({i-j >= 1, j <= m, j >= 1, i <= n}, + ({i-j >= 1, j >= 1, i <= n, j <= m}, {ray(m), ray(n), ray(i+n), ray(i+j+m+n), vertex(2*i+j+m+2*n)}) - ({i-j <= -1, j <= m, i <= n, i >= 1}, + ({i-j <= -1, i >= 1, i <= n, j <= m}, {ray(m), ray(n), ray(j+m), ray(i+j+m+n), vertex(i+2*j+2*m+n)}) } { - ({j >= 0, i-n <= 2, i >= 3, j-m <= -1}, + ({i >= 3, j-m <= -1, i-n <= 2, j >= 0}, {ray(m), ray(j+m), ray(n), ray(i+n), vertex(3*i+m+n)}) } { - ({j >= 1, i <= n, i >= 1, j <= m}, - {ray(j+m), ray(n), ray(i+n), ray(m), vertex(i+j+m+n)}) + ({i >= 1, j >= 1, i <= n, j <= m}, + {ray(m), ray(j+m), ray(n), ray(i+n), vertex(i+j+m+n)}) } {({0 = 1}, {})} {({}, {line(i), line(n), vertex(0)})} { - ({i+j >= 3, i >= 1, j >= 1, j <= m, i <= n}, + ({i+j >= 3, i >= 1, j >= 1, i <= n, j <= m}, {ray(j+m), vertex(i+2*j+2*m+n), ray(m), ray(n), ray(i+n), vertex( 2*i+j+m+2*n)}) } diff --git a/Test/test_gen_syst.result b/Test/test_gen_syst.result dissimilarity index 70% index b75050a..1450c77 100644 --- a/Test/test_gen_syst.result +++ b/Test/test_gen_syst.result @@ -1,14 +1,14 @@ -i+3*j -((3*i-k+n) div 2*p)+(-((3*j-k-m) div q)) -((3*i-k+n) div 2*p)+(-((3*j-k-m) div 2*p)) -0 -0 -0 -{2*i+j = n, i <= n, i >= 0, j <= n, i > j} -{i1 >= 1, i1 <= n, j1 >= 1, j1 <= n, i2 >= 1, i2 <= m, j2 >= 1, j2 <= m, - i1 = j1, i1 = k1, k2 = 1, (j1 mod 8)+(-(k1 mod 8)) = 0, - (j2 mod 8)+(-(k2 mod 8)) = 0} -{i1 = j1, -1+(j2 mod 8) = 0, j1 >= 1, j1 <= n, i2 >= 1, i2 <= m, j2 >= 1, - j2 <= m} -{i1 = j1, -1+(j2 mod 8) = 0, j1 >= 1, j1 <= n, i2 >= 1, i2 <= m, j2 >= 1, - j2 <= m} +i+3*j +((3*i-k+n) div 2*p)+(-((3*j-k-m) div q)) +((3*i-k+n) div 2*p)+(-((3*j-k-m) div 2*p)) +0 +0 +0 +{i > j, i <= n, i >= 0, j <= n, 2*i+j = n} +{i1 >= 1, i2 >= 1, j1 >= 1, j2 >= 1, i1 <= n, i2 <= m, j1 <= n, j2 <= m, + k2 = 1, i1 = k1, i1 = j1, (j1 mod 8)+(-(k1 mod 8)) = 0, + (j2 mod 8)+(-(k2 mod 8)) = 0} +{i2 >= 1, j1 >= 1, j2 >= 1, i2 <= m, j1 <= n, j2 <= m, i1 = j1, + -1+(j2 mod 8) = 0} +{i2 >= 1, j1 >= 1, j2 >= 1, i2 <= m, j1 <= n, j2 <= m, i1 = j1, + -1+(j2 mod 8) = 0} -- 2.11.4.GIT