src/Tools/isac/Knowledge/LogExp.thy
author Walther Neuper <wneuper@ist.tugraz.at>
Wed, 26 Dec 2018 14:24:05 +0100
changeset 59489 cfcbcac0bae8
parent 59473 28b67cae58c3
child 59504 546bd1b027cc
permissions -rw-r--r--
[-Test_Isac] funpack: further replacement ID::type by char string

plus root' replaced by rootX, compare 863c3629ad24
     1 (* all outcommented in order to demonstrate authoring:
     2    WN071203
     3 *)
     4 
     5 theory LogExp imports PolyEq begin
     6 
     7 consts
     8 
     9   ln     :: "real => real"
    10   exp    :: "real => real"         ("E'_ ^^^ _" 80)
    11 
    12 (*--------------------------------------------------*) 
    13   alog   :: "[real, real] => real" ("_ log _" 90)
    14 
    15   (*Script-names*)
    16   Solve'_log    :: "[bool,real,        bool list]  
    17 				    => bool list"
    18                   ("((Script Solve'_log (_ _=))//(_))" 9)
    19 
    20 axiomatization where
    21 
    22   equality_pow:    "0 < a ==> (l = r) = (a^^^l = a^^^r)" and
    23   (* this is what students   ^^^^^^^... are told to do *)
    24   equality_power:  "((a log b) = c) = (a^^^(a log b) = a^^^c)" and
    25   exp_invers_log:  "a^^^(a log b) = b"
    26 
    27 ML \<open>
    28 val thy = @{theory};
    29 \<close>
    30 (** problems **)
    31 setup \<open>KEStore_Elems.add_pbts
    32   [(Specify.prep_pbt thy "pbl_test_equ_univ_log" [] Celem.e_pblID
    33       (["logarithmic","univariate","equation"],
    34         [("#Given",["equality e_e","solveFor v_v"]),
    35           ("#Where",["matches ((?a log ?v_v) = ?b) e_e"]),
    36           ("#Find" ,["solutions v_v'i'"]),
    37           ("#With" ,["||(lhs (Subst (v'i', v_v) e_e) - " ^
    38 	          "  (rhs (Subst (v'i', v_v) e_e) || < eps)"])],
    39         PolyEq_prls, SOME "solve (e_e::bool, v_v)", [["Equation","solve_log"]]))]\<close>
    40 
    41 (** methods **)
    42 setup \<open>KEStore_Elems.add_mets
    43     [Specify.prep_met thy "met_equ_log" [] Celem.e_metID
    44       (["Equation","solve_log"],
    45         [("#Given" ,["equality e_e","solveFor v_v"]),
    46           ("#Where" ,["matches ((?a log ?v_v) = ?b) e_e"]),
    47           ("#Find"  ,["solutions v_v'i'"])],
    48         {rew_ord' = "termlessI", rls' = PolyEq_erls, srls = Rule.e_rls, prls = PolyEq_prls, calc = [],
    49           crls = PolyEq_crls, errpats = [], nrls = norm_Rational},
    50         "Script Solve_log (e_e::bool) (v_v::real) =     " ^
    51         "(let e_e = ((Rewrite ''equality_power'' False) @@ " ^
    52         "           (Rewrite ''exp_invers_log'' False) @@  " ^
    53         "           (Rewrite_Set ''norm_Poly'' False)) e_e " ^
    54         " in [e_e])")]
    55 \<close>
    56 
    57 end