test/Tools/isac/Knowledge/gcd_poly_ml.sml
changeset 52099 2a95fc276d0a
parent 52098 bb49dd92fa04
child 59368 c69a314184f3
     1.1 --- a/test/Tools/isac/Knowledge/gcd_poly_ml.sml	Sun Sep 01 16:50:51 2013 +0200
     1.2 +++ b/test/Tools/isac/Knowledge/gcd_poly_ml.sml	Mon Sep 02 14:56:57 2013 +0200
     1.3 @@ -741,7 +741,6 @@
     1.4  "----------- fun gcd_poly'  ------------------------------";
     1.5  "----------- fun gcd_poly'  ------------------------------";
     1.6  "----------- fun gcd_poly'  ------------------------------";
     1.7 -
     1.8  if gcd_poly' [(~3,[2,0]),(1,[5,0]),(3,[0,1]),(~6,[1,1]),(~1,[3,1]),(2,[4,1]),(1,[3,2]),(~1,[1,3]),(2,[2,3])]
     1.9  [(2,[2,0]),(~2,[0,1]),(4,[1,1]),(~1,[3,1]),(1,[1,2]),(~1,[2,2]),(~1,[0,3]),(2,[1,3])] 2 0 
    1.10  = [(1, [2, 0]), (~1, [0, 1]), (2, [1, 1])] then () else error 
    1.11 @@ -750,7 +749,7 @@
    1.12  "= [(1, [2, 0]), (~1, [0, 1]), (2, [1, 1])] changed";
    1.13  (* -xy +xy^2z+yz - 1*)(* xy +1*) (*=*) (*xy -1*)
    1.14  if gcd_poly' [(~1,[0,0,0]),(1,[0,1,1]),(1,[1,2,1]),(~1,[1,1,0])] [(1,[0,0,0]),(1,[1,1,0])] 3 0 
    1.15 -= [(1, [0, 0, 0]), (1, [1, 1, 0])] then () else error
    1.16 + = [(~1, [0, 0, 0]), (~1, [1, 1, 0])] then () else error
    1.17  "gcd_poly' [(~1,[0,0,0]),(1,[0,1,1]),(1,[1,2,1]),(~1,[1,1,0])] [(1,[0,0,0]),(1,[1,1,0])] 3 0 "
    1.18  "= [(1, [0, 0, 0]), (1, [1, 1, 0])] changed";
    1.19  
    1.20 @@ -810,6 +809,16 @@
    1.21  val ((a', b'), c) = gcd_poly a b;
    1.22  if a = (a' %%*%% c) andalso b = (b' %%*%% c) then () else error "regression test changed";
    1.23  
    1.24 +(* regression test for --- integration lev.1 -- lev.5 in rational.sml *)
    1.25 +val a = [(1, [0, 1, 1, 0, 1]), (1, [1, 0, 0, 1, 1])]: poly
    1.26 +val b = [(1, [0, 1, 0, 1, 1])]: poly
    1.27 +val ((a', b'), c) = gcd_poly a b;
    1.28 +
    1.29 +a' = [(1, [0, 1, 1, 0, 0]), (1, [1, 0, 0, 1, 0])];
    1.30 +b' = [(1, [0, 1, 0, 1, 0])];
    1.31 +c = [(1, [0, 0, 0, 0, 1])];
    1.32 +if a = (a' %%*%% c) andalso b = (b' %%*%% c) then () else error "gcd_monom changed";
    1.33 +
    1.34  "----------- fun gcd_poly downto division by zero -------";
    1.35  "----------- fun gcd_poly downto division by zero -------";
    1.36  "----------- fun gcd_poly downto division by zero -------";