test/Tools/isac/Knowledge/polyminus.sml
changeset 60549 c0a775618258
parent 60509 2e0b7ca391dc
child 60556 486223010ea8
equal deleted inserted replaced
60548:5765bd0f7055 60549:c0a775618258
   369 
   369 
   370 "----------- pbl polynom vereinfachen p.33 -----------------------";
   370 "----------- pbl polynom vereinfachen p.33 -----------------------";
   371 "----------- pbl polynom vereinfachen p.33 -----------------------";
   371 "----------- pbl polynom vereinfachen p.33 -----------------------";
   372 "----------- pbl polynom vereinfachen p.33 -----------------------";
   372 "----------- pbl polynom vereinfachen p.33 -----------------------";
   373 "----------- 140 c ---";
   373 "----------- 140 c ---";
   374 reset_states ();
   374 States.reset ();
   375 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   375 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   376 	    "normalform N"],
   376 	    "normalform N"],
   377 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   377 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   378 	    ["simplification", "for_polynomials", "with_minus"]))];
   378 	    ["simplification", "for_polynomials", "with_minus"]))];
   379 moveActiveRoot 1;
   379 moveActiveRoot 1;
   380 autoCalculate 1 CompleteCalc;
   380 autoCalculate 1 CompleteCalc;
   381 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   381 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   382 if p = ([], Res) andalso 
   382 if p = ([], Res) andalso 
   383    UnparseC.term (get_obj g_res pt (fst p)) = "3 - 2 * e + 2 * f + 2 * g"
   383    UnparseC.term (get_obj g_res pt (fst p)) = "3 - 2 * e + 2 * f + 2 * g"
   384 then () else error "polyminus.sml: Vereinfache (3 - 2 * e + 2 * f...";
   384 then () else error "polyminus.sml: Vereinfache (3 - 2 * e + 2 * f...";
   385 
   385 
   386 "======= 140 d ---";
   386 "======= 140 d ---";
   387 reset_states ();
   387 States.reset ();
   388 CalcTree [(["Term (-r - 2*s - 3*t + 5 + 4*r + 8*s - 5*t - 2)",
   388 CalcTree [(["Term (-r - 2*s - 3*t + 5 + 4*r + 8*s - 5*t - 2)",
   389 	    "normalform N"],
   389 	    "normalform N"],
   390 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   390 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   391 	    ["simplification", "for_polynomials", "with_minus"]))];
   391 	    ["simplification", "for_polynomials", "with_minus"]))];
   392 moveActiveRoot 1;
   392 moveActiveRoot 1;
   393 autoCalculate 1 CompleteCalc;
   393 autoCalculate 1 CompleteCalc;
   394 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   394 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   395 if p = ([], Res) andalso 
   395 if p = ([], Res) andalso 
   396    UnparseC.term (get_obj g_res pt (fst p)) = "3 + 3 * r + 6 * s - 8 * t"
   396    UnparseC.term (get_obj g_res pt (fst p)) = "3 + 3 * r + 6 * s - 8 * t"
   397 then () else error "polyminus.sml: Vereinfache 140 d)";
   397 then () else error "polyminus.sml: Vereinfache 140 d)";
   398 
   398 
   399 "======= 139 c ---";
   399 "======= 139 c ---";
   400 reset_states ();
   400 States.reset ();
   401 CalcTree [(["Term (3*e - 6*f - 8*e - 4*f + 5*e + 7*f)",
   401 CalcTree [(["Term (3*e - 6*f - 8*e - 4*f + 5*e + 7*f)",
   402 	    "normalform N"],
   402 	    "normalform N"],
   403 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   403 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   404 	    ["simplification", "for_polynomials", "with_minus"]))];
   404 	    ["simplification", "for_polynomials", "with_minus"]))];
   405 moveActiveRoot 1;
   405 moveActiveRoot 1;
   406 autoCalculate 1 CompleteCalc;
   406 autoCalculate 1 CompleteCalc;
   407 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   407 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   408 if p = ([], Res) andalso 
   408 if p = ([], Res) andalso 
   409    UnparseC.term (get_obj g_res pt (fst p)) = "- (3 * f)"
   409    UnparseC.term (get_obj g_res pt (fst p)) = "- (3 * f)"
   410 then () else error "polyminus.sml: Vereinfache 139 c)";
   410 then () else error "polyminus.sml: Vereinfache 139 c)";
   411 
   411 
   412 "======= 139 b ---";
   412 "======= 139 b ---";
   413 reset_states ();
   413 States.reset ();
   414 CalcTree [(["Term (8*u - 5*v - 5*u + 7*v - 6*u - 3*v)",
   414 CalcTree [(["Term (8*u - 5*v - 5*u + 7*v - 6*u - 3*v)",
   415 	    "normalform N"],
   415 	    "normalform N"],
   416 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   416 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   417 	    ["simplification", "for_polynomials", "with_minus"]))];
   417 	    ["simplification", "for_polynomials", "with_minus"]))];
   418 moveActiveRoot 1;
   418 moveActiveRoot 1;
   419 autoCalculate 1 CompleteCalc;
   419 autoCalculate 1 CompleteCalc;
   420 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   420 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   421 if p = ([], Res) andalso 
   421 if p = ([], Res) andalso 
   422    UnparseC.term (get_obj g_res pt (fst p)) = "- 3 * u - v"
   422    UnparseC.term (get_obj g_res pt (fst p)) = "- 3 * u - v"
   423 then () else error "polyminus.sml: Vereinfache 139 b)";
   423 then () else error "polyminus.sml: Vereinfache 139 b)";
   424 
   424 
   425 "======= 138 a ---";
   425 "======= 138 a ---";
   426 reset_states ();
   426 States.reset ();
   427 CalcTree [(["Term (2*u - 3*v - 6*u + 5*v)",
   427 CalcTree [(["Term (2*u - 3*v - 6*u + 5*v)",
   428 	    "normalform N"],
   428 	    "normalform N"],
   429 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   429 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   430 	    ["simplification", "for_polynomials", "with_minus"]))];
   430 	    ["simplification", "for_polynomials", "with_minus"]))];
   431 moveActiveRoot 1;
   431 moveActiveRoot 1;
   432 autoCalculate 1 CompleteCalc;
   432 autoCalculate 1 CompleteCalc;
   433 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   433 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   434 if p = ([], Res) andalso 
   434 if p = ([], Res) andalso 
   435    UnparseC.term (get_obj g_res pt (fst p)) = "- 4 * u + 2 * v"
   435    UnparseC.term (get_obj g_res pt (fst p)) = "- 4 * u + 2 * v"
   436 then () else error "polyminus.sml: Vereinfache 138 a)";
   436 then () else error "polyminus.sml: Vereinfache 138 a)";
   437 
   437 
   438 "----------- met probe fuer_polynom ------------------------------";
   438 "----------- met probe fuer_polynom ------------------------------";
   449 TermC.atomty sc;
   449 TermC.atomty sc;
   450 
   450 
   451 "----------- pbl polynom probe -----------------------------------";
   451 "----------- pbl polynom probe -----------------------------------";
   452 "----------- pbl polynom probe -----------------------------------";
   452 "----------- pbl polynom probe -----------------------------------";
   453 "----------- pbl polynom probe -----------------------------------";
   453 "----------- pbl polynom probe -----------------------------------";
   454 reset_states ();
   454 States.reset ();
   455 CalcTree [(["Pruefe ((5::int)*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12 =\
   455 CalcTree [(["Pruefe ((5::int)*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12 =\
   456 	    \3 - 2 * e + 2 * f + 2 * (g::int))",
   456 	    \3 - 2 * e + 2 * f + 2 * (g::int))",
   457 	    "mitWert [e = (1::int), f = (2::int), g = (3::int)]",
   457 	    "mitWert [e = (1::int), f = (2::int), g = (3::int)]",
   458 	    "Geprueft b"],
   458 	    "Geprueft b"],
   459 	   ("PolyMinus",["polynom", "probe"],
   459 	   ("PolyMinus",["polynom", "probe"],
   461 moveActiveRoot 1;
   461 moveActiveRoot 1;
   462 autoCalculate 1 CompleteCalc;
   462 autoCalculate 1 CompleteCalc;
   463 (* autoCalculate 1 CompleteCalcHead;
   463 (* autoCalculate 1 CompleteCalcHead;
   464    autoCalculate 1 (Steps 1);
   464    autoCalculate 1 (Steps 1);
   465    autoCalculate 1 (Steps 1);
   465    autoCalculate 1 (Steps 1);
   466    val ((pt,p),_) = get_calc 1; UnparseC.term (get_obj g_res pt (fst p));
   466    val ((pt,p),_) = States.get_calc 1; UnparseC.term (get_obj g_res pt (fst p));
   467 @@@@@WN081114 gives "??.empty", all "Pruefe" are the same,
   467 @@@@@WN081114 gives "??.empty", all "Pruefe" are the same,
   468 although analogies work in interface.sml: FIXME.WN081114 in "Pruefe"*)
   468 although analogies work in interface.sml: FIXME.WN081114 in "Pruefe"*)
   469 val ((pt,p),_) = get_calc 1;
   469 val ((pt,p),_) = States.get_calc 1;
   470 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "11 = 11"
   470 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "11 = 11"
   471 then () else error "polyminus.sml: Probe 11 = 11";
   471 then () else error "polyminus.sml: Probe 11 = 11";
   472 Test_Tool.show_pt pt;
   472 Test_Tool.show_pt pt;
   473 
   473 
   474 
   474 
   475 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   475 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   476 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   476 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   477 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   477 "----------- pbl klammer polynom vereinfachen p.34 ---------------";
   478 reset_states ();
   478 States.reset ();
   479 CalcTree [(["Term (2*u - 5 - (3 - 4*u) + (8*u + 9))",
   479 CalcTree [(["Term (2*u - 5 - (3 - 4*u) + (8*u + 9))",
   480 	    "normalform N"],
   480 	    "normalform N"],
   481 	   ("PolyMinus",["klammer", "polynom", "vereinfachen"],
   481 	   ("PolyMinus",["klammer", "polynom", "vereinfachen"],
   482 	    ["simplification", "for_polynomials", "with_parentheses"]))];
   482 	    ["simplification", "for_polynomials", "with_parentheses"]))];
   483 moveActiveRoot 1;
   483 moveActiveRoot 1;
   484 autoCalculate 1 CompleteCalc;
   484 autoCalculate 1 CompleteCalc;
   485 val ((pt,p),_) = get_calc 1;
   485 val ((pt,p),_) = States.get_calc 1;
   486 if p = ([], Res) andalso 
   486 if p = ([], Res) andalso 
   487    UnparseC.term (get_obj g_res pt (fst p)) = "1 + 14 * u"
   487    UnparseC.term (get_obj g_res pt (fst p)) = "1 + 14 * u"
   488 then () else error "polyminus.sml: Vereinfache (2*u - 5 - (3 - ...";
   488 then () else error "polyminus.sml: Vereinfache (2*u - 5 - (3 - ...";
   489 Test_Tool.show_pt pt;
   489 Test_Tool.show_pt pt;
   490 
   490 
   491 "======= probe p.34 -----";
   491 "======= probe p.34 -----";
   492 reset_states ();
   492 States.reset ();
   493 CalcTree [(["Pruefe (2*u - 5 - (3 - 4*u) + (8*u + 9) = 1 + 14 * (u::int))",
   493 CalcTree [(["Pruefe (2*u - 5 - (3 - 4*u) + (8*u + 9) = 1 + 14 * (u::int))",
   494 	    "mitWert [u = (2::int)]",
   494 	    "mitWert [u = (2::int)]",
   495 	    "Geprueft b"],
   495 	    "Geprueft b"],
   496 	   ("PolyMinus",["polynom", "probe"],
   496 	   ("PolyMinus",["polynom", "probe"],
   497 	    ["probe", "fuer_polynom"]))];
   497 	    ["probe", "fuer_polynom"]))];
   498 moveActiveRoot 1;
   498 moveActiveRoot 1;
   499 autoCalculate 1 CompleteCalc;
   499 autoCalculate 1 CompleteCalc;
   500 val ((pt,p),_) = get_calc 1;
   500 val ((pt,p),_) = States.get_calc 1;
   501 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "29 = 29"
   501 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "29 = 29"
   502 then () else error "polyminus.sml: Probe 29 = 29";
   502 then () else error "polyminus.sml: Probe 29 = 29";
   503 Test_Tool.show_pt pt;
   503 Test_Tool.show_pt pt;
   504 
   504 
   505 
   505 
   506 "----------- try fun applyTactics --------------------------------";
   506 "----------- try fun applyTactics --------------------------------";
   507 "----------- try fun applyTactics --------------------------------";
   507 "----------- try fun applyTactics --------------------------------";
   508 "----------- try fun applyTactics --------------------------------";
   508 "----------- try fun applyTactics --------------------------------";
   509 reset_states ();
   509 States.reset ();
   510 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   510 CalcTree [(["Term (5*e + 6*f - 8*g - 9 - 7*e - 4*f + 10*g + 12)",
   511 	    "normalform N"],
   511 	    "normalform N"],
   512 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   512 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   513 	    ["simplification", "for_polynomials", "with_minus"]))];
   513 	    ["simplification", "for_polynomials", "with_minus"]))];
   514 moveActiveRoot 1;
   514 moveActiveRoot 1;
   515 autoCalculate 1 CompleteCalcHead;
   515 autoCalculate 1 CompleteCalcHead;
   516 autoCalculate 1 (Steps 1);
   516 autoCalculate 1 (Steps 1);
   517 autoCalculate 1 (Steps 1);
   517 autoCalculate 1 (Steps 1);
   518 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   518 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   519 "----- 1  \<up> ";
   519 "----- 1  \<up> ";
   520 fetchApplicableTactics 1 0 p;
   520 fetchApplicableTactics 1 0 p;
   521 val appltacs = specific_from_prog pt p;
   521 val appltacs = specific_from_prog pt p;
   522 applyTactic 1 p (hd appltacs) (*addiere_x_plus_minus*);
   522 applyTactic 1 p (hd appltacs) (*addiere_x_plus_minus*);
   523 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   523 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   524 "----- 2  \<up> ";
   524 "----- 2  \<up> ";
   525 (*Rewrite.trace_on := true; ..stopped Test_Isac.thy*)
   525 (*Rewrite.trace_on := true; ..stopped Test_Isac.thy*)
   526 val erls = erls_ordne_alphabetisch;
   526 val erls = erls_ordne_alphabetisch;
   527 val t = TermC.str2term "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
   527 val t = TermC.str2term "- 9 + 12 + 5 * e - 7 * e + (6 - 4) * f - 8 * g + 10 * g";
   528 val SOME (t',_) = 
   528 val SOME (t',_) = 
   538     rewrite_set_ ctxt false ordne_alphabetisch t;
   538     rewrite_set_ ctxt false ordne_alphabetisch t;
   539 UnparseC.term t';     "- 9 + 12 + 5 * e - 7 * e - 8 * g + 10 * g + (- 4 + 6) * f";
   539 UnparseC.term t';     "- 9 + 12 + 5 * e - 7 * e - 8 * g + 10 * g + (- 4 + 6) * f";
   540 
   540 
   541 
   541 
   542 applyTactic 1 p (hd (specific_from_prog pt p)) (*tausche_minus*);
   542 applyTactic 1 p (hd (specific_from_prog pt p)) (*tausche_minus*);
   543 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   543 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   544 "----- 3  \<up> ";
   544 "----- 3  \<up> ";
   545 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   545 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   546 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   546 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   547 "----- 4  \<up> ";
   547 "----- 4  \<up> ";
   548 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   548 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   549 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   549 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   550 "----- 5  \<up> ";
   550 "----- 5  \<up> ";
   551 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   551 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   552 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   552 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   553 "----- 6  \<up> ";
   553 "----- 6  \<up> ";
   554 
   554 
   555 (*<CALCMESSAGE> failure </CALCMESSAGE>
   555 (*<CALCMESSAGE> failure </CALCMESSAGE>
   556 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   556 applyTactic 1 p (hd (specific_from_prog pt p)) (**);
   557 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   557 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   558 "----- 7  \<up> ";
   558 "----- 7  \<up> ";
   559 *)
   559 *)
   560 autoCalculate 1 CompleteCalc;
   560 autoCalculate 1 CompleteCalc;
   561 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   561 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   562 (*independent from failure above: met_simp_poly_minus not confluent:
   562 (*independent from failure above: met_simp_poly_minus not confluent:
   563 (([9], Res), - (8 * g) + 10 * g + (3 - 2 * e + 2 * f)),
   563 (([9], Res), - (8 * g) + 10 * g + (3 - 2 * e + 2 * f)),
   564 (([], Res), - (8 * g) + 10 * g + (3 - 2 * e + 2 * f))]
   564 (([], Res), - (8 * g) + 10 * g + (3 - 2 * e + 2 * f))]
   565 ~~~~~~~~~~~###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*)
   565 ~~~~~~~~~~~###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*)
   566 val ([], Res) = p;
   566 val ([], Res) = p;
   567 val "2 * g + (3 - 2 * e + 2 * f)" = get_obj g_res pt (fst p) |> UnparseC.term;
   567 val "2 * g + (3 - 2 * e + 2 * f)" = get_obj g_res pt (fst p) |> UnparseC.term;
   568 (* ---------^^^--- not quite perfect*)
   568 (* ---------^^^--- not quite perfect*)
   569 
   569 
   570 
   570 
   571 "#############################################################################";
   571 "#############################################################################";
   572 reset_states ();
   572 States.reset ();
   573 CalcTree [(["Term (- (8 * g) + 10 * g + h)",
   573 CalcTree [(["Term (- (8 * g) + 10 * g + h)",
   574 	    "normalform N"],
   574 	    "normalform N"],
   575 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   575 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   576 	    ["simplification", "for_polynomials", "with_minus"]))];
   576 	    ["simplification", "for_polynomials", "with_minus"]))];
   577 moveActiveRoot 1;
   577 moveActiveRoot 1;
   578 autoCalculate 1 CompleteCalc;
   578 autoCalculate 1 CompleteCalc;
   579 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   579 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   580 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "2 * g + h"
   580 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "2 * g + h"
   581 then () else error "polyminus.sml: addiere_vor_minus";
   581 then () else error "polyminus.sml: addiere_vor_minus";
   582 
   582 
   583 
   583 
   584 "#############################################################################";
   584 "#############################################################################";
   585 reset_states ();
   585 States.reset ();
   586 CalcTree [(["Term (- (8 * g) + 10 * g + f)",
   586 CalcTree [(["Term (- (8 * g) + 10 * g + f)",
   587 	    "normalform N"],
   587 	    "normalform N"],
   588 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   588 	   ("PolyMinus",["plus_minus", "polynom", "vereinfachen"],
   589 	    ["simplification", "for_polynomials", "with_minus"]))];
   589 	    ["simplification", "for_polynomials", "with_minus"]))];
   590 moveActiveRoot 1;
   590 moveActiveRoot 1;
   591 autoCalculate 1 CompleteCalc;
   591 autoCalculate 1 CompleteCalc;
   592 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   592 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   593 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "f + 2 * g"
   593 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "f + 2 * g"
   594 then () else error "polyminus.sml: tausche_vor_plus";
   594 then () else error "polyminus.sml: tausche_vor_plus";
   595 
   595 
   596 "----------- pbl binom polynom vereinfachen p.39 -----------------";
   596 "----------- pbl binom polynom vereinfachen p.39 -----------------";
   597 "----------- pbl binom polynom vereinfachen p.39 -----------------";
   597 "----------- pbl binom polynom vereinfachen p.39 -----------------";
   625 val rls = verschoenere;
   625 val rls = verschoenere;
   626 val SOME (t,_) = rewrite_set_ ctxt false rls t; UnparseC.term t;
   626 val SOME (t,_) = rewrite_set_ ctxt false rls t; UnparseC.term t;
   627 *)
   627 *)
   628 
   628 
   629 (*@@@@@@@*)
   629 (*@@@@@@@*)
   630 reset_states ();
   630 States.reset ();
   631 CalcTree [(["Term ((3*a + 2) * (4*a - 1))",
   631 CalcTree [(["Term ((3*a + 2) * (4*a - 1))",
   632 	    "normalform N"],
   632 	    "normalform N"],
   633 	   ("PolyMinus",["binom_klammer", "polynom", "vereinfachen"],
   633 	   ("PolyMinus",["binom_klammer", "polynom", "vereinfachen"],
   634 	    ["simplification", "for_polynomials", "with_parentheses_mult"]))];
   634 	    ["simplification", "for_polynomials", "with_parentheses_mult"]))];
   635 moveActiveRoot 1;
   635 moveActiveRoot 1;
   636 autoCalculate 1 CompleteCalc;
   636 autoCalculate 1 CompleteCalc;
   637 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   637 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   638 
   638 
   639 if p = ([], Res) andalso
   639 if p = ([], Res) andalso
   640    UnparseC.term (get_obj g_res pt (fst p)) =(*"- 2 + 12 * a \<up> 2 + 5 * a" with OLD numerals*)
   640    UnparseC.term (get_obj g_res pt (fst p)) =(*"- 2 + 12 * a \<up> 2 + 5 * a" with OLD numerals*)
   641                                                "- 2 + 5 * a + 12 * a \<up> 2"
   641                                                "- 2 + 5 * a + 12 * a \<up> 2"
   642 then () else error "polyminus.sml: Vereinfache (2*u - 5 - (3 - ...";
   642 then () else error "polyminus.sml: Vereinfache (2*u - 5 - (3 - ...";
   643 
   643 
   644 "----------- pbl binom polynom vereinfachen: cube ----------------";
   644 "----------- pbl binom polynom vereinfachen: cube ----------------";
   645 "----------- pbl binom polynom vereinfachen: cube ----------------";
   645 "----------- pbl binom polynom vereinfachen: cube ----------------";
   646 "----------- pbl binom polynom vereinfachen: cube ----------------";
   646 "----------- pbl binom polynom vereinfachen: cube ----------------";
   647 reset_states ();
   647 States.reset ();
   648 CalcTree [(["Term (8*(a - q) + a - 2*q + 3*(a - 2*q))", "normalform N"],
   648 CalcTree [(["Term (8*(a - q) + a - 2*q + 3*(a - 2*q))", "normalform N"],
   649 	   ("PolyMinus",["binom_klammer", "polynom", "vereinfachen"],
   649 	   ("PolyMinus",["binom_klammer", "polynom", "vereinfachen"],
   650 	    ["simplification", "for_polynomials", "with_parentheses_mult"]))];
   650 	    ["simplification", "for_polynomials", "with_parentheses_mult"]))];
   651 moveActiveRoot 1;
   651 moveActiveRoot 1;
   652 autoCalculate 1 CompleteCalc;
   652 autoCalculate 1 CompleteCalc;
   653 val ((pt,p),_) = get_calc 1; Test_Tool.show_pt pt;
   653 val ((pt,p),_) = States.get_calc 1; Test_Tool.show_pt pt;
   654 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "12 * a - 16 * q" 
   654 if p = ([], Res) andalso UnparseC.term (get_obj g_res pt (fst p)) = "12 * a - 16 * q" 
   655 then () else error "pbl binom polynom vereinfachen: cube";
   655 then () else error "pbl binom polynom vereinfachen: cube";
   656 
   656 
   657 "----------- Refine.refine Vereinfache ----------------------------------";
   657 "----------- Refine.refine Vereinfache ----------------------------------";
   658 "----------- Refine.refine Vereinfache ----------------------------------";
   658 "----------- Refine.refine Vereinfache ----------------------------------";