src/Tools/isac/Knowledge/DiophantEq.thy
author Walther Neuper <wneuper@ist.tugraz.at>
Mon, 26 Mar 2018 07:28:39 +0200
changeset 59416 229e5c9cf78b
parent 59411 3e241a6938ce
child 59424 406681ebe781
permissions -rw-r--r--
Rule: structure pushed to code files
     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 
    16 axiomatization where
    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 setup {* KEStore_Elems.add_pbts
    23   [(Specify.prep_pbt thy "pbl_equ_dio" [] Celem.e_pblID
    24       (["diophantine","equation"],
    25         [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
    26           (*                                      TODO: drop ^^^^^*)
    27           ("#Where" ,[]),
    28           ("#Find"  ,["boolTestFind s_s"])],
    29         Rule.e_rls, SOME "solve (e_e::bool, v_v::int)", [["LinEq","solve_lineq_equation"]]))] *}
    30 
    31 text {*method solving the usecase*}
    32 setup {* KEStore_Elems.add_mets
    33   [Specify.prep_met thy "met_test_diophant" [] Celem.e_metID
    34       (["Test","solve_diophant"],
    35         [("#Given" ,["boolTestGiven e_e","intTestGiven (v_v::int)"]),
    36           (*                                      TODO: drop ^^^^^*)
    37           ("#Where" ,[]),
    38           ("#Find"  ,["boolTestFind s_s"])],
    39         {rew_ord' = "e_rew_ord", rls' = tval_rls, srls = Rule.e_rls, prls = Rule.e_rls, calc = [],
    40           crls = tval_rls, errpats = [], nrls = Test_simplify},
    41         "Script Diophant_equation (e_e::bool) (v_v::int)=                  " ^
    42           "(Repeat                                                          " ^
    43           "    ((Try (Rewrite_Inst [(bdv,v_v::int)] int_isolate_add False)) @@" ^
    44           "     (Try (Calculate PLUS)) @@  " ^
    45           "     (Try (Calculate TIMES))) e_e::bool)")]
    46 *}
    47 
    48 end