[951dc2a] | 1 | LIB "tst.lib"; |
---|
| 2 | tst_init(); |
---|
| 3 | |
---|
| 4 | LIB("ehv.lib"); |
---|
| 5 | |
---|
[db61bce] | 6 | proc testRemoveReduntandComponents() |
---|
| 7 | { |
---|
| 8 | ring rng = 0,(x,y),dp; |
---|
| 9 | def L1 = list(list(std(ideal(x-1)),ideal(x-1)),list(std(ideal(x-1)),ideal(x-1)),list(std(ideal(y-2)),ideal(y-2))); |
---|
| 10 | def L2 = list(list(std(ideal(x-1)),ideal(x-1)),list(std(ideal(y-2)),ideal(y-2))); |
---|
| 11 | def LL1 = removeRedundantComponents(L1); |
---|
| 12 | ASSUME(0, size(LL1)==2); |
---|
| 13 | ASSUME(0, primDecsAreEquivalent( L1, L2 ) ); |
---|
| 14 | |
---|
| 15 | system("random", 1401092447); |
---|
| 16 | ring rng2 = 23,(x, y, z), dp; |
---|
| 17 | ideal I = 9*x*y^2-11*x*z^2, 11*x*y*z^2+4*x^2*z, -3*y^5+x*z-10*y*z; |
---|
| 18 | |
---|
| 19 | list L1,L2, LL1; |
---|
| 20 | |
---|
| 21 | def RI = std(radical(I)); |
---|
| 22 | |
---|
| 23 | L1 = primdecGTZ(RI); |
---|
| 24 | L2 = primdecGTZ(RI); |
---|
| 25 | LL1 = removeRedundantComponents(L1); |
---|
| 26 | ASSUME(0, size(LL1)==6); |
---|
| 27 | ASSUME(0, primDecsAreEquivalent( LL1, L1) ); |
---|
| 28 | ASSUME(0, primDecsAreEquivalent( L1 , L2 ) ); |
---|
| 29 | } |
---|
| 30 | |
---|
[3b2bf92] | 31 | proc testPrimDecsAreEquivalent() |
---|
[951dc2a] | 32 | { |
---|
[3b2bf92] | 33 | ring rng = 0 ,x,dp; |
---|
| 34 | list L1, L2; |
---|
| 35 | |
---|
| 36 | // test1. different sizes |
---|
| 37 | L1[1] = list( ideal(0), ideal(0) ); |
---|
| 38 | ASSUME(0, 0 == primDecsAreEquivalent(L1,L2) ); |
---|
| 39 | // test2. same size, but different content |
---|
| 40 | L2[1] = list( ideal(1), ideal(1) ); |
---|
| 41 | |
---|
| 42 | ASSUME(0, 0 == primDecsAreEquivalent(L1,L2) ); |
---|
| 43 | |
---|
| 44 | // test3. equivalent content |
---|
| 45 | L1[1] = list( ideal(0), ideal(0) ); |
---|
| 46 | L1[2] = list( ideal(x), ideal(x) ); |
---|
| 47 | L2[1] = list( ideal(x), ideal(x) ); |
---|
| 48 | L2[2] = list( ideal(0), ideal(0) ); |
---|
| 49 | ASSUME(0, 1 == primDecsAreEquivalent(L1,L2) ); |
---|
[db61bce] | 50 | |
---|
[75f460] | 51 | |
---|
[db61bce] | 52 | |
---|
[951dc2a] | 53 | } |
---|
| 54 | |
---|
[db61bce] | 55 | testRemoveReduntandComponents(); |
---|
[3b2bf92] | 56 | testPrimDecsAreEquivalent(); |
---|
[951dc2a] | 57 | |
---|
| 58 | tst_status(1); $; |
---|
| 59 | |
---|