test/Tools/isac/Knowledge/polyeq-1.sml
author Walther Neuper <walther.neuper@jku.at>
Fri, 15 May 2020 14:22:05 +0200
changeset 59984 08296690e7a6
parent 59971 2909d58a5c5d
child 59997 46fe5a8c3911
permissions -rw-r--r--
prep. cleanup of Specification
walther@59627
     1
(* Title:  Knowledge/polyeq-1.sml
walther@59627
     2
           testexamples for PolyEq, poynomial equations and equational systems
walther@59627
     3
   Author: Richard Lang 2003  
walther@59627
     4
   (c) due to copyright terms
walther@59627
     5
WN030609: some expls dont work due to unfinished handling of 'expanded terms';
walther@59627
     6
          others marked with TODO have to be checked, too.
walther@59627
     7
*)
walther@59627
     8
walther@59627
     9
"-----------------------------------------------------------------";
walther@59627
    10
"table of contents -----------------------------------------------";
walther@59627
    11
"-----------------------------------------------------------------";
walther@59627
    12
"------ polyeq-1.sml ---------------------------------------------";
walther@59627
    13
"----------- tests on predicates in problems ---------------------";
walther@59627
    14
"----------- test matching problems ------------------------------";
walther@59847
    15
"----------- prep. for introduction of Matthias Goldgruber 2003 trials on rewrite orders -----";
walther@59847
    16
"----------- Matthias Goldgruber 2003 trials on rewrite orders -------------------------------";
walther@59627
    17
"----------- lin.eq degree_0 -------------------------------------";
walther@59627
    18
"----------- test thm's d2_pq_formulsxx[_neg]---------------------";
walther@59627
    19
"----------- equality (2 +(-1)*x + x^^^2 = (0::real)) ----------------------------------------";
walther@59627
    20
"----------- equality (-2 +(-1)*x + 1*x^^^2 = 0) ---------------------------------------------";
walther@59627
    21
"----------- equality (-2 + x + x^^^2 = 0) ---------------------------------------------------";
walther@59627
    22
"----------- equality (2 + x + x^^^2 = 0) ----------------------------------------------------";
walther@59627
    23
"----------- equality (-2 + x + 1*x^^^2 = 0)) ------------------------------------------------";
walther@59627
    24
"----------- equality (1*x +   x^^^2 = 0) ----------------------------------------------------";
walther@59627
    25
"----------- equality (1*x + 1*x^^^2 = 0) ----------------------------------------------------";
walther@59627
    26
"----------- equality (x +   x^^^2 = 0) ------------------------------------------------------";
walther@59627
    27
"----------- equality (x + 1*x^^^2 = 0) ------------------------------------------------------";
walther@59627
    28
"----------- equality (-4 + x^^^2 = 0) -------------------------------------------------------";
walther@59627
    29
"----------- equality (4 + 1*x^^^2 = 0) -------------------------------------------------------";
walther@59627
    30
"----------- equality (1 +(-1)*x + 2*x^^^2 = 0) ----------------------------------------------";
walther@59627
    31
"----------- equality (-1 + x + 2*x^^^2 = 0) -------------------------------------------------";
walther@59627
    32
"----------- equality (1 + x + 2*x^^^2 = 0) --------------------------------------------------";
walther@59627
    33
"----------- (-8 - 2*x + x^^^2 = 0),  (*Schalk 2, S.67 Nr.31.b----";
walther@59627
    34
"----------- (-8 - 2*x + x^^^2 = 0),  by rewriting ---------------";
walther@59627
    35
"----------- (-16 + 4*x + 2*x^^^2 = 0), --------------------------";
walther@59627
    36
"-----------------------------------------------------------------";
walther@59627
    37
"------ polyeq-2.sml ---------------------------------------------";
walther@59627
    38
"----------- (a*b - (a+b)*x + x^^^2 = 0), (*Schalk 2,S.68Nr.44.a*)";
walther@59627
    39
"----------- (-64 + x^^^2 = 0), (*Schalk 2, S.66 Nr.1.a~--------*)";
walther@59627
    40
"----------- (-147 + 3*x^^^2 = 0), (*Schalk 2, S.66 Nr.1.b------*)";
walther@59627
    41
"----------- (3*x - 1 - (5*x - (2 - 4*x)) = -11),(*Schalk Is86Bsp5";
walther@59627
    42
"----------- ((x+1)*(x+2) - (3*x - 2)^^^2=.. Schalk II s.68 Bsp 37";
walther@59627
    43
"----------- rls make_polynomial_in ------------------------------";
walther@59627
    44
"----------- interSteps ([1],Res); on Schalk Is86Bsp5-------------";
walther@59627
    45
"----------- rls d2_polyeq_bdv_only_simplify ---------------------";
walther@59627
    46
"-----------------------------------------------------------------";
walther@59627
    47
"-----------------------------------------------------------------";
walther@59627
    48
walther@59627
    49
"----------- tests on predicates in problems ---------------------";
walther@59627
    50
"----------- tests on predicates in problems ---------------------";
walther@59627
    51
"----------- tests on predicates in problems ---------------------";
walther@59901
    52
(* Rewrite.trace_on:=true;
walther@59901
    53
 Rewrite.trace_on:=false;
walther@59627
    54
*)
walther@59627
    55
 val t1 = (Thm.term_of o the o (parse thy)) "lhs (-8 - 2*x + x^^^2 = 0)";
walther@59627
    56
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t1;
walther@59868
    57
 if ((UnparseC.term t) = "-8 - 2 * x + x ^^^ 2") then ()
walther@59627
    58
 else  error "polyeq.sml: diff.behav. in lhs";
walther@59627
    59
walther@59627
    60
 val t2 = (Thm.term_of o the o (parse thy)) "(-8 - 2*x + x^^^2) is_expanded_in x";
walther@59627
    61
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t2;
walther@59868
    62
 if (UnparseC.term t) = "True" then ()
walther@59627
    63
 else  error "polyeq.sml: diff.behav. 1 in is_expended_in";
walther@59627
    64
walther@59627
    65
 val t0 = (Thm.term_of o the o (parse thy)) "(sqrt(x)) is_poly_in x";
walther@59627
    66
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t0;
walther@59868
    67
 if (UnparseC.term t) = "False" then ()
walther@59627
    68
 else  error "polyeq.sml: diff.behav. 2 in is_poly_in";
walther@59627
    69
walther@59627
    70
 val t3 = (Thm.term_of o the o (parse thy)) "(-8 + (-1)*2*x + x^^^2) is_poly_in x";
walther@59627
    71
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t3;
walther@59868
    72
 if (UnparseC.term t) = "True" then ()
walther@59627
    73
 else  error "polyeq.sml: diff.behav. 3 in is_poly_in";
walther@59627
    74
walther@59627
    75
 val t4 = (Thm.term_of o the o (parse thy)) "(lhs (-8 + (-1)*2*x + x^^^2 = 0)) is_expanded_in x";
walther@59627
    76
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t4;
walther@59868
    77
 if (UnparseC.term t) = "True" then ()
walther@59627
    78
 else  error "polyeq.sml: diff.behav. 4 in is_expended_in";
walther@59627
    79
walther@59627
    80
walther@59627
    81
 val t6 = (Thm.term_of o the o (parse thy)) "(lhs (-8 - 2*x + x^^^2 = 0)) is_expanded_in x";
walther@59627
    82
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t6;
walther@59868
    83
 if (UnparseC.term t) = "True" then ()
walther@59627
    84
 else  error "polyeq.sml: diff.behav. 5 in is_expended_in";
walther@59627
    85
 
walther@59627
    86
 val t3 = (Thm.term_of o the o (parse thy))"((-8 - 2*x + x^^^2) has_degree_in x) = 2";
walther@59627
    87
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t3;
walther@59868
    88
 if (UnparseC.term t) = "True" then ()
walther@59627
    89
 else  error "polyeq.sml: diff.behav. in has_degree_in_in";
walther@59627
    90
walther@59627
    91
 val t3 = (Thm.term_of o the o (parse thy)) "((sqrt(x)) has_degree_in x) = 2";
walther@59627
    92
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t3;
walther@59868
    93
 if (UnparseC.term t) = "False" then ()
walther@59627
    94
 else  error "polyeq.sml: diff.behav. 6 in has_degree_in_in";
walther@59627
    95
walther@59627
    96
 val t4 = (Thm.term_of o the o (parse thy)) 
walther@59627
    97
	      "((-8 - 2*x + x^^^2) has_degree_in x) = 1";
walther@59627
    98
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t4;
walther@59868
    99
 if (UnparseC.term t) = "False" then ()
walther@59627
   100
 else  error "polyeq.sml: diff.behav. 7 in has_degree_in_in";
walther@59627
   101
walther@59627
   102
 val t5 = (Thm.term_of o the o (parse thy)) 
walther@59627
   103
	      "((-8 - 2*x + x^^^2) has_degree_in x) = 2";
walther@59627
   104
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_prls t5;
walther@59868
   105
 if (UnparseC.term t) = "True" then ()
walther@59627
   106
 else  error "polyeq.sml: diff.behav. 8 in has_degree_in_in";
walther@59627
   107
walther@59627
   108
"----------- test matching problems --------------------------0---";
walther@59627
   109
"----------- test matching problems --------------------------0---";
walther@59627
   110
"----------- test matching problems --------------------------0---";
walther@59627
   111
val fmz = ["equality (-8 - 2*x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59984
   112
if M_Match.match_pbl fmz (Problem.from_store ["expanded","univariate","equation"]) =
walther@59984
   113
  M_Match.Matches' {Find = [Correct "solutions L"], 
walther@59627
   114
            With = [], 
walther@59627
   115
            Given = [Correct "equality (-8 - 2 * x + x ^^^ 2 = 0)", Correct "solveFor x"], 
walther@59627
   116
            Where = [Correct "matches (?a = 0) (-8 - 2 * x + x ^^^ 2 = 0)", 
walther@59627
   117
                     Correct "lhs (-8 - 2 * x + x ^^^ 2 = 0) is_expanded_in x"], 
walther@59627
   118
            Relate = []}
walther@59984
   119
then () else error "M_Match.match_pbl [expanded,univariate,equation]";
walther@59627
   120
walther@59984
   121
if M_Match.match_pbl fmz (Problem.from_store ["degree_2","expanded","univariate","equation"]) =
walther@59984
   122
  M_Match.Matches' {Find = [Correct "solutions L"], 
walther@59627
   123
            With = [], 
walther@59627
   124
            Given = [Correct "equality (-8 - 2 * x + x ^^^ 2 = 0)", Correct "solveFor x"], 
walther@59627
   125
            Where = [Correct "lhs (-8 - 2 * x + x ^^^ 2 = 0) has_degree_in x = 2"], 
walther@59627
   126
            Relate = []}              (*before WN110906 was: has_degree_in x =!= 2"]*)
walther@59984
   127
then () else error "M_Match.match_pbl [degree_2,expanded,univariate,equation]";
walther@59627
   128
walther@59847
   129
walther@59847
   130
"----------- prep. for introduction of Matthias Goldgruber 2003 trials on rewrite orders -----";
walther@59847
   131
"----------- prep. for introduction of Matthias Goldgruber 2003 trials on rewrite orders -----";
walther@59847
   132
"----------- prep. for introduction of Matthias Goldgruber 2003 trials on rewrite orders -----";
walther@59847
   133
(*##################################################################################
walther@59847
   134
-----------28.2.03: war nicht upgedatet und ausgeklammert in ROOT.ML-->Test_Isac.thy
walther@59847
   135
walther@59847
   136
  (*Aufgabe zum Einstieg in die Arbeit...*)
walther@59847
   137
  val t = (Thm.term_of o the o (parse thy)) "a*b - (a+b)*x + x^^^2 = 0";
walther@59847
   138
  (*ein 'ruleset' aus Poly.ML wird angewandt...*)
walther@59847
   139
  val SOME (t,_) = rewrite_set_ thy Poly_erls false make_polynomial t;
walther@59868
   140
  UnparseC.term t;
walther@59847
   141
  "a * b + (-1 * (a * x) + (-1 * (b * x) + x ^^^ 2)) = 0";
walther@59847
   142
  val SOME (t,_) = 
walther@59847
   143
      rewrite_set_inst_ thy Poly_erls false [("bdv","a")] make_polynomial_in t;
walther@59868
   144
  UnparseC.term t;
walther@59847
   145
  "x ^^^ 2 + (-1 * (b * x) + (-1 * (x * a) + b * a)) = 0";
walther@59847
   146
(* bei Verwendung von "size_of-term" nach MG :*)
walther@59847
   147
(*"x ^^^ 2 + (-1 * (b * x) + (b * a + -1 * (x * a))) = 0"  !!! *)
walther@59847
   148
walther@59847
   149
  (*wir holen 'a' wieder aus der Klammerung heraus...*)
walther@59847
   150
  val SOME (t,_) = rewrite_set_ thy Poly_erls false discard_parentheses t;
walther@59868
   151
  UnparseC.term t;
walther@59847
   152
   "x ^^^ 2 + -1 * b * x + -1 * x * a + b * a = 0";
walther@59847
   153
(* "x ^^^ 2 + -1 * b * x + b * a + -1 * x * a = 0" !!! *)
walther@59847
   154
walther@59847
   155
  val SOME (t,_) =
walther@59847
   156
      rewrite_set_inst_ thy Poly_erls false [("bdv","a")] make_polynomial_in t;
walther@59868
   157
  UnparseC.term t;
walther@59847
   158
  "x ^^^ 2 + (-1 * (b * x) + a * (b + -1 * x)) = 0"; 
walther@59847
   159
  (*da sind wir fast am Ziel: make_polynomial_in 'a' sollte ergeben
walther@59847
   160
  "x ^^^ 2 + (-1 * (b * x)) + (b + -1 * x) * a = 0"*)
walther@59847
   161
walther@59847
   162
  (*das rewriting l"asst sich beobachten mit
walther@59901
   163
Rewrite.trace_on := false;
walther@59847
   164
  *)
walther@59847
   165
walther@59847
   166
"------15.11.02 --------------------------";
walther@59847
   167
  val t = (Thm.term_of o the o (parse thy)) "1 + a * x + b * x";
walther@59847
   168
  val bdv = (Thm.term_of o the o (parse thy)) "bdv";
walther@59847
   169
  val a = (Thm.term_of o the o (parse thy)) "a";
walther@59847
   170
 
walther@59901
   171
Rewrite.trace_on := false;
walther@59847
   172
 (* Anwenden einer Regelmenge aus Termorder.ML: *)
walther@59847
   173
 val SOME (t,_) =
walther@59847
   174
     rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
walther@59868
   175
 UnparseC.term t;
walther@59847
   176
 val SOME (t,_) =
walther@59847
   177
     rewrite_set_ thy false discard_parentheses t;
walther@59868
   178
 UnparseC.term t;
walther@59847
   179
"1 + b * x + x * a";
walther@59847
   180
walther@59847
   181
 val t = (Thm.term_of o the o (parse thy)) "1 + a * (x + b * x) + a^^^2";
walther@59847
   182
 val SOME (t,_) =
walther@59847
   183
     rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
walther@59868
   184
 UnparseC.term t;
walther@59847
   185
 val SOME (t,_) =
walther@59847
   186
     rewrite_set_ thy false discard_parentheses t;
walther@59868
   187
 UnparseC.term t;
walther@59847
   188
"1 + (x + b * x) * a + a ^^^ 2";
walther@59847
   189
walther@59847
   190
 val t = (Thm.term_of o the o (parse thy)) "1 + a ^^^2 * x + b * a + 7*a^^^2";
walther@59847
   191
 val SOME (t,_) =
walther@59847
   192
     rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
walther@59868
   193
 UnparseC.term t;
walther@59847
   194
 val SOME (t,_) =
walther@59847
   195
     rewrite_set_ thy false discard_parentheses t;
walther@59868
   196
 UnparseC.term t;
walther@59847
   197
"1 + b * a + (7 + x) * a ^^^ 2";
walther@59847
   198
walther@59847
   199
(* MG2003
walther@59847
   200
 Prog_Expr.thy       grundlegende Algebra
walther@59847
   201
 Poly.thy         Polynome
walther@59847
   202
 Rational.thy     Br"uche
walther@59847
   203
 Root.thy         Wurzeln
walther@59847
   204
 RootRat.thy      Wurzen + Br"uche
walther@59847
   205
 Termorder.thy    BITTE NUR HIERHER SCHREIBEN (...WN03)
walther@59847
   206
walther@59847
   207
 get_thm Termorder.thy "bdv_n_collect";
walther@59847
   208
 get_thm (theory "Isac_Knowledge") "bdv_n_collect";
walther@59847
   209
*)
walther@59847
   210
 val t = (Thm.term_of o the o (parse thy)) "a ^^^2 * x + 7 * a^^^2";
walther@59847
   211
 val SOME (t,_) =
walther@59847
   212
     rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in t;
walther@59868
   213
 UnparseC.term t;
walther@59847
   214
 val SOME (t,_) =
walther@59847
   215
     rewrite_set_ thy false discard_parentheses t;
walther@59868
   216
 UnparseC.term t;
walther@59847
   217
"(7 + x) * a ^^^ 2";
walther@59847
   218
walther@59847
   219
 val t = (Thm.term_of o the o (parse Termorder.thy)) "Pi";
walther@59847
   220
walther@59847
   221
 val t = (Thm.term_of o the o (parseold thy)) "7";
walther@59847
   222
##################################################################################*)
walther@59847
   223
walther@59847
   224
walther@59847
   225
"----------- Matthias Goldgruber 2003 trials on rewrite orders -------------------------------";
walther@59847
   226
"----------- Matthias Goldgruber 2003 trials on rewrite orders -------------------------------";
walther@59847
   227
"----------- Matthias Goldgruber 2003 trials on rewrite orders -------------------------------";
walther@59861
   228
  val substa = [(TermC.empty, (Thm.term_of o the o (parse thy)) "a")];
walther@59861
   229
  val substb = [(TermC.empty, (Thm.term_of o the o (parse thy)) "b")];
walther@59861
   230
  val substx = [(TermC.empty, (Thm.term_of o the o (parse thy)) "x")];
walther@59847
   231
walther@59847
   232
  val x1 = (Thm.term_of o the o (parse thy)) "a + b + x";
walther@59847
   233
  val x2 = (Thm.term_of o the o (parse thy)) "a + x + b";
walther@59847
   234
  val x3 = (Thm.term_of o the o (parse thy)) "a + x + b";
walther@59847
   235
  val x4 = (Thm.term_of o the o (parse thy)) "x + a + b";
walther@59847
   236
walther@59847
   237
if ord_make_polynomial_in true thy substx (x1,x2) = true(*LESS *) then ()
walther@59847
   238
else error "termorder.sml diff.behav ord_make_polynomial_in #1";
walther@59847
   239
 
walther@59847
   240
if ord_make_polynomial_in true thy substa (x1,x2) = true(*LESS *) then ()
walther@59847
   241
else error "termorder.sml diff.behav ord_make_polynomial_in #2";
walther@59847
   242
walther@59847
   243
if ord_make_polynomial_in true thy substb (x1,x2) = false(*GREATER*) then ()
walther@59847
   244
else error "termorder.sml diff.behav ord_make_polynomial_in #3";
walther@59847
   245
walther@59847
   246
  val aa = (Thm.term_of o the o (parse thy)) "-1 * a * x";
walther@59847
   247
  val bb = (Thm.term_of o the o (parse thy)) "x^^^3";
walther@59847
   248
  ord_make_polynomial_in true thy substx (aa, bb);
walther@59847
   249
  true; (* => LESS *) 
walther@59847
   250
  
walther@59847
   251
  val aa = (Thm.term_of o the o (parse thy)) "-1 * a * x";
walther@59847
   252
  val bb = (Thm.term_of o the o (parse thy)) "x^^^3";
walther@59847
   253
  ord_make_polynomial_in true thy substa (aa, bb);
walther@59847
   254
  false; (* => GREATER *)
walther@59847
   255
walther@59847
   256
(* und nach dem Re-engineering der Termorders in den 'rulesets' 
walther@59847
   257
   kannst Du die 'gr"osste' Variable frei w"ahlen: *)
walther@59847
   258
  val bdv= (Thm.term_of o the o (parse thy)) "''bdv''";
walther@59847
   259
  val x  = (Thm.term_of o the o (parse thy)) "x";
walther@59847
   260
  val a  = (Thm.term_of o the o (parse thy)) "a";
walther@59847
   261
  val b  = (Thm.term_of o the o (parse thy)) "b";
walther@59847
   262
val SOME (t',_) = rewrite_set_inst_ thy false [(bdv,a)] make_polynomial_in x2;
walther@59868
   263
if UnparseC.term t' = "b + x + a" then ()
walther@59847
   264
else error "termorder.sml diff.behav ord_make_polynomial_in #11";
walther@59847
   265
walther@59847
   266
val NONE = rewrite_set_inst_ thy false [(bdv,b)] make_polynomial_in x2;
walther@59847
   267
walther@59847
   268
val SOME (t',_) = rewrite_set_inst_ thy false [(bdv,x)] make_polynomial_in x2;
walther@59868
   269
if UnparseC.term t' = "a + b + x" then ()
walther@59847
   270
else error "termorder.sml diff.behav ord_make_polynomial_in #13";
walther@59847
   271
walther@59847
   272
  val ppp' = "-6 + -5*x + x^^^3 + -1*x^^^2 + -1*x^^^3 + -14*x^^^2";
walther@59847
   273
  val ppp  = (Thm.term_of o the o (parse thy)) ppp';
walther@59847
   274
val SOME (t',_) = rewrite_set_inst_ thy false [(bdv,x)] make_polynomial_in ppp;
walther@59868
   275
if UnparseC.term t' = "-6 + -5 * x + -15 * x ^^^ 2 + 0" then ()
walther@59847
   276
else error "termorder.sml diff.behav ord_make_polynomial_in #14";
walther@59847
   277
walther@59847
   278
val SOME (t', _) = rewrite_set_inst_ thy false [(bdv,x)] make_polynomial_in ppp;
walther@59868
   279
if UnparseC.term t' = "-6 + -5 * x + -15 * x ^^^ 2 + 0" then ()
walther@59847
   280
else error "termorder.sml diff.behav ord_make_polynomial_in #15";
walther@59847
   281
walther@59847
   282
  val ttt' = "(3*x + 5)/18";
walther@59847
   283
  val ttt = (Thm.term_of o the o (parse thy)) ttt';
walther@59847
   284
val SOME (uuu,_) = rewrite_set_inst_ thy false [(bdv,x)] make_polynomial_in ttt;
walther@59868
   285
if UnparseC.term uuu = "(5 + 3 * x) / 18" then ()
walther@59847
   286
else error "termorder.sml diff.behav ord_make_polynomial_in #16a";
walther@59847
   287
walther@59847
   288
(*============ inhibit exn WN120316 ==============================================
walther@59847
   289
val SOME (uuu,_) = rewrite_set_ thy false make_polynomial ttt;
walther@59868
   290
if UnparseC.term uuu = "(5 + 3 * x) / 18" then ()
walther@59847
   291
else error "termorder.sml diff.behav ord_make_polynomial_in #16b";
walther@59847
   292
============ inhibit exn WN120316 ==============================================*)
walther@59847
   293
walther@59847
   294
walther@59627
   295
"----------- lin.eq degree_0 -------------------------------------";
walther@59627
   296
"----------- lin.eq degree_0 -------------------------------------";
walther@59627
   297
"----------- lin.eq degree_0 -------------------------------------";
walther@59627
   298
"----- d0_false ------";
walther@59627
   299
val fmz = ["equality (1 = (0::real))", "solveFor x", "solutions L"];
walther@59627
   300
val (dI',pI',mI') = ("PolyEq",["degree_0","polynomial","univariate","equation"],
walther@59627
   301
                     ["PolyEq","solve_d0_polyeq_equation"]);
walther@59871
   302
(*=== inhibit exn WN110914: declare_constraints doesnt work with ThmC.numerals_to_Free ========
walther@59627
   303
TODO: change to "equality (x + -1*x = (0::real))"
walther@59627
   304
      and search for an appropriate problem and method.
walther@59627
   305
walther@59627
   306
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   307
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   308
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   309
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   310
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   311
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   312
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   313
case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"[]")) => ()
walther@59627
   314
	 | _ => error "polyeq.sml: diff.behav. in 1 = 0 -> []";
walther@59627
   315
walther@59627
   316
"----- d0_true ------";
walther@59627
   317
val fmz = ["equality (0 = (0::real))", "solveFor x","solutions L"];
walther@59627
   318
val (dI',pI',mI') = ("PolyEq",["degree_0","polynomial","univariate","equation"],
walther@59627
   319
                     ["PolyEq","solve_d0_polyeq_equation"]);
walther@59627
   320
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   321
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   322
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   323
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   324
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   325
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   326
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   327
case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"UniversalList")) => ()
walther@59627
   328
	 | _ => error "polyeq.sml: diff.behav. in 0 = 0 -> UniversalList";
walther@59627
   329
============ inhibit exn WN110914 ============================================*)
walther@59627
   330
walther@59627
   331
"----------- test thm's d2_pq_formulsxx[_neg]---------------------";
walther@59627
   332
"----------- test thm's d2_pq_formulsxx[_neg]---------------------";
walther@59627
   333
"----------- test thm's d2_pq_formulsxx[_neg]---------------------";
walther@59627
   334
"----- d2_pqformula1 ------!!!!";
walther@59627
   335
val fmz = ["equality (-1/8 + (-1/4)*z + z^^^2 = (0::real))", "solveFor z","solutions L"];
walther@59627
   336
val (dI',pI',mI') =
walther@59627
   337
  ("Isac_Knowledge", ["pqFormula","degree_2","polynomial","univariate","equation"], ["no_met"]);
walther@59627
   338
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   339
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   340
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   341
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   342
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   343
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   344
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   345
val (p,_,f,nxt,_,pt) = me nxt p [] pt; (*Apply_Method ["PolyEq", "solve_d2_polyeq_pq_equation"]*)
walther@59627
   346
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   347
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   348
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   349
val (p,_,f,nxt,_,pt) = me nxt p [] pt;         
walther@59627
   350
walther@59627
   351
(*[z = 1 / 8 + sqrt (9 / 16) / 2, z = 1 / 8 + -1 * sqrt (9 / 16) / 2] TODO sqrt*)
walther@59627
   352
val (p,_,f,nxt,_,pt) = me nxt p [] pt; (*nxt =..,Check_elementwise "Assumptions")*)
walther@59921
   353
val (p,_,f,nxt,_,pt) = me nxt p [] pt;         
walther@59921
   354
val (p,_,f,nxt,_,pt) = me nxt p [] pt;         
walther@59921
   355
walther@59921
   356
if p = ([], Res) andalso
walther@59921
   357
  f2str f = "[z = 1 / 8 + sqrt (9 / 16) / 2, z = 1 / 8 + -1 * sqrt (9 / 16) / 2]" then
walther@59921
   358
    case nxt of End_Proof' => () | _ => error "(-1/8 + (-1/4)*z + z^^^2 = (0::real)) CHANGED 1"
walther@59921
   359
else error "(-1/8 + (-1/4)*z + z^^^2 = (0::real)) CHANGED 2";
walther@59627
   360
walther@59627
   361
"----------- equality (2 +(-1)*x + x^^^2 = (0::real)) ----------------------------------------";
walther@59627
   362
"----------- equality (2 +(-1)*x + x^^^2 = (0::real)) ----------------------------------------";
walther@59627
   363
"----------- equality (2 +(-1)*x + x^^^2 = (0::real)) ----------------------------------------";
walther@59627
   364
"----- d2_pqformula1_neg ------";
walther@59627
   365
val fmz = ["equality (2 +(-1)*x + x^^^2 = (0::real))", "solveFor x","solutions L"];
walther@59627
   366
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"], ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   367
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   368
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   369
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   370
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   371
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   372
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   373
(*### or2list False
walther@59627
   374
  ([1],Res)  False   Or_to_List)*)
walther@59627
   375
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59627
   376
(*### or2list False                           
walther@59627
   377
  ([2],Res)  []      Check_elementwise "Assumptions"*)
walther@59627
   378
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   379
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59844
   380
val asm = Ctree.get_assumptions pt p;
walther@59627
   381
if f2str f = "[]" andalso 
walther@59868
   382
  UnparseC.terms asm = "[\"lhs (2 + -1 * x + x ^^^ 2 = 0) is_poly_in x\"," ^
walther@59627
   383
    "\"lhs (2 + -1 * x + x ^^^ 2 = 0) has_degree_in x = 2\"]" then ()
walther@59627
   384
else error "polyeq.sml: diff.behav. in 2 +(-1)*x + x^^^2 = 0";
walther@59627
   385
walther@59627
   386
"----------- equality (-2 +(-1)*x + 1*x^^^2 = 0) ---------------------------------------------";
walther@59627
   387
"----------- equality (-2 +(-1)*x + 1*x^^^2 = 0) ---------------------------------------------";
walther@59627
   388
"----------- equality (-2 +(-1)*x + 1*x^^^2 = 0) ---------------------------------------------";
walther@59627
   389
"----- d2_pqformula2 ------";
walther@59627
   390
val fmz = ["equality (-2 +(-1)*x + 1*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   391
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   392
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   393
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   394
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   395
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   396
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   397
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   398
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   399
walther@59627
   400
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   401
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   402
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   403
case f of Test_Out.FormKF "[x = 2, x = -1]" => ()
walther@59627
   404
	 | _ => error "polyeq.sml: diff.behav. in -2 + (-1)*x + x^2 = 0 -> [x = 2, x = -1]";
walther@59627
   405
walther@59627
   406
walther@59627
   407
"----------- equality (-2 + x + x^^^2 = 0) ---------------------------------------------------";
walther@59627
   408
"----------- equality (-2 + x + x^^^2 = 0) ---------------------------------------------------";
walther@59627
   409
"----------- equality (-2 + x + x^^^2 = 0) ---------------------------------------------------";
walther@59627
   410
"----- d2_pqformula3 ------";
walther@59627
   411
(*EP-9*)
walther@59627
   412
val fmz = ["equality (-2 + x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   413
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   414
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   415
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   416
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   417
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   418
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   419
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   420
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   421
walther@59627
   422
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   423
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   424
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59959
   425
case f of Test_Out.FormKF "[x = 1, x = -2]" => ()
walther@59627
   426
	 | _ => error "polyeq.sml: diff.behav. in  -2 + x + x^2 = 0-> [x = 1, x = -2]";
walther@59627
   427
walther@59627
   428
walther@59627
   429
"----------- equality (2 + x + x^^^2 = 0) ----------------------------------------------------";
walther@59627
   430
"----------- equality (2 + x + x^^^2 = 0) ----------------------------------------------------";
walther@59627
   431
"----------- equality (2 + x + x^^^2 = 0) ----------------------------------------------------";
walther@59627
   432
"----- d2_pqformula3_neg ------";
walther@59627
   433
val fmz = ["equality (2 + x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   434
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   435
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   436
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   437
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   438
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   439
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   440
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   441
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   442
walther@59627
   443
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   444
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   445
"TODO 2 + x + x^^^2 = 0";
walther@59627
   446
"TODO 2 + x + x^^^2 = 0";
walther@59627
   447
"TODO 2 + x + x^^^2 = 0";
walther@59627
   448
walther@59627
   449
"----------- equality (-2 + x + 1*x^^^2 = 0)) ------------------------------------------------";
walther@59627
   450
"----------- equality (-2 + x + 1*x^^^2 = 0)) ------------------------------------------------";
walther@59627
   451
"----------- equality (-2 + x + 1*x^^^2 = 0)) ------------------------------------------------";
walther@59627
   452
"----- d2_pqformula4 ------";
walther@59627
   453
val fmz = ["equality (-2 + x + 1*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   454
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   455
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   456
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   457
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   458
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   459
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   460
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   461
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   462
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   463
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   464
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   465
case f of Test_Out.FormKF "[x = 1, x = -2]" => ()
walther@59627
   466
	 | _ => error "polyeq.sml: diff.behav. in  -2 + x + 1*x^^^2 = 0 -> [x = 1, x = -2]";
walther@59627
   467
walther@59627
   468
"----------- equality (1*x +   x^^^2 = 0) ----------------------------------------------------";
walther@59627
   469
"----------- equality (1*x +   x^^^2 = 0) ----------------------------------------------------";
walther@59627
   470
"----------- equality (1*x +   x^^^2 = 0) ----------------------------------------------------";
walther@59627
   471
"----- d2_pqformula5 ------";
walther@59627
   472
val fmz = ["equality (1*x +   x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   473
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   474
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   475
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   476
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   477
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   478
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   479
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   480
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   481
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   482
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   483
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   484
case f of Test_Out.FormKF "[x = 0, x = -1]" => ()
walther@59627
   485
	 | _ => error "polyeq.sml: diff.behav. in  1*x +   x^2 = 0 -> [x = 0, x = -1]";
walther@59627
   486
walther@59627
   487
"----------- equality (1*x + 1*x^^^2 = 0) ----------------------------------------------------";
walther@59627
   488
"----------- equality (1*x + 1*x^^^2 = 0) ----------------------------------------------------";
walther@59627
   489
"----------- equality (1*x + 1*x^^^2 = 0) ----------------------------------------------------";
walther@59627
   490
"----- d2_pqformula6 ------";
walther@59627
   491
val fmz = ["equality (1*x + 1*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   492
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   493
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   494
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   495
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   496
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   497
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   498
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   499
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   500
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   501
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   502
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59959
   503
case f of Test_Out.FormKF "[x = 0, x = -1]" => ()
walther@59627
   504
	 | _ => error "polyeq.sml: diff.behav. in  1*x + 1*x^2 = 0 -> [x = 0, x = -1]";
walther@59627
   505
walther@59627
   506
"----------- equality (x +   x^^^2 = 0) ------------------------------------------------------";
walther@59627
   507
"----------- equality (x +   x^^^2 = 0) ------------------------------------------------------";
walther@59627
   508
"----------- equality (x +   x^^^2 = 0) ------------------------------------------------------";
walther@59627
   509
"----- d2_pqformula7 ------";
walther@59627
   510
(*EP-10*)
walther@59627
   511
val fmz = ["equality (  x +   x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   512
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   513
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   514
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   515
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   516
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   517
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   518
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   519
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   520
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   521
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   522
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59959
   523
case f of Test_Out.FormKF "[x = 0, x = -1]" => ()
walther@59627
   524
	 | _ => error "polyeq.sml: diff.behav. in  x + x^2 = 0 -> [x = 0, x = -1]";
walther@59627
   525
walther@59627
   526
"----------- equality (x + 1*x^^^2 = 0) ------------------------------------------------------";
walther@59627
   527
"----------- equality (x + 1*x^^^2 = 0) ------------------------------------------------------";
walther@59627
   528
"----------- equality (x + 1*x^^^2 = 0) ------------------------------------------------------";
walther@59627
   529
"----- d2_pqformula8 ------";
walther@59627
   530
val fmz = ["equality (x + 1*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   531
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   532
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   533
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   534
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   535
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   536
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   537
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   538
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   539
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   540
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   541
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59959
   542
case f of Test_Out.FormKF "[x = 0, x = -1]" => ()
walther@59627
   543
	 | _ => error "polyeq.sml: diff.behav. in  x + 1*x^2 = 0 -> [x = 0, x = -1]";
walther@59627
   544
walther@59627
   545
"----------- equality (-4 + x^^^2 = 0) -------------------------------------------------------";
walther@59627
   546
"----------- equality (-4 + x^^^2 = 0) -------------------------------------------------------";
walther@59627
   547
"----------- equality (-4 + x^^^2 = 0) -------------------------------------------------------";
walther@59627
   548
"----- d2_pqformula9 ------";
walther@59627
   549
val fmz = ["equality (-4 + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   550
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   551
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   552
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   553
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   554
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   555
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   556
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   557
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   558
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   559
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   560
case f of Test_Out.FormKF "[x = 2, x = -2]" => ()
walther@59627
   561
	 | _ => error "polyeq.sml: diff.behav. in -4 + x^2 = 0 -> [x = 2, x = -2]";
walther@59627
   562
walther@59627
   563
walther@59627
   564
"----------- equality (4 + 1*x^^^2 = 0) -------------------------------------------------------";
walther@59627
   565
"----------- equality (4 + 1*x^^^2 = 0) -------------------------------------------------------";
walther@59627
   566
"----------- equality (4 + 1*x^^^2 = 0) -------------------------------------------------------";
walther@59627
   567
"----- d2_pqformula9_neg ------";
walther@59627
   568
val fmz = ["equality (4 + 1*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   569
val (dI',pI',mI') = ("PolyEq",["pqFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   570
                     ["PolyEq","solve_d2_polyeq_pq_equation"]);
walther@59627
   571
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   572
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   573
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   574
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   575
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   576
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   577
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   578
"TODO 4 + 1*x^^^2 = 0";
walther@59627
   579
"TODO 4 + 1*x^^^2 = 0";
walther@59627
   580
"TODO 4 + 1*x^^^2 = 0";
walther@59627
   581
walther@59627
   582
"-------------------- test thm's d2_abc_formulsxx[_neg]-----";
walther@59627
   583
"-------------------- test thm's d2_abc_formulsxx[_neg]-----";
walther@59627
   584
"-------------------- test thm's d2_abc_formulsxx[_neg]-----";
walther@59627
   585
val fmz = ["equality (-1 +(-1)*x + 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   586
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   587
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   588
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   589
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   590
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   591
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   592
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   593
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   594
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   595
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   596
case f of Test_Out.FormKF "[x = 1, x = -1 / 2]" => ()
walther@59627
   597
	 | _ => error "polyeq.sml: diff.behav. in -1 + (-1)*x + 2*x^2 = 0 -> [x = 1, x = -1/2]";
walther@59627
   598
walther@59627
   599
"----------- equality (1 +(-1)*x + 2*x^^^2 = 0) ----------------------------------------------";
walther@59627
   600
"----------- equality (1 +(-1)*x + 2*x^^^2 = 0) ----------------------------------------------";
walther@59627
   601
"----------- equality (1 +(-1)*x + 2*x^^^2 = 0) ----------------------------------------------";
walther@59627
   602
val fmz = ["equality (1 +(-1)*x + 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   603
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   604
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   605
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   606
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   607
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   608
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   609
walther@59627
   610
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   611
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   612
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   613
"TODO 1 +(-1)*x + 2*x^^^2 = 0";
walther@59627
   614
"TODO 1 +(-1)*x + 2*x^^^2 = 0";
walther@59627
   615
"TODO 1 +(-1)*x + 2*x^^^2 = 0";
walther@59627
   616
walther@59627
   617
walther@59627
   618
"----------- equality (-1 + x + 2*x^^^2 = 0) -------------------------------------------------";
walther@59627
   619
"----------- equality (-1 + x + 2*x^^^2 = 0) -------------------------------------------------";
walther@59627
   620
"----------- equality (-1 + x + 2*x^^^2 = 0) -------------------------------------------------";
walther@59627
   621
(*EP-11*)
walther@59627
   622
val fmz = ["equality (-1 + x + 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   623
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   624
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   625
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   626
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   627
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   628
walther@59627
   629
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   630
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   631
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   632
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   633
walther@59627
   634
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   635
case f of Test_Out.FormKF "[x = 1 / 2, x = -1]" => ()
walther@59627
   636
	 | _ => error "polyeq.sml: diff.behav. in -1 + x + 2*x^2 = 0 -> [x = 1/2, x = -1]";
walther@59627
   637
walther@59627
   638
walther@59627
   639
"----------- equality (1 + x + 2*x^^^2 = 0) --------------------------------------------------";
walther@59627
   640
"----------- equality (1 + x + 2*x^^^2 = 0) --------------------------------------------------";
walther@59627
   641
"----------- equality (1 + x + 2*x^^^2 = 0) --------------------------------------------------";
walther@59627
   642
val fmz = ["equality (1 + x + 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   643
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   644
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   645
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   646
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   647
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   648
walther@59627
   649
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   650
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   651
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   652
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   653
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59627
   654
"TODO 1 + x + 2*x^^^2 = 0";
walther@59627
   655
"TODO 1 + x + 2*x^^^2 = 0";
walther@59627
   656
"TODO 1 + x + 2*x^^^2 = 0";
walther@59627
   657
walther@59627
   658
walther@59627
   659
val fmz = ["equality (-2 + 1*x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   660
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   661
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   662
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   663
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   664
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   665
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   666
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   667
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   668
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   669
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   670
case f of Test_Out.FormKF "[x = 1, x = -2]" => ()
walther@59627
   671
	 | _ => error "polyeq.sml: diff.behav. in -2 + 1*x + x^2 = 0 -> [x = 1, x = -2]";
walther@59627
   672
walther@59627
   673
val fmz = ["equality ( 2 + 1*x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   674
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   675
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   676
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   677
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   678
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   679
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   680
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   681
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   682
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   683
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59627
   684
"TODO 2 + 1*x + x^^^2 = 0";
walther@59627
   685
"TODO 2 + 1*x + x^^^2 = 0";
walther@59627
   686
"TODO 2 + 1*x + x^^^2 = 0";
walther@59627
   687
walther@59627
   688
(*EP-12*)
walther@59627
   689
val fmz = ["equality (-2 + x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   690
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   691
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   692
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   693
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   694
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   695
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   696
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   697
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   698
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   699
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   700
case f of Test_Out.FormKF "[x = 1, x = -2]" => ()
walther@59627
   701
	 | _ => error "polyeq.sml: diff.behav. in -2 + x + x^2 = 0 -> [x = 1, x = -2]";
walther@59627
   702
walther@59627
   703
val fmz = ["equality ( 2 + x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   704
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   705
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   706
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   707
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   708
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   709
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   710
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   711
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   712
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   713
val (p,_,f,nxt,_,pt) = me nxt p [] pt; 
walther@59627
   714
"TODO 2 + x + x^^^2 = 0";
walther@59627
   715
"TODO 2 + x + x^^^2 = 0";
walther@59627
   716
"TODO 2 + x + x^^^2 = 0";
walther@59627
   717
walther@59627
   718
(*EP-13*)
walther@59627
   719
val fmz = ["equality (-8 + 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   720
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   721
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   722
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   723
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   724
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   725
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   726
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   727
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   728
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   729
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   730
case f of Test_Out.FormKF "[x = 2, x = -2]" => ()
walther@59627
   731
	 | _ => error "polyeq.sml: diff.behav. in -8 + 2*x^2 = 0 -> [x = 2, x = -2]";
walther@59627
   732
walther@59627
   733
val fmz = ["equality ( 8+ 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   734
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   735
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   736
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   737
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   738
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   739
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   740
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   741
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   742
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   743
"TODO 8+ 2*x^^^2 = 0";
walther@59627
   744
"TODO 8+ 2*x^^^2 = 0";
walther@59627
   745
"TODO 8+ 2*x^^^2 = 0";
walther@59627
   746
walther@59627
   747
(*EP-14*)
walther@59627
   748
val fmz = ["equality (-4 + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   749
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"], ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   750
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   751
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   752
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   753
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   754
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   755
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   756
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   757
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   758
case f of Test_Out.FormKF "[x = 2, x = -2]" => ()
walther@59627
   759
	 | _ => error "polyeq.sml: diff.behav. in -4 + x^2 = 0 -> [x = 2, x = -2]";
walther@59627
   760
walther@59627
   761
walther@59627
   762
val fmz = ["equality ( 4+ x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   763
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"], ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   764
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   765
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   766
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   767
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   768
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   769
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   770
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   771
"TODO 4+ x^^^2 = 0";
walther@59627
   772
"TODO 4+ x^^^2 = 0";
walther@59627
   773
"TODO 4+ x^^^2 = 0";
walther@59627
   774
walther@59627
   775
(*EP-15*)
walther@59627
   776
val fmz = ["equality (2*x + 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   777
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   778
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   779
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   780
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   781
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   782
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   783
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   784
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   785
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   786
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   787
case f of Test_Out.FormKF "[x = 0, x = -1]" => ()
walther@59627
   788
	 | _ => error "polyeq.sml: diff.behav. in x + x^2 = 0 -> [x = 0, x = -1]";
walther@59627
   789
walther@59627
   790
val fmz = ["equality (1*x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   791
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   792
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   793
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   794
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   795
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   796
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   797
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   798
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   799
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   800
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   801
case f of Test_Out.FormKF "[x = 0, x = -1]" => ()
walther@59627
   802
	 | _ => error "polyeq.sml: diff.behav. in x + x^2 = 0 -> [x = 0, x = -1]";
walther@59627
   803
walther@59627
   804
(*EP-16*)
walther@59627
   805
val fmz = ["equality (x + 2*x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   806
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   807
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   808
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   809
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   810
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   811
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   812
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   813
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   814
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   815
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   816
case f of Test_Out.FormKF "[x = 0, x = -1 / 2]" => ()
walther@59627
   817
	 | _ => error "polyeq.sml: diff.behav. in x + x^2 = 0 -> [x = 0, x = -1 / 2]";
walther@59627
   818
walther@59627
   819
(*EP-//*)
walther@59627
   820
val fmz = ["equality (x + x^^^2 = 0)", "solveFor x","solutions L"];
walther@59627
   821
val (dI',pI',mI') = ("PolyEq",["abcFormula","degree_2","polynomial","univariate","equation"],
walther@59627
   822
                     ["PolyEq","solve_d2_polyeq_abc_equation"]);
walther@59627
   823
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   824
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   825
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   826
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   827
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   828
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   829
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   830
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59959
   831
case f of Test_Out.FormKF "[x = 0, x = -1]" => ()
walther@59627
   832
	 | _ => error "polyeq.sml: diff.behav. in x + x^2 = 0 -> [x = 0, x = -1]";
walther@59627
   833
walther@59627
   834
walther@59627
   835
"----------- (-8 - 2*x + x^^^2 = 0),  (*Schalk 2, S.67 Nr.31.b----";
walther@59627
   836
"----------- (-8 - 2*x + x^^^2 = 0),  (*Schalk 2, S.67 Nr.31.b----";
walther@59627
   837
"----------- (-8 - 2*x + x^^^2 = 0),  (*Schalk 2, S.67 Nr.31.b----";
walther@59627
   838
(*stopped du to TODO.txt WN111014.TODO calculate_Poly < calculate_Rational < calculate_RootRat
walther@59627
   839
see --- val rls = calculate_RootRat > calculate_Rational ---
walther@59627
   840
calculate_RootRat was a TODO with 2002, requires re-design.
walther@59627
   841
see also --- (-8 - 2*x + x^^^2 = 0),  by rewriting --- below
walther@59627
   842
*)
walther@59627
   843
 val fmz = ["equality (-8 - 2*x + x^^^2 = 0)", (*Schalk 2, S.67 Nr.31.b*)
walther@59627
   844
 	    "solveFor x","solutions L"];
walther@59627
   845
 val (dI',pI',mI') =
walther@59627
   846
     ("PolyEq",["degree_2","expanded","univariate","equation"],
walther@59627
   847
      ["PolyEq","complete_square"]);
walther@59627
   848
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   849
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   850
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   851
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   852
walther@59627
   853
val (p,_,f,nxt,_,pt) = me nxt p [] pt; val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   854
(*Apply_Method ("PolyEq","complete_square")*)
walther@59627
   855
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   856
(*"-8 - 2 * x + x ^^^ 2 = 0", nxt = Rewrite_Set_Inst ... "complete_square*)
walther@59627
   857
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   858
(*"-8 + (2 / 2 - x) ^^^ 2 = (2 / 2) ^^^ 2", nxt = Rewrite("square_explicit1"*)
walther@59627
   859
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   860
(*"(2 / 2 - x) ^^^ 2 = (2 / 2) ^^^ 2 - -8" nxt = Rewrite("root_plus_minus*)
walther@59627
   861
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   862
(*"2 / 2 - x = sqrt ((2 / 2) ^^^ 2 - -8) |
walther@59627
   863
   2 / 2 - x = - sqrt ((2 / 2) ^^^ 2 - -8)" nxt = Rewr_Inst("bdv_explicit2"*)
walther@59627
   864
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   865
(*"2 / 2 - x = sqrt ((2 / 2) ^^^ 2 - -8) |
walther@59627
   866
   -1*x = - (2 / 2) + - sqrt ((2 / 2) ^^^ 2 - -8)"nxt = R_Inst("bdv_explt2"*)
walther@59627
   867
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   868
(*"-1 * x = - (2 / 2) + sqrt ((2 / 2) ^^^ 2 - -8) |
walther@59627
   869
   -1 * x = (- (2 / 2) + - sqrt ((2 / 2) ^^^ 2 - -8))"nxt = bdv_explicit3*)
walther@59627
   870
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   871
(*"-1 * x = - (2 / 2) + sqrt ((2 / 2) ^^^ 2 - -8) |
walther@59627
   872
  x = -1 * (- (2 / 2) + - sqrt ((2 / 2) ^^^ 2 - -8))" nxt = bdv_explicit3*)
walther@59627
   873
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   874
(*"x = -1 * (- (2 / 2) + sqrt ((2 / 2) ^^^ 2 - -8)) |
walther@59627
   875
   x = -1 * (- (2 / 2) + - sqrt ((2 / 2) ^^^ 2 - -8))"nxt = calculate_Rational
walther@59627
   876
   NOT IMPLEMENTED SINCE 2002 ------------------------------^^^^^^^^^^^^^^^^^^*)
walther@59627
   877
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   878
(*"x = -2 | x = 4" nxt = Or_to_List*)
walther@59627
   879
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   880
(*"[x = -2, x = 4]" nxt = Check_Postcond*)
walther@59627
   881
val (p,_,f,nxt,_,pt) = me nxt p [] pt; f2str f;
walther@59627
   882
(* FIXXXME 
walther@59959
   883
 case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"[x = -2, x = 4]")) => () TODO
walther@59627
   884
	 | _ => error "polyeq.sml: diff.behav. in [x = -2, x = 4]";
walther@59627
   885
*)
walther@59627
   886
if f2str f =
walther@59627
   887
"[x = -1 * -1 + -1 * sqrt (2 ^^^ 2 / 2 ^^^ 2 - -8),\n x = -1 * -1 + -1 * (-1 * sqrt (2 ^^^ 2 / 2 ^^^ 2 - -8))]"
walther@59627
   888
(*"[x = -1 * -1 + -1 * sqrt (1 ^^^ 2 - -8),\n x = -1 * -1 + -1 * (-1 * sqrt (1 ^^^ 2 - -8))]"*)
walther@59627
   889
then () else error "polyeq.sml corrected?behav. in [x = -2, x = 4]";
walther@59627
   890
walther@59627
   891
walther@59627
   892
"----------- (-8 - 2*x + x^^^2 = 0),  by rewriting ---------------";
walther@59627
   893
"----------- (-8 - 2*x + x^^^2 = 0),  by rewriting ---------------";
walther@59627
   894
"----------- (-8 - 2*x + x^^^2 = 0),  by rewriting ---------------";
walther@59627
   895
(*stopped du to TODO.txt WN111014.TODO calculate_Poly < calculate_Rational < calculate_RootRat
walther@59627
   896
see --- val rls = calculate_RootRat > calculate_Rational ---*)
walther@59627
   897
val thy = @{theory PolyEq};
walther@59627
   898
val ctxt = Proof_Context.init_global thy;
walther@59627
   899
val inst = [((the o (parseNEW  ctxt)) "bdv::real", (the o (parseNEW  ctxt)) "x::real")];
walther@59627
   900
val t = (the o (parseNEW  ctxt)) "-8 - 2*x + x^^^2 = (0::real)";
walther@59627
   901
walther@59627
   902
val rls = complete_square;
walther@59627
   903
val SOME (t,asm) = rewrite_set_inst_ thy true inst rls t;
walther@59868
   904
UnparseC.term t = "-8 + (2 / 2 - x) ^^^ 2 = (2 / 2) ^^^ 2";
walther@59627
   905
walther@59871
   906
val thm = ThmC.numerals_to_Free @{thm square_explicit1};
walther@59851
   907
val SOME (t,asm) = rewrite_ thy dummy_ord Rule_Set.Empty true thm t;
walther@59868
   908
UnparseC.term t = "(2 / 2 - x) ^^^ 2 = (2 / 2) ^^^ 2 - -8";
walther@59627
   909
walther@59871
   910
val thm = ThmC.numerals_to_Free @{thm root_plus_minus};
walther@59627
   911
val SOME (t,asm) = rewrite_ thy dummy_ord PolyEq_erls true thm t;
walther@59868
   912
UnparseC.term t = "2 / 2 - x = sqrt ((2 / 2) ^^^ 2 - -8) |"^
walther@59627
   913
           "\n2 / 2 - x = -1 * sqrt ((2 / 2) ^^^ 2 - -8)";
walther@59627
   914
walther@59627
   915
(*the thm bdv_explicit2* here required to be constrained to ::real*)
walther@59871
   916
val thm = ThmC.numerals_to_Free @{thm bdv_explicit2};
walther@59851
   917
val SOME (t,asm) = rewrite_inst_ thy dummy_ord Rule_Set.Empty true inst thm t;
walther@59868
   918
UnparseC.term t = "2 / 2 - x = sqrt ((2 / 2) ^^^ 2 - -8) |"^
walther@59627
   919
              "\n-1 * x = - (2 / 2) + -1 * sqrt ((2 / 2) ^^^ 2 - -8)";
walther@59627
   920
walther@59871
   921
val thm = ThmC.numerals_to_Free @{thm bdv_explicit3};
walther@59851
   922
val SOME (t,asm) = rewrite_inst_ thy dummy_ord Rule_Set.Empty true inst thm t;
walther@59868
   923
UnparseC.term t = "2 / 2 - x = sqrt ((2 / 2) ^^^ 2 - -8) |"^
walther@59627
   924
                   "\nx = -1 * (- (2 / 2) + -1 * sqrt ((2 / 2) ^^^ 2 - -8))";
walther@59627
   925
walther@59871
   926
val thm = ThmC.numerals_to_Free @{thm bdv_explicit2};
walther@59851
   927
val SOME (t,asm) = rewrite_inst_ thy dummy_ord Rule_Set.Empty true inst thm t;
walther@59868
   928
UnparseC.term t = "-1 * x = - (2 / 2) + sqrt ((2 / 2) ^^^ 2 - -8) |"^
walther@59627
   929
                "\nx = -1 * (- (2 / 2) + -1 * sqrt ((2 / 2) ^^^ 2 - -8))";
walther@59627
   930
walther@59627
   931
val rls = calculate_RootRat;
walther@59627
   932
val SOME (t,asm) = rewrite_set_ thy true rls t;
walther@59868
   933
if UnparseC.term t =
walther@59627
   934
  "-1 * x = -1 + sqrt (2 ^^^ 2 / 2 ^^^ 2 - -8) \<or>\nx = -1 * -1 + -1 * (-1 * sqrt (2 ^^^ 2 / 2 ^^^ 2 - -8))"
walther@59627
   935
(*"-1 * x = -1 + sqrt (2 ^^^ 2 / 2 ^^^ 2 - -8) |\nx = -1 * -1 + -1 * (-1 * sqrt (2 ^^^ 2 / 2 ^^^ 2 - -8))"..isabisac15*)
walther@59627
   936
then () else error "(-8 - 2*x + x^^^2 = 0),  by rewriting -- ERROR INDICATES IMPROVEMENT";
walther@59868
   937
(*SHOULD BE: UnparseC.term = "x = -2 | x = 4;*)
walther@59627
   938
walther@59627
   939
walther@59627
   940
"-------------------- (3 - 10*x + 3*x^^^2 = 0), ----------------------";
walther@59627
   941
"-------------------- (3 - 10*x + 3*x^^^2 = 0), ----------------------";
walther@59627
   942
"-------------------- (3 - 10*x + 3*x^^^2 = 0), ----------------------";
walther@59627
   943
"---- test the erls ----";
walther@59627
   944
 val t1 = (Thm.term_of o the o (parse thy)) "0 <= (10/3/2)^^^2 - 1";
walther@59627
   945
 val SOME (t,_) = rewrite_set_ @{theory PolyEq} false PolyEq_erls t1;
walther@59868
   946
 val t' = UnparseC.term t;
walther@59627
   947
 (*if t'= "HOL.True" then ()
walther@59627
   948
 else error "polyeq.sml: diff.behav. in 'rewrite_set_.. PolyEq_erls";*)
walther@59627
   949
(* *)
walther@59627
   950
 val fmz = ["equality (3 - 10*x + 3*x^^^2 = 0)",
walther@59627
   951
 	    "solveFor x","solutions L"];
walther@59627
   952
 val (dI',pI',mI') =
walther@59627
   953
     ("PolyEq",["degree_2","expanded","univariate","equation"],
walther@59627
   954
      ["PolyEq","complete_square"]);
walther@59627
   955
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   956
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   957
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   958
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   959
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   960
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   961
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   962
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   963
 (*Apply_Method ("PolyEq","complete_square")*)
walther@59627
   964
 val (p,_,f,nxt,_,pt) = me nxt p [] pt; f2str f;
walther@59627
   965
walther@59627
   966
"----------- (-16 + 4*x + 2*x^^^2 = 0), --------------------------";
walther@59627
   967
"----------- (-16 + 4*x + 2*x^^^2 = 0), --------------------------";
walther@59627
   968
"----------- (-16 + 4*x + 2*x^^^2 = 0), --------------------------";
walther@59627
   969
 val fmz = ["equality (-16 + 4*x + 2*x^^^2 = 0)",
walther@59627
   970
 	    "solveFor x","solutions L"];
walther@59627
   971
 val (dI',pI',mI') =
walther@59627
   972
     ("PolyEq",["degree_2","expanded","univariate","equation"],
walther@59627
   973
      ["PolyEq","complete_square"]);
walther@59627
   974
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
walther@59627
   975
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   976
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   977
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   978
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   979
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   980
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   981
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   982
 (*Apply_Method ("PolyEq","complete_square")*)
walther@59627
   983
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   984
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   985
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   986
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   987
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   988
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   989
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   990
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   991
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   992
 val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59627
   993
(* FIXXXXME n1.,
walther@59959
   994
 case f of Form' (Test_Out.FormKF (~1,EdUndef,0,Nundef,"[x = 2, x = -4]")) => () TODO
walther@59627
   995
	 | _ => error "polyeq.sml: diff.behav. in [x = 2, x = -4]";
walther@59627
   996
*)
walther@59627
   997