neuper@37906: (* tests on simplification neuper@37906: author: Walther Neuper neuper@37906: 061019 neuper@37906: (c) due to copyright terms neuper@37906: neuper@37906: use"../smltest/IsacKnowledge/simplify.sml"; neuper@37906: use"simplify.sml"; neuper@37906: *) neuper@37906: val thy = Simplify.thy; neuper@37906: neuper@37906: "-----------------------------------------------------------------"; neuper@37906: "table of contents -----------------------------------------------"; neuper@37906: "-----------------------------------------------------------------"; neuper@37906: "----------- CAS-command Simplify --------------------------------"; neuper@37906: "----------- append inform with final result ---------------------"; neuper@37906: "-----------------------------------------------------------------"; neuper@37906: "-----------------------------------------------------------------"; neuper@37906: "-----------------------------------------------------------------"; neuper@37906: neuper@37906: neuper@37906: neuper@37906: "----------- CAS-command Simplify --------------------------------"; neuper@37906: "----------- CAS-command Simplify --------------------------------"; neuper@37906: "----------- CAS-command Simplify --------------------------------"; neuper@37906: states:=[]; neuper@37906: CalcTree [([], ("e_domID", ["e_pblID"], ["e_metID"]))]; neuper@37906: Iterator 1; neuper@37906: moveActiveRoot 1; neuper@37906: replaceFormula 1 "Simplify (2*a + 3*a)"; neuper@37906: autoCalculate 1 (Step 1); neuper@37906: autoCalculate 1 CompleteCalc; neuper@37906: val ((pt,p),_) = get_calc 1; neuper@37906: val Form res = (#1 o pt_extract) (pt, ([],Res)); neuper@37906: show_pt pt; neuper@37906: if p = ([], Res) andalso term2str res = "5 * a" then () neuper@37906: else raise error "simplify.sml: diff.behav. CAScmd: Simplify (2*a + 3*a)"; neuper@37906: neuper@37906: neuper@37906: "----------- append inform with final result ---------------------"; neuper@37906: "----------- append inform with final result ---------------------"; neuper@37906: "----------- append inform with final result ---------------------"; neuper@37906: states:=[]; neuper@37967: CalcTree [(["TERM ((14 * x * y) / ( x * y ))", "normalform N"], neuper@37991: ("Rational",["rational","simplification"], neuper@37906: ["simplification","of_rationals"]))]; neuper@37906: Iterator 1; neuper@37906: moveActiveRoot 1; neuper@37906: autoCalculate 1 CompleteCalcHead; neuper@37906: autoCalculate 1 (Step 1); neuper@37906: appendFormula 1 "14"; neuper@37906: val ((pt,p),_) = get_calc 1; show_pt pt; neuper@37906: neuper@37906: autoCalculate 1 (Step 1); neuper@37906: val ((pt,p),_) = get_calc 1; show_pt pt; neuper@37906: val Form res = (#1 o pt_extract) (pt, ([],Res)); neuper@37906: if p = ([], Res) andalso term2str res = "14" then () neuper@37906: else raise error "simplify.sml: append inform with final result ?!?";