src/Tools/isac/Knowledge/Biegelinie.thy
author Walther Neuper <neuper@ist.tugraz.at>
Tue, 31 Jul 2012 15:16:47 +0200
changeset 42451 bc03b5d60547
parent 42425 da7fbace995b
child 52148 aabc6c8e930a
permissions -rw-r--r--
prepared for fun stepToErrorPatterns

for efficiency reasons each rule-set knows the error-patterns of the member thms.
TODO: lift the error-patterns from thms to rls recursively.
TODO: set error-patterns and fill-patterns in Build_Thydata.thy
     1 (* chapter 'Biegelinie' from the textbook: 
     2    Timischl, Kaiser. Ingenieur-Mathematik 3. Wien 1999. p.268-271.
     3    author: Walther Neuper 050826,
     4    (c) due to copyright terms
     5 *)
     6 
     7 theory Biegelinie imports Integrate Equation EqSystem Atools begin
     8 
     9 consts
    10 
    11   qq    :: "real => real"             (* Streckenlast               *)
    12   Q     :: "real => real"             (* Querkraft                  *)
    13   Q'    :: "real => real"             (* Ableitung der Querkraft    *)
    14   M'_b  :: "real => real" ("M'_b")    (* Biegemoment                *)
    15   M'_b' :: "real => real" ("M'_b'")   (* Ableitung des Biegemoments *)
    16   y''   :: "real => real"             (* 2.Ableitung der Biegeline  *)
    17   y'    :: "real => real"             (* Neigung der Biegeline      *)
    18 (*y     :: "real => real"             (* Biegeline                  *)*)
    19   EI    :: "real"                     (* Biegesteifigkeit           *)
    20 
    21   (*new Descriptions in the related problems*)
    22   Traegerlaenge            :: "real => una"
    23   Streckenlast             :: "real => una"
    24   BiegemomentVerlauf       :: "bool => una"
    25   Biegelinie               :: "(real => real) => una"
    26   Randbedingungen          :: "bool list => una"
    27   RandbedingungenBiegung   :: "bool list => una"
    28   RandbedingungenNeigung   :: "bool list => una"
    29   RandbedingungenMoment    :: "bool list => una"
    30   RandbedingungenQuerkraft :: "bool list => una"
    31   FunktionsVariable        :: "real => una"
    32   Funktionen               :: "bool list => una"
    33   Gleichungen              :: "bool list => una"
    34 
    35   (*Script-names*)
    36   Biegelinie2Script        :: "[real,real,real,real=>real,bool list,
    37 				bool] => bool"	
    38 	("((Script Biegelinie2Script (_ _ _ _ _ =))// (_))" 9)
    39   BiegelinieScript         :: "[real,real,real,real=>real,bool list,bool list,
    40 				bool] => bool"	
    41 	("((Script BiegelinieScript (_ _ _ _ _ _ =))// (_))" 9)
    42   Biege2xIntegrierenScript :: "[real,real,real,bool,real=>real,bool list,
    43 				bool] => bool"		
    44 	("((Script Biege2xIntegrierenScript (_ _ _ _ _ _ =))// (_))" 9)
    45   Biege4x4SystemScript     :: "[real,real,real,real=>real,bool list,  
    46 				bool] => bool"	
    47 	("((Script Biege4x4SystemScript (_ _ _ _ _ =))// (_))" 9)
    48   Biege1xIntegrierenScript :: 
    49 	            "[real,real,real,real=>real,bool list,bool list,bool list,
    50 		      bool] => bool"	
    51 	("((Script Biege1xIntegrierenScript (_ _ _ _ _ _ _ =))// (_))" 9)
    52   Belastung2BiegelScript   :: "[real,real,
    53 	                        bool list] => bool list"	
    54 	("((Script Belastung2BiegelScript (_ _ =))// (_))" 9)
    55   SetzeRandbedScript       :: "[bool list,bool list,
    56 	                        bool list] => bool list"	
    57 	("((Script SetzeRandbedScript (_ _ =))// (_))" 9)
    58 
    59 axioms(*axiomatization where*)
    60 
    61   Querkraft_Belastung:   "Q' x = -qq x" (*and*)
    62   Belastung_Querkraft:   "-qq x = Q' x" (*and*)
    63 
    64   Moment_Querkraft:      "M_b' x = Q x" (*and*)
    65   Querkraft_Moment:      "Q x = M_b' x" (*and*)
    66 
    67   Neigung_Moment:        "y'' x = -M_b x/ EI" (*and*)
    68   Moment_Neigung:        "M_b x = -EI * y'' x" (*and*)
    69 
    70   (*according to rls 'simplify_Integral': .. = 1/a * .. instead .. = ../ a*)
    71   make_fun_explicit:     "Not (a =!= 0) ==> (a * (f x) = b) = (f x = 1/a * b)"
    72 
    73 ML {*
    74 val thy = @{theory};
    75 
    76 (** theory elements for transfer into html **)
    77 
    78 store_isa ["IsacKnowledge"] [];
    79 store_thy thy 
    80 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    81 store_isa ["IsacKnowledge", theory2thyID thy, "Theorems"] 
    82 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    83 store_thm thy "IsacKnowledge" ("Belastung_Querkraft", prop_of @{thm Belastung_Querkraft})
    84 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    85 store_thm thy "IsacKnowledge" ("Moment_Neigung", prop_of @{thm Moment_Neigung})
    86 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    87 store_thm thy "IsacKnowledge" ("Moment_Querkraft", prop_of @{thm Moment_Querkraft})
    88 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    89 store_thm thy "IsacKnowledge" ("Neigung_Moment", prop_of @{thm Neigung_Moment})
    90 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    91 store_thm thy "IsacKnowledge" ("Querkraft_Belastung", prop_of @{thm Querkraft_Belastung})
    92 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    93 store_thm thy "IsacKnowledge" ("Querkraft_Moment", prop_of @{thm Querkraft_Moment})
    94 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    95 store_thm thy "IsacKnowledge" ("make_fun_explicit", prop_of @{thm make_fun_explicit})
    96 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"];
    97 
    98 *}
    99 ML {*
   100 (** problems **)
   101 
   102 store_pbt
   103  (prep_pbt thy "pbl_bieg" [] e_pblID
   104  (["Biegelinien"],
   105   [("#Given" ,["Traegerlaenge l_l", "Streckenlast q_q"]),
   106    (*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   107    ("#Find"  ,["Biegelinie b_b"]),
   108    ("#Relate",["Randbedingungen r_b"])
   109   ],
   110   append_rls "e_rls" e_rls [], 
   111   NONE, 
   112   [["IntegrierenUndKonstanteBestimmen2"]]));
   113 
   114 store_pbt 
   115  (prep_pbt thy "pbl_bieg_mom" [] e_pblID
   116  (["MomentBestimmte","Biegelinien"],
   117   [("#Given" ,["Traegerlaenge l_l", "Streckenlast q_q"]),
   118    (*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   119    ("#Find"  ,["Biegelinie b_b"]),
   120    ("#Relate",["RandbedingungenBiegung r_b","RandbedingungenMoment r_m"])
   121   ],
   122   append_rls "e_rls" e_rls [], 
   123   NONE, 
   124   [["IntegrierenUndKonstanteBestimmen"]]));
   125 
   126 store_pbt
   127  (prep_pbt thy "pbl_bieg_momg" [] e_pblID
   128  (["MomentGegebene","Biegelinien"],
   129   [],
   130   append_rls "e_rls" e_rls [], 
   131   NONE, 
   132   [["IntegrierenUndKonstanteBestimmen","2xIntegrieren"]]));
   133 
   134 store_pbt
   135  (prep_pbt thy "pbl_bieg_einf" [] e_pblID
   136  (["einfache","Biegelinien"],
   137   [],
   138   append_rls "e_rls" e_rls [], 
   139   NONE, 
   140   [["IntegrierenUndKonstanteBestimmen","4x4System"]]));
   141 
   142 store_pbt
   143  (prep_pbt thy "pbl_bieg_momquer" [] e_pblID
   144  (["QuerkraftUndMomentBestimmte","Biegelinien"],
   145   [],
   146   append_rls "e_rls" e_rls [], 
   147   NONE, 
   148   [["IntegrierenUndKonstanteBestimmen","1xIntegrieren"]]));
   149 
   150 store_pbt
   151  (prep_pbt thy "pbl_bieg_vonq" [] e_pblID
   152  (["vonBelastungZu","Biegelinien"],
   153   [("#Given" ,["Streckenlast q_q","FunktionsVariable v_v"]),
   154    ("#Find"  ,["Funktionen funs'''"])],
   155   append_rls "e_rls" e_rls [], 
   156   NONE, 
   157   [["Biegelinien","ausBelastung"]]));
   158 
   159 store_pbt
   160  (prep_pbt thy "pbl_bieg_randbed" [] e_pblID
   161  (["setzeRandbedingungen","Biegelinien"],
   162   [("#Given" ,["Funktionen fun_s","Randbedingungen r_b"]),
   163    ("#Find"  ,["Gleichungen equs'''"])],
   164   append_rls "e_rls" e_rls [], 
   165   NONE, 
   166   [["Biegelinien","setzeRandbedingungenEin"]]));
   167 
   168 store_pbt
   169  (prep_pbt thy "pbl_equ_fromfun" [] e_pblID
   170  (["makeFunctionTo","equation"],
   171   [("#Given" ,["functionEq fu_n","substitution su_b"]),
   172    ("#Find"  ,["equality equ'''"])],
   173   append_rls "e_rls" e_rls [], 
   174   NONE, 
   175   [["Equation","fromFunction"]]));
   176 
   177 *}
   178 ML {*
   179 (** methods **)
   180 
   181 val srls = Rls {id="srls_IntegrierenUnd..", 
   182 		preconds = [], 
   183 		rew_ord = ("termlessI",termlessI), 
   184 		erls = append_rls "erls_in_srls_IntegrierenUnd.." e_rls
   185 				  [(*for asm in NTH_CONS ...*)
   186 				   Calc ("Orderings.ord_class.less",eval_equ "#less_"),
   187 				   (*2nd NTH_CONS pushes n+-1 into asms*)
   188 				   Calc("Groups.plus_class.plus", eval_binop "#add_")
   189 				   ], 
   190 		srls = Erls, calc = [], errpatts = [],
   191 		rules = [Thm ("NTH_CONS",num_str @{thm NTH_CONS}),
   192 			 Calc("Groups.plus_class.plus", eval_binop "#add_"),
   193 			 Thm ("NTH_NIL",num_str @{thm NTH_NIL}),
   194 			 Calc("Tools.lhs", eval_lhs"eval_lhs_"),
   195 			 Calc("Tools.rhs", eval_rhs"eval_rhs_"),
   196 			 Calc("Atools.argument'_in",
   197 			      eval_argument_in "Atools.argument'_in")
   198 			 ],
   199 		scr = EmptyScr};
   200     
   201 val srls2 = 
   202     Rls {id="srls_IntegrierenUnd..", 
   203 	 preconds = [], 
   204 	 rew_ord = ("termlessI",termlessI), 
   205 	 erls = append_rls "erls_in_srls_IntegrierenUnd.." e_rls
   206 			   [(*for asm in NTH_CONS ...*)
   207 			    Calc ("Orderings.ord_class.less",eval_equ "#less_"),
   208 			    (*2nd NTH_CONS pushes n+-1 into asms*)
   209 			    Calc("Groups.plus_class.plus", eval_binop "#add_")
   210 			    ], 
   211 	 srls = Erls, calc = [], errpatts = [],
   212 	 rules = [Thm ("NTH_CONS",num_str @{thm NTH_CONS}),
   213 		  Calc("Groups.plus_class.plus", eval_binop "#add_"),
   214 		  Thm ("NTH_NIL", num_str @{thm NTH_NIL}),
   215 		  Calc("Tools.lhs", eval_lhs "eval_lhs_"),
   216 		  Calc("Atools.filter'_sameFunId",
   217 		       eval_filter_sameFunId "Atools.filter'_sameFunId"),
   218 		  (*WN070514 just for smltest/../biegelinie.sml ...*)
   219 		  Calc("Atools.sameFunId", eval_sameFunId "Atools.sameFunId"),
   220 		  Thm ("filter_Cons", num_str @{thm filter_Cons}),
   221 		  Thm ("filter_Nil", num_str @{thm filter_Nil}),
   222 		  Thm ("if_True", num_str @{thm if_True}),
   223 		  Thm ("if_False", num_str @{thm if_False}),
   224 		  Thm ("hd_thm", num_str @{thm hd_thm})
   225 		  ],
   226 	 scr = EmptyScr};
   227 *}
   228 
   229 ML {*
   230 store_met
   231   (prep_met thy "met_biege" [] e_metID 
   232 	    (["IntegrierenUndKonstanteBestimmen"],
   233 	     [("#Given" ,["Traegerlaenge l_l", "Streckenlast q__q", "FunktionsVariable v_v"]),
   234 		(*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   235 		      ("#Find"  ,["Biegelinie b_b"]),
   236 		      ("#Relate",["RandbedingungenBiegung r_b", "RandbedingungenMoment r_m"])],
   237 	     {rew_ord'="tless_true", 
   238 	      rls' = append_rls "erls_IntegrierenUndK.." e_rls 
   239 				        [Calc ("Atools.ident",eval_ident "#ident_"),
   240 				         Thm ("not_true",num_str @{thm not_true}),
   241 				         Thm ("not_false",num_str @{thm not_false})], 
   242 				       calc = [], srls = srls, prls = Erls, crls = Atools_erls, errpats = [], nrls = Erls},
   243 "Script BiegelinieScript                                                 " ^
   244 "(l_l::real) (q__q::real) (v_v::real) (b_b::real=>real)                  " ^
   245 "(r_b::bool list) (r_m::bool list) =                                     " ^
   246 "  (let q___q = Take (qq v_v = q__q);                                    " ^
   247 "       q___q = ((Rewrite sym_neg_equal_iff_equal True) @@               " ^
   248 "              (Rewrite Belastung_Querkraft True)) q___q;                " ^
   249 "      (Q__Q:: bool) =                                                   " ^
   250 "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   251 "                          [diff,integration,named])                     " ^
   252 "                          [REAL (rhs q___q), REAL v_v, REAL_REAL Q]);   " ^
   253 "       Q__Q = Rewrite Querkraft_Moment True Q__Q;                       " ^
   254 "      (M__M::bool) =                                                    " ^
   255 "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   256 "                          [diff,integration,named])                     " ^
   257 "                          [REAL (rhs Q__Q), REAL v_v, REAL_REAL M_b]);  " ^
   258                                         (*([5], Res), M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2*)
   259 "       e__1 = NTH 1 r_m;                                                " ^
   260 "      (x__1::real) = argument_in (lhs e__1);                            " ^
   261 "      (M__1::bool) = (Substitute [v_v = x__1]) M__M;                    " ^
   262                                         (*([6], Res), M_b 0 = c_2 + c * 0 + -1 * q_0 / 2 * 0 ^^^ 2*)
   263 "       M__1        = (Substitute [e__1]) M__1;                          " ^
   264                                         (*([7], Res), 0 = c_2 + c * 0 + -1 * q_0 / 2 * 0 ^^^ 2*)
   265 "       M__2 = Take M__M;                                                " ^
   266                                         (*([8], Frm), M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2*)
   267 (*without above Take 'Substitute [v_v = x__2]' takes _last formula from ctree_*)
   268 "       e__2 = NTH 2 r_m;                                                " ^
   269 "      (x__2::real) = argument_in (lhs e__2);                            " ^
   270 "      (M__2::bool) = (Substitute [v_v = x__2]) M__M;                    " ^
   271                                         (*([8], Res), M_b L = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
   272 "       M__2        = (Substitute [e__2]) M__2;                          " ^
   273                                         (**)
   274 "      (c_1_2::bool list) =                                              " ^
   275 "             (SubProblem (Biegelinie',[linear,system],[no_met])         " ^
   276 "                          [BOOL_LIST [M__1, M__2], REAL_LIST [c,c_2]]); " ^
   277 "       M__M = Take  M__M;                                               " ^
   278 "       M__M = ((Substitute c_1_2) @@                                    " ^
   279 "              (Try (Rewrite_Set_Inst [(bdv_1, c),(bdv_2, c_2)]          " ^
   280 "                                   simplify_System False)) @@           " ^
   281 "              (Rewrite Moment_Neigung False) @@                         " ^
   282 "              (Rewrite make_fun_explicit False)) M__M;                  " ^
   283 (*----------------------- and the same once more ------------------------*)
   284 "      (N__N:: bool) =                                                   " ^
   285 "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   286 "                          [diff,integration,named])                     " ^
   287 "                          [REAL (rhs M__M), REAL v_v, REAL_REAL y']);   " ^
   288 "      (B__B:: bool) =                                                   " ^
   289 "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   290 "                          [diff,integration,named])                     " ^
   291 "                          [REAL (rhs N__N), REAL v_v, REAL_REAL y]);    " ^
   292 "       e__1 = NTH 1 r_b;                                                " ^
   293 "      (x__1::real) = argument_in (lhs e__1);                            " ^
   294 "      (B__1::bool) = (Substitute [v_v = x__1]) B__B;                    " ^
   295 "       B__1        = (Substitute [e__1]) B__1 ;                         " ^
   296 "       B__2 = Take B__B;                                                " ^
   297 "       e__2 = NTH 2 r_b;                                                " ^
   298 "      (x__2::real) = argument_in (lhs e__2);                            " ^
   299 "      (B__2::bool) = (Substitute [v_v = x__2]) B__B;                    " ^
   300 "       B__2        = (Substitute [e__2]) B__2 ;                         " ^
   301 "      (c_1_2::bool list) =                                              " ^
   302 "             (SubProblem (Biegelinie',[linear,system],[no_met])         " ^
   303 "                          [BOOL_LIST [B__1, B__2], REAL_LIST [c,c_2]]); " ^
   304 "       B__B = Take  B__B;                                               " ^
   305 "       B__B = ((Substitute c_1_2) @@                                    " ^
   306 "              (Rewrite_Set_Inst [(bdv, x)] make_ratpoly_in False)) B__B " ^
   307 " in B__B)"
   308 ));
   309 *}
   310 ML {*
   311 store_met
   312   (prep_met thy "met_biege_2" [] e_metID
   313 	    (["IntegrierenUndKonstanteBestimmen2"],
   314 	     [("#Given" ,["Traegerlaenge l_l", "Streckenlast q__q", "FunktionsVariable v_v"]),
   315 		(*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   316 		      ("#Find"  ,["Biegelinie b_b"]),
   317 		      ("#Relate",["Randbedingungen r_b"])],
   318 	    {rew_ord'="tless_true", 
   319 	     rls' = append_rls "erls_IntegrierenUndK.." e_rls 
   320 				       [Calc ("Atools.ident",eval_ident "#ident_"),
   321 				        Thm ("not_true",num_str @{thm not_true}),
   322 				        Thm ("not_false",num_str @{thm not_false})], 
   323 				     calc = [], 
   324 				     srls = append_rls "erls_IntegrierenUndK.." e_rls 
   325 				       [Calc("Tools.rhs", eval_rhs"eval_rhs_"),
   326 				        Calc ("Atools.ident",eval_ident "#ident_"),
   327 				        Thm ("last_thmI",num_str @{thm last_thmI}),
   328 				        Thm ("if_True",num_str @{thm if_True}),
   329 				        Thm ("if_False",num_str @{thm if_False})],
   330 				     prls = Erls, crls = Atools_erls, errpats = [], nrls = Erls},
   331 "Script Biegelinie2Script                                                  " ^
   332 "(l_l::real) (q__q::real) (v_v::real) (b_b::real=>real) (r_b::bool list) = " ^
   333 "  (let                                                                    " ^
   334 "      (fun_s:: bool list) =                                               " ^
   335 "             (SubProblem (Biegelinie',[vonBelastungZu,Biegelinien],       " ^
   336 "                          [Biegelinien,ausBelastung])                     " ^
   337 "                          [REAL q__q, REAL v_v]);                         " ^
   338 "      (equ_s::bool list) =                                                " ^
   339 "             (SubProblem (Biegelinie',[setzeRandbedingungen,Biegelinien], " ^
   340 "                          [Biegelinien,setzeRandbedingungenEin])          " ^
   341 "                          [BOOL_LIST fun_s, BOOL_LIST r_b]);              " ^
   342 "      (con_s::bool list) =                                                " ^
   343 "             (SubProblem (Biegelinie',[linear,system],[no_met])           " ^
   344 "                          [BOOL_LIST equ_s, REAL_LIST [c,c_2,c_3,c_4]]);  " ^
   345 "       B_B = Take (lastI fun_s);                                          " ^
   346 "       B_B = ((Substitute con_s) @@                                       " ^
   347 "              (Rewrite_Set_Inst [(bdv, v_v)] make_ratpoly_in False)) B_B  " ^
   348 " in B_B)"
   349 ));
   350 
   351 *}
   352 ML {*
   353 store_met
   354     (prep_met thy "met_biege_intconst_2" [] e_metID
   355 	      (["IntegrierenUndKonstanteBestimmen","2xIntegrieren"],
   356 	       [],
   357 	       {rew_ord'="tless_true", rls'=Erls, calc = [], 
   358 		srls = e_rls, 
   359 		prls=e_rls,
   360 	     crls = Atools_erls, errpats = [], nrls = e_rls},
   361 "empty_script"
   362 ));
   363 
   364 store_met
   365     (prep_met thy "met_biege_intconst_4" [] e_metID
   366 	      (["IntegrierenUndKonstanteBestimmen","4x4System"],
   367 	       [],
   368 	       {rew_ord'="tless_true", rls'=Erls, calc = [], 
   369 		srls = e_rls, 
   370 		prls=e_rls,
   371 	     crls = Atools_erls, errpats = [], nrls = e_rls},
   372 "empty_script"
   373 ));
   374 
   375 store_met
   376     (prep_met thy "met_biege_intconst_1" [] e_metID
   377 	      (["IntegrierenUndKonstanteBestimmen","1xIntegrieren"],
   378 	       [],
   379 	       {rew_ord'="tless_true", rls'=Erls, calc = [], 
   380 		srls = e_rls, 
   381 		prls=e_rls,
   382 	     crls = Atools_erls, errpats = [], nrls = e_rls},
   383 "empty_script"
   384 ));
   385 
   386 store_met
   387     (prep_met thy "met_biege2" [] e_metID
   388 	      (["Biegelinien"],
   389 	       [],
   390 	       {rew_ord'="tless_true", rls'=Erls, calc = [], 
   391 		srls = e_rls, 
   392 		prls=e_rls,
   393 	     crls = Atools_erls, errpats = [], nrls = e_rls},
   394 "empty_script"
   395 ));
   396 
   397 *}
   398 ML {*
   399 store_met
   400   (prep_met thy "met_biege_ausbelast" [] e_metID
   401 	    (["Biegelinien", "ausBelastung"],
   402 	     [("#Given" ,["Streckenlast q__q", "FunktionsVariable v_v"]),
   403 	      ("#Find"  ,["Funktionen fun_s"])],
   404 	     {rew_ord'="tless_true", 
   405 	      rls' = append_rls "erls_ausBelastung" e_rls 
   406 				        [Calc ("Atools.ident", eval_ident "#ident_"),
   407 				         Thm ("not_true", num_str @{thm not_true}),
   408 				         Thm ("not_false", num_str @{thm not_false})], 
   409 				      calc = [], 
   410 				      srls = append_rls "srls_ausBelastung" e_rls 
   411 				        [Calc ("Tools.rhs", eval_rhs "eval_rhs_")], 
   412 				      prls = e_rls, crls = Atools_erls, errpats = [], nrls = e_rls},
   413 "Script Belastung2BiegelScript (q__q::real) (v_v::real) =               " ^
   414 "  (let q___q = Take (qq v_v = q__q);                                  " ^
   415 "       q___q = ((Rewrite sym_neg_equal_iff_equal True) @@              " ^
   416 "              (Rewrite Belastung_Querkraft True)) q___q;               " ^
   417 "      (Q__Q:: bool) =                                                  " ^
   418 "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   419 "                          [diff,integration,named])                    " ^
   420 "                          [REAL (rhs q___q), REAL v_v, REAL_REAL Q]);  " ^
   421 "       M__M = Rewrite Querkraft_Moment True Q__Q;                      " ^
   422 "      (M__M::bool) =                                                   " ^
   423 "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   424 "                          [diff,integration,named])                    " ^
   425 "                          [REAL (rhs M__M), REAL v_v, REAL_REAL M_b]); " ^
   426 "       N__N = ((Rewrite Moment_Neigung False) @@                       " ^
   427 "              (Rewrite make_fun_explicit False)) M__M;                 " ^
   428 "      (N__N:: bool) =                                                  " ^
   429 "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   430 "                          [diff,integration,named])                    " ^
   431 "                          [REAL (rhs N__N), REAL v_v, REAL_REAL y']);  " ^
   432 "      (B__B:: bool) =                                                  " ^
   433 "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   434 "                          [diff,integration,named])                    " ^
   435 "                          [REAL (rhs N__N), REAL v_v, REAL_REAL y])    " ^
   436 " in [Q__Q, M__M, N__N, B__B])"
   437 ));
   438 
   439 *}
   440 ML {*
   441 store_met
   442     (prep_met thy "met_biege_setzrand" [] e_metID
   443 	      (["Biegelinien", "setzeRandbedingungenEin"],
   444 	       [("#Given" , ["Funktionen fun_s", "Randbedingungen r_b"]),
   445 	        ("#Find"  , ["Gleichungen equs'''"])],
   446 	       {rew_ord'="tless_true", rls'=Erls, calc = [], 
   447 		srls = srls2, 
   448 		prls=e_rls,
   449 	     crls = Atools_erls, errpats = [], nrls = e_rls},
   450 "Script SetzeRandbedScript (fun_s::bool list) (r_b::bool list) = " ^
   451 " (let b_1 = NTH 1 r_b;                                         " ^
   452 "      f_s = filter_sameFunId (lhs b_1) fun_s;                   " ^
   453 "      (e_1::bool) =                                             " ^
   454 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   455 "                          [Equation,fromFunction])              " ^
   456 "                          [BOOL (hd f_s), BOOL b_1]);         " ^
   457 "      b_2 = NTH 2 r_b;                                         " ^
   458 "      f_s = filter_sameFunId (lhs b_2) fun_s;                   " ^
   459 "      (e_2::bool) =                                             " ^
   460 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   461 "                          [Equation,fromFunction])              " ^
   462 "                          [BOOL (hd f_s), BOOL b_2]);         " ^
   463 "      b_3 = NTH 3 r_b;                                         " ^
   464 "      f_s = filter_sameFunId (lhs b_3) fun_s;                   " ^
   465 "      (e_3::bool) =                                             " ^
   466 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   467 "                          [Equation,fromFunction])              " ^
   468 "                          [BOOL (hd f_s), BOOL b_3]);         " ^
   469 "      b_4 = NTH 4 r_b;                                         " ^
   470 "      f_s = filter_sameFunId (lhs b_4) fun_s;                   " ^
   471 "      (e_4::bool) =                                             " ^
   472 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   473 "                          [Equation,fromFunction])              " ^
   474 "                          [BOOL (hd f_s), BOOL b_4])          " ^
   475 " in [e_1, e_2, e_3, e_4])"
   476 (* filter requires more than 1 sec !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   477 "Script SetzeRandbedScript (fun_s::bool list) (r_b::bool list) = " ^
   478 " (let b_1 = NTH 1 r_b;                                         " ^
   479 "      f_s = filter (sameFunId (lhs b_1)) fun_s;                 " ^
   480 "      (e_1::bool) =                                             " ^
   481 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   482 "                          [Equation,fromFunction])              " ^
   483 "                          [BOOL (hd f_s), BOOL b_1]);         " ^
   484 "      b_2 = NTH 2 r_b;                                         " ^
   485 "      f_s = filter (sameFunId (lhs b_2)) fun_s;                 " ^
   486 "      (e_2::bool) =                                             " ^
   487 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   488 "                          [Equation,fromFunction])              " ^
   489 "                          [BOOL (hd f_s), BOOL b_2]);         " ^
   490 "      b_3 = NTH 3 r_b;                                         " ^
   491 "      f_s = filter (sameFunId (lhs b_3)) fun_s;                 " ^
   492 "      (e_3::bool) =                                             " ^
   493 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   494 "                          [Equation,fromFunction])              " ^
   495 "                          [BOOL (hd f_s), BOOL b_3]);         " ^
   496 "      b_4 = NTH 4 r_b;                                         " ^
   497 "      f_s = filter (sameFunId (lhs b_4)) fun_s;                 " ^
   498 "      (e_4::bool) =                                             " ^
   499 "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   500 "                          [Equation,fromFunction])              " ^
   501 "                          [BOOL (hd f_s), BOOL b_4])          " ^
   502 " in [e_1,e_2,e_3,e_4])"*)
   503 ));
   504 
   505 *}
   506 ML {*
   507 store_met
   508   (prep_met thy "met_equ_fromfun" [] e_metID
   509 	    (["Equation","fromFunction"],
   510 	     [("#Given" ,["functionEq fu_n","substitution su_b"]),
   511 	      ("#Find"  ,["equality equ'''"])],
   512 	     {rew_ord'="tless_true", rls'=Erls, calc = [], 
   513 	      srls = append_rls "srls_in_EquationfromFunc" e_rls
   514 				        [Calc("Tools.lhs", eval_lhs"eval_lhs_"),
   515 				         Calc("Atools.argument'_in", eval_argument_in "Atools.argument'_in")], 
   516 				       prls=e_rls, crls = Atools_erls, errpats = [], nrls = e_rls},
   517 (*(M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2) (M_b L = 0) -->
   518        0 = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
   519 "Script Function2Equality (fu_n::bool) (su_b::bool) =" ^
   520 " (let fu_n = Take fu_n;                             " ^
   521 "      bd_v = argument_in (lhs fu_n);                " ^
   522 "      va_l = argument_in (lhs su_b);                " ^
   523 "      eq_u = (Substitute [bd_v = va_l]) fu_n;       " ^
   524                                         (*([1], Res), M_b L = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
   525 "      eq_u = (Substitute [su_b]) eq_u               " ^
   526 " in (Rewrite_Set norm_Rational False) eq_u)         "
   527 ));
   528 *}
   529 
   530 end
   531