src/Tools/isac/Knowledge/DiophantEq.thy
author Walther Neuper <neuper@ist.tugraz.at>
Thu, 17 Mar 2011 10:11:18 +0100
branchdecompose-isar
changeset 41931 ca6aac81b893
parent 41928 20138d6136cd
child 42197 7497ff20f1e8
permissions -rw-r--r--
intermed. usecase Diophant

term2str changed output for unknown reason, eg. test/../integrate.sml
"Integral 1 / EI *\n (L * q_0 / 2 * x + -1 * q_0 / 2 * x ^^^ 2) D x"
(*"Integral 1 / EI * (L * q_0 / 2 * x + -1 * q_0 / 2 * x ^^^ 2) D x" *)
plus 1 change in test/../reational.sml for unknown reason

Test_Isac.thy goes through again.
     1 (* Title:  Knowledge/DiophantEq.thy
     2    Author: Mathias Lehnfeld 2011
     3    (c) due to copyright terms
     4 12345678901234567890123456789012345678901234567890123456789012345678901234567890
     5         10        20        30        40        50        60        70        80
     6 *)
     7 
     8 theory DiophantEq imports Atools Equation Test
     9 begin
    10 
    11 consts
    12   Diophant'_equation :: "[bool, int, bool ] 
    13                                        => bool "
    14                     ("((Script Diophant'_equation (_ _ =))//(_))" 9)
    15 axioms
    16 
    17   int_isolate_add: "(bdv + a = b) = (bdv = b + (-1)*(a::int))"
    18 
    19 ML {*val thy = @{theory}*}
    20 
    21 text {*problemclass for the usecase*}
    22 ML {*
    23 store_pbt
    24  (prep_pbt thy "pbl_equ_dio" [] e_pblID
    25  (["diophantine","equation"],
    26   [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
    27   (*                                      TODO: drop ^^^^^*)
    28    ("#Where" ,[]),
    29    ("#Find"  ,["boolTestFind s_s"]) 
    30   ],
    31   e_rls, SOME "solve (e_e::bool, v_v::int)",
    32   [["LinEq","solve_lineq_equation"]])); (*-----TODO*)
    33 show_ptyps();
    34 get_pbt ["diophantine","equation"];
    35 *}
    36 
    37 text {*method solving the usecase*}
    38 ML {*
    39 store_met
    40 (prep_met thy "met_test_diophant" [] e_metID
    41  (["Test","solve_diophant"]:metID,
    42   [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
    43   (*                                      TODO: drop ^^^^^*)
    44    ("#Where" ,[]),
    45    ("#Find"  ,["boolTestFind s_s"]) 
    46   ],
    47    {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = e_rls,
    48     prls = e_rls, calc = [], crls = tval_rls, nrls = Test_simplify},
    49  "Script Diophant_equation (e_e::bool) (v_v::int)=                  " ^
    50  "(Repeat                                                          " ^
    51  "    ((Try (Rewrite_Inst [(bdv,v_v::int)] int_isolate_add False)) @@" ^
    52  "     (Try (Calculate PLUS)) @@  " ^
    53  "     (Try (Calculate TIMES))) e_e::bool)"
    54  ))
    55 *}
    56 
    57 end