src/Tools/isac/Knowledge/DiophantEq.thy
author Walther Neuper <neuper@ist.tugraz.at>
Thu, 10 Mar 2011 15:16:13 +0100
branchdecompose-isar
changeset 41926 460baed1d047
parent 41925 d4a8c40594a3
child 41928 20138d6136cd
permissions -rw-r--r--
intermed.update Isabelle2011:

fiddling with sudo fetch, merge, push
     1 theory DiophantEq imports Atools Equation begin
     2 
     3 consts
     4    Solve'_lineq'_equation :: "[bool, int, bool ] 
     5                                        => bool "
     6                     ("((Script Diophant'_equation (_ _ =))//(_))" 9)
     7 axioms
     8 
     9   int_isolate_add: "(bdv + a = b) = (bdv = b - (a::int))"
    10 
    11 ML {*
    12 val thy = @{theory};
    13 val ctxt = ProofContext.init_global thy;
    14 fun parseNEW ctxt str = numbers_to_string (Syntax.read_term ctxt str);
    15 parseNEW ctxt "x = (1::int)"; (*TODO omit ::int*)
    16 *}
    17 
    18 ML {*
    19 store_pbt
    20  (prep_pbt thy "pbl_equ_dio" [] e_pblID
    21  (["diophantine","equation"],
    22   [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
    23   (*                                      TODO: drop ^^^^^*)
    24    ("#Where" ,[]),
    25    ("#Find"  ,["boolTestFind s_s"]) 
    26   ],
    27   e_rls, SOME "solve (e_e::bool, v_v::int)",
    28   [["LinEq","solve_lineq_equation"]])); (*-----TODO*)
    29 show_ptyps();
    30 get_pbt ["diophantine","equation"];
    31 *}
    32 
    33 ML {*
    34 val subst = [(parseNEW ctxt "bdv::int", parseNEW ctxt "x::int")];
    35 val t = parseNEW ctxt "x + 1 = (2::int)";
    36 *}
    37 
    38 ML {*
    39 rewrite_inst_ thy e_rew_ord e_rls true subst (@{thm "int_isolate_add"}) t;
    40 
    41  
    42 *}
    43 
    44 ML {*
    45 prop_of (@{thm "int_isolate_add"});
    46 writeln "-----------";
    47 t;
    48 *}
    49 
    50 end