test/Tools/isac/Knowledge/polyminus.sml
changeset 59997 46fe5a8c3911
parent 59983 f1fdb213717b
child 60230 0ca0f9363ad3
equal deleted inserted replaced
59996:7e314dd233fd 59997:46fe5a8c3911
   247 val c = [];
   247 val c = [];
   248 val (p,_,f,nxt,_,pt) = 
   248 val (p,_,f,nxt,_,pt) = 
   249       CalcTreeTEST 
   249       CalcTreeTEST 
   250         [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   250         [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   251            "normalform N"],
   251            "normalform N"],
   252 	          ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   252 	          ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   253 	           ["simplification","for_polynomials","with_minus"]))];
   253 	           ["simplification", "for_polynomials", "with_minus"]))];
   254 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   254 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   255 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   255 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   256 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   256 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   257 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   257 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   258 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   258 val (p,_,f,nxt,_,pt) = me nxt p c pt;
   272 "----------- pbl polynom vereinfachen p.33 -----------------------";
   272 "----------- pbl polynom vereinfachen p.33 -----------------------";
   273 "----------- 140 c ---";
   273 "----------- 140 c ---";
   274 reset_states ();
   274 reset_states ();
   275 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   275 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   276 	    "normalform N"],
   276 	    "normalform N"],
   277 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   277 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   278 	    ["simplification","for_polynomials","with_minus"]))];
   278 	    ["simplification", "for_polynomials", "with_minus"]))];
   279 moveActiveRoot 1;
   279 moveActiveRoot 1;
   280 autoCalculate 1 CompleteCalc;
   280 autoCalculate 1 CompleteCalc;
   281 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   281 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   282 if p = ([], Res) andalso 
   282 if p = ([], Res) andalso 
   283    UnparseC.term (get_obj g_res pt (fst p)) = "3 - 2 * e + 2 * f + 2 * g"
   283    UnparseC.term (get_obj g_res pt (fst p)) = "3 - 2 * e + 2 * f + 2 * g"
   285 
   285 
   286 "======= 140 d ---";
   286 "======= 140 d ---";
   287 reset_states ();
   287 reset_states ();
   288 CalcTree [(["Term (-r - 2*s - 3*t + 5 + 4*r + 8*s - 5*t - 2)",
   288 CalcTree [(["Term (-r - 2*s - 3*t + 5 + 4*r + 8*s - 5*t - 2)",
   289 	    "normalform N"],
   289 	    "normalform N"],
   290 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   290 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   291 	    ["simplification","for_polynomials","with_minus"]))];
   291 	    ["simplification", "for_polynomials", "with_minus"]))];
   292 moveActiveRoot 1;
   292 moveActiveRoot 1;
   293 autoCalculate 1 CompleteCalc;
   293 autoCalculate 1 CompleteCalc;
   294 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   294 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   295 if p = ([], Res) andalso 
   295 if p = ([], Res) andalso 
   296    UnparseC.term (get_obj g_res pt (fst p)) = "3 + 3 * r + 6 * s - 8 * t"
   296    UnparseC.term (get_obj g_res pt (fst p)) = "3 + 3 * r + 6 * s - 8 * t"
   298 
   298 
   299 "======= 139 c ---";
   299 "======= 139 c ---";
   300 reset_states ();
   300 reset_states ();
   301 CalcTree [(["Term (3*e - 6*f - 8*e - 4*f + 5*e + 7*f)",
   301 CalcTree [(["Term (3*e - 6*f - 8*e - 4*f + 5*e + 7*f)",
   302 	    "normalform N"],
   302 	    "normalform N"],
   303 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   303 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   304 	    ["simplification","for_polynomials","with_minus"]))];
   304 	    ["simplification", "for_polynomials", "with_minus"]))];
   305 moveActiveRoot 1;
   305 moveActiveRoot 1;
   306 autoCalculate 1 CompleteCalc;
   306 autoCalculate 1 CompleteCalc;
   307 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   307 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   308 if p = ([], Res) andalso 
   308 if p = ([], Res) andalso 
   309    UnparseC.term (get_obj g_res pt (fst p)) = "- (3 * f)"
   309    UnparseC.term (get_obj g_res pt (fst p)) = "- (3 * f)"
   311 
   311 
   312 "======= 139 b ---";
   312 "======= 139 b ---";
   313 reset_states ();
   313 reset_states ();
   314 CalcTree [(["Term (8*u - 5*v - 5*u + 7*v - 6*u - 3*v)",
   314 CalcTree [(["Term (8*u - 5*v - 5*u + 7*v - 6*u - 3*v)",
   315 	    "normalform N"],
   315 	    "normalform N"],
   316 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   316 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   317 	    ["simplification","for_polynomials","with_minus"]))];
   317 	    ["simplification", "for_polynomials", "with_minus"]))];
   318 moveActiveRoot 1;
   318 moveActiveRoot 1;
   319 autoCalculate 1 CompleteCalc;
   319 autoCalculate 1 CompleteCalc;
   320 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   320 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   321 if p = ([], Res) andalso 
   321 if p = ([], Res) andalso 
   322    UnparseC.term (get_obj g_res pt (fst p)) = "-3 * u - v"
   322    UnparseC.term (get_obj g_res pt (fst p)) = "-3 * u - v"
   324 
   324 
   325 "======= 138 a ---";
   325 "======= 138 a ---";
   326 reset_states ();
   326 reset_states ();
   327 CalcTree [(["Term (2*u - 3*v - 6*u + 5*v)",
   327 CalcTree [(["Term (2*u - 3*v - 6*u + 5*v)",
   328 	    "normalform N"],
   328 	    "normalform N"],
   329 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   329 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   330 	    ["simplification","for_polynomials","with_minus"]))];
   330 	    ["simplification", "for_polynomials", "with_minus"]))];
   331 moveActiveRoot 1;
   331 moveActiveRoot 1;
   332 autoCalculate 1 CompleteCalc;
   332 autoCalculate 1 CompleteCalc;
   333 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   333 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   334 if p = ([], Res) andalso 
   334 if p = ([], Res) andalso 
   335    UnparseC.term (get_obj g_res pt (fst p)) = "-4 * u + 2 * v"
   335    UnparseC.term (get_obj g_res pt (fst p)) = "-4 * u + 2 * v"
   354 reset_states ();
   354 reset_states ();
   355 CalcTree [(["Pruefe ((5::int)*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12 =\
   355 CalcTree [(["Pruefe ((5::int)*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12 =\
   356 	    \3 - 2 * e + 2 * f + 2 * (g::int))",
   356 	    \3 - 2 * e + 2 * f + 2 * (g::int))",
   357 	    "mitWert [e = (1::int), f = (2::int), g = (3::int)]",
   357 	    "mitWert [e = (1::int), f = (2::int), g = (3::int)]",
   358 	    "Geprueft b"],
   358 	    "Geprueft b"],
   359 	   ("PolyMinus",["polynom","probe"],
   359 	   ("PolyMinus",["polynom", "probe"],
   360 	    ["probe","fuer_polynom"]))];
   360 	    ["probe", "fuer_polynom"]))];
   361 moveActiveRoot 1;
   361 moveActiveRoot 1;
   362 autoCalculate 1 CompleteCalc;
   362 autoCalculate 1 CompleteCalc;
   363 (* autoCalculate 1 CompleteCalcHead;
   363 (* autoCalculate 1 CompleteCalcHead;
   364    autoCalculate 1 (Steps 1);
   364    autoCalculate 1 (Steps 1);
   365    autoCalculate 1 (Steps 1);
   365    autoCalculate 1 (Steps 1);
   375 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   375 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   376 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   376 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   377 reset_states ();
   377 reset_states ();
   378 CalcTree [(["Term (2*u - 5 - (3 - 4*u) + (8*u + 9))",
   378 CalcTree [(["Term (2*u - 5 - (3 - 4*u) + (8*u + 9))",
   379 	    "normalform N"],
   379 	    "normalform N"],
   380 	   ("PolyMinus",["klammer","polynom","vereinfachen"],
   380 	   ("PolyMinus",["klammer", "polynom", "vereinfachen"],
   381 	    ["simplification","for_polynomials","with_parentheses"]))];
   381 	    ["simplification", "for_polynomials", "with_parentheses"]))];
   382 moveActiveRoot 1;
   382 moveActiveRoot 1;
   383 autoCalculate 1 CompleteCalc;
   383 autoCalculate 1 CompleteCalc;
   384 val ((pt,p),_) = get_calc 1;
   384 val ((pt,p),_) = get_calc 1;
   385 if p = ([], Res) andalso 
   385 if p = ([], Res) andalso 
   386    UnparseC.term (get_obj g_res pt (fst p)) = "1 + 14 * u"
   386    UnparseC.term (get_obj g_res pt (fst p)) = "1 + 14 * u"
   390 "======= probe p.34 -----";
   390 "======= probe p.34 -----";
   391 reset_states ();
   391 reset_states ();
   392 CalcTree [(["Pruefe (2*u - 5 - (3 - 4*u) + (8*u + 9) = 1 + 14 * (u::int))",
   392 CalcTree [(["Pruefe (2*u - 5 - (3 - 4*u) + (8*u + 9) = 1 + 14 * (u::int))",
   393 	    "mitWert [u = (2::int)]",
   393 	    "mitWert [u = (2::int)]",
   394 	    "Geprueft b"],
   394 	    "Geprueft b"],
   395 	   ("PolyMinus",["polynom","probe"],
   395 	   ("PolyMinus",["polynom", "probe"],
   396 	    ["probe","fuer_polynom"]))];
   396 	    ["probe", "fuer_polynom"]))];
   397 moveActiveRoot 1;
   397 moveActiveRoot 1;
   398 autoCalculate 1 CompleteCalc;
   398 autoCalculate 1 CompleteCalc;
   399 val ((pt,p),_) = get_calc 1;
   399 val ((pt,p),_) = get_calc 1;
   400 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "29 = 29"
   400 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "29 = 29"
   401 then () else error "polyminus.sml: Probe 29 = 29";
   401 then () else error "polyminus.sml: Probe 29 = 29";
   405 "----------- try fun applyTactics --------------------------------";
   405 "----------- try fun applyTactics --------------------------------";
   406 "----------- try fun applyTactics --------------------------------";
   406 "----------- try fun applyTactics --------------------------------";
   407 reset_states ();
   407 reset_states ();
   408 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   408 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   409 	    "normalform N"],
   409 	    "normalform N"],
   410 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   410 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   411 	    ["simplification","for_polynomials","with_minus"]))];
   411 	    ["simplification", "for_polynomials", "with_minus"]))];
   412 moveActiveRoot 1;
   412 moveActiveRoot 1;
   413 autoCalculate 1 CompleteCalcHead;
   413 autoCalculate 1 CompleteCalcHead;
   414 autoCalculate 1 (Steps 1);
   414 autoCalculate 1 (Steps 1);
   415 autoCalculate 1 (Steps 1);
   415 autoCalculate 1 (Steps 1);
   416 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   416 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   466 
   466 
   467 "#############################################################################";
   467 "#############################################################################";
   468 reset_states ();
   468 reset_states ();
   469 CalcTree [(["Term (- (8 * g) + 10 * g + h)",
   469 CalcTree [(["Term (- (8 * g) + 10 * g + h)",
   470 	    "normalform N"],
   470 	    "normalform N"],
   471 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   471 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   472 	    ["simplification","for_polynomials","with_minus"]))];
   472 	    ["simplification", "for_polynomials", "with_minus"]))];
   473 moveActiveRoot 1;
   473 moveActiveRoot 1;
   474 autoCalculate 1 CompleteCalc;
   474 autoCalculate 1 CompleteCalc;
   475 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   475 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   476 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "2 * g + h"
   476 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "2 * g + h"
   477 then () else error "polyminus.sml: addiere_vor_minus";
   477 then () else error "polyminus.sml: addiere_vor_minus";
   479 
   479 
   480 "#############################################################################";
   480 "#############################################################################";
   481 reset_states ();
   481 reset_states ();
   482 CalcTree [(["Term (- (8 * g) + 10 * g + f)",
   482 CalcTree [(["Term (- (8 * g) + 10 * g + f)",
   483 	    "normalform N"],
   483 	    "normalform N"],
   484 	   ("PolyMinus",["plus_minus","polynom","vereinfachen"],
   484 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   485 	    ["simplification","for_polynomials","with_minus"]))];
   485 	    ["simplification", "for_polynomials", "with_minus"]))];
   486 moveActiveRoot 1;
   486 moveActiveRoot 1;
   487 autoCalculate 1 CompleteCalc;
   487 autoCalculate 1 CompleteCalc;
   488 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   488 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   489 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "f + 2 * g"
   489 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "f + 2 * g"
   490 then () else error "polyminus.sml: tausche_vor_plus";
   490 then () else error "polyminus.sml: tausche_vor_plus";
   523 
   523 
   524 (*@@@@@@@*)
   524 (*@@@@@@@*)
   525 reset_states ();
   525 reset_states ();
   526 CalcTree [(["Term ((3*a + 2) * (4*a - 1))",
   526 CalcTree [(["Term ((3*a + 2) * (4*a - 1))",
   527 	    "normalform N"],
   527 	    "normalform N"],
   528 	   ("PolyMinus",["binom_klammer","polynom","vereinfachen"],
   528 	   ("PolyMinus",["binom_klammer", "polynom", "vereinfachen"],
   529 	    ["simplification","for_polynomials","with_parentheses_mult"]))];
   529 	    ["simplification", "for_polynomials", "with_parentheses_mult"]))];
   530 moveActiveRoot 1;
   530 moveActiveRoot 1;
   531 autoCalculate 1 CompleteCalc;
   531 autoCalculate 1 CompleteCalc;
   532 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   532 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   533 if p = ([], Res) andalso 
   533 if p = ([], Res) andalso 
   534    UnparseC.term (get_obj g_res pt (fst p)) = "-2 + 12 * a ^^^ 2 + 5 * a"
   534    UnparseC.term (get_obj g_res pt (fst p)) = "-2 + 12 * a ^^^ 2 + 5 * a"
   537 "----------- pbl binom polynom vereinfachen: cube ----------------";
   537 "----------- pbl binom polynom vereinfachen: cube ----------------";
   538 "----------- pbl binom polynom vereinfachen: cube ----------------";
   538 "----------- pbl binom polynom vereinfachen: cube ----------------";
   539 "----------- pbl binom polynom vereinfachen: cube ----------------";
   539 "----------- pbl binom polynom vereinfachen: cube ----------------";
   540 reset_states ();
   540 reset_states ();
   541 CalcTree [(["Term (8*(a - q) + a - 2*q + 3*(a - 2*q))", "normalform N"],
   541 CalcTree [(["Term (8*(a - q) + a - 2*q + 3*(a - 2*q))", "normalform N"],
   542 	   ("PolyMinus",["binom_klammer","polynom","vereinfachen"],
   542 	   ("PolyMinus",["binom_klammer", "polynom", "vereinfachen"],
   543 	    ["simplification","for_polynomials","with_parentheses_mult"]))];
   543 	    ["simplification", "for_polynomials", "with_parentheses_mult"]))];
   544 moveActiveRoot 1;
   544 moveActiveRoot 1;
   545 autoCalculate 1 CompleteCalc;
   545 autoCalculate 1 CompleteCalc;
   546 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   546 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   547 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "12 * a - 16 * q" 
   547 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "12 * a - 16 * q" 
   548 then () else error "pbl binom polynom vereinfachen: cube";
   548 then () else error "pbl binom polynom vereinfachen: cube";