src/Tools/isac/Knowledge/LogExp.thy
author Walther Neuper <neuper@ist.tugraz.at>
Thu, 23 Sep 2010 08:54:26 +0200
branchisac-update-Isa09-2
changeset 38012 f57ddfd09474
parent 38010 a37a3ab989f4
child 42197 7497ff20f1e8
permissions -rw-r--r--
tuned pbt's due to copy_named
     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 axioms
    21 
    22   equality_pow:    "0 < a ==> (l = r) = (a^^^l = a^^^r)"
    23   (* this is what students   ^^^^^^^... are told to do *)
    24   equality_power:  "((a log b) = c) = (a^^^(a log b) = a^^^c)"
    25   exp_invers_log:  "a^^^(a log b) = b"
    26 
    27 ML {*
    28 val thy = @{theory};
    29 
    30 (** problems **)
    31 store_pbt
    32  (prep_pbt thy "pbl_test_equ_univ_log" [] 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    ],
    40   PolyEq_prls, SOME "solve (e_e::bool, v_v)",
    41   [["Equation","solve_log"]]));
    42 *}
    43 ML {*
    44 (** methods **)
    45 store_met
    46  (prep_met thy "met_equ_log" [] e_metID
    47  (["Equation","solve_log"],
    48   [("#Given" ,["equality e_e","solveFor v_v"]),
    49    ("#Where" ,["matches ((?a log ?v_v) = ?b) e_e"]),
    50    ("#Find"  ,["solutions v_v'i'"])
    51   ],
    52    {rew_ord'="termlessI",rls'=PolyEq_erls,srls=e_rls,prls=PolyEq_prls,
    53     calc=[],crls=PolyEq_crls, nrls=norm_Rational},
    54     "Script Solve_log (e_e::bool) (v_v::real) =     " ^
    55     "(let e_e = ((Rewrite equality_power False) @@ " ^
    56     "           (Rewrite exp_invers_log False) @@ " ^
    57     "           (Rewrite_Set norm_Poly False)) e_e " ^
    58     " in [e_e])"
    59    ));
    60 *}
    61 
    62 end