src/Tools/isac/Knowledge/DiophantEq.thy
author Mathias Lehnfeld <s1210629013@students.fh-hagenberg.at>
Mon, 27 Jan 2014 22:26:51 +0100
changeset 55363 d78bc1342183
parent 55359 73dc85c025ab
child 55373 4f3f530f3cf6
permissions -rw-r--r--
ad 967c8a1eb6b1 (7): removed all code concerned with 'ptyps = Unsynchronized.ref'
neuper@41931
     1
(* Title:  Knowledge/DiophantEq.thy
neuper@41931
     2
   Author: Mathias Lehnfeld 2011
neuper@41931
     3
   (c) due to copyright terms
neuper@41931
     4
12345678901234567890123456789012345678901234567890123456789012345678901234567890
neuper@41931
     5
        10        20        30        40        50        60        70        80
neuper@41931
     6
*)
neuper@41931
     7
neuper@41931
     8
theory DiophantEq imports Atools Equation Test
neuper@41931
     9
begin
neuper@41921
    10
neuper@41921
    11
consts
neuper@41931
    12
  Diophant'_equation :: "[bool, int, bool ] 
neuper@41921
    13
                                       => bool "
neuper@41921
    14
                    ("((Script Diophant'_equation (_ _ =))//(_))" 9)
neuper@41921
    15
neuper@52148
    16
axiomatization where
neuper@41931
    17
  int_isolate_add: "(bdv + a = b) = (bdv = b + (-1)*(a::int))"
neuper@41921
    18
neuper@41931
    19
ML {*val thy = @{theory}*}
neuper@41921
    20
neuper@41931
    21
text {*problemclass for the usecase*}
s1210629013@55359
    22
setup {* KEStore_Elems.add_pbts
s1210629013@55339
    23
  [(prep_pbt thy "pbl_equ_dio" [] e_pblID
s1210629013@55339
    24
      (["diophantine","equation"],
s1210629013@55339
    25
        [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
s1210629013@55339
    26
          (*                                      TODO: drop ^^^^^*)
s1210629013@55339
    27
          ("#Where" ,[]),
s1210629013@55339
    28
          ("#Find"  ,["boolTestFind s_s"])],
s1210629013@55339
    29
        e_rls, SOME "solve (e_e::bool, v_v::int)", [["LinEq","solve_lineq_equation"]]))] *}
neuper@41921
    30
neuper@41931
    31
text {*method solving the usecase*}
neuper@41921
    32
ML {*
neuper@41931
    33
store_met
neuper@41931
    34
(prep_met thy "met_test_diophant" [] e_metID
neuper@41931
    35
 (["Test","solve_diophant"]:metID,
neuper@41931
    36
  [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
neuper@41931
    37
  (*                                      TODO: drop ^^^^^*)
neuper@41931
    38
   ("#Where" ,[]),
neuper@41931
    39
   ("#Find"  ,["boolTestFind s_s"]) 
neuper@41931
    40
  ],
neuper@41931
    41
   {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = e_rls,
neuper@42425
    42
    prls = e_rls, calc = [], crls = tval_rls, errpats = [], nrls = Test_simplify},
neuper@41931
    43
 "Script Diophant_equation (e_e::bool) (v_v::int)=                  " ^
neuper@41931
    44
 "(Repeat                                                          " ^
neuper@41931
    45
 "    ((Try (Rewrite_Inst [(bdv,v_v::int)] int_isolate_add False)) @@" ^
neuper@41931
    46
 "     (Try (Calculate PLUS)) @@  " ^
neuper@41931
    47
 "     (Try (Calculate TIMES))) e_e::bool)"
neuper@41931
    48
 ))
neuper@41921
    49
*}
neuper@41921
    50
neuper@41921
    51
end