src/Tools/isac/Knowledge/Biegelinie.thy
author Walther Neuper <neuper@ist.tugraz.at>
Wed, 04 Jun 2014 17:20:40 +0200
changeset 55420 011d51b00136
parent 55380 7be2ad0e4acb
child 55425 cf1983f664f8
permissions -rw-r--r--
ad 967c8a1eb6b1 (1): restrict write-access to thehier

ATTENTION: errors in test/../inform.sml, test/../thy-hierarchy.sml
     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 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 store_thes 
    78   [make_thy @{theory}
    79     ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    80   make_isa @{theory} ("IsacKnowledge", "Theorems")
    81     ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    82   make_thm thy "IsacKnowledge" ("Belastung_Querkraft", prop_of @{thm Belastung_Querkraft})
    83 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    84   make_thm thy "IsacKnowledge" ("Moment_Neigung", prop_of @{thm Moment_Neigung})
    85 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    86   make_thm thy "IsacKnowledge" ("Moment_Querkraft", prop_of @{thm Moment_Querkraft})
    87 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    88   make_thm thy "IsacKnowledge" ("Neigung_Moment", prop_of @{thm Neigung_Moment})
    89 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    90   make_thm thy "IsacKnowledge" ("Querkraft_Belastung", prop_of @{thm Querkraft_Belastung})
    91 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    92   make_thm thy "IsacKnowledge" ("Querkraft_Moment", prop_of @{thm Querkraft_Moment})
    93 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"],
    94   make_thm thy "IsacKnowledge" ("make_fun_explicit", prop_of @{thm make_fun_explicit})
    95 	  ["Walther Neuper 2005 supported by a grant from NMI Austria"]
    96   ]
    97 *}
    98 
    99 (** problems **)
   100 setup {* KEStore_Elems.add_pbts
   101   [(prep_pbt thy "pbl_bieg" [] e_pblID
   102       (["Biegelinien"],
   103         [("#Given" ,["Traegerlaenge l_l", "Streckenlast q_q"]),
   104           (*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   105           ("#Find"  ,["Biegelinie b_b"]),
   106           ("#Relate",["Randbedingungen r_b"])],
   107         append_rls "e_rls" e_rls [], NONE, [["IntegrierenUndKonstanteBestimmen2"]])),
   108     (prep_pbt thy "pbl_bieg_mom" [] e_pblID
   109       (["MomentBestimmte","Biegelinien"],
   110         [("#Given" ,["Traegerlaenge l_l", "Streckenlast q_q"]),
   111           (*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   112           ("#Find"  ,["Biegelinie b_b"]),
   113           ("#Relate",["RandbedingungenBiegung r_b","RandbedingungenMoment r_m"])
   114         ],
   115         append_rls "e_rls" e_rls [], NONE, [["IntegrierenUndKonstanteBestimmen"]])),
   116     (prep_pbt thy "pbl_bieg_momg" [] e_pblID
   117       (["MomentGegebene","Biegelinien"], [], append_rls "e_rls" e_rls [], NONE,
   118         [["IntegrierenUndKonstanteBestimmen","2xIntegrieren"]])),
   119     (prep_pbt thy "pbl_bieg_einf" [] e_pblID
   120       (["einfache","Biegelinien"], [], append_rls "e_rls" e_rls [], NONE,
   121         [["IntegrierenUndKonstanteBestimmen","4x4System"]])),
   122     (prep_pbt thy "pbl_bieg_momquer" [] e_pblID
   123       (["QuerkraftUndMomentBestimmte","Biegelinien"], [], append_rls "e_rls" e_rls [], NONE,
   124         [["IntegrierenUndKonstanteBestimmen","1xIntegrieren"]])),
   125     (prep_pbt thy "pbl_bieg_vonq" [] e_pblID
   126       (["vonBelastungZu","Biegelinien"],
   127           [("#Given" ,["Streckenlast q_q","FunktionsVariable v_v"]),
   128             ("#Find"  ,["Funktionen funs'''"])],
   129         append_rls "e_rls" e_rls [], NONE, [["Biegelinien","ausBelastung"]])),
   130     (prep_pbt thy "pbl_bieg_randbed" [] e_pblID
   131       (["setzeRandbedingungen","Biegelinien"],
   132           [("#Given" ,["Funktionen fun_s","Randbedingungen r_b"]),
   133             ("#Find"  ,["Gleichungen equs'''"])],
   134         append_rls "e_rls" e_rls [], NONE, [["Biegelinien","setzeRandbedingungenEin"]])),
   135     (prep_pbt thy "pbl_equ_fromfun" [] e_pblID
   136       (["makeFunctionTo","equation"],
   137           [("#Given" ,["functionEq fu_n","substitution su_b"]),
   138             ("#Find"  ,["equality equ'''"])],
   139         append_rls "e_rls" e_rls [], NONE, [["Equation","fromFunction"]]))] *}
   140 ML {*
   141 (** methods **)
   142 
   143 val srls = Rls {id="srls_IntegrierenUnd..", 
   144 		preconds = [], 
   145 		rew_ord = ("termlessI",termlessI), 
   146 		erls = append_rls "erls_in_srls_IntegrierenUnd.." e_rls
   147 				  [(*for asm in NTH_CONS ...*)
   148 				   Calc ("Orderings.ord_class.less",eval_equ "#less_"),
   149 				   (*2nd NTH_CONS pushes n+-1 into asms*)
   150 				   Calc("Groups.plus_class.plus", eval_binop "#add_")
   151 				   ], 
   152 		srls = Erls, calc = [], errpatts = [],
   153 		rules = [Thm ("NTH_CONS",num_str @{thm NTH_CONS}),
   154 			 Calc("Groups.plus_class.plus", eval_binop "#add_"),
   155 			 Thm ("NTH_NIL",num_str @{thm NTH_NIL}),
   156 			 Calc("Tools.lhs", eval_lhs"eval_lhs_"),
   157 			 Calc("Tools.rhs", eval_rhs"eval_rhs_"),
   158 			 Calc("Atools.argument'_in",
   159 			      eval_argument_in "Atools.argument'_in")
   160 			 ],
   161 		scr = EmptyScr};
   162     
   163 val srls2 = 
   164     Rls {id="srls_IntegrierenUnd..", 
   165 	 preconds = [], 
   166 	 rew_ord = ("termlessI",termlessI), 
   167 	 erls = append_rls "erls_in_srls_IntegrierenUnd.." e_rls
   168 			   [(*for asm in NTH_CONS ...*)
   169 			    Calc ("Orderings.ord_class.less",eval_equ "#less_"),
   170 			    (*2nd NTH_CONS pushes n+-1 into asms*)
   171 			    Calc("Groups.plus_class.plus", eval_binop "#add_")
   172 			    ], 
   173 	 srls = Erls, calc = [], errpatts = [],
   174 	 rules = [Thm ("NTH_CONS",num_str @{thm NTH_CONS}),
   175 		  Calc("Groups.plus_class.plus", eval_binop "#add_"),
   176 		  Thm ("NTH_NIL", num_str @{thm NTH_NIL}),
   177 		  Calc("Tools.lhs", eval_lhs "eval_lhs_"),
   178 		  Calc("Atools.filter'_sameFunId",
   179 		       eval_filter_sameFunId "Atools.filter'_sameFunId"),
   180 		  (*WN070514 just for smltest/../biegelinie.sml ...*)
   181 		  Calc("Atools.sameFunId", eval_sameFunId "Atools.sameFunId"),
   182 		  Thm ("filter_Cons", num_str @{thm filter_Cons}),
   183 		  Thm ("filter_Nil", num_str @{thm filter_Nil}),
   184 		  Thm ("if_True", num_str @{thm if_True}),
   185 		  Thm ("if_False", num_str @{thm if_False}),
   186 		  Thm ("hd_thm", num_str @{thm hd_thm})
   187 		  ],
   188 	 scr = EmptyScr};
   189 *}
   190 
   191 setup {* KEStore_Elems.add_mets
   192   [prep_met thy "met_biege" [] e_metID 
   193 	    (["IntegrierenUndKonstanteBestimmen"],
   194 	      [("#Given" ,["Traegerlaenge l_l", "Streckenlast q__q", "FunktionsVariable v_v"]),
   195 		      (*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   196 		      ("#Find"  ,["Biegelinie b_b"]),
   197 		      ("#Relate",["RandbedingungenBiegung r_b", "RandbedingungenMoment r_m"])],
   198 	    {rew_ord'="tless_true",
   199         rls' = append_rls "erls_IntegrierenUndK.." e_rls 
   200 				    [Calc ("Atools.ident",eval_ident "#ident_"),
   201 				      Thm ("not_true",num_str @{thm not_true}),
   202 				      Thm ("not_false",num_str @{thm not_false})], 
   203 				calc = [], srls = srls, prls = Erls, crls = Atools_erls, errpats = [], nrls = Erls},
   204         "Script BiegelinieScript                                                 " ^
   205           "(l_l::real) (q__q::real) (v_v::real) (b_b::real=>real)                  " ^
   206           "(r_b::bool list) (r_m::bool list) =                                     " ^
   207           "  (let q___q = Take (qq v_v = q__q);                                    " ^
   208           "       q___q = ((Rewrite sym_neg_equal_iff_equal True) @@               " ^
   209           "              (Rewrite Belastung_Querkraft True)) q___q;                " ^
   210           "      (Q__Q:: bool) =                                                   " ^
   211           "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   212           "                          [diff,integration,named])                     " ^
   213           "                          [REAL (rhs q___q), REAL v_v, REAL_REAL Q]);   " ^
   214           "       Q__Q = Rewrite Querkraft_Moment True Q__Q;                       " ^
   215           "      (M__M::bool) =                                                    " ^
   216           "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   217           "                          [diff,integration,named])                     " ^
   218           "                          [REAL (rhs Q__Q), REAL v_v, REAL_REAL M_b]);  " ^
   219                                         (*([5], Res), M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2*)
   220           "       e__1 = NTH 1 r_m;                                                " ^
   221           "      (x__1::real) = argument_in (lhs e__1);                            " ^
   222           "      (M__1::bool) = (Substitute [v_v = x__1]) M__M;                    " ^
   223                                         (*([6], Res), M_b 0 = c_2 + c * 0 + -1 * q_0 / 2 * 0 ^^^ 2*)
   224           "       M__1        = (Substitute [e__1]) M__1;                          " ^
   225                                             (*([7], Res), 0 = c_2 + c * 0 + -1 * q_0 / 2 * 0 ^^^ 2*)
   226           "       M__2 = Take M__M;                                                " ^
   227                                         (*([8], Frm), M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2*)
   228           (*without above Take 'Substitute [v_v = x__2]' takes _last formula from ctree_*)
   229           "       e__2 = NTH 2 r_m;                                                " ^
   230           "      (x__2::real) = argument_in (lhs e__2);                            " ^
   231           "      (M__2::bool) = (Substitute [v_v = x__2]) M__M;                    " ^
   232                                         (*([8], Res), M_b L = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
   233           "       M__2        = (Substitute [e__2]) M__2;                          " ^
   234           "      (c_1_2::bool list) =                                              " ^
   235           "             (SubProblem (Biegelinie',[LINEAR,system],[no_met])         " ^
   236           "                          [BOOL_LIST [M__1, M__2], REAL_LIST [c,c_2]]); " ^
   237           "       M__M = Take  M__M;                                               " ^
   238           "       M__M = ((Substitute c_1_2) @@                                    " ^
   239           "              (Try (Rewrite_Set_Inst [(bdv_1, c),(bdv_2, c_2)]          " ^
   240           "                                   simplify_System False)) @@           " ^
   241           "              (Rewrite Moment_Neigung False) @@                         " ^
   242           "              (Rewrite make_fun_explicit False)) M__M;                  " ^
   243           (*----------------------- and the same once more ------------------------*)
   244           "      (N__N:: bool) =                                                   " ^
   245           "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   246           "                          [diff,integration,named])                     " ^
   247           "                          [REAL (rhs M__M), REAL v_v, REAL_REAL y']);   " ^
   248           "      (B__B:: bool) =                                                   " ^
   249           "             (SubProblem (Biegelinie',[named,integrate,function],       " ^
   250           "                          [diff,integration,named])                     " ^
   251           "                          [REAL (rhs N__N), REAL v_v, REAL_REAL y]);    " ^
   252           "       e__1 = NTH 1 r_b;                                                " ^
   253           "      (x__1::real) = argument_in (lhs e__1);                            " ^
   254           "      (B__1::bool) = (Substitute [v_v = x__1]) B__B;                    " ^
   255           "       B__1        = (Substitute [e__1]) B__1 ;                         " ^
   256           "       B__2 = Take B__B;                                                " ^
   257           "       e__2 = NTH 2 r_b;                                                " ^
   258           "      (x__2::real) = argument_in (lhs e__2);                            " ^
   259           "      (B__2::bool) = (Substitute [v_v = x__2]) B__B;                    " ^
   260           "       B__2        = (Substitute [e__2]) B__2 ;                         " ^
   261           "      (c_1_2::bool list) =                                              " ^
   262           "             (SubProblem (Biegelinie',[LINEAR,system],[no_met])         " ^
   263           "                          [BOOL_LIST [B__1, B__2], REAL_LIST [c,c_2]]); " ^
   264           "       B__B = Take  B__B;                                               " ^
   265           "       B__B = ((Substitute c_1_2) @@                                    " ^
   266           "              (Rewrite_Set_Inst [(bdv, x)] make_ratpoly_in False)) B__B " ^
   267           " in B__B)"),
   268     prep_met thy "met_biege_2" [] e_metID
   269 	    (["IntegrierenUndKonstanteBestimmen2"],
   270 	      [("#Given" ,["Traegerlaenge l_l", "Streckenlast q__q", "FunktionsVariable v_v"]),
   271 		      (*("#Where",["0 < l_l"]), ...wait for &lt; and handling Arbfix*)
   272 		      ("#Find"  ,["Biegelinie b_b"]),
   273 		      ("#Relate",["Randbedingungen r_b"])],
   274 	      {rew_ord'="tless_true", 
   275 	        rls' = append_rls "erls_IntegrierenUndK.." e_rls 
   276 				      [Calc ("Atools.ident",eval_ident "#ident_"),
   277 				        Thm ("not_true",num_str @{thm not_true}),
   278 				        Thm ("not_false",num_str @{thm not_false})], 
   279 				  calc = [], 
   280 				  srls = append_rls "erls_IntegrierenUndK.." e_rls 
   281 				      [Calc("Tools.rhs", eval_rhs"eval_rhs_"),
   282 				        Calc ("Atools.ident",eval_ident "#ident_"),
   283 				        Thm ("last_thmI",num_str @{thm last_thmI}),
   284 				        Thm ("if_True",num_str @{thm if_True}),
   285 				        Thm ("if_False",num_str @{thm if_False})],
   286 				  prls = Erls, crls = Atools_erls, errpats = [], nrls = Erls},
   287         "Script Biegelinie2Script                                                  " ^
   288           "(l_l::real) (q__q::real) (v_v::real) (b_b::real=>real) (r_b::bool list) = " ^
   289           "  (let                                                                    " ^
   290           "      (fun_s:: bool list) =                                               " ^
   291           "             (SubProblem (Biegelinie',[vonBelastungZu,Biegelinien],       " ^
   292           "                          [Biegelinien,ausBelastung])                     " ^
   293           "                          [REAL q__q, REAL v_v]);                         " ^
   294           "      (equ_s::bool list) =                                                " ^
   295           "             (SubProblem (Biegelinie',[setzeRandbedingungen,Biegelinien], " ^
   296           "                          [Biegelinien,setzeRandbedingungenEin])          " ^
   297           "                          [BOOL_LIST fun_s, BOOL_LIST r_b]);              " ^
   298           "      (con_s::bool list) =                                                " ^
   299           "             (SubProblem (Biegelinie',[LINEAR,system],[no_met])           " ^
   300           "                          [BOOL_LIST equ_s, REAL_LIST [c,c_2,c_3,c_4]]);  " ^
   301           "       B_B = Take (lastI fun_s);                                          " ^
   302           "       B_B = ((Substitute con_s) @@                                       " ^
   303           "              (Rewrite_Set_Inst [(bdv, v_v)] make_ratpoly_in False)) B_B  " ^
   304           " in B_B)"),
   305     prep_met thy "met_biege_intconst_2" [] e_metID
   306 	    (["IntegrierenUndKonstanteBestimmen","2xIntegrieren"], [],
   307 	      {rew_ord'="tless_true", rls'=Erls, calc = [], srls = e_rls, prls=e_rls, crls = Atools_erls,
   308           errpats = [], nrls = e_rls},
   309         "empty_script"),
   310     prep_met thy "met_biege_intconst_4" [] e_metID
   311 	    (["IntegrierenUndKonstanteBestimmen","4x4System"], [],
   312 	      {rew_ord'="tless_true", rls'=Erls, calc = [], srls = e_rls, prls=e_rls, crls = Atools_erls,
   313           errpats = [], nrls = e_rls},
   314         "empty_script"),
   315     prep_met thy "met_biege_intconst_1" [] e_metID
   316 	    (["IntegrierenUndKonstanteBestimmen","1xIntegrieren"], [],
   317         {rew_ord'="tless_true", rls'=Erls, calc = [], srls = e_rls, prls=e_rls, crls = Atools_erls,
   318           errpats = [], nrls = e_rls},
   319         "empty_script"),
   320     prep_met thy "met_biege2" [] e_metID
   321 	    (["Biegelinien"], [],
   322 	      {rew_ord'="tless_true", rls'=Erls, calc = [], srls = e_rls, prls=e_rls, crls = Atools_erls,
   323           errpats = [], nrls = e_rls},
   324         "empty_script"),
   325     prep_met thy "met_biege_ausbelast" [] e_metID
   326 	    (["Biegelinien", "ausBelastung"],
   327 	      [("#Given" ,["Streckenlast q__q", "FunktionsVariable v_v"]),
   328 	        ("#Find"  ,["Funktionen fun_s"])],
   329 	      {rew_ord'="tless_true", 
   330 	        rls' = append_rls "erls_ausBelastung" e_rls 
   331 				      [Calc ("Atools.ident", eval_ident "#ident_"),
   332 				        Thm ("not_true", num_str @{thm not_true}),
   333 				        Thm ("not_false", num_str @{thm not_false})], 
   334 				  calc = [], 
   335 				  srls = append_rls "srls_ausBelastung" e_rls 
   336 				      [Calc ("Tools.rhs", eval_rhs "eval_rhs_")], 
   337 				  prls = e_rls, crls = Atools_erls, errpats = [], nrls = e_rls},
   338         "Script Belastung2BiegelScript (q__q::real) (v_v::real) =               " ^
   339           "  (let q___q = Take (qq v_v = q__q);                                  " ^
   340           "       q___q = ((Rewrite sym_neg_equal_iff_equal True) @@              " ^
   341           "              (Rewrite Belastung_Querkraft True)) q___q;               " ^
   342           "      (Q__Q:: bool) =                                                  " ^
   343           "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   344           "                          [diff,integration,named])                    " ^
   345           "                          [REAL (rhs q___q), REAL v_v, REAL_REAL Q]);  " ^
   346           "       M__M = Rewrite Querkraft_Moment True Q__Q;                      " ^
   347           "      (M__M::bool) =                                                   " ^
   348           "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   349           "                          [diff,integration,named])                    " ^
   350           "                          [REAL (rhs M__M), REAL v_v, REAL_REAL M_b]); " ^
   351           "       N__N = ((Rewrite Moment_Neigung False) @@                       " ^
   352           "              (Rewrite make_fun_explicit False)) M__M;                 " ^
   353           "      (N__N:: bool) =                                                  " ^
   354           "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   355           "                          [diff,integration,named])                    " ^
   356           "                          [REAL (rhs N__N), REAL v_v, REAL_REAL y']);  " ^
   357           "      (B__B:: bool) =                                                  " ^
   358           "             (SubProblem (Biegelinie',[named,integrate,function],      " ^
   359           "                          [diff,integration,named])                    " ^
   360           "                          [REAL (rhs N__N), REAL v_v, REAL_REAL y])    " ^
   361           " in [Q__Q, M__M, N__N, B__B])"),
   362     prep_met thy "met_biege_setzrand" [] e_metID
   363 	    (["Biegelinien", "setzeRandbedingungenEin"],
   364 	      [("#Given" , ["Funktionen fun_s", "Randbedingungen r_b"]),
   365 	        ("#Find"  , ["Gleichungen equs'''"])],
   366 	      {rew_ord'="tless_true", rls'=Erls, calc = [], srls = srls2, prls=e_rls, crls = Atools_erls,
   367           errpats = [], nrls = e_rls},
   368         "Script SetzeRandbedScript (fun_s::bool list) (r_b::bool list) = " ^
   369           " (let b_1 = NTH 1 r_b;                                         " ^
   370           "      f_s = filter_sameFunId (lhs b_1) fun_s;                   " ^
   371           "      (e_1::bool) =                                             " ^
   372           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   373           "                          [Equation,fromFunction])              " ^
   374           "                          [BOOL (hd f_s), BOOL b_1]);         " ^
   375           "      b_2 = NTH 2 r_b;                                         " ^
   376           "      f_s = filter_sameFunId (lhs b_2) fun_s;                   " ^
   377           "      (e_2::bool) =                                             " ^
   378           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   379           "                          [Equation,fromFunction])              " ^
   380           "                          [BOOL (hd f_s), BOOL b_2]);         " ^
   381           "      b_3 = NTH 3 r_b;                                         " ^
   382           "      f_s = filter_sameFunId (lhs b_3) fun_s;                   " ^
   383           "      (e_3::bool) =                                             " ^
   384           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   385           "                          [Equation,fromFunction])              " ^
   386           "                          [BOOL (hd f_s), BOOL b_3]);         " ^
   387           "      b_4 = NTH 4 r_b;                                         " ^
   388           "      f_s = filter_sameFunId (lhs b_4) fun_s;                   " ^
   389           "      (e_4::bool) =                                             " ^
   390           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   391           "                          [Equation,fromFunction])              " ^
   392           "                          [BOOL (hd f_s), BOOL b_4])          " ^
   393           " in [e_1, e_2, e_3, e_4])"
   394           (* filter requires more than 1 sec !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   395           "Script SetzeRandbedScript (fun_s::bool list) (r_b::bool list) = " ^
   396           " (let b_1 = NTH 1 r_b;                                         " ^
   397           "      f_s = filter (sameFunId (lhs b_1)) fun_s;                 " ^
   398           "      (e_1::bool) =                                             " ^
   399           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   400           "                          [Equation,fromFunction])              " ^
   401           "                          [BOOL (hd f_s), BOOL b_1]);         " ^
   402           "      b_2 = NTH 2 r_b;                                         " ^
   403           "      f_s = filter (sameFunId (lhs b_2)) fun_s;                 " ^
   404           "      (e_2::bool) =                                             " ^
   405           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   406           "                          [Equation,fromFunction])              " ^
   407           "                          [BOOL (hd f_s), BOOL b_2]);         " ^
   408           "      b_3 = NTH 3 r_b;                                         " ^
   409           "      f_s = filter (sameFunId (lhs b_3)) fun_s;                 " ^
   410           "      (e_3::bool) =                                             " ^
   411           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   412           "                          [Equation,fromFunction])              " ^
   413           "                          [BOOL (hd f_s), BOOL b_3]);         " ^
   414           "      b_4 = NTH 4 r_b;                                         " ^
   415           "      f_s = filter (sameFunId (lhs b_4)) fun_s;                 " ^
   416           "      (e_4::bool) =                                             " ^
   417           "             (SubProblem (Biegelinie',[makeFunctionTo,equation]," ^
   418           "                          [Equation,fromFunction])              " ^
   419           "                          [BOOL (hd f_s), BOOL b_4])          " ^
   420           " in [e_1,e_2,e_3,e_4])"*)),
   421     prep_met thy "met_equ_fromfun" [] e_metID
   422 	    (["Equation","fromFunction"],
   423 	      [("#Given" ,["functionEq fu_n","substitution su_b"]),
   424 	        ("#Find"  ,["equality equ'''"])],
   425 	      {rew_ord'="tless_true", rls'=Erls, calc = [],
   426           srls = append_rls "srls_in_EquationfromFunc" e_rls
   427 				      [Calc("Tools.lhs", eval_lhs"eval_lhs_"),
   428 				        Calc("Atools.argument'_in", eval_argument_in "Atools.argument'_in")], 
   429 				  prls=e_rls, crls = Atools_erls, errpats = [], nrls = e_rls},
   430         (*(M_b x = c_2 + c * x + -1 * q_0 / 2 * x ^^^ 2) (M_b L = 0) -->
   431                0 = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
   432         "Script Function2Equality (fu_n::bool) (su_b::bool) =" ^
   433         " (let fu_n = Take fu_n;                             " ^
   434         "      bd_v = argument_in (lhs fu_n);                " ^
   435         "      va_l = argument_in (lhs su_b);                " ^
   436         "      eq_u = (Substitute [bd_v = va_l]) fu_n;       " ^
   437                                         (*([1], Res), M_b L = c_2 + c * L + -1 * q_0 / 2 * L ^^^ 2*)
   438         "      eq_u = (Substitute [su_b]) eq_u               " ^
   439         " in (Rewrite_Set norm_Rational False) eq_u)         ")]
   440 *}
   441 
   442 end
   443