ad 967c8a1eb6b1 (2): for 'ptyps' add functions accessing Theory_Data in parallel to the old ones for 'Unsynchronized.ref'.
- get_ptyps and store_pbts added to KEStore_Elems
- fun merge for Theory_Data
- RootEq and RatEq now necessarily inherit from Equation. ptyps worked previously - Due to fortunate computation order?
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
8 theory DiophantEq imports Atools Equation Test
12 Diophant'_equation :: "[bool, int, bool ]
14 ("((Script Diophant'_equation (_ _ =))//(_))" 9)
17 int_isolate_add: "(bdv + a = b) = (bdv = b + (-1)*(a::int))"
19 ML {*val thy = @{theory}*}
21 text {*problemclass for the usecase*}
24 (prep_pbt thy "pbl_equ_dio" [] e_pblID
25 (["diophantine","equation"],
26 [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
29 ("#Find" ,["boolTestFind s_s"])
31 e_rls, SOME "solve (e_e::bool, v_v::int)",
32 [["LinEq","solve_lineq_equation"]])); (*-----TODO*)
34 get_pbt ["diophantine","equation"];
36 setup {* KEStore_Elems.store_pbts
37 [(prep_pbt thy "pbl_equ_dio" [] e_pblID
38 (["diophantine","equation"],
39 [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
42 ("#Find" ,["boolTestFind s_s"])],
43 e_rls, SOME "solve (e_e::bool, v_v::int)", [["LinEq","solve_lineq_equation"]]))] *}
45 text {*method solving the usecase*}
48 (prep_met thy "met_test_diophant" [] e_metID
49 (["Test","solve_diophant"]:metID,
50 [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
53 ("#Find" ,["boolTestFind s_s"])
55 {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = e_rls,
56 prls = e_rls, calc = [], crls = tval_rls, errpats = [], nrls = Test_simplify},
57 "Script Diophant_equation (e_e::bool) (v_v::int)= " ^
59 " ((Try (Rewrite_Inst [(bdv,v_v::int)] int_isolate_add False)) @@" ^
60 " (Try (Calculate PLUS)) @@ " ^
61 " (Try (Calculate TIMES))) e_e::bool)"