src/Tools/isac/Knowledge/Test_Build_Thydata.thy
author Walther Neuper <walther.neuper@jku.at>
Sun, 04 Apr 2021 12:29:42 +0200
changeset 60182 9f927860d907
parent 60077 bd5be37901f8
child 60266 4921574fd67f
permissions -rw-r--r--
separate session Specify
wneuper@59344
     1
(* Minimal Thydata for test/../thy-hierarchy *)
neuper@55408
     2
neuper@55408
     3
theory Test_Build_Thydata
walther@60182
     4
  imports "Specify.ProgLang"
neuper@55408
     5
begin
wneuper@59427
     6
wneuper@59472
     7
ML \<open>
wneuper@59427
     8
open Rule
walther@59910
     9
fun termlessI (_: subst) uv = LibraryC.termless uv;
wneuper@59472
    10
\<close>
neuper@55408
    11
axiomatization where
neuper@55408
    12
  thm111: "thm111 = thm111 + (111::int)" and
neuper@55408
    13
  thm222: "thm222 = thm222 + (222::int)"
neuper@55408
    14
wneuper@59472
    15
ML \<open>
walther@59851
    16
val rls111 = Rule_Def.Repeat {id = "rls111", 
walther@59852
    17
	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.empty, 
walther@59851
    18
	srls = Rule_Set.Empty, calc = [], errpatts = [],
wneuper@59416
    19
	rules = [Rule.Thm ("thm111", @{thm thm111}), Rule.Thm ("refl", @{thm refl})],
walther@59878
    20
	scr = Rule.Empty_Prog};
neuper@55408
    21
walther@59851
    22
val rls222 = Rule_Def.Repeat {id = "rls222", 
walther@59852
    23
	preconds = [], rew_ord = ("termlessI", termlessI), erls = Rule_Set.empty, 
walther@59851
    24
	srls = Rule_Set.Empty, calc = [], errpatts = [],
wneuper@59416
    25
	rules = [Rule.Thm ("sym_thm111", @{thm thm111} RS @{thm sym}), Rule.Thm ("o_def", @{thm o_def})],
walther@59878
    26
	scr = Rule.Empty_Prog};
s1210629013@55444
    27
walther@59618
    28
val prep_rls' = Auto_Prog.prep_rls @{theory};
wneuper@59472
    29
\<close>
neuper@55408
    30
wneuper@59472
    31
setup \<open>KEStore_Elems.add_rlss 
wneuper@59428
    32
  [("rls111", (Context.theory_name @{theory}, prep_rls' rls111)),
wneuper@59472
    33
   ("rls222", (Context.theory_name @{theory}, prep_rls' rls222))]\<close>
neuper@55408
    34
wneuper@59472
    35
ML \<open>
neuper@55408
    36
  @{thm refl};
neuper@55408
    37
  @{thm o_def};
wneuper@59427
    38
wneuper@59472
    39
\<close> ML \<open>
wneuper@59427
    40
val [aaa, bbb, ccc, ddd, eee] = KEStore_Elems.get_rlss @{theory};
wneuper@59472
    41
\<close> ML \<open>
walther@59852
    42
if eq_set op = (map fst [aaa, bbb, ccc], ["e_rrls", "empty", "prog_expr"]) then ()
walther@59962
    43
else raise ERROR "test/../thy-hierarchy CHANGED"
wneuper@59472
    44
\<close> ML \<open>
wneuper@59427
    45
case ddd of
wneuper@59427
    46
  ("rls111",
wneuper@59428
    47
    ("Test_Build_Thydata",
walther@59851
    48
     Rule_Def.Repeat {calc = [], erls =
walther@59852
    49
          Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
walther@59878
    50
               ("dummy_ord", _), rules = [], scr = Empty_Prog, srls = Rule_Set.Empty},
wneuper@59427
    51
          errpatts = [], id = "rls111", preconds = [], rew_ord = ("termlessI", _), rules =
walther@59878
    52
          [Thm ("thm111", _), Thm ("refl", _)], scr = Empty_Prog, srls = Rule_Set.Empty})) => ()
walther@59962
    53
| _ => raise ERROR "test/../thy-hierarchy CHANGED 4";
wneuper@59472
    54
\<close> ML \<open>
wneuper@59427
    55
case eee of
wneuper@59427
    56
  ("rls222",
wneuper@59428
    57
    ("Test_Build_Thydata",
walther@59851
    58
     Rule_Def.Repeat {calc = [], erls =
walther@59852
    59
          Rule_Def.Repeat {calc = [], erls = Erls, errpatts = [], id = "empty", preconds = [], rew_ord =
walther@59878
    60
               ("dummy_ord", _), rules = [], scr = Empty_Prog, srls = Rule_Set.Empty},
wneuper@59427
    61
          errpatts = [], id = "rls222", preconds = [], rew_ord = ("termlessI", _), rules =
walther@59878
    62
          [Thm ("sym_thm111", _), Thm ("o_def", _)], scr = Empty_Prog, srls = Rule_Set.Empty})) => ()
walther@59962
    63
| _ => raise ERROR "test/../thy-hierarchy CHANGED 5";
wneuper@59472
    64
\<close>
neuper@55408
    65
wneuper@59472
    66
ML \<open>
wneuper@59472
    67
\<close> ML \<open>
wneuper@59472
    68
\<close>
neuper@55408
    69
end