src/smltest/IsacKnowledge/simplify.sml
author wneuper
Fri, 03 Nov 2006 18:15:55 +0100
branchstart_Take
changeset 682 634a6268de81
parent 672 8e8e94006f2c
permissions -rw-r--r--
bugfix for inform with final result (gave ??.empty at ([],Res))
     1 (* tests on simplification
     2    author: Walther Neuper
     3    061019
     4    (c) due to copyright terms
     5 
     6 use"../smltest/IsacKnowledge/simplify.sml";
     7 use"simplify.sml";
     8 *)
     9 val thy = Simplify.thy;
    10 
    11 "-----------------------------------------------------------------";
    12 "table of contents -----------------------------------------------";
    13 "-----------------------------------------------------------------";
    14 "----------- CAS-command Simplify --------------------------------";
    15 "----------- append inform with final result ---------------------";
    16 "-----------------------------------------------------------------";
    17 "-----------------------------------------------------------------";
    18 "-----------------------------------------------------------------";
    19 
    20 
    21 
    22 "----------- CAS-command Simplify --------------------------------";
    23 "----------- CAS-command Simplify --------------------------------";
    24 "----------- CAS-command Simplify --------------------------------";
    25 states:=[];
    26 CalcTree [([], ("e_domID", ["e_pblID"], ["e_metID"]))];
    27 Iterator 1;
    28 moveActiveRoot 1;
    29 replaceFormula 1 "Simplify (2*a + 3*a)";
    30 autoCalculate 1 CompleteCalc;
    31 val ((pt,p),_) = get_calc 1;
    32 val Form res = (#1 o pt_extract) (pt, ([],Res));
    33 show_pt pt;
    34 if p = ([], Res) andalso term2str res = "5 * a" then ()
    35 else raise error "simplify.sml: diff.behav. CAScmd: Simplify (2*a + 3*a)";
    36 
    37 
    38 "----------- append inform with final result ---------------------";
    39 "----------- append inform with final result ---------------------";
    40 "----------- append inform with final result ---------------------";
    41 states:=[];
    42 CalcTree [(["term ((14 * x * y) / ( x * y ))", "normalform N"],
    43 	   ("Rational.thy",["rational","simplification"],
    44 	    ["simplification","of_rationals"]))];
    45 Iterator 1;
    46 moveActiveRoot 1;
    47 autoCalculate 1 CompleteCalcHead;
    48 autoCalculate 1 (Step 1);
    49 appendFormula 1 "14";
    50 val ((pt,p),_) = get_calc 1; show_pt pt;
    51 
    52 autoCalculate 1 (Step 1);
    53 val ((pt,p),_) = get_calc 1; show_pt pt;
    54 val Form res = (#1 o pt_extract) (pt, ([],Res));
    55 if p = ([], Res) andalso term2str res = "14" then ()
    56 else raise error "simplify.sml: append inform with final result ?!?";