test/Tools/isac/Interpret/li-tool.sml
author Walther Neuper <walther.neuper@jku.at>
Wed, 15 Apr 2020 18:00:58 +0200
changeset 59881 bdced24f62bf
parent 59879 33449c96d99f
child 59898 68883c046963
permissions -rw-r--r--
collect code in ThyC
neuper@41999
     1
(* Title:  test/../script.sml
neuper@41999
     2
   Author: Walther Neuper 050908
neuper@37906
     3
   (c) copyright due to lincense terms.
neuper@37906
     4
*)
neuper@37906
     5
"-----------------------------------------------------------------";
neuper@37906
     6
"table of contents -----------------------------------------------";
neuper@37906
     7
"-----------------------------------------------------------------";
walther@59823
     8
"----------- fun specific_from_prog ----------------------------";
walther@59848
     9
"----------- fun implicit_take, fun get_first_argument -------------------------";
walther@59823
    10
"----------- fun from_prog ---------------------------------------";
walther@59823
    11
"----------- fun specific_from_prog ----------------------------";
wneuper@59257
    12
"----------- fun de_esc_underscore -------------------------------";
wneuper@59257
    13
"----------- fun go ----------------------------------------------";
wneuper@59257
    14
"----------- fun formal_args -------------------------------------";
wneuper@59257
    15
"----------- fun dsc_valT ----------------------------------------";
walther@59848
    16
"----------- fun arguments_from_model ---------------------------------------";
wneuper@59583
    17
"----------- fun init_pstate -----------------------------------------------------------------";
neuper@37906
    18
"-----------------------------------------------------------------";
neuper@37906
    19
"-----------------------------------------------------------------";
neuper@37906
    20
"-----------------------------------------------------------------";
neuper@37906
    21
wneuper@59592
    22
val thy =  @{theory Isac_Knowledge};
neuper@42281
    23
walther@59823
    24
"----------- fun specific_from_prog ----------------------------";
walther@59823
    25
"----------- fun specific_from_prog ----------------------------";
walther@59823
    26
"----------- fun specific_from_prog ----------------------------";
akargl@42145
    27
s1210629013@55445
    28
reset_states ();
neuper@41970
    29
CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@41970
    30
  ("Test", ["sqroot-test","univariate","equation","test"],
neuper@37906
    31
   ["Test","squ-equ-test-subpbl1"]))];
neuper@37906
    32
Iterator 1;
neuper@37906
    33
moveActiveRoot 1;
wneuper@59248
    34
autoCalculate 1 CompleteCalcHead;
walther@59747
    35
autoCalculate 1 (Steps 1);
walther@59747
    36
autoCalculate 1 (Steps 1);
neuper@37906
    37
val ((pt, p), _) = get_calc 1; show_pt pt;
walther@59823
    38
val appltacs = specific_from_prog pt p;
wneuper@59252
    39
case appltacs of 
wneuper@59252
    40
  [Rewrite ("radd_commute", radd_commute), 
walther@59877
    41
  Rewrite ("add.assoc", add_assoc), Calculate "TIMES"]
walther@59868
    42
  => if (UnparseC.term o Thm.prop_of) radd_commute = "?m + ?n = ?n + ?m" andalso 
walther@59868
    43
        (UnparseC.term o Thm.prop_of) add_assoc = "?a + ?b + ?c = ?a + (?b + ?c)" then ()
walther@59823
    44
        else error "script.sml fun specific_from_prog diff.behav. 2"
walther@59823
    45
| _ => error "script.sml fun specific_from_prog diff.behav. 1";
neuper@37906
    46
walther@59845
    47
trace_LI := true;
walther@59845
    48
trace_LI := false;
neuper@37906
    49
applyTactic 1 p (hd appltacs);
neuper@37906
    50
val ((pt, p), _) = get_calc 1; show_pt pt;
walther@59823
    51
val appltacs = specific_from_prog pt p;
walther@59691
    52
(*applyTactic 1 p (hd appltacs); WAS scan_dn1: call by ([3], Pbl)*)
neuper@37906
    53
akargl@42169
    54
"~~~~~ fun applyTactic, args:"; val ((cI:calcID), ip, tac) = (1, p, (hd appltacs));
akargl@42169
    55
val ((pt, _), _) = get_calc cI;
akargl@42169
    56
val p = get_pos cI 1;
walther@59804
    57
Step.by_tactic;
walther@59804
    58
Step.by_tactic tac;
akargl@42169
    59
walther@59804
    60
(*Step.by_tactic tac (pt, ip); (*WAS scan_dn1: call by ([3], Pbl)*)*)
walther@59804
    61
"~~~~~ fun Step.by_tactic, args:"; val (tac, (ptp as (pt, p))) = (tac, (pt, ip));
walther@59755
    62
  val Appl m = applicable_in p pt tac ; (*Appl*)
walther@59755
    63
  (*if*) Tactic.for_specify' m; (*false*)
akargl@42169
    64
(*loc_solve_ (mI,m) ptp; (*Argument: (mI, m) : string * tac Reason: Can't unify tac_ with tac*)*)
walther@59806
    65
walther@59749
    66
"~~~~~ fun loc_solve_, args:"; val (m ,(pt,pos)) = (m, ptp);
walther@59751
    67
(*val (msg, cs') = Step_Solve.by_tactic m (pt, pos);
akargl@42169
    68
(*Argument: m : string * tac Reason: Can't unify tac_ with tac (Different type constructors)*)*)
akargl@42169
    69
m;
akargl@42169
    70
(pt, pos);
walther@59751
    71
"~~~~~ fun Step_Solve.by_tactic , args:"; val (m, (pt, po as (p,p_))) = (m, (pt, pos));
akargl@42169
    72
(*solve has still p_!!!!!!!!!!!!!!!!!!!!!!!!!*)
akargl@42169
    73
akargl@42169
    74
e_metID = get_obj g_metID pt (par_pblobj pt p); (*false*)
akargl@42169
    75
val ctxt = get_ctxt pt po;
akargl@42169
    76
walther@59846
    77
(*generate1 m (Istate.empty, ctxt) (p,p_) pt;
akargl@42169
    78
(*Argument: m : tac Reason: Can't unify tac_ with tac (Different type constructors)*)*)
walther@59881
    79
(ThyC.get_theory (get_obj g_domID pt (par_pblobj pt p)));
walther@59881
    80
ThyC.get_theory;
akargl@42169
    81
walther@59734
    82
(* ERROR  which has NOT be created by this change set
walther@59734
    83
(1) actual         : ERROR exception PTREE "get_obj f EmptyPtree" raised (line 289 of "~~/src/Tools/isac/MathEngBasic/ctree-basic.sml")
walther@59734
    84
(2) in 927379190abd: generate1: not impl.for Empty_Tac
walther@59734
    85
walther@59734
    86
in case (2) exn.ERROR _ was caught, while in case (1) exn.Ptree is not caught before toplevel
walther@59734
    87
walther@59734
    88
autoCalculate 1 CompleteCalc; (* ONE ERROR *)
walther@59734
    89
==============================^^^^^^^^^^^^^*)
neuper@37906
    90
walther@59848
    91
"----------- fun implicit_take, fun get_first_argument -------------------------";
walther@59848
    92
"----------- fun implicit_take, fun get_first_argument -------------------------";
walther@59848
    93
"----------- fun implicit_take, fun get_first_argument -------------------------";
neuper@41969
    94
val fmz = ["equality (x+1=(2::real))", "solveFor x", "solutions L"];
neuper@41969
    95
val (dI',pI',mI') = ("Test",["sqroot-test","univariate","equation","test"],
neuper@41969
    96
  ["Test","squ-equ-test-subpbl1"]);
neuper@41969
    97
val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))];
neuper@41969
    98
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
neuper@41969
    99
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
neuper@41969
   100
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
neuper@41969
   101
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
neuper@41969
   102
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
neuper@41969
   103
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
neuper@41969
   104
val (p,_,f,nxt,_,pt) = me nxt p [] pt;
walther@59749
   105
"~~~~~ fun me, args:"; val tac = nxt;
walther@59804
   106
"~~~~~ fun Step.by_tactic, args:"; val ptp as (pt, p) = (pt, p);
walther@59755
   107
val Appl m = applicable_in p pt tac;
walther@59755
   108
 (*if*) Tactic.for_specify' m; (*false*)
walther@59749
   109
"~~~~~ fun loc_solve_, args:"; val (m, (pt, pos) ) = (m, ptp);
walther@59751
   110
"~~~~~ fun Step_Solve.by_tactic , args:"; val (Apply_Method' (mI,_,_,ctxt), pos as (p,_))
walther@59751
   111
  = (m, pos);
neuper@41969
   112
val {srls, ...} = get_met mI;
neuper@41969
   113
val PblObj {meth=itms, ...} = get_obj I pt p;
neuper@41969
   114
val thy' = get_obj g_domID pt p;
walther@59881
   115
val thy = ThyC.get_theory thy';
walther@59790
   116
val srls = LItool.get_simplifier (pt, pos)
walther@59685
   117
val (is as Pstate {env, ...}, ctxt, sc) = init_pstate srls ctxt itms mI;
walther@59848
   118
val ini = implicit_take sc env;
walther@59845
   119
"----- fun implicit_take, args:"; val (Prog sc) = sc;
walther@59848
   120
"----- fun get_first_argument, args:"; val (y, h $ body) = (thy, sc);
walther@59848
   121
case get_first_argument sc of SOME (Free ("e_e", _)) => ()
neuper@41969
   122
| _ => error "script: Const (?, ?) in script (as term) changed";;
neuper@41969
   123
walther@59823
   124
"----------- fun from_prog ---------------------------------------";
walther@59823
   125
"----------- fun from_prog ---------------------------------------";
walther@59823
   126
"----------- fun from_prog ---------------------------------------";
neuper@42438
   127
(* compare test/../interface.sml
neuper@42438
   128
"--------- getTactic, fetchApplicableTactics ------------";
neuper@42438
   129
*)
s1210629013@55445
   130
 reset_states ();
neuper@42438
   131
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@42438
   132
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@42438
   133
    ["Test","squ-equ-test-subpbl1"]))];
neuper@42438
   134
 Iterator 1;
neuper@42438
   135
 moveActiveRoot 1;
wneuper@59248
   136
 autoCalculate 1 CompleteCalc;
neuper@42438
   137
 val ((pt,_),_) = get_calc 1;
neuper@42438
   138
 show_pt pt;
neuper@42394
   139
neuper@42438
   140
(*UC\label{SOLVE:MANUAL:TACTIC:listall} UC 30.3.2.2 p.175*)
walther@59823
   141
 val tacs = from_prog pt ([],Pbl);
wneuper@59253
   142
 case tacs of [Apply_Method ["Test", "squ-equ-test-subpbl1"]] => ()
walther@59823
   143
 | _ => error "script.sml: diff.behav. in from_prog ([],Pbl)";
neuper@42438
   144
walther@59823
   145
 val tacs = from_prog pt ([1],Res);
wneuper@59253
   146
 case tacs of [Rewrite_Set "norm_equation", Rewrite_Set "Test_simplify",
neuper@55279
   147
      Subproblem ("Test", ["LINEAR", "univariate", "equation", "test"]),
wneuper@59253
   148
      Check_elementwise "Assumptions"] => ()
walther@59823
   149
 | _ => error "script.sml: diff.behav. in from_prog ([1],Res)";
neuper@42438
   150
walther@59823
   151
 val tacs = from_prog pt ([3],Pbl);
wneuper@59253
   152
 case tacs of [Apply_Method ["Test", "solve_linear"]] => ()
walther@59823
   153
 | _ => error "script.sml: diff.behav. in from_prog ([3],Pbl)";
neuper@42438
   154
walther@59823
   155
 val tacs = from_prog pt ([3,1],Res);
wneuper@59497
   156
 case tacs of [Rewrite_Set_Inst (["(''bdv'', x)"], "isolate_bdv"), Rewrite_Set "Test_simplify"] => ()
walther@59823
   157
 | _ => error "script.sml: diff.behav. in from_prog ([3,1],Res)";
neuper@42438
   158
walther@59823
   159
 val tacs = from_prog pt ([3],Res);
wneuper@59253
   160
 case tacs of [Rewrite_Set "norm_equation", Rewrite_Set "Test_simplify",
neuper@55279
   161
      Subproblem ("Test", ["LINEAR", "univariate", "equation", "test"]),
wneuper@59253
   162
      Check_elementwise "Assumptions"] => ()
walther@59823
   163
 | _ => error "script.sml: diff.behav. in from_prog ([3],Res)";
neuper@42438
   164
walther@59823
   165
 val tacs = (from_prog pt ([],Res)) handle PTREE str => [Tac str];
wneuper@59253
   166
 case tacs of [Tac "no tactics applicable at the end of a calculation"] => ()
walther@59823
   167
 | _ => error "script.sml: diff.behav. in from_prog ([],Res)";
neuper@42438
   168
walther@59823
   169
"----------- fun specific_from_prog ----------------------------";
walther@59823
   170
"----------- fun specific_from_prog ----------------------------";
walther@59823
   171
"----------- fun specific_from_prog ----------------------------";
s1210629013@55445
   172
 reset_states ();
neuper@42438
   173
 CalcTree [(["equality (x+1=(2::real))", "solveFor x","solutions L"], 
neuper@42438
   174
   ("Test", ["sqroot-test","univariate","equation","test"],
neuper@42438
   175
    ["Test","squ-equ-test-subpbl1"]))];
neuper@42438
   176
 Iterator 1;
neuper@42438
   177
 moveActiveRoot 1;
wneuper@59248
   178
 autoCalculate 1 CompleteCalc;
neuper@42438
   179
neuper@42438
   180
(*UC\label{SOLVE:MANUAL:TACTIC:listall} UC 30.3.2.2 p.175*)
neuper@42438
   181
 fetchApplicableTactics 1 99999 ([],Pbl);
neuper@42438
   182
neuper@42438
   183
 fetchApplicableTactics 1 99999 ([1],Res);
neuper@42438
   184
"~~~~~ fun fetchApplicableTactics, args:"; val (cI, (scope:int), (p:pos')) = (1, 99999, ([1],Res));
neuper@42438
   185
val ((pt, _), _) = get_calc cI;
neuper@42438
   186
(*version 1:*)
walther@59823
   187
case from_prog pt p of [Rewrite_Set "norm_equation", Rewrite_Set "Test_simplify",
neuper@55279
   188
  Subproblem ("Test", ["LINEAR", "univariate", "equation", "test"]),
wneuper@59253
   189
  Check_elementwise "Assumptions"] => ()
wneuper@59253
   190
| _ => error "fetchApplicableTactics ([1],Res) changed";
neuper@42438
   191
(*version 2:*)
neuper@42438
   192
(*WAS:
walther@59823
   193
specific_from_prog pt p;
neuper@42438
   194
...
neuper@55279
   195
### atomic_appl_tacs: not impl. for tac='Subproblem(Test,["LINEAR","univariate","equation","test"])' 
neuper@42438
   196
### atomic_appl_tacs: not impl. for tac = 'Check_elementwise "Assumptions"' 
neuper@42438
   197
*)
neuper@42438
   198
walther@59823
   199
"~~~~~ fun specific_from_prog , args:"; val (pt, (p, p_)) = (pt, p);
walther@59800
   200
Pos.on_specification p_ = false;
neuper@42438
   201
        val pp = par_pblobj pt p
walther@59879
   202
        val thy' = (get_obj g_domID pt pp):ThyC.id
walther@59881
   203
        val thy = ThyC.get_theory thy'
neuper@42438
   204
        val metID = get_obj g_metID pt pp
neuper@42438
   205
        val metID' =
neuper@42438
   206
          if metID = e_metID 
neuper@42438
   207
          then (thd3 o snd3) (get_obj g_origin pt pp)
neuper@42438
   208
          else metID
neuper@48790
   209
        val {scr=Prog sc,srls,erls,rew_ord'=ro,...} = get_met metID'
walther@59807
   210
        val Pstate ist = get_istate_LI pt (p,p_)
walther@59722
   211
        val ctxt = get_ctxt pt (p, p_)
neuper@42438
   212
        val alltacs = (*we expect at least 1 stac in a script*)
walther@59823
   213
          map ((LItool.tac_from_prog pt thy) o rep_stacexpr o #1 o
walther@59772
   214
           (check_leaf "selrul" ctxt srls (get_subst ist) )) (stacpbls sc)
neuper@42438
   215
        val f =
walther@59722
   216
          (case p_ of Frm => get_obj g_form pt p | Res => (fst o (get_obj g_result pt)) p
walther@59722
   217
          | _ => error "");
neuper@42438
   218
(*WN120611 stopped and took version 1 again for fetchApplicableTactics !
neuper@42438
   219
(distinct o flat o (map (atomic_appl_tacs thy ro erls f))) alltacs
neuper@42438
   220
...
neuper@55279
   221
### atomic_appl_tacs: not impl. for tac='Subproblem(Test,["LINEAR","univariate","equation","test"])' 
neuper@42438
   222
### atomic_appl_tacs: not impl. for tac = 'Check_elementwise "Assumptions"' 
neuper@42438
   223
*)
neuper@42438
   224
wneuper@59257
   225
"----------- fun de_esc_underscore -------------------------------";
wneuper@59257
   226
"----------- fun de_esc_underscore -------------------------------";
wneuper@59257
   227
"----------- fun de_esc_underscore -------------------------------";
wneuper@59257
   228
(*
wneuper@59257
   229
> val str = "Rewrite_Set_Inst";
wneuper@59257
   230
> val esc = esc_underscore str;
wneuper@59257
   231
val it = "Rewrite'_Set'_Inst" : string
wneuper@59257
   232
> val des = de_esc_underscore esc;
wneuper@59257
   233
 val des = de_esc_underscore esc;*)
wneuper@59257
   234
wneuper@59257
   235
"----------- fun go ----------------------------------------------";
wneuper@59257
   236
"----------- fun go ----------------------------------------------";
wneuper@59257
   237
"----------- fun go ----------------------------------------------";
wneuper@59257
   238
(*
wneuper@59257
   239
> val t = (Thm.term_of o the o (parse thy)) "a+b";
wneuper@59257
   240
val it = Const (#,#) $ Free (#,#) $ Free ("b","RealDef.real") : term
walther@59767
   241
> val plus_a = at_location [L] t; 
walther@59767
   242
> val b = at_location [R] t; 
walther@59767
   243
> val plus = at_location [L,L] t; 
walther@59767
   244
> val a = at_location [L,R] t;
wneuper@59257
   245
wneuper@59257
   246
> val t = (Thm.term_of o the o (parse thy)) "a+b+c";
wneuper@59257
   247
val t = Const (#,#) $ (# $ # $ Free #) $ Free ("c","RealDef.real") : term
walther@59767
   248
> val pl_pl_a_b = at_location [L] t; 
walther@59767
   249
> val c = at_location [R] t; 
walther@59767
   250
> val a = at_location [L,R,L,R] t; 
walther@59767
   251
> val b = at_location [L,R,R] t; 
wneuper@59257
   252
*)
wneuper@59257
   253
wneuper@59257
   254
"----------- fun formal_args -------------------------------------";
wneuper@59257
   255
"----------- fun formal_args -------------------------------------";
wneuper@59257
   256
"----------- fun formal_args -------------------------------------";
wneuper@59257
   257
(*
wneuper@59257
   258
> formal_args scr;
wneuper@59257
   259
  [Free ("f_","RealDef.real"),Free ("v_","RealDef.real"),
wneuper@59257
   260
   Free ("eqs_","bool List.list")] : term list
wneuper@59257
   261
*)
wneuper@59257
   262
"----------- fun dsc_valT ----------------------------------------";
wneuper@59257
   263
"----------- fun dsc_valT ----------------------------------------";
wneuper@59257
   264
"----------- fun dsc_valT ----------------------------------------";
wneuper@59257
   265
(*> val t = (Thm.term_of o the o (parse thy)) "equality";
wneuper@59257
   266
> val T = type_of t;
wneuper@59257
   267
val T = "bool => Tools.una" : typ
wneuper@59257
   268
> val dsc = dsc_valT t;
wneuper@59257
   269
val dsc = "una" : string
wneuper@59257
   270
wneuper@59257
   271
> val t = (Thm.term_of o the o (parse thy)) "fixedValues";
wneuper@59257
   272
> val T = type_of t;
wneuper@59257
   273
val T = "bool List.list => Tools.nam" : typ
wneuper@59257
   274
> val dsc = dsc_valT t;
wneuper@59257
   275
val dsc = "nam" : string*)
walther@59848
   276
"----------- fun arguments_from_model ---------------------------------------";
walther@59848
   277
"----------- fun arguments_from_model ---------------------------------------";
walther@59848
   278
"----------- fun arguments_from_model ---------------------------------------";
wneuper@59257
   279
(*
wneuper@59257
   280
> val sc = ... Solve_root_equation ...
wneuper@59585
   281
> val mI = ("Program","sqrt-equ-test");
wneuper@59257
   282
> val PblObj{meth={ppc=itms,...},...} = get_obj I pt [];
walther@59848
   283
> val ts = arguments_from_model thy mI itms;
walther@59870
   284
> map (UnparseC.term_in_thy thy) ts;
wneuper@59257
   285
["sqrt (#9 + #4 * x) = sqrt x + sqrt (#5 + x)","x","#0"] : string list
wneuper@59257
   286
*)
wneuper@59539
   287
wneuper@59583
   288
"----------- fun init_pstate -----------------------------------------------------------------";
wneuper@59583
   289
"----------- fun init_pstate -----------------------------------------------------------------";
wneuper@59583
   290
"----------- fun init_pstate -----------------------------------------------------------------";
wneuper@59539
   291
val fmz = ["Traegerlaenge L","Streckenlast q_0","Biegelinie y",
wneuper@59582
   292
	     "Randbedingungen [y 0 = (0::real), y L = 0, M_b 0 = 0, M_b L = 0]",
wneuper@59540
   293
	     "FunktionsVariable x", "GleichungsVariablen [c, c_2, c_3, c_4]",
wneuper@59540
   294
	     "AbleitungBiegelinie dy"];
wneuper@59539
   295
val (dI',pI',mI') = ("Biegelinie", ["Biegelinien"],
wneuper@59539
   296
		     ["IntegrierenUndKonstanteBestimmen2"]);
wneuper@59539
   297
val p = e_pos'; val c = [];
wneuper@59539
   298
(*[], Pbl*)val (p,_,f,nxt,_,pt) = CalcTreeTEST [(fmz, (dI',pI',mI'))]; (*nxt = Model_Problem*)
wneuper@59539
   299
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Given "Traegerlaenge L"*)
wneuper@59539
   300
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Given "Streckenlast q_0"*)
wneuper@59539
   301
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Find "Biegelinie y"*)
wneuper@59539
   302
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Relation "Randbedingungen [y 0 = 0]", ERROR MISSING step: M_b 0 = 0*)
wneuper@59539
   303
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Relation "Randbedingungen [y L = 0, M_b 0 = 0, M_b L = 0]"*)
wneuper@59539
   304
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Specify_Theory "Biegelinie"*)
wneuper@59539
   305
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Specify_Problem ["Biegelinien"]*)
wneuper@59539
   306
(*[], Pbl*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Specify_Method ["IntegrierenUndKonstanteBestimmen2"]*)
wneuper@59539
   307
(*[], Met*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Given "FunktionsVariable x"*)
wneuper@59539
   308
(*[], Met*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Given "GleichungsVariablen [c, c_2, c_3, c_4]"*)
wneuper@59540
   309
(*[], Met*)val (p,_,f,nxt,_,pt) = me nxt p c pt; (*nxt = Add_Given "AbleitungBiegelinie dy"*)
wneuper@59539
   310
(*[], Met*)val (p''''',_,f,nxt''''',_,pt''''') = me nxt p c pt; (*nxt''''' = Apply_Method ["IntegrierenUndKonstanteBestimmen2"*)
wneuper@59539
   311
wneuper@59582
   312
(*+*)val PblObj {meth, spec = (thy, _ , metID), ...} = get_obj I pt''''' (fst p''''');
wneuper@59582
   313
(*+*)val ctxt = get_ctxt pt''''' p''''';
walther@59677
   314
(*+*)val srls = get_simplifier (pt''''', p''''');
walther@59881
   315
"~~~~~ fun init_pstate , args:"; val (srls, thy, itms, metID) = (srls, ThyC.get_theory thy, meth, metID);
walther@59677
   316
val (Pstate st, ctxt, Prog _) = init_pstate srls ctxt itms metID;
walther@59777
   317
if pstate2str st =
walther@59784
   318
   "([\"\n(l, L)\",\"\n(q, q_0)\",\"\n(v, x)\",\"\n(b, dy)\",\"\n(s, [y 0 = 0, y L = 0, M_b 0 = 0, M_b L = 0])\",\"\n(vs, [c, c_2, c_3, c_4])\",\"\n(id_abl, y)\"], [], erls_IntegrierenUndK.., NONE, \n??.empty, ORundef, false, true)"
wneuper@59583
   319
then () else error "init_pstate changed for Biegelinie";
wneuper@59539
   320
wneuper@59539
   321
(*[1], Pbl*)val (p,_,f,nxt,_,pt) = me nxt''''' p''''' c pt'''''; (*nxt = Model_Problem*)
walther@59749
   322
if p = ([1], Pbl) 
walther@59749
   323
then case nxt of Model_Problem => () | _ => error "Biegelinie 7.70 changed 1"
wneuper@59539
   324
else error "modeling root-problem of Biegelinie 7.70 changed";