test/Tools/isac/Frontend/interface.sml
author Walther Neuper <neuper@ist.tugraz.at>
Mon, 20 Jun 2011 17:33:06 +0200
branchdecompose-isar
changeset 42048 6548da70f14e
parent 41971 329a5c90d0ab
child 42055 3da7095ac8d5
permissions -rw-r--r--
intermed: bakk msteger
neuper@37906
     1
(* tests the interface of isac's SML-kernel in accordance to 
neuper@37906
     2
   java-tests/isac.bridge.
neuper@37906
     3
neuper@37906
     4
WN050707 ... if true, the test ist marked with a \label referring
neuper@37906
     5
to the same UC in isac-docu.tex as the JUnit testcase.
neuper@37906
     6
use"../smltest/FE-interface/interface.sml";
neuper@37906
     7
use"interface.sml";
neuper@37906
     8
 *)
neuper@37906
     9
neuper@38066
    10
"--------------------------------------------------------";
neuper@38066
    11
"table of contents --------------------------------------";
neuper@38066
    12
"--------------------------------------------------------";
neuper@38066
    13
"within struct ------------------------------------------";
neuper@38066
    14
"--------------------------------------------------------";
neuper@38066
    15
"--------- encode ^ -> ^^^ ------------------------------";
neuper@38066
    16
"--------------------------------------------------------";
neuper@38066
    17
"exported from struct -----------------------------------";
neuper@38066
    18
"--------------------------------------------------------";
neuper@38066
    19
"--------- empty rootpbl --------------------------------";
neuper@38066
    20
"--------- solve_linear as rootpbl FE -------------------";
neuper@38066
    21
"--------- inspect the CalcTree No.1 with Iterator No.2 -";
neuper@38066
    22
"--------- miniscript with mini-subpbl ------------------";
neuper@38066
    23
"--------- mini-subpbl AUTOCALCULATE Step 1 -------------";
neuper@38066
    24
"--------- solve_linear as rootpbl AUTO CompleteCalc ----";
neuper@38066
    25
"--------- solve_linear as rootpbl AUTO CompleteHead/Calc ";
neuper@38066
    26
"--------- mini-subpbl AUTOCALCULATE CompleteCalc -------";
neuper@38066
    27
"--------- mini-subpbl AUTO CompleteCalcHead ------------";
neuper@38066
    28
"--------- solve_linear as rootpbl AUTO CompleteModel ---";
neuper@38066
    29
"--------- setContext..Thy ------------------------------";
neuper@38066
    30
"--------- mini-subpbl AUTOCALC CompleteToSubpbl --------";
neuper@38066
    31
"--------- rat-eq + subpbl: no_met, NO solution dropped -";
neuper@38066
    32
"--------- tryMatchProblem, tryRefineProblem ------------";
neuper@38066
    33
"--------- modifyCalcHead, resetCalcHead, modelProblem --";
neuper@38066
    34
"--------- maximum-example, UC: Modeling an example -----";
neuper@38066
    35
"--------- solve_linear from pbl-hierarchy --------------";
neuper@38066
    36
"--------- solve_linear as in an algebra system (CAS)----";
neuper@38066
    37
"--------- interSteps: on 'miniscript with mini-subpbl' -";
neuper@38066
    38
"--------- getTactic, fetchApplicableTactics ------------";
neuper@38066
    39
"--------- getAssumptions, getAccumulatedAsms -----------";
neuper@38066
    40
"--------- arbitrary combinations of steps --------------";
neuper@38066
    41
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}right";
neuper@38066
    42
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}other";
neuper@38066
    43
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}oth 2";
neuper@38066
    44
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}NOTok";
neuper@38066
    45
"--------- replaceFormula {SOL:MAN:FOR:replace} right----";
neuper@38066
    46
"--------- replaceFormula {SOL:MAN:FOR:replace} other----";
neuper@38066
    47
"--------- replaceFormula {SOL:MAN:FOR:replace} other 2--";
neuper@38066
    48
"--------- replaceFormula {SOL:MAN:FOR:replace} NOTok----";
neuper@38066
    49
"--------------------------------------------------------";
neuper@37906
    50
neuper@37906
    51
"within struct ---------------------------------------------------";
neuper@37906
    52
"within struct ---------------------------------------------------";
neuper@37906
    53
"within struct ---------------------------------------------------";
neuper@37906
    54
(*==================================================================
neuper@37906
    55
neuper@37906
    56
neuper@38066
    57
"--------- encode ^ -> ^^^ ------------------------------";
neuper@38066
    58
"--------- encode ^ -> ^^^ ------------------------------";
neuper@38066
    59
"--------- encode ^ -> ^^^ ------------------------------";
neuper@37906
    60
if encode "a^2+b^2=c^2" = "a^^^2+b^^^2=c^^^2" then ()
neuper@38031
    61
else error "interface.sml: diff.behav. in encode ^ -> ^^^ ";
neuper@37906
    62
neuper@37906
    63
if (decode o encode) "a^2+b^2=c^2" = "a^2+b^2=c^2" then ()
neuper@38031
    64
else error "interface.sml: diff.behav. in de/encode ^ <-> ^^^ ";
neuper@37906
    65
neuper@37906
    66
==================================================================*)
neuper@37906
    67
"exported from struct --------------------------------------------";
neuper@37906
    68
"exported from struct --------------------------------------------";
neuper@37906
    69
"exported from struct --------------------------------------------";
neuper@37906
    70
neuper@37906
    71
neuper@37906
    72
(*------------ set at startup of the Kernel --------------------------*)
neuper@37906
    73
 states:= [];  (*resets all state information in Kernel               *)
neuper@37906
    74
(*----------------------------------------------------------------*)
neuper@37906
    75
neuper@38066
    76
"--------- empty rootpbl --------------------------------";
neuper@38066
    77
"--------- empty rootpbl --------------------------------";
neuper@38066
    78
"--------- empty rootpbl --------------------------------";
neuper@37906
    79
 CalcTree [([], ("", [], []))];
neuper@37906
    80
 Iterator 1;
neuper@37906
    81
 moveActiveRoot 1;
neuper@37906
    82
 refFormula 1 (get_pos 1 1);
neuper@37906
    83
(*WN.040222: stoert das sehr, dass e_domID etc. statt leer kommt ???*)
neuper@37906
    84
neuper@38056
    85
neuper@38066
    86
"--------- solve_linear as rootpbl FE -------------------";
neuper@38066
    87
"--------- solve_linear as rootpbl FE -------------------";
neuper@38066
    88
"--------- solve_linear as rootpbl FE -------------------";
neuper@37906
    89
 states := [];
neuper@37906
    90
 CalcTree      (*start of calculation, return No.1*)
bonzai@41949
    91
     [(["equality (1+-1*2+x=(0::real))", "solveFor x","solutions L"],
neuper@38058
    92
       ("Test", 
neuper@37906
    93
	["linear","univariate","equation","test"],
neuper@37906
    94
	["Test","solve_linear"]))];
neuper@37906
    95
 Iterator 1;     (*create an active Iterator on CalcTree No.1*)
neuper@37906
    96
 
neuper@37906
    97
 moveActiveRoot 1;(*sets the CalcIterator No.1 at the root of CalcTree No.1*);
neuper@37906
    98
 refFormula 1 (get_pos 1 1)  (*gets CalcHead; model is still empty*);
neuper@37906
    99
 
neuper@38056
   100
neuper@37906
   101
 fetchProposedTactic 1 (*by using Iterator No.1*);
neuper@38066
   102
 setNextTactic 1 (Model_Problem); (*by using Iterator No.1*)
neuper@37906
   103
 autoCalculate 1 (Step 1);
neuper@37906
   104
 refFormula 1 (get_pos 1 1)  (*model contains descriptions for all items*);
neuper@37906
   105
 autoCalculate 1 (Step 1);
neuper@37926
   106
(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
neuper@37906
   107
 fetchProposedTactic 1;
neuper@37906
   108
 setNextTactic 1 (Add_Given "equality (1 + -1 * 2 + x = 0)");
neuper@37906
   109
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1); (*equality added*);
neuper@37906
   110
neuper@37906
   111
 fetchProposedTactic 1;
neuper@37906
   112
 setNextTactic 1 (Add_Given "solveFor x");
neuper@37906
   113
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   114
neuper@37906
   115
 fetchProposedTactic 1;
neuper@37906
   116
 setNextTactic 1 (Add_Find "solutions L");
neuper@37906
   117
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   118
neuper@37906
   119
 fetchProposedTactic 1;
neuper@38058
   120
 setNextTactic 1 (Specify_Theory "Test");
neuper@37906
   121
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37926
   122
*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
neuper@37906
   123
neuper@37906
   124
 fetchProposedTactic 1;
neuper@37906
   125
 setNextTactic 1 (Specify_Problem ["linear","univariate","equation","test"]);
neuper@37906
   126
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   127
(*-------------------------------------------------------------------------*)
neuper@37906
   128
 fetchProposedTactic 1;
neuper@37906
   129
 val (ptp as (pt,p), tacis) = get_calc 1; get_pos 1 1;
neuper@37906
   130
neuper@37906
   131
 setNextTactic 1 (Specify_Method ["Test","solve_linear"]);
neuper@37906
   132
 val (ptp as (pt,p), tacis) = get_calc 1; get_pos 1 1;
neuper@37906
   133
neuper@37906
   134
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   135
 val (ptp as (pt,p), tacis) = get_calc 1; get_pos 1 1;
neuper@37906
   136
neuper@37906
   137
(*-------------------------------------------------------------------------*)
neuper@37906
   138
 fetchProposedTactic 1;
neuper@41929
   139
(*========== inhibit exn 110310 ================================================
neuper@37906
   140
 val (ptp as (pt,p), tacis) = get_calc 1; get_pos 1 1;
neuper@37906
   141
neuper@37906
   142
 setNextTactic 1 (Apply_Method ["Test","solve_linear"]);
neuper@42048
   143
   (*ERROR.110620 <SETNEXTTACTIC>..<MESSAGE> end-of-calculation*)
neuper@37906
   144
 val (ptp as (pt,p), tacis) = get_calc 1; get_pos 1 1;
neuper@37906
   145
 is_complete_mod ptp;
neuper@37906
   146
 is_complete_spec ptp;
neuper@37906
   147
neuper@37906
   148
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   149
 val (ptp as (pt,p), tacis) = get_calc 1; get_pos 1 1;
neuper@37906
   150
 (*term2str (get_obj g_form pt [1]);*)
neuper@37906
   151
(*-------------------------------------------------------------------------*)
neuper@37906
   152
neuper@37906
   153
 fetchProposedTactic 1;
neuper@37906
   154
 setNextTactic 1 (Rewrite_Set_Inst (["(bdv,x)"], "isolate_bdv"));
neuper@37906
   155
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   156
neuper@37906
   157
 fetchProposedTactic 1;
neuper@37906
   158
 setNextTactic 1 (Rewrite_Set "Test_simplify");
neuper@37906
   159
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   160
neuper@37906
   161
 fetchProposedTactic 1;
neuper@37906
   162
 setNextTactic 1 (Check_Postcond ["linear","univariate","equation","test"]);
neuper@37906
   163
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   164
neuper@37906
   165
 val ((pt,_),_) = get_calc 1;
neuper@37906
   166
 val ip = get_pos 1 1;
neuper@37906
   167
 val (Form f, tac, asms) = pt_extract (pt, ip);
neuper@37906
   168
     (*exception just above means: 'ModSpec' has been returned: error anyway*)
neuper@37906
   169
 if term2str f = "[x = 1]" then () else 
neuper@38031
   170
 error "FE-Kernel-interface.sml: diff.behav. in solve_linear as rootpbl";
neuper@42048
   171
============ inhibit exn 110310 ==============================================*)
neuper@37906
   172
neuper@42048
   173
(*========== inhibit exn 110620 ================================================
neuper@38066
   174
"--------- inspect the CalcTree No.1 with Iterator No.2 -";
neuper@38066
   175
"--------- inspect the CalcTree No.1 with Iterator No.2 -";
neuper@38066
   176
"--------- inspect the CalcTree No.1 with Iterator No.2 -";
neuper@37906
   177
(*WN041118: inspection shifted to Iterator No.1, because others need pos'*)
neuper@37906
   178
 moveActiveRoot 1; 
neuper@37906
   179
 refFormula 1 ([],Pbl); getTactic 1 ([],Pbl);(*Error*)
neuper@37906
   180
 moveActiveDown 1; 
neuper@37906
   181
 refFormula 1 ([1],Frm); getTactic 1 ([1],Frm);(*Error*)
neuper@37906
   182
 moveActiveDown 1 ; 
neuper@37906
   183
 refFormula 1 ([1],Res); getTactic 1 ([1],Res);(*OK*) 
neuper@37906
   184
 (*getAssumption 1 ([1],Res); TODO.WN041217*)
neuper@37906
   185
 moveActiveDown 1 ; refFormula 1 ([2],Res);
neuper@37906
   186
 moveActiveCalcHead 1; refFormula 1 ([],Pbl);
neuper@37906
   187
 moveActiveDown 1;
neuper@37906
   188
 moveActiveDown 1;
neuper@37906
   189
 moveActiveDown 1;
neuper@37906
   190
 if get_pos 1 1 = ([2], Res) then () else 
neuper@38031
   191
 error "FE-interface.sml: diff.behav. in a inspect 1 with Iterator 2";
neuper@37906
   192
 moveActiveDown 1; refFormula 1 ([], Res);
neuper@37906
   193
 if get_pos 1 1 = ([], Res) then () else 
neuper@38031
   194
 error "FE-interface.sml: diff.behav. in b inspect 1 with Iterator 2";
neuper@37906
   195
 moveActiveCalcHead 1; refFormula 1 ([],Pbl);
neuper@42048
   196
============ inhibit exn 110620 ==============================================*)
neuper@37906
   197
neuper@38066
   198
"--------- miniscript with mini-subpbl ------------------";
neuper@38066
   199
"--------- miniscript with mini-subpbl ------------------";
neuper@38066
   200
"--------- miniscript with mini-subpbl ------------------";
neuper@41970
   201
 states:=[]; (*start of calculation, return No.1*)
neuper@41970
   202
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   203
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   204
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   205
 Iterator 1;
neuper@37906
   206
neuper@37906
   207
 moveActiveRoot 1; 
neuper@37906
   208
 refFormula 1 (get_pos 1 1);
neuper@37906
   209
 fetchProposedTactic 1;
neuper@37906
   210
 setNextTactic 1 (Model_Problem);
neuper@37906
   211
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);(*gets ModSpec;model is still empty*)
neuper@37906
   212
neuper@37906
   213
 fetchProposedTactic 1;
neuper@37906
   214
 setNextTactic 1 (Add_Given "equality (x + 1 = 2)");
neuper@37906
   215
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   216
neuper@37906
   217
 fetchProposedTactic 1;
neuper@37906
   218
 setNextTactic 1 (Add_Given "solveFor x");
neuper@37906
   219
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   220
neuper@37906
   221
 fetchProposedTactic 1;
neuper@37906
   222
 setNextTactic 1 (Add_Find "solutions L");
neuper@37906
   223
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   224
neuper@37906
   225
 fetchProposedTactic 1;
neuper@38058
   226
 setNextTactic 1 (Specify_Theory "Test");
neuper@37906
   227
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   228
neuper@37906
   229
 fetchProposedTactic 1;
neuper@37906
   230
 setNextTactic 1 (Specify_Problem 
neuper@37906
   231
		      ["sqroot-test","univariate","equation","test"]);
neuper@37906
   232
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   233
"1-----------------------------------------------------------------";
neuper@37906
   234
neuper@37906
   235
 fetchProposedTactic 1;
neuper@37906
   236
 setNextTactic 1 (Specify_Method ["Test","squ-equ-test-subpbl1"]);
neuper@37906
   237
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   238
neuper@37906
   239
 fetchProposedTactic 1;
neuper@37906
   240
 setNextTactic 1 (Apply_Method ["Test","squ-equ-test-subpbl1"]);
neuper@37906
   241
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   242
neuper@37906
   243
 fetchProposedTactic 1;
neuper@37906
   244
 setNextTactic 1 (Rewrite_Set "norm_equation");
neuper@37906
   245
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   246
neuper@37906
   247
 fetchProposedTactic 1;
neuper@37906
   248
 setNextTactic 1 (Rewrite_Set "Test_simplify");
neuper@37906
   249
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   250
neuper@37906
   251
 fetchProposedTactic 1;(*----------------Subproblem--------------------*);
neuper@38058
   252
 setNextTactic 1 (Subproblem ("Test",
neuper@37906
   253
			      ["linear","univariate","equation","test"]));
neuper@37906
   254
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   255
neuper@37906
   256
 fetchProposedTactic 1;
neuper@37906
   257
 setNextTactic 1 (Model_Problem );
neuper@37906
   258
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   259
neuper@37906
   260
 fetchProposedTactic 1;
neuper@37906
   261
 setNextTactic 1 (Add_Given "equality (-1 + x = 0)");
neuper@37906
   262
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   263
neuper@37906
   264
 fetchProposedTactic 1;
neuper@37906
   265
 setNextTactic 1 (Add_Given "solveFor x");
neuper@37906
   266
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   267
neuper@37906
   268
 fetchProposedTactic 1;
neuper@37906
   269
 setNextTactic 1 (Add_Find "solutions x_i");
neuper@37906
   270
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   271
neuper@37906
   272
 fetchProposedTactic 1;
neuper@38058
   273
 setNextTactic 1 (Specify_Theory "Test");
neuper@37906
   274
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   275
neuper@37906
   276
 fetchProposedTactic 1;
neuper@37906
   277
 setNextTactic 1 (Specify_Problem ["linear","univariate","equation","test"]);
neuper@37906
   278
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   279
"2-----------------------------------------------------------------";
neuper@37906
   280
neuper@37906
   281
 fetchProposedTactic 1;
neuper@37906
   282
 setNextTactic 1 (Specify_Method ["Test","solve_linear"]);
neuper@37906
   283
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   284
neuper@37906
   285
 fetchProposedTactic 1;
neuper@37906
   286
 setNextTactic 1 (Apply_Method ["Test","solve_linear"]);
neuper@37906
   287
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   288
neuper@37906
   289
 fetchProposedTactic 1;
neuper@37906
   290
 setNextTactic 1 (Rewrite_Set_Inst (["(bdv,x)"], "isolate_bdv"));
neuper@37906
   291
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   292
neuper@37906
   293
 fetchProposedTactic 1;
neuper@37906
   294
 setNextTactic 1 (Rewrite_Set "Test_simplify");
neuper@37906
   295
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   296
neuper@37906
   297
 fetchProposedTactic 1;
neuper@37906
   298
 setNextTactic 1 (Check_Postcond ["linear","univariate","equation","test"]);
neuper@37906
   299
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   300
neuper@37906
   301
 fetchProposedTactic 1;
neuper@37906
   302
 setNextTactic 1 (Check_elementwise "Assumptions");
neuper@37906
   303
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   304
neuper@37906
   305
 val xml = fetchProposedTactic 1;
neuper@37906
   306
 setNextTactic 1 (Check_Postcond 
neuper@37906
   307
		      ["sqroot-test","univariate","equation","test"]);
neuper@37906
   308
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   309
neuper@37906
   310
 val ((pt,_),_) = get_calc 1;
neuper@37906
   311
 val str = pr_ptree pr_short pt;
neuper@37906
   312
 writeln str;
neuper@37906
   313
 val ip = get_pos 1 1;
neuper@37906
   314
 val (Form f, tac, asms) = pt_extract (pt, ip);
neuper@37906
   315
     (*exception just above means: 'ModSpec' has been returned: error anyway*)
neuper@37906
   316
 if term2str f = "[x = 1]" then () else 
neuper@38031
   317
 error "FE-interface.sml: diff.behav. in miniscript with mini-subpb";
neuper@37906
   318
neuper@37906
   319
 DEconstrCalcTree 1;
neuper@37906
   320
neuper@38066
   321
"--------- mini-subpbl AUTOCALCULATE Step 1 -------------";
neuper@38066
   322
"--------- mini-subpbl AUTOCALCULATE Step 1 -------------";
neuper@38066
   323
"--------- mini-subpbl AUTOCALCULATE Step 1 -------------";
neuper@37906
   324
 states:=[];
neuper@41970
   325
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   326
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   327
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   328
 Iterator 1;
neuper@37906
   329
 moveActiveRoot 1;
neuper@37906
   330
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   331
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   332
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   333
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   334
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   335
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   336
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   337
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   338
 (*here the solve-phase starts*)
neuper@37906
   339
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   340
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   341
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   342
 (*------------------------------------*)
neuper@37906
   343
(* print_depth 13; get_calc 1;
neuper@37906
   344
   *)
neuper@37906
   345
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   346
 (*calc-head of subproblem*)
neuper@37906
   347
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   348
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   349
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   350
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   351
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   352
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   353
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   354
 (*solve-phase of the subproblem*)
neuper@37906
   355
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   356
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   357
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   358
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   359
 (*finish subproblem*)
neuper@37906
   360
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   361
 (*finish problem*)
neuper@37906
   362
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1); 
neuper@37906
   363
neuper@37906
   364
 (*this checks the test for correctness..*)
neuper@37906
   365
 val ((pt,_),_) = get_calc 1;
neuper@37906
   366
 val p = get_pos 1 1;
neuper@37906
   367
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   368
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
   369
 error "FE-interface.sml: diff.behav. in miniscript with mini-subpb";
neuper@37906
   370
neuper@37906
   371
 DEconstrCalcTree 1;
neuper@37906
   372
neuper@42048
   373
(*========== inhibit exn 110620 ================================================
neuper@38066
   374
"--------- solve_linear as rootpbl AUTO CompleteCalc ----";
neuper@38066
   375
"--------- solve_linear as rootpbl AUTO CompleteCalc ----";
neuper@38066
   376
"--------- solve_linear as rootpbl AUTO CompleteCalc ----";
neuper@37906
   377
 states:=[];
neuper@37906
   378
 CalcTree
neuper@37906
   379
     [(["equality (1+-1*2+x=0)", "solveFor x","solutions L"],
neuper@38058
   380
       ("Test", 
neuper@37906
   381
	["linear","univariate","equation","test"],
neuper@37906
   382
	["Test","solve_linear"]))];
neuper@37906
   383
 Iterator 1;
neuper@37906
   384
 moveActiveRoot 1;
neuper@37906
   385
getFormulaeFromTo 1 ([],Pbl) ([],Pbl) 999 false;
neuper@37906
   386
neuper@37906
   387
 autoCalculate 1 CompleteCalc; 
neuper@37906
   388
 val (unc, del, gen) = (([],Pbl), ([],Pbl), ([],Res));
neuper@37906
   389
 getFormulaeFromTo 1 unc gen 1 (*only level 1*) false;
neuper@37906
   390
neuper@37906
   391
 val ((pt,_),_) = get_calc 1;
neuper@37906
   392
 val p = get_pos 1 1;
neuper@37906
   393
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   394
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
   395
 error "FE-interface.sml: diff.behav. in solve_linear/rt AUTOCALCULATE ";
neuper@37906
   396
neuper@38066
   397
"--------- solve_linear as rootpbl AUTO CompleteHead/Calc ";
neuper@38066
   398
"--------- solve_linear as rootpbl AUTO CompleteHead/Calc ";
neuper@38066
   399
"--------- solve_linear as rootpbl AUTO CompleteHead/Calc ";
neuper@37906
   400
 states:=[];
neuper@37906
   401
 CalcTree
neuper@37906
   402
     [(["equality (1+-1*2+x=0)", "solveFor x","solutions L"],
neuper@38058
   403
       ("Test", 
neuper@37906
   404
	["linear","univariate","equation","test"],
neuper@37906
   405
	["Test","solve_linear"]))];
neuper@37906
   406
 Iterator 1;
neuper@37906
   407
 moveActiveRoot 1;
neuper@37906
   408
 autoCalculate 1 CompleteCalcHead;
neuper@37906
   409
 refFormula 1 (get_pos 1 1);
neuper@37906
   410
 val ((pt,p),_) = get_calc 1;
neuper@37906
   411
neuper@37906
   412
 autoCalculate 1 CompleteCalc; 
neuper@37906
   413
 val ((pt,p),_) = get_calc 1;
neuper@37906
   414
 if p=([], Res) then () else 
neuper@38031
   415
 error "FE-interface.sml: diff.behav. in solve_linear AUTOC Head/Calc ";
neuper@42048
   416
============ inhibit exn 110620 ==============================================*)
neuper@37906
   417
neuper@38066
   418
"--------- mini-subpbl AUTOCALCULATE CompleteCalc -------";
neuper@38066
   419
"--------- mini-subpbl AUTOCALCULATE CompleteCalc -------";
neuper@38066
   420
"--------- mini-subpbl AUTOCALCULATE CompleteCalc -------";
neuper@37906
   421
 states:=[];
neuper@41970
   422
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   423
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   424
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   425
 Iterator 1;
neuper@37906
   426
 moveActiveRoot 1;
neuper@37906
   427
 autoCalculate 1 CompleteCalc;
neuper@37906
   428
neuper@37906
   429
(*
neuper@37906
   430
getTactic 1 ([1],Frm);
neuper@37906
   431
getTactic 1 ([1],Res);
neuper@37906
   432
initContext 1 Thy_ ([1],Res);
neuper@37906
   433
*)
neuper@37906
   434
neuper@37906
   435
 (*... returns calcChangedEvent with*)
neuper@37906
   436
 val (unc, del, gen) = (([],Pbl), ([],Pbl), ([],Res));
neuper@37906
   437
 getFormulaeFromTo 1 unc gen 0 (*only result*) false;
neuper@37906
   438
 getFormulaeFromTo 1 unc gen 1 (*only level 1*) false;
neuper@37906
   439
 getFormulaeFromTo 1 unc gen 99999 (*all levels*) false;
neuper@37906
   440
neuper@37906
   441
 val ((pt,_),_) = get_calc 1;
neuper@37906
   442
 val p = get_pos 1 1;
neuper@42048
   443
(*========== inhibit exn 110620 ================================================
neuper@37906
   444
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@42048
   445
(*    ModSpec........... =  ...................DIFFERENT !*)
neuper@37906
   446
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
   447
 error "FE-interface.sml: diff.behav. in mini-subpbl AUTOCALCULATE 6";
neuper@42048
   448
============ inhibit exn 110620 ==============================================*)
neuper@37906
   449
neuper@37906
   450
neuper@42048
   451
(*=== inhibit exn ?=============================================================
neuper@38066
   452
"--------- mini-subpbl AUTO CompleteCalcHead ------------";
neuper@38066
   453
"--------- mini-subpbl AUTO CompleteCalcHead ------------";
neuper@38066
   454
"--------- mini-subpbl AUTO CompleteCalcHead ------------";
neuper@37906
   455
 states:=[];
neuper@41970
   456
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   457
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   458
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   459
 Iterator 1;
neuper@42048
   460
 moveActiveRoot 1;
neuper@37906
   461
(* doesn't terminate !!!
neuper@37906
   462
 autoCalculate 1 CompleteCalcHead; 
neuper@37906
   463
*)
neuper@37906
   464
neuper@38066
   465
"--------- solve_linear as rootpbl AUTO CompleteModel ---";
neuper@38066
   466
"--------- solve_linear as rootpbl AUTO CompleteModel ---";
neuper@38066
   467
"--------- solve_linear as rootpbl AUTO CompleteModel ---";
neuper@37906
   468
 states:=[];
neuper@37906
   469
 CalcTree
neuper@37906
   470
     [(["equality (1+-1*2+x=0)", "solveFor x","solutions L"],
neuper@38058
   471
       ("Test", 
neuper@37906
   472
	["linear","univariate","equation","test"],
neuper@37906
   473
	["Test","solve_linear"]))];
neuper@37906
   474
 Iterator 1;
neuper@37906
   475
 moveActiveRoot 1;
neuper@37906
   476
 autoCalculate 1 CompleteModel; 
neuper@37906
   477
 refFormula 1 (get_pos 1 1);
neuper@37906
   478
neuper@37906
   479
setProblem 1 ["linear","univariate","equation","test"];
neuper@37906
   480
val pos = get_pos 1 1;
neuper@37906
   481
setContext 1 pos (kestoreID2guh Pbl_["linear","univariate","equation","test"]);
neuper@37906
   482
 refFormula 1 (get_pos 1 1);
neuper@37906
   483
neuper@37906
   484
setMethod 1 ["Test","solve_linear"];
neuper@37906
   485
setContext 1 pos (kestoreID2guh Met_ ["Test","solve_linear"]);
neuper@37906
   486
 refFormula 1 (get_pos 1 1);
neuper@37906
   487
 val ((pt,_),_) = get_calc 1;
neuper@37906
   488
 if get_obj g_spec pt [] = ("e_domID", 
neuper@37906
   489
			    ["linear", "univariate","equation","test"],
neuper@37906
   490
			    ["Test","solve_linear"]) then ()
neuper@38031
   491
 else error "FE-interface.sml: diff.behav. in setProblem, setMethod";
neuper@37906
   492
neuper@37906
   493
 autoCalculate 1 CompleteCalcHead;
neuper@37906
   494
 refFormula 1 (get_pos 1 1); 
neuper@37906
   495
 autoCalculate 1 CompleteCalc; 
neuper@37906
   496
 moveActiveDown 1;
neuper@37906
   497
 moveActiveDown 1;
neuper@37906
   498
 moveActiveDown 1;
neuper@37906
   499
 refFormula 1 (get_pos 1 1); 
neuper@37906
   500
 val ((pt,_),_) = get_calc 1;
neuper@37906
   501
 val p = get_pos 1 1;
neuper@37906
   502
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   503
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
   504
 error "FE-interface.sml: diff.behav. in mini-subpbl AUTOCALCULATE 6";
neuper@37906
   505
neuper@37906
   506
neuper@38066
   507
"--------- setContext..Thy ------------------------------";
neuper@38066
   508
"--------- setContext..Thy ------------------------------";
neuper@38066
   509
"--------- setContext..Thy ------------------------------";
neuper@37906
   510
states:=[];
neuper@41970
   511
CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   512
  ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   513
   ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   514
Iterator 1; moveActiveRoot 1;
neuper@37906
   515
autoCalculate 1 CompleteCalcHead;
neuper@37906
   516
autoCalculate 1 (Step 1);
neuper@37906
   517
val ((pt,p),_) = get_calc 1;  show_pt pt;
neuper@37906
   518
(*
neuper@37906
   519
setNextTactic 1 (Rewrite_Set "Test_simplify");
neuper@37906
   520
autoCalculate 1 (Step 1);
neuper@37906
   521
val ((pt,p),_) = get_calc 1;  show_pt pt;
neuper@37906
   522
*)
neuper@37906
   523
"-----^^^^^ and vvvvv do the same -----";
neuper@37906
   524
setContext 1 p "thy_isac_Test-rls-Test_simplify";
neuper@37906
   525
val ((pt,p),_) = get_calc 1;  show_pt pt;
neuper@37906
   526
neuper@37906
   527
autoCalculate 1 (Step 1);
neuper@37906
   528
setContext 1 p "thy_isac_Test-rls-Test_simplify";
neuper@37906
   529
val ((pt,p),_) = get_calc 1;  show_pt pt;
neuper@37906
   530
neuper@37906
   531
autoCalculate 1 CompleteCalc;
neuper@37906
   532
neuper@37906
   533
neuper@37906
   534
neuper@38066
   535
"--------- mini-subpbl AUTOCALC CompleteToSubpbl --------";
neuper@38066
   536
"--------- mini-subpbl AUTOCALC CompleteToSubpbl --------";
neuper@38066
   537
"--------- mini-subpbl AUTOCALC CompleteToSubpbl --------";
neuper@37906
   538
 states:=[];
neuper@41970
   539
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   540
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   541
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   542
 Iterator 1; moveActiveRoot 1;
neuper@37906
   543
 autoCalculate 1 CompleteToSubpbl;
neuper@37906
   544
 refFormula 1 (get_pos 1 1); (*<ISA> -1 + x = 0 </ISA>*);
neuper@37906
   545
 val ((pt,_),_) = get_calc 1;
neuper@37906
   546
 val str = pr_ptree pr_short pt;
neuper@37906
   547
 writeln str;
neuper@37906
   548
 if str = ".    ----- pblobj -----\n1.   x + 1 = 2\n2.   x + 1 + -1 * 2 = 0\n"
neuper@37906
   549
 then () else 
neuper@38031
   550
 error "FE-interface.sml: diff.behav. in mini-subpbl CompleteToSubpbl-1";
neuper@37906
   551
neuper@37906
   552
 autoCalculate 1 (Step 1); (*proceeds only, of NOT 1 step before subplb*)
neuper@37906
   553
 autoCalculate 1 CompleteToSubpbl;
neuper@37906
   554
 val ((pt,_),_) = get_calc 1;
neuper@37906
   555
 val str = pr_ptree pr_short pt;
neuper@37906
   556
 writeln str;
neuper@37906
   557
 autoCalculate 1 CompleteCalc; (*das geht ohnehin !*);
neuper@37906
   558
 val ((pt,_),_) = get_calc 1;
neuper@37906
   559
 val p = get_pos 1 1;
neuper@37906
   560
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   561
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
   562
 error "FE-interface.sml: diff.behav. in mini-subpbl CompleteToSubpbl 1";
neuper@37906
   563
neuper@37906
   564
neuper@38066
   565
"--------- rat-eq + subpbl: no_met, NO solution dropped -";
neuper@38066
   566
"--------- rat-eq + subpbl: no_met, NO solution dropped -";
neuper@38066
   567
"--------- rat-eq + subpbl: no_met, NO solution dropped -";
neuper@37906
   568
 states:=[];
neuper@37906
   569
 CalcTree
neuper@37906
   570
 [(["equality ((5*x)/(x - 2) - x/(x+2)=4)", "solveFor x","solutions L"],
neuper@38058
   571
   ("RatEq", ["univariate","equation"], ["no_met"]))];
neuper@37906
   572
 Iterator 1;
neuper@37906
   573
 moveActiveRoot 1; 
neuper@37906
   574
 fetchProposedTactic 1;
neuper@37906
   575
 setNextTactic 1 (Model_Problem );
neuper@38066
   576
autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37926
   577
(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
neuper@37906
   578
 setNextTactic 1 (Add_Given "equality (5 * x / (x - 2) - x / (x + 2) = 4)");
neuper@37906
   579
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   580
 setNextTactic 1 (Add_Given "solveFor x");
neuper@37906
   581
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   582
 setNextTactic 1 (Add_Find "solutions L");
neuper@37906
   583
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37926
   584
*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
neuper@38058
   585
 setNextTactic 1 (Specify_Theory "RatEq");
neuper@37906
   586
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   587
 setNextTactic 1 (Specify_Problem ["rational","univariate","equation"]);
neuper@37906
   588
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   589
 setNextTactic 1 (Specify_Method ["RatEq","solve_rat_equation"]);
neuper@37906
   590
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   591
 setNextTactic 1 (Apply_Method ["RatEq","solve_rat_equation"]);
neuper@37906
   592
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   593
 setNextTactic 1 (Rewrite_Set "RatEq_simplify");
neuper@37906
   594
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   595
 setNextTactic 1 (Rewrite_Set "norm_Rational");
neuper@37906
   596
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   597
 setNextTactic 1 (Rewrite_Set "RatEq_eliminate");
neuper@37906
   598
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   599
 (*               __________ for "12 * x + 4 * x ^^^ 2 = 4 * (-4 + x ^^^ 2)"*)
neuper@38058
   600
 setNextTactic 1 (Subproblem ("PolyEq", ["normalize","polynomial",
neuper@37906
   601
					    "univariate","equation"]));
neuper@37906
   602
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   603
 setNextTactic 1 (Model_Problem );
neuper@37906
   604
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37926
   605
(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
neuper@37906
   606
 setNextTactic 1 (Add_Given 
neuper@37906
   607
		      "equality (12 * x + 4 * x ^^^ 2 = 4 * (-4 + x ^^^ 2))");
neuper@37906
   608
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   609
 setNextTactic 1 (Add_Given "solveFor x");
neuper@37906
   610
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   611
 setNextTactic 1 (Add_Find "solutions x_i");
neuper@37906
   612
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37926
   613
*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
neuper@38058
   614
 setNextTactic 1 (Specify_Theory "PolyEq");
neuper@37906
   615
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   616
 setNextTactic 1 (Specify_Problem ["normalize","polynomial",
neuper@37906
   617
				   "univariate","equation"]);
neuper@37906
   618
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   619
 setNextTactic 1 (Specify_Method ["PolyEq","normalize_poly"]);
neuper@37906
   620
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   621
 setNextTactic 1 (Apply_Method ["PolyEq","normalize_poly"]);
neuper@37906
   622
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   623
 setNextTactic 1 (Rewrite ("all_left",""));
neuper@37906
   624
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   625
 setNextTactic 1 (Rewrite_Set_Inst (["(bdv,x)"], "make_ratpoly_in"));
neuper@37906
   626
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   627
 (*               __________ for "16 + 12 * x = 0"*)
neuper@38058
   628
 setNextTactic 1 (Subproblem ("PolyEq",
neuper@37906
   629
			 ["degree_1","polynomial","univariate","equation"]));
neuper@37906
   630
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   631
 setNextTactic 1 (Model_Problem );
neuper@37906
   632
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37926
   633
(*-----since Model_Problem + complete_mod_ in case cas of SOME-----*
neuper@37906
   634
 setNextTactic 1 (Add_Given 
neuper@37906
   635
		      "equality (16 + 12 * x = 0)");
neuper@37906
   636
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   637
 setNextTactic 1 (Add_Given "solveFor x");
neuper@37906
   638
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   639
 setNextTactic 1 (Add_Find "solutions x_i");
neuper@37906
   640
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37926
   641
*-----since Model_Problem + complete_mod_ in case cas of SOME-----*)
neuper@38058
   642
 setNextTactic 1 (Specify_Theory "PolyEq");
neuper@37906
   643
 (*------------- some trials in the problem-hierarchy ---------------*)
neuper@37906
   644
 setNextTactic 1 (Specify_Problem ["linear","univariate","equation"]);
neuper@37906
   645
 autoCalculate 1 (Step 1); fetchProposedTactic 1; (*<ERROR> helpless </ERROR> !!!*)
neuper@37906
   646
 setNextTactic 1 (Refine_Problem ["univariate","equation"]);
neuper@37906
   647
neuper@37906
   648
neuper@37906
   649
 (*------------------------------------------------------------------*)
neuper@37906
   650
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   651
 setNextTactic 1 (Specify_Method ["PolyEq","solve_d1_polyeq_equation"]);
neuper@37906
   652
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   653
 setNextTactic 1 (Apply_Method ["PolyEq","solve_d1_polyeq_equation"]);
neuper@37906
   654
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   655
 setNextTactic 1 (Rewrite_Set_Inst (["(bdv,x)"], "d1_polyeq_simplify"));
neuper@37906
   656
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   657
 setNextTactic 1 (Rewrite_Set "polyeq_simplify");
neuper@37906
   658
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   659
 (*==================================================================*)
neuper@37906
   660
 setNextTactic 1 Or_to_List;
neuper@37906
   661
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   662
 setNextTactic 1 (Check_elementwise "Assumptions");
neuper@37906
   663
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   664
 setNextTactic 1 (Check_Postcond ["degree_1","polynomial",
neuper@38066
   665
				  "univariate","equation"]);
neuper@37906
   666
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   667
 setNextTactic 1 (Check_Postcond ["normalize","polynomial",
neuper@38066
   668
				  "univariate","equation"]);
neuper@37906
   669
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@38066
   670
(*========== inhibit exn =======================================================
neuper@38066
   671
*** exception TYPE raised (line 460 of "old_goals.ML"):
neuper@38066
   672
*** Type error in application: Incompatible operand type
neuper@38066
   673
*** 
neuper@38066
   674
*** Operator:  equality :: bool => una
neuper@38066
   675
*** Operand:   [((x * 3) = -4)] :: bool list
neuper@38066
   676
*** 
neuper@38066
   677
*** bool => una
neuper@38066
   678
*** bool list
neuper@38066
   679
*** equality
neuper@38066
   680
*** [x * 3 = -4]
neuper@38066
   681
neuper@37906
   682
 setNextTactic 1 (Check_elementwise "Assumptions");
neuper@37906
   683
 autoCalculate 1 (Step 1); fetchProposedTactic 1;
neuper@37906
   684
 setNextTactic 1 (Check_Postcond ["rational","univariate","equation"]);
neuper@37906
   685
 val (ptp,_) = get_calc 1;
neuper@37906
   686
 val (Form t,_,_) = pt_extract ptp;
neuper@37906
   687
 if get_pos 1 1 = ([], Res) andalso term2str t = "[x = -4 / 3]" then ()
neuper@37906
   688
 else writeln "FE-inteface.sml: diff.behav. in rat-eq + subpbl: no_met, NO ..";
neuper@38066
   689
============ inhibit exn =====================================================*)
neuper@37906
   690
neuper@37906
   691
neuper@38066
   692
"--------- tryMatchProblem, tryRefineProblem ------------";
neuper@38066
   693
"--------- tryMatchProblem, tryRefineProblem ------------";
neuper@38066
   694
"--------- tryMatchProblem, tryRefineProblem ------------";
neuper@37906
   695
(*{\bf\UC{Having \isac{} Refine the Problem
neuper@37906
   696
 * Automatically}\label{SPECIFY:refine-auto}\\} test match and refine with
neuper@37906
   697
 * x^^^2 + 4*x + 5 = 2
neuper@37906
   698
see isac.bridge.TestSpecify#testMatchRefine*)
neuper@37906
   699
 DEconstrCalcTree 1;
neuper@37906
   700
 CalcTree
neuper@37906
   701
 [(["equality (x^2 + 4*x + 5 = 2)", "solveFor x","solutions L"],
neuper@38050
   702
   ("Isac", 
neuper@37906
   703
    ["univariate","equation"],
neuper@37906
   704
    ["no_met"]))];
neuper@37906
   705
 Iterator 1;
neuper@37906
   706
 moveActiveRoot 1; 
neuper@37906
   707
neuper@37906
   708
 fetchProposedTactic 1;
neuper@37906
   709
 setNextTactic 1 (Model_Problem );
neuper@37906
   710
 (*..this tactic should be done 'tacitly', too !*)
neuper@37906
   711
neuper@37906
   712
(*
neuper@37906
   713
autoCalculate 1 CompleteCalcHead; 
neuper@37906
   714
checkContext 1 ([],Pbl) "pbl_equ_univ";
neuper@37906
   715
checkContext 1 ([],Pbl) (kestoreID2guh Pbl_ ["univariate","equation"]);
neuper@37906
   716
*)
neuper@37906
   717
neuper@37906
   718
 autoCalculate 1 (Step 1); 
neuper@37906
   719
neuper@37906
   720
 fetchProposedTactic 1;
neuper@37906
   721
 setNextTactic 1 (Add_Given "equality (x ^^^ 2 + 4 * x + 5 = 2)");
neuper@37906
   722
 autoCalculate 1 (Step 1); 
neuper@37906
   723
neuper@37906
   724
 "--------- we go into the ProblemBrowser (_NO_ pblID selected) -";
neuper@37906
   725
initContext 1 Pbl_ ([],Pbl);
neuper@37906
   726
initContext 1 Met_ ([],Pbl);
neuper@37906
   727
neuper@37906
   728
 "--------- this match will show some incomplete items: ---------";
neuper@37906
   729
checkContext 1 ([],Pbl) (kestoreID2guh Pbl_ ["univariate","equation"]);
neuper@37906
   730
checkContext 1 ([],Pbl) (kestoreID2guh Met_ ["LinEq", "solve_lineq_equation"]);
neuper@37906
   731
neuper@37906
   732
neuper@37906
   733
 fetchProposedTactic 1;
neuper@37906
   734
 setNextTactic 1 (Add_Given "solveFor x"); autoCalculate 1 (Step 1);
neuper@37906
   735
neuper@37906
   736
 fetchProposedTactic 1;
neuper@37906
   737
 setNextTactic 1 (Add_Find "solutions L"); autoCalculate 1 (Step 1);
neuper@37906
   738
neuper@37906
   739
 "--------- this is a matching model (all items correct): -------";
neuper@37906
   740
checkContext 1  ([],Pbl) (kestoreID2guh Pbl_ ["univariate","equation"]);
neuper@37906
   741
 "--------- this is a NOT matching model (some 'false': ---------";
neuper@37906
   742
checkContext 1  ([],Pbl)(kestoreID2guh Pbl_["linear","univariate","equation"]);
neuper@37906
   743
neuper@37906
   744
 "--------- find out a matching problem: ------------------------";
neuper@37906
   745
 "--------- find out a matching problem (FAILING: no new pbl) ---";
neuper@37906
   746
 refineProblem 1([],Pbl)(pblID2guh ["linear","univariate","equation"]);
neuper@37906
   747
neuper@37906
   748
 "--------- find out a matching problem (SUCCESSFUL) ------------";
neuper@37906
   749
 refineProblem 1 ([],Pbl) (pblID2guh ["univariate","equation"]);
neuper@37906
   750
neuper@37906
   751
 "--------- tryMatch, tryRefine did not change the calculation -";
neuper@37906
   752
 "--------- this is done by <TRANSFER> on the pbl-browser: ------";
neuper@37906
   753
 setNextTactic 1 (Specify_Problem ["normalize","polynomial",
neuper@37906
   754
				 "univariate","equation"]);
neuper@37906
   755
 autoCalculate 1 (Step 1);
neuper@37906
   756
(*WN050904 fetchProposedTactic again --> Specify_Problem ["normalize",...
neuper@37906
   757
  and Specify_Theory skipped in comparison to below ---^^^-inserted      *)
neuper@37906
   758
(*------------vvv-inserted-----------------------------------------------*)
neuper@37906
   759
 fetchProposedTactic 1;
neuper@37906
   760
 setNextTactic 1 (Specify_Problem ["normalize","polynomial",
neuper@37906
   761
				 "univariate","equation"]);
neuper@37906
   762
 autoCalculate 1 (Step 1);
neuper@37906
   763
neuper@37906
   764
(*and Specify_Theory skipped by fetchProposedTactic ?!?*)
neuper@37906
   765
neuper@37906
   766
 fetchProposedTactic 1;
neuper@37906
   767
 setNextTactic 1 (Specify_Method ["PolyEq","normalize_poly"]);
neuper@37906
   768
 autoCalculate 1 (Step 1);
neuper@37906
   769
neuper@37906
   770
 fetchProposedTactic 1;
neuper@37906
   771
 setNextTactic 1 (Apply_Method ["PolyEq","normalize_poly"]);
neuper@37906
   772
 autoCalculate 1 CompleteCalc;
neuper@37906
   773
 val ((pt,_),_) = get_calc 1;
neuper@37906
   774
 show_pt pt;
neuper@37906
   775
 val p = get_pos 1 1;
neuper@37906
   776
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   777
 if term2str f = "[x = -1, x = -3]" andalso p = ([], Res) then () else 
neuper@38031
   778
 error "FE-interface.sml: diff.behav. in tryMatchProblem, tryRefine";
neuper@37906
   779
neuper@37906
   780
(*------------^^^-inserted-----------------------------------------------*)
neuper@37906
   781
(*WN050904 the fetchProposedTactic's below may not have worked like that
neuper@37906
   782
  before, too, because there was no check*)
neuper@37906
   783
 fetchProposedTactic 1;
neuper@38058
   784
 setNextTactic 1 (Specify_Theory "PolyEq");
neuper@37906
   785
 autoCalculate 1 (Step 1);
neuper@37906
   786
neuper@37906
   787
 fetchProposedTactic 1;
neuper@37906
   788
 setNextTactic 1 (Specify_Method ["PolyEq","normalize_poly"]);
neuper@37906
   789
 autoCalculate 1 (Step 1);
neuper@37906
   790
neuper@37906
   791
 fetchProposedTactic 1;
neuper@37906
   792
 "--------- now the calc-header is ready for enter 'solving' ----";
neuper@37906
   793
 autoCalculate 1 CompleteCalc;
neuper@37906
   794
neuper@37906
   795
 val ((pt,_),_) = get_calc 1;
neuper@37906
   796
rootthy pt;
neuper@37906
   797
 show_pt pt;
neuper@37906
   798
 val p = get_pos 1 1;
neuper@37906
   799
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   800
 if term2str f = "[x = -1, x = -3]" andalso p = ([], Res) then () else 
neuper@38031
   801
 error "FE-interface.sml: diff.behav. in tryMatchProblem, tryRefine";
neuper@37906
   802
neuper@37906
   803
neuper@38066
   804
"--------- modifyCalcHead, resetCalcHead, modelProblem --";
neuper@38066
   805
"--------- modifyCalcHead, resetCalcHead, modelProblem --";
neuper@38066
   806
"--------- modifyCalcHead, resetCalcHead, modelProblem --";
neuper@37906
   807
 states:=[]; 
neuper@37906
   808
 DEconstrCalcTree 1;
neuper@41970
   809
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   810
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   811
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   812
 Iterator 1;
neuper@37906
   813
 moveActiveRoot 1; 
neuper@37906
   814
neuper@37906
   815
 modifyCalcHead 1 (([],Pbl),(*the position from refFormula*)
neuper@37906
   816
		  "solve (x+1=2, x)",(*the headline*)
neuper@41971
   817
		  [Given ["equality (x+1=2)", "solveFor x"],
neuper@37906
   818
		   Find ["solutions L"](*,Relate []*)],
neuper@37906
   819
		  Pbl, 
neuper@38058
   820
		  ("Test", 
neuper@37906
   821
		   ["sqroot-test","univariate","equation","test"],
neuper@37906
   822
		   ["Test","squ-equ-test-subpbl1"]));
neuper@37906
   823
resetCalcHead 1;
neuper@37906
   824
modelProblem 1;
neuper@37906
   825
neuper@37906
   826
neuper@38066
   827
"--------- maximum-example, UC: Modeling an example -----";
neuper@38066
   828
"--------- maximum-example, UC: Modeling an example -----";
neuper@38066
   829
"--------- maximum-example, UC: Modeling an example -----";
neuper@37906
   830
(* {\bf\UC{Editing the Model}\label{SPECIFY:enter}\label{SPECIFY:check}\\}
neuper@37906
   831
see isac.bridge.TestModel#testEditItems
neuper@37906
   832
*)
neuper@37906
   833
 val elems = ["fixedValues [r=Arbfix]","maximum A","valuesFor [a,b]",
neuper@37906
   834
	      "relations [A=a*b, (a/2)^2 + (b/2)^2 = r^2]",
neuper@37906
   835
	      "relations [A=a*b, (a/2)^2 + (b/2)^2 = r^2]",
neuper@37906
   836
	      "relations [A=a*b, a/2=r*sin alpha, b/2=r*cos alpha]",
neuper@37906
   837
	      (*^^^ these are the elements for the root-problem (in variants)*)
neuper@37906
   838
              (*vvv these are elements required for subproblems*)
neuper@37906
   839
	      "boundVariable a","boundVariable b","boundVariable alpha",
neuper@37906
   840
	      "interval {x::real. 0 <= x & x <= 2*r}",
neuper@37906
   841
	      "interval {x::real. 0 <= x & x <= 2*r}",
neuper@37906
   842
	      "interval {x::real. 0 <= x & x <= pi}",
neuper@37906
   843
	      "errorBound (eps=(0::real))"]
neuper@37906
   844
 (*specifying is not interesting for this example*)
neuper@38058
   845
 val spec = ("DiffApp", ["maximum_of","function"], 
neuper@37906
   846
	     ["DiffApp","max_by_calculus"]);
neuper@37906
   847
 (*the empty model with descriptions for user-guidance by Model_Problem*)
neuper@37906
   848
 val empty_model = [Given ["fixedValues []"],
neuper@37906
   849
		    Find ["maximum", "valuesFor"],
neuper@37906
   850
		    Relate ["relations []"]];
neuper@37906
   851
 states:=[];
neuper@37906
   852
 DEconstrCalcTree 1;
neuper@37906
   853
 CalcTree [(elems, spec)];
neuper@37906
   854
 Iterator 1;
neuper@37906
   855
 moveActiveRoot 1; 
neuper@37906
   856
 refFormula 1 (get_pos 1 1);
neuper@37906
   857
 (*this gives a completely empty model*) 
neuper@37906
   858
neuper@37906
   859
 fetchProposedTactic 1;
neuper@37906
   860
(*fill the CalcHead with Descriptions...*)
neuper@37906
   861
 setNextTactic 1 (Model_Problem );
neuper@37906
   862
 autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   863
neuper@37906
   864
 (*user input is !!!!!EITHER!!!!! _some_ (at least one) items of the model 
neuper@37906
   865
 !!!!!OR!!!!! _one_ part of the specification !!!!!!!!!!!!!*)
neuper@37906
   866
 (*input of two items, 'fixedValues [r=Arbfix]' and 'maximum b'...*)
neuper@37906
   867
 modifyCalcHead 1 (([],Pbl) (*position, from previous refFormula*),
neuper@37906
   868
		  "Problem (DiffApp.thy, [maximum_of, function])",
neuper@37906
   869
		  (*the head-form ^^^ is not used for input here*)
neuper@37906
   870
		  [Given ["fixedValues [r=Arbfix]"(*new input*)],
neuper@37906
   871
		   Find ["maximum b"(*new input*), "valuesFor"], 
neuper@37906
   872
		   Relate ["relations"]],
neuper@37906
   873
		  (*input (Arbfix will dissappear soon)*)
neuper@37906
   874
		  Pbl (*belongsto*),
neuper@37906
   875
		  e_spec (*no input to the specification*));
neuper@37906
   876
neuper@37906
   877
 (*the user does not know, what 'superfluous' for 'maximum b' may mean
neuper@37906
   878
  and asks what to do next*)
neuper@37906
   879
 fetchProposedTactic 1;
neuper@37906
   880
 (*the student follows the advice*)
neuper@37906
   881
 setNextTactic 1 (Add_Find "maximum A"); (*FIXME.17.11.03: does not yet work*)
neuper@37906
   882
  autoCalculate 1 (Step 1); refFormula 1 (get_pos 1 1);
neuper@37906
   883
 
neuper@37906
   884
 (*this input completes the model*)
neuper@37906
   885
 modifyCalcHead 1 (([],Pbl), "not used here",
neuper@37906
   886
		  [Given ["fixedValues [r=Arbfix]"],
neuper@37906
   887
		   Find ["maximum A", "valuesFor [a,b]"(*new input*)], 
neuper@37906
   888
		   Relate ["relations [A=a*b, \
neuper@37906
   889
			   \(a/2)^2 + (b/2)^2 = r^2]"]], Pbl, e_spec);
neuper@37906
   890
neuper@37906
   891
 (*specification is not interesting an should be skipped by the dialogguide;
neuper@37906
   892
   !!!!!!!!!!!!!!!!!!!! input of ONE part at a time !!!!!!!!!!!!!!!!!!!!!!*)
neuper@37906
   893
 modifyCalcHead 1 (([],Pbl), "not used here",
neuper@37906
   894
		  [Given ["fixedValues [r=Arbfix]"],
neuper@37906
   895
		   Find ["maximum A", "valuesFor [a,b]"(*new input*)], 
neuper@37906
   896
		   Relate ["relations [A=a*b, \
neuper@37906
   897
			   \(a/2)^2 + (b/2)^2 = r^2]"]], Pbl, 
neuper@38058
   898
		  ("DiffApp", ["e_pblID"], ["e_metID"]));
neuper@37906
   899
 modifyCalcHead 1 (([],Pbl), "not used here",
neuper@37906
   900
		  [Given ["fixedValues [r=Arbfix]"],
neuper@37906
   901
		   Find ["maximum A", "valuesFor [a,b]"(*new input*)], 
neuper@37906
   902
		   Relate ["relations [A=a*b, \
neuper@37906
   903
			   \(a/2)^2 + (b/2)^2 = r^2]"]], Pbl, 
neuper@38058
   904
		  ("DiffApp", ["maximum_of","function"], 
neuper@37906
   905
		   ["e_metID"]));
neuper@37906
   906
 modifyCalcHead 1 (([],Pbl), "not used here",
neuper@37906
   907
		  [Given ["fixedValues [r=Arbfix]"],
neuper@37906
   908
		   Find ["maximum A", "valuesFor [a,b]"(*new input*)], 
neuper@37906
   909
		   Relate ["relations [A=a*b, \
neuper@37906
   910
			   \(a/2)^2 + (b/2)^2 = r^2]"]], Pbl, 
neuper@38058
   911
		  ("DiffApp", ["maximum_of","function"], 
neuper@37906
   912
		   ["DiffApp","max_by_calculus"]));
neuper@37906
   913
 (*this final calcHead now has STATUS 'complete' !*)
neuper@37906
   914
 DEconstrCalcTree 1;
neuper@37906
   915
neuper@37906
   916
neuper@38066
   917
"--------- solve_linear from pbl-hierarchy --------------";
neuper@38066
   918
"--------- solve_linear from pbl-hierarchy --------------";
neuper@38066
   919
"--------- solve_linear from pbl-hierarchy --------------";
neuper@37906
   920
 states:=[];
neuper@37906
   921
 val (fmz, sp) = ([], ("", ["linear","univariate","equation","test"], []));
neuper@37906
   922
 CalcTree [(fmz, sp)];
neuper@37906
   923
 Iterator 1; moveActiveRoot 1;
neuper@37906
   924
 refFormula 1 (get_pos 1 1);
neuper@37906
   925
 modifyCalcHead 1 (([],Pbl),"solve (1+-1*2+x=0)",
neuper@37906
   926
		  [Given ["equality (1+-1*2+x=0)", "solveFor x"],
neuper@37906
   927
		   Find ["solutions L"]],
neuper@37906
   928
		  Pbl, 
neuper@38058
   929
		  ("Test", ["linear","univariate","equation","test"],
neuper@37906
   930
		   ["Test","solve_linear"]));
neuper@37906
   931
 autoCalculate 1 CompleteCalc;
neuper@37906
   932
 refFormula 1 (get_pos 1 1);
neuper@37906
   933
 val ((pt,_),_) = get_calc 1;
neuper@37906
   934
 val p = get_pos 1 1;
neuper@37906
   935
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   936
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
   937
 error "FE-interface.sml: diff.behav. in from pbl-hierarchy";
neuper@37906
   938
 
neuper@37906
   939
neuper@38066
   940
"--------- solve_linear as in an algebra system (CAS)----";
neuper@38066
   941
"--------- solve_linear as in an algebra system (CAS)----";
neuper@38066
   942
"--------- solve_linear as in an algebra system (CAS)----";
neuper@37906
   943
 states:=[];
neuper@37906
   944
 val (fmz, sp) = ([], ("", [], []));
neuper@37906
   945
 CalcTree [(fmz, sp)];
neuper@37906
   946
 Iterator 1; moveActiveRoot 1;
neuper@37906
   947
 modifyCalcHead 1 (([],Pbl),"solveTest (1+-1*2+x=0,x)", [], Pbl, ("", [], []));
neuper@37906
   948
 autoCalculate 1 CompleteCalc;
neuper@37906
   949
 refFormula 1 (get_pos 1 1);
neuper@37906
   950
 val ((pt,_),_) = get_calc 1;
neuper@37906
   951
 val p = get_pos 1 1;
neuper@37906
   952
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
   953
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
   954
 error "FE-interface.sml: diff.behav. in algebra system";
neuper@37906
   955
neuper@37906
   956
neuper@38066
   957
"--------- interSteps: on 'miniscript with mini-subpbl' -";
neuper@38066
   958
"--------- interSteps: on 'miniscript with mini-subpbl' -";
neuper@38066
   959
"--------- interSteps: on 'miniscript with mini-subpbl' -";
neuper@37906
   960
 states:=[];
neuper@41970
   961
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   962
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   963
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
   964
 Iterator 1;
neuper@37906
   965
 moveActiveRoot 1;
neuper@37906
   966
 autoCalculate 1 CompleteCalc; 
neuper@37906
   967
 val ((pt,_),_) = get_calc 1;
neuper@37906
   968
 show_pt pt;
neuper@37906
   969
neuper@37906
   970
 (*UC\label{SOLVE:INFO:intermediate-steps}*)
neuper@37906
   971
 interSteps 1 ([2],Res);
neuper@37906
   972
 val ((pt,_),_) = get_calc 1; show_pt pt (*new ([2,1],Frm)..([2,6],Res)*);
neuper@37906
   973
 val (unc, del, gen) = (([1],Res),([1],Res),([2,6],Res));
neuper@37906
   974
 getFormulaeFromTo 1 unc gen 1 false; 
neuper@37906
   975
neuper@37906
   976
 (*UC\label{SOLVE:INFO:intermediate-steps}*)
neuper@37906
   977
 interSteps 1 ([3,2],Res);
neuper@37906
   978
 val ((pt,_),_) = get_calc 1; show_pt pt (*new ([3,2,1],Frm)..([3,2,2],Res)*);
neuper@37906
   979
 val (unc, del, gen) = (([3,1],Res),([3,1],Res),([3,2,2],Res));
neuper@37906
   980
 getFormulaeFromTo 1 unc gen 1 false; 
neuper@37906
   981
neuper@37906
   982
 (*UC\label{SOLVE:INFO:intermediate-steps}*)
neuper@37906
   983
 interSteps 1 ([3],Res)  (*no new steps in subproblems*);
neuper@37906
   984
 val (unc, del, gen) = (([3],Pbl),([3],Pbl),([3,2],Res));
neuper@37906
   985
 getFormulaeFromTo 1 unc gen 1 false; 
neuper@37906
   986
neuper@37906
   987
 (*UC\label{SOLVE:INFO:intermediate-steps}*)
neuper@37906
   988
 interSteps 1 ([],Res)  (*no new steps in subproblems*);
neuper@37906
   989
 val (unc, del, gen) = (([],Pbl),([],Pbl),([4],Res));
neuper@37906
   990
 getFormulaeFromTo 1 unc gen 1 false; 
neuper@37906
   991
neuper@37906
   992
neuper@38066
   993
"--------- getTactic, fetchApplicableTactics ------------";
neuper@38066
   994
"--------- getTactic, fetchApplicableTactics ------------";
neuper@38066
   995
"--------- getTactic, fetchApplicableTactics ------------";
neuper@37906
   996
 states:=[];
neuper@41970
   997
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
   998
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
   999
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1000
 Iterator 1; moveActiveRoot 1;
neuper@37906
  1001
 autoCalculate 1 CompleteCalc;
neuper@37906
  1002
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1003
 show_pt pt;
neuper@37906
  1004
neuper@37906
  1005
 (*UC\label{SOLVE:HIDE:getTactic}*)
neuper@37906
  1006
 getTactic 1 ([],Pbl);
neuper@37906
  1007
 getTactic 1 ([1],Res);
neuper@37906
  1008
 getTactic 1 ([3],Pbl);
neuper@37906
  1009
 getTactic 1 ([3,1],Frm);
neuper@37906
  1010
 getTactic 1 ([3],Res);
neuper@37906
  1011
 getTactic 1 ([],Res);
neuper@37906
  1012
neuper@37906
  1013
(*UC\label{SOLVE:MANUAL:TACTIC:listall}*)
neuper@37906
  1014
 fetchApplicableTactics 1 99999 ([],Pbl);
neuper@37906
  1015
 fetchApplicableTactics 1 99999 ([1],Res);
neuper@37906
  1016
 fetchApplicableTactics 1 99999 ([3],Pbl);
neuper@37906
  1017
 fetchApplicableTactics 1 99999 ([3,1],Res);
neuper@37906
  1018
 fetchApplicableTactics 1 99999 ([3],Res);
neuper@37906
  1019
 fetchApplicableTactics 1 99999 ([],Res);
neuper@37906
  1020
neuper@37906
  1021
neuper@38066
  1022
"--------- getAssumptions, getAccumulatedAsms -----------";
neuper@38066
  1023
"--------- getAssumptions, getAccumulatedAsms -----------";
neuper@38066
  1024
"--------- getAssumptions, getAccumulatedAsms -----------";
neuper@37906
  1025
states:=[];
neuper@37906
  1026
CalcTree
neuper@37906
  1027
[(["equality (x/(x^2 - 6*x+9) - 1/(x^2 - 3*x) =1/x)",
neuper@37906
  1028
	   "solveFor x","solutions L"], 
neuper@38058
  1029
  ("RatEq",["univariate","equation"],["no_met"]))];
neuper@37906
  1030
Iterator 1; moveActiveRoot 1;
neuper@37906
  1031
autoCalculate 1 CompleteCalc; 
neuper@37906
  1032
val ((pt,_),_) = get_calc 1;
neuper@37906
  1033
show_pt pt;
neuper@37906
  1034
neuper@37906
  1035
(*UC\label{SOLVE:HELP:assumptions}*)
neuper@37906
  1036
getAssumptions 1 ([3], Res);
neuper@37906
  1037
getAssumptions 1 ([5], Res);
neuper@37906
  1038
(*UC\label{SOLVE:HELP:assumptions-origin} WN0502 still without positions*)
neuper@37906
  1039
getAccumulatedAsms 1 ([3], Res);
neuper@37906
  1040
getAccumulatedAsms 1 ([5], Res);
neuper@37906
  1041
neuper@37906
  1042
neuper@38066
  1043
"--------- arbitrary combinations of steps --------------";
neuper@38066
  1044
"--------- arbitrary combinations of steps --------------";
neuper@38066
  1045
"--------- arbitrary combinations of steps --------------";
neuper@37906
  1046
 states:=[];
neuper@37906
  1047
 CalcTree      (*start of calculation, return No.1*)
neuper@37906
  1048
     [(["equality (1+-1*2+x=0)", "solveFor x","solutions L"],
neuper@38058
  1049
       ("Test", 
neuper@37906
  1050
	["linear","univariate","equation","test"],
neuper@37906
  1051
	["Test","solve_linear"]))];
neuper@37906
  1052
 Iterator 1; moveActiveRoot 1;
neuper@37906
  1053
neuper@37906
  1054
 fetchProposedTactic 1;
neuper@37906
  1055
 setNextTactic 1 (Model_Problem );
neuper@37906
  1056
 autoCalculate 1 (Step 1); 
neuper@37906
  1057
neuper@37906
  1058
 fetchProposedTactic 1;
neuper@37906
  1059
 fetchProposedTactic 1;
neuper@37906
  1060
neuper@37906
  1061
 setNextTactic 1 (Add_Find "solutions L");
neuper@37906
  1062
 setNextTactic 1 (Add_Find "solutions L");
neuper@37906
  1063
neuper@37906
  1064
 autoCalculate 1 (Step 1); 
neuper@37906
  1065
 autoCalculate 1 (Step 1); 
neuper@37906
  1066
neuper@38058
  1067
 setNextTactic 1 (Specify_Theory "Test");
neuper@37906
  1068
 fetchProposedTactic 1;
neuper@37906
  1069
 autoCalculate 1 (Step 1); 
neuper@37906
  1070
neuper@37906
  1071
 autoCalculate 1 (Step 1); 
neuper@37906
  1072
 autoCalculate 1 (Step 1); 
neuper@37906
  1073
 autoCalculate 1 (Step 1); 
neuper@37906
  1074
 autoCalculate 1 (Step 1); 
neuper@37906
  1075
(*------------------------- end calc-head*)
neuper@37906
  1076
neuper@37906
  1077
 fetchProposedTactic 1;
neuper@37906
  1078
 setNextTactic 1 (Rewrite_Set_Inst (["(bdv,x)"], "isolate_bdv"));
neuper@37906
  1079
 autoCalculate 1 (Step 1); 
neuper@37906
  1080
neuper@37906
  1081
 setNextTactic 1 (Rewrite_Set "Test_simplify");
neuper@37906
  1082
 fetchProposedTactic 1;
neuper@37906
  1083
 autoCalculate 1 (Step 1); 
neuper@37906
  1084
neuper@37906
  1085
 autoCalculate 1 CompleteCalc; 
neuper@37906
  1086
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1087
 val p = get_pos 1 1;
neuper@37906
  1088
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1089
 if term2str f = "[x = 1]" andalso p = ([], Res) then () else 
neuper@38031
  1090
 error "FE-interface.sml: diff.behav. in combinations of steps";
neuper@37906
  1091
neuper@37906
  1092
neuper@38066
  1093
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}right";
neuper@38066
  1094
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}right";
neuper@38066
  1095
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}right";
neuper@37906
  1096
 states:=[];
neuper@41970
  1097
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1098
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1099
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1100
 Iterator 1;
neuper@37906
  1101
 moveActiveRoot 1;
neuper@37906
  1102
 autoCalculate 1 CompleteCalcHead;
neuper@37906
  1103
 autoCalculate 1 (Step 1);
neuper@37906
  1104
 autoCalculate 1 (Step 1);
neuper@37906
  1105
 appendFormula 1 "-1 + x = 0";  
neuper@37906
  1106
 (*... returns calcChangedEvent with*)
neuper@37906
  1107
 val (unc, del, gen) = (([1],Res), ([1],Res), ([2],Res));
neuper@37906
  1108
 getFormulaeFromTo 1 unc gen 99999 (*all levels*) false;
neuper@37906
  1109
neuper@37906
  1110
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1111
 val p = get_pos 1 1;
neuper@37906
  1112
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1113
 if term2str f = "-1 + x = 0" andalso p = ([2], Res) then () else 
neuper@38031
  1114
 error "FE-interface.sml: diff.behav. in FORMULA:enter} right";
neuper@37906
  1115
neuper@38066
  1116
neuper@38066
  1117
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}other";
neuper@38066
  1118
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}other";
neuper@38066
  1119
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}other";
neuper@37906
  1120
 states:=[];
neuper@41970
  1121
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1122
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1123
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1124
 Iterator 1;
neuper@37906
  1125
 moveActiveRoot 1;
neuper@37906
  1126
 autoCalculate 1 CompleteCalcHead;
neuper@37906
  1127
 autoCalculate 1 (Step 1);
neuper@37906
  1128
 autoCalculate 1 (Step 1);
neuper@37906
  1129
 appendFormula 1 "x - 1 = 0"; 
neuper@37906
  1130
 val (unc, del, gen) = (([1],Res), ([1],Res), ([2],Res));
neuper@37906
  1131
 getFormulaeFromTo 1 unc gen 99999 (*all levels*) false;
neuper@37906
  1132
 (*11 elements !!!*)
neuper@37906
  1133
neuper@37906
  1134
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1135
 val p = get_pos 1 1;
neuper@37906
  1136
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1137
 if term2str f = "x - 1 = 0" andalso p = ([2], Res) then () else 
neuper@38031
  1138
 error "FE-interface.sml: diff.behav. in FORMULA:enter} other";
neuper@37906
  1139
neuper@38066
  1140
neuper@38066
  1141
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}oth 2";
neuper@38066
  1142
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}oth 2";
neuper@38066
  1143
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}oth 2";
neuper@37906
  1144
 states:=[];
neuper@41970
  1145
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1146
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1147
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1148
 Iterator 1;
neuper@37906
  1149
 moveActiveRoot 1;
neuper@37906
  1150
 autoCalculate 1 CompleteCalcHead;
neuper@37906
  1151
 autoCalculate 1 (Step 1);
neuper@37906
  1152
 autoCalculate 1 (Step 1);
neuper@37906
  1153
 appendFormula 1 "x = 1"; 
neuper@37906
  1154
 (*... returns calcChangedEvent with*)
neuper@37906
  1155
 val (unc, del, gen) = (([1],Res), ([1],Res), ([3,2],Res));
neuper@37906
  1156
 getFormulaeFromTo 1 unc gen 99999 (*all levels*) false;
neuper@37906
  1157
 (*6 elements !!!*)
neuper@37906
  1158
neuper@37906
  1159
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1160
 val p = get_pos 1 1;
neuper@37906
  1161
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1162
 if term2str f = "x = 1" andalso p = ([3,2], Res) then () else 
neuper@38031
  1163
 error "FE-interface.sml: diff.behav. in FORMULA:enter} oth 2";
neuper@37906
  1164
neuper@37906
  1165
neuper@38066
  1166
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}NOTok";
neuper@38066
  1167
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}NOTok";
neuper@38066
  1168
"--------- appendF label{SOLVE:MANUAL:FORMULA:enter}NOTok";
neuper@37906
  1169
 states:=[];
neuper@41970
  1170
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1171
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1172
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1173
 Iterator 1;
neuper@37906
  1174
 moveActiveRoot 1;
neuper@37906
  1175
 autoCalculate 1 CompleteCalcHead;
neuper@37906
  1176
 autoCalculate 1 (Step 1);
neuper@37906
  1177
 autoCalculate 1 (Step 1);
neuper@37906
  1178
 appendFormula 1 "x - 4711 = 0"; 
neuper@37906
  1179
 (*... returns <ERROR> no derivation found </ERROR>*)
neuper@37906
  1180
neuper@37906
  1181
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1182
 val p = get_pos 1 1;
neuper@37906
  1183
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1184
 if term2str f = "x + 1 + -1 * 2 = 0" andalso p = ([1], Res) then () else 
neuper@38031
  1185
 error "FE-interface.sml: diff.behav. in FORMULA:enter} NOTok";
neuper@37906
  1186
neuper@37906
  1187
neuper@38066
  1188
"--------- replaceFormula {SOL:MAN:FOR:replace} right----";
neuper@38066
  1189
"--------- replaceFormula {SOL:MAN:FOR:replace} right----";
neuper@38066
  1190
"--------- replaceFormula {SOL:MAN:FOR:replace} right----";
neuper@37906
  1191
 states:=[];
neuper@41970
  1192
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1193
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1194
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1195
 Iterator 1;
neuper@37906
  1196
 moveActiveRoot 1;
neuper@37906
  1197
 autoCalculate 1 CompleteCalc;
neuper@37906
  1198
 moveActiveFormula 1 ([2],Res);
neuper@37906
  1199
 replaceFormula 1 "-1 + x = 0" (*i.e. repeats input*);
neuper@37906
  1200
 (*... returns <ERROR> formula not changed </ERROR>*)
neuper@37906
  1201
neuper@37906
  1202
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1203
 val p = get_pos 1 1;
neuper@37906
  1204
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1205
 if term2str f = "-1 + x = 0" andalso p = ([2], Res) then () else 
neuper@38031
  1206
 error "FE-interface.sml: diff.behav. in FORMULA:replace} right 1";
neuper@37906
  1207
 if map fst (get_interval ([2],Res) ([],Res) 9999 pt) = 
neuper@37906
  1208
    [([2], Res), ([3], Pbl), ([3, 1], Frm), ([3, 1], Res), ([3, 2], Res),
neuper@37906
  1209
     ([3], Res), ([4], Res), ([], Res)] then () (*nothing deleted!*) else
neuper@38031
  1210
 error "FE-interface.sml: diff.behav. in FORMULA:replace} right 2";
neuper@37906
  1211
 
neuper@37906
  1212
(*WN050211 replaceFormula didn't work on second ctree: thus now tested...*)
neuper@41970
  1213
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1214
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1215
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1216
 Iterator 2;
neuper@37906
  1217
 moveActiveRoot 2;
neuper@37906
  1218
 autoCalculate 2 CompleteCalc;
neuper@37906
  1219
 moveActiveFormula 2 ([2],Res);
neuper@37906
  1220
 replaceFormula 2 "-1 + x = 0" (*i.e. repeats input*);
neuper@37906
  1221
 (*... returns <ERROR> formula not changed </ERROR>*)
neuper@37906
  1222
neuper@37906
  1223
 val ((pt,_),_) = get_calc 2;
neuper@37906
  1224
 val p = get_pos 2 1;
neuper@37906
  1225
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1226
 if term2str f = "-1 + x = 0" andalso p = ([2], Res) then () else 
neuper@38031
  1227
 error "FE-interface.sml: diff.behav. in FORMULA:replace} right 1";
neuper@37906
  1228
 if map fst (get_interval ([2],Res) ([],Res) 9999 pt) = 
neuper@37906
  1229
    [([2], Res), ([3], Pbl), ([3, 1], Frm), ([3, 1], Res), ([3, 2], Res),
neuper@37906
  1230
     ([3], Res), ([4], Res), ([], Res)] then () (*nothing deleted!*) else
neuper@38031
  1231
 error "FE-interface.sml: diff.behav. in FORMULA:replace} right 2b";
neuper@37906
  1232
neuper@38066
  1233
neuper@38066
  1234
"--------- replaceFormula {SOL:MAN:FOR:replace} other----";
neuper@38066
  1235
"--------- replaceFormula {SOL:MAN:FOR:replace} other----";
neuper@38066
  1236
"--------- replaceFormula {SOL:MAN:FOR:replace} other----";
neuper@37906
  1237
 states:=[];
neuper@41970
  1238
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1239
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1240
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1241
 Iterator 1;
neuper@37906
  1242
 moveActiveRoot 1;
neuper@37906
  1243
 autoCalculate 1 CompleteCalc;
neuper@37906
  1244
 moveActiveFormula 1 ([2],Res); (*there is "-1 + x = 0"*)
neuper@37906
  1245
 replaceFormula 1 "x - 1 = 0"; (*<-------------------------------------*)
neuper@37906
  1246
 (*... returns calcChangedEvent with*)
neuper@37906
  1247
 val (unc, del, gen) = (([1],Res), ([4],Res), ([2],Res));
neuper@37906
  1248
 getFormulaeFromTo 1 unc gen 99999 (*all levels*) false;
neuper@37906
  1249
neuper@37906
  1250
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1251
 show_pt pt;
neuper@37906
  1252
 val p = get_pos 1 1;
neuper@37906
  1253
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1254
 if term2str f = "x - 1 = 0" andalso p = ([2], Res) then () else 
neuper@38031
  1255
 error "FE-interface.sml: diff.behav. in FORMULA:replace} other 1";
neuper@37906
  1256
(* for getting the list in whole length ...
neuper@37906
  1257
print_depth 99;map fst (get_interval ([1],Res) ([],Res) 9999 pt);print_depth 3;
neuper@37906
  1258
   *)
neuper@37906
  1259
 if map fst (get_interval ([1],Res) ([],Res) 9999 pt) = 
neuper@37906
  1260
    [([1], Res), ([2, 1], Frm), ([2, 1], Res), ([2, 2], Res), ([2, 3], Res),
neuper@37906
  1261
      ([2, 4], Res), ([2, 5], Res), ([2, 6], Res), ([2, 7], Res),
neuper@37906
  1262
      ([2, 8], Res), ([2, 9], Res), ([2], Res)
neuper@37906
  1263
(*WN060727 {cutlevup->test_trans} removed: , 
neuper@37906
  1264
      ([], Res)(*dropped, if test_trans doesnt stop at PblNd*)*)] then () else
neuper@38031
  1265
 error "FE-interface.sml: diff.behav. in FORMULA:replace} other 2";
neuper@37906
  1266
neuper@37906
  1267
neuper@38066
  1268
"--------- replaceFormula {SOL:MAN:FOR:replace} other 2--";
neuper@38066
  1269
"--------- replaceFormula {SOL:MAN:FOR:replace} other 2--";
neuper@38066
  1270
"--------- replaceFormula {SOL:MAN:FOR:replace} other 2--";
neuper@37906
  1271
 states:=[];
neuper@41970
  1272
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1273
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1274
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1275
 Iterator 1;
neuper@37906
  1276
 moveActiveRoot 1;
neuper@37906
  1277
 autoCalculate 1 CompleteCalc;
neuper@37906
  1278
 moveActiveFormula 1 ([2],Res); (*there is "-1 + x = 0"*)
neuper@37906
  1279
 replaceFormula 1 "x = 1"; (*<-------------------------------------*)
neuper@37906
  1280
 (*... returns calcChangedEvent with ...*)
neuper@37906
  1281
 val (unc, del, gen) = (([1],Res), ([4],Res), ([3,2],Res));
neuper@37906
  1282
 getFormulaeFromTo 1 unc gen 99999 (*all levels*) false;
neuper@37906
  1283
 (*9 elements !!!*)
neuper@37906
  1284
neuper@37906
  1285
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1286
 show_pt pt; (*error: ...get_interval drops ([3,2],Res) ...*)
neuper@37906
  1287
 val (t,_) = get_obj g_result pt [3,2]; term2str t;
neuper@37906
  1288
  if map fst (get_interval ([1],Res) ([],Res) 9999 pt) = 
neuper@37906
  1289
    [([1], Res), ([2], Res), ([3], Pbl), ([3, 1], Frm), ([3, 1], Res),
neuper@37906
  1290
      ([3, 2, 1], Frm), ([3, 2, 1], Res), ([3, 2, 2], Res), 
neuper@37906
  1291
      ([3,2],Res)] then () else
neuper@38031
  1292
 error "FE-interface.sml: diff.behav. in FORMULA:replace} oth2 1";
neuper@37906
  1293
neuper@37906
  1294
 val p = get_pos 1 1;
neuper@37906
  1295
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1296
 if term2str f = "x = 1" andalso p = ([3,2], Res) then () else 
neuper@38031
  1297
 error "FE-interface.sml: diff.behav. in FORMULA:replace} oth2 2";
neuper@37906
  1298
neuper@37906
  1299
neuper@38066
  1300
"--------- replaceFormula {SOL:MAN:FOR:replace} NOTok----";
neuper@38066
  1301
"--------- replaceFormula {SOL:MAN:FOR:replace} NOTok----";
neuper@38066
  1302
"--------- replaceFormula {SOL:MAN:FOR:replace} NOTok----";
neuper@37906
  1303
 states:=[];
neuper@41970
  1304
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
  1305
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
  1306
    ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
  1307
 Iterator 1;
neuper@37906
  1308
 moveActiveRoot 1;
neuper@37906
  1309
 autoCalculate 1 CompleteCalc;
neuper@37906
  1310
 moveActiveFormula 1 ([2],Res); (*there is "-1 + x = 0"*)
neuper@37906
  1311
 replaceFormula 1 "x - 4711 = 0"; 
neuper@37906
  1312
 (*... returns <ERROR> no derivation found </ERROR>*)
neuper@37906
  1313
neuper@37906
  1314
 val ((pt,_),_) = get_calc 1;
neuper@37906
  1315
 show_pt pt;
neuper@37906
  1316
 val p = get_pos 1 1;
neuper@37906
  1317
 val (Form f, tac, asms) = pt_extract (pt, p);
neuper@37906
  1318
 if term2str f = "-1 + x = 0" andalso p = ([2], Res) then () else 
neuper@38031
  1319
 error "FE-interface.sml: diff.behav. in FORMULA:replace} NOTok";
neuper@41929
  1320
neuper@42048
  1321
===== inhibit exn ?===========================================================*)
neuper@42048
  1322