author | haftmann |
Mon, 13 Sep 2021 14:18:24 +0000 | |
changeset 74309 | 42523fbf643b |
parent 72998 | 7ea253f93606 |
child 74503 | 403ce50e6a2a |
permissions | -rw-r--r-- |
42153 | 1 |
(* Title: HOL/Hoare/hoare_syntax.ML |
2 |
Author: Leonor Prensa Nieto & Tobias Nipkow |
|
72806
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
3 |
Author: Walter Guttmann (extension to total-correctness proofs) |
42153 | 4 |
|
5 |
Syntax translations for Hoare logic. |
|
6 |
*) |
|
7 |
||
8 |
signature HOARE_SYNTAX = |
|
9 |
sig |
|
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
10 |
val hoare_vars_tr: Proof.context -> term list -> term |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
11 |
val hoare_tc_vars_tr: Proof.context -> term list -> term |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
12 |
val spec_tr': string -> Proof.context -> term list -> term |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
13 |
val setup: |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
14 |
{Basic: string, Skip: string, Seq: string, Cond: string, While: string, |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
15 |
Valid: string, ValidTC: string} -> theory -> theory |
42153 | 16 |
end; |
17 |
||
18 |
structure Hoare_Syntax: HOARE_SYNTAX = |
|
19 |
struct |
|
20 |
||
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
21 |
(** theory data **) |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
22 |
|
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
23 |
structure Data = Theory_Data |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
24 |
( |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
25 |
type T = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
26 |
{Basic: string, Skip: string, Seq: string, Cond: string, While: string, |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
27 |
Valid: string, ValidTC: string} option; |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
28 |
val empty: T = NONE; |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
29 |
val extend = I; |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
30 |
fun merge (data1, data2) = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
31 |
if is_some data1 andalso is_some data2 andalso data1 <> data2 then |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
32 |
error "Cannot merge syntax from different Hoare Logics" |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
33 |
else merge_options (data1, data2); |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
34 |
); |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
35 |
|
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
36 |
fun const_syntax ctxt which = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
37 |
(case Data.get (Proof_Context.theory_of ctxt) of |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
38 |
SOME consts => which consts |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
39 |
| NONE => error "Undefined Hoare syntax consts"); |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
40 |
|
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
41 |
val syntax_const = Syntax.const oo const_syntax; |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
42 |
|
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
43 |
|
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
44 |
|
42153 | 45 |
(** parse translation **) |
46 |
||
47 |
local |
|
48 |
||
49 |
fun idt_name (Free (x, _)) = SOME x |
|
69597 | 50 |
| idt_name (Const (\<^syntax_const>\<open>_constrain\<close>, _) $ t $ _) = idt_name t |
42153 | 51 |
| idt_name _ = NONE; |
52 |
||
53 |
fun eq_idt tu = |
|
59058
a78612c67ec0
renamed "pairself" to "apply2", in accordance to @{apply 2};
wenzelm
parents:
55659
diff
changeset
|
54 |
(case apply2 idt_name tu of |
42153 | 55 |
(SOME x, SOME y) => x = y |
56 |
| _ => false); |
|
57 |
||
42284 | 58 |
fun mk_abstuple [x] body = Syntax_Trans.abs_tr [x, body] |
42153 | 59 |
| mk_abstuple (x :: xs) body = |
69597 | 60 |
Syntax.const \<^const_syntax>\<open>case_prod\<close> $ Syntax_Trans.abs_tr [x, mk_abstuple xs body]; |
42153 | 61 |
|
62 |
fun mk_fbody x e [y] = if eq_idt (x, y) then e else y |
|
63 |
| mk_fbody x e (y :: xs) = |
|
69597 | 64 |
Syntax.const \<^const_syntax>\<open>Pair\<close> $ |
42153 | 65 |
(if eq_idt (x, y) then e else y) $ mk_fbody x e xs; |
66 |
||
67 |
fun mk_fexp x e xs = mk_abstuple xs (mk_fbody x e xs); |
|
68 |
||
69 |
||
70 |
(* bexp_tr & assn_tr *) |
|
71 |
(*all meta-variables for bexp except for TRUE are translated as if they |
|
72 |
were boolean expressions*) |
|
73 |
||
55659 | 74 |
fun bexp_tr (Const ("TRUE", _)) _ = Syntax.const "TRUE" (* FIXME !? *) |
69597 | 75 |
| bexp_tr b xs = Syntax.const \<^const_syntax>\<open>Collect\<close> $ mk_abstuple xs b; |
42153 | 76 |
|
69597 | 77 |
fun assn_tr r xs = Syntax.const \<^const_syntax>\<open>Collect\<close> $ mk_abstuple xs r; |
42153 | 78 |
|
72806
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
79 |
fun var_tr v xs = mk_abstuple xs v; |
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
80 |
|
42153 | 81 |
|
82 |
(* com_tr *) |
|
83 |
||
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
84 |
fun com_tr ctxt = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
85 |
let |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
86 |
fun tr (Const (\<^syntax_const>\<open>_assign\<close>, _) $ x $ e) xs = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
87 |
syntax_const ctxt #Basic $ mk_fexp x e xs |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
88 |
| tr (Const (\<^syntax_const>\<open>_Seq\<close>,_) $ c1 $ c2) xs = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
89 |
syntax_const ctxt #Seq $ tr c1 xs $ tr c2 xs |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
90 |
| tr (Const (\<^syntax_const>\<open>_Cond\<close>,_) $ b $ c1 $ c2) xs = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
91 |
syntax_const ctxt #Cond $ bexp_tr b xs $ tr c1 xs $ tr c2 xs |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
92 |
| tr (Const (\<^syntax_const>\<open>_While\<close>,_) $ b $ I $ V $ c) xs = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
93 |
syntax_const ctxt #While $ bexp_tr b xs $ assn_tr I xs $ var_tr V xs $ tr c xs |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
94 |
| tr t _ = t; |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
95 |
in tr end; |
42153 | 96 |
|
69597 | 97 |
fun vars_tr (Const (\<^syntax_const>\<open>_idts\<close>, _) $ idt $ vars) = idt :: vars_tr vars |
42153 | 98 |
| vars_tr t = [t]; |
99 |
||
100 |
in |
|
101 |
||
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
102 |
fun hoare_vars_tr ctxt [vars, pre, prg, post] = |
42153 | 103 |
let val xs = vars_tr vars |
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
104 |
in syntax_const ctxt #Valid $ assn_tr pre xs $ com_tr ctxt prg xs $ assn_tr post xs end |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
105 |
| hoare_vars_tr _ ts = raise TERM ("hoare_vars_tr", ts); |
42153 | 106 |
|
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
107 |
fun hoare_tc_vars_tr ctxt [vars, pre, prg, post] = |
72806
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
108 |
let val xs = vars_tr vars |
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
109 |
in syntax_const ctxt #ValidTC $ assn_tr pre xs $ com_tr ctxt prg xs $ assn_tr post xs end |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
110 |
| hoare_tc_vars_tr _ ts = raise TERM ("hoare_tc_vars_tr", ts); |
72806
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
111 |
|
42153 | 112 |
end; |
113 |
||
114 |
||
115 |
||
116 |
(** print translation **) |
|
117 |
||
118 |
local |
|
119 |
||
120 |
fun dest_abstuple |
|
69597 | 121 |
(Const (\<^const_syntax>\<open>case_prod\<close>, _) $ Abs (v, _, body)) = |
42153 | 122 |
subst_bound (Syntax.free v, dest_abstuple body) |
123 |
| dest_abstuple (Abs (v,_, body)) = subst_bound (Syntax.free v, body) |
|
124 |
| dest_abstuple tm = tm; |
|
125 |
||
69597 | 126 |
fun abs2list (Const (\<^const_syntax>\<open>case_prod\<close>, _) $ Abs (x, T, t)) = Free (x, T) :: abs2list t |
55659 | 127 |
| abs2list (Abs (x, T, _)) = [Free (x, T)] |
42153 | 128 |
| abs2list _ = []; |
129 |
||
69597 | 130 |
fun mk_ts (Const (\<^const_syntax>\<open>case_prod\<close>, _) $ Abs (_, _, t)) = mk_ts t |
55659 | 131 |
| mk_ts (Abs (_, _, t)) = mk_ts t |
69597 | 132 |
| mk_ts (Const (\<^const_syntax>\<open>Pair\<close>, _) $ a $ b) = a :: mk_ts b |
42153 | 133 |
| mk_ts t = [t]; |
134 |
||
69597 | 135 |
fun mk_vts (Const (\<^const_syntax>\<open>case_prod\<close>,_) $ Abs (x, _, t)) = |
42153 | 136 |
(Syntax.free x :: abs2list t, mk_ts t) |
137 |
| mk_vts (Abs (x, _, t)) = ([Syntax.free x], [t]) |
|
55659 | 138 |
| mk_vts _ = raise Match; |
42153 | 139 |
|
55659 | 140 |
fun find_ch [] _ _ = (false, (Syntax.free "not_ch", Syntax.free "not_ch")) (* FIXME no_ch!? *) |
42153 | 141 |
| find_ch ((v, t) :: vts) i xs = |
142 |
if t = Bound i then find_ch vts (i - 1) xs |
|
143 |
else (true, (v, subst_bounds (xs, t))); |
|
144 |
||
69597 | 145 |
fun is_f (Const (\<^const_syntax>\<open>case_prod\<close>, _) $ Abs _) = true |
55659 | 146 |
| is_f (Abs _) = true |
147 |
| is_f _ = false; |
|
42153 | 148 |
|
149 |
||
150 |
(* assn_tr' & bexp_tr'*) |
|
151 |
||
69597 | 152 |
fun assn_tr' (Const (\<^const_syntax>\<open>Collect\<close>, _) $ T) = dest_abstuple T |
153 |
| assn_tr' (Const (\<^const_syntax>\<open>inter\<close>, _) $ |
|
154 |
(Const (\<^const_syntax>\<open>Collect\<close>, _) $ T1) $ (Const (\<^const_syntax>\<open>Collect\<close>, _) $ T2)) = |
|
155 |
Syntax.const \<^const_syntax>\<open>inter\<close> $ dest_abstuple T1 $ dest_abstuple T2 |
|
42153 | 156 |
| assn_tr' t = t; |
157 |
||
69597 | 158 |
fun bexp_tr' (Const (\<^const_syntax>\<open>Collect\<close>, _) $ T) = dest_abstuple T |
42153 | 159 |
| bexp_tr' t = t; |
160 |
||
72806
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
161 |
fun var_tr' (Const (\<^const_syntax>\<open>Collect\<close>, _) $ T) = dest_abstuple T |
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
162 |
| var_tr' t = t; |
4fa08e083865
Extension of session HOL/Hoare with total correctness proof system by Walter Guttmann
nipkow
parents:
69597
diff
changeset
|
163 |
|
42153 | 164 |
|
165 |
(* com_tr' *) |
|
166 |
||
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
167 |
fun mk_assign ctxt f = |
42153 | 168 |
let |
169 |
val (vs, ts) = mk_vts f; |
|
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
170 |
val (ch, (a, b)) = find_ch (vs ~~ ts) (length vs - 1) (rev vs); |
42153 | 171 |
in |
172 |
if ch |
|
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
173 |
then Syntax.const \<^syntax_const>\<open>_assign\<close> $ a $ b |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
174 |
else syntax_const ctxt #Skip |
42153 | 175 |
end; |
176 |
||
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
177 |
fun com_tr' ctxt t = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
178 |
let |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
179 |
val (head, args) = apfst (try (#1 o Term.dest_Const)) (Term.strip_comb t); |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
180 |
fun arg k = nth args (k - 1); |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
181 |
val n = length args; |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
182 |
in |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
183 |
(case head of |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
184 |
NONE => t |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
185 |
| SOME c => |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
186 |
if c = const_syntax ctxt #Basic andalso n = 1 andalso is_f (arg 1) then |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
187 |
mk_assign ctxt (arg 1) |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
188 |
else if c = const_syntax ctxt #Seq andalso n = 2 then |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
189 |
Syntax.const \<^syntax_const>\<open>_Seq\<close> $ com_tr' ctxt (arg 1) $ com_tr' ctxt (arg 2) |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
190 |
else if c = const_syntax ctxt #Cond andalso n = 3 then |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
191 |
Syntax.const \<^syntax_const>\<open>_Cond\<close> $ |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
192 |
bexp_tr' (arg 1) $ com_tr' ctxt (arg 2) $ com_tr' ctxt (arg 3) |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
193 |
else if c = const_syntax ctxt #While andalso n = 4 then |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
194 |
Syntax.const \<^syntax_const>\<open>_While\<close> $ |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
195 |
bexp_tr' (arg 1) $ assn_tr' (arg 2) $ var_tr' (arg 3) $ com_tr' ctxt (arg 4) |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
196 |
else t) |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
197 |
end; |
42153 | 198 |
|
199 |
in |
|
200 |
||
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
201 |
fun spec_tr' syn ctxt [p, c, q] = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
202 |
Syntax.const syn $ assn_tr' p $ com_tr' ctxt c $ assn_tr' q; |
42153 | 203 |
|
204 |
end; |
|
205 |
||
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
206 |
|
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
207 |
(** setup **) |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
208 |
|
72998
7ea253f93606
more robust: clarified error when merging Hoare_Logic + Hoare_Logic_Abort;
wenzelm
parents:
72987
diff
changeset
|
209 |
val _ = |
7ea253f93606
more robust: clarified error when merging Hoare_Logic + Hoare_Logic_Abort;
wenzelm
parents:
72987
diff
changeset
|
210 |
Theory.setup |
7ea253f93606
more robust: clarified error when merging Hoare_Logic + Hoare_Logic_Abort;
wenzelm
parents:
72987
diff
changeset
|
211 |
(Sign.parse_translation |
7ea253f93606
more robust: clarified error when merging Hoare_Logic + Hoare_Logic_Abort;
wenzelm
parents:
72987
diff
changeset
|
212 |
[(\<^syntax_const>\<open>_hoare_vars\<close>, hoare_vars_tr), |
7ea253f93606
more robust: clarified error when merging Hoare_Logic + Hoare_Logic_Abort;
wenzelm
parents:
72987
diff
changeset
|
213 |
(\<^syntax_const>\<open>_hoare_vars_tc\<close>, hoare_tc_vars_tr)]); |
7ea253f93606
more robust: clarified error when merging Hoare_Logic + Hoare_Logic_Abort;
wenzelm
parents:
72987
diff
changeset
|
214 |
|
72987
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
215 |
fun setup consts = |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
216 |
Data.put (SOME consts) #> |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
217 |
Sign.print_translation |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
218 |
[(#Valid consts, spec_tr' \<^syntax_const>\<open>_hoare\<close>), |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
219 |
(#ValidTC consts, spec_tr' \<^syntax_const>\<open>_hoare_tc\<close>)]; |
b1be35908165
clarified modules: avoid multiple uses of the same ML file;
wenzelm
parents:
72806
diff
changeset
|
220 |
|
42153 | 221 |
end; |