@@ -38,6 +38,8 @@ val lens_defsN = "lens_defs"
38
38
val lens_defs = (Binding.empty, [Token.make_src (lens_defsN, Position.none) []])
39
39
val alpha_splitsN = " alpha_splits"
40
40
val alpha_splits = [Token.make_src (alpha_splitsN, Position.none) []]
41
+ val alpha_defsN = " alpha_defs"
42
+ val alpha_defs = (Binding.empty, [Token.make_src (alpha_defsN, Position.none) []])
41
43
val equivN = " equivs"
42
44
val splits_suffix = " .splits"
43
45
val defs_suffix = " .defs"
@@ -102,7 +104,7 @@ fun lens_sym_proof tname thy =
102
104
103
105
fun prove_lens_goal tname thy ctx =
104
106
let open Simplifier; open Global_Theory in
105
- auto_tac (fold add_simp (get_thms thy lens_defsN @
107
+ auto_tac (fold add_simp (get_thms thy lens_defsN @ get_thms thy alpha_defsN @
106
108
get_thms thy (tname ^ splits_suffix) @
107
109
[@{thm prod.case_eq_if}]) ctx)
108
110
end
@@ -148,7 +150,7 @@ fun lens_bij_proof tname thy =
148
150
$ const (Context.theory_name {long = false } thy ^ " ." ^ tname ^ " ." ^ child_lensN)))]))
149
151
(fn {context = context, prems = _}
150
152
=> EVERY [ Locale.intro_locales_tac {strict = true , eager = true } context []
151
- , auto_tac (fold add_simp (get_thms thy lens_defsN @ [@{thm prod.case_eq_if}])
153
+ , auto_tac (fold add_simp (get_thms thy lens_defsN @ get_thms thy alpha_defsN @ [@{thm prod.case_eq_if}])
152
154
context)])
153
155
end
154
156
@@ -227,7 +229,7 @@ fun lenses_bij_proof tname parent thy fs =
227
229
]))
228
230
(fn {context = context, prems = _}
229
231
=> EVERY [ Locale.intro_locales_tac {strict = true , eager = true } context []
230
- , auto_tac (fold add_simp (get_thms thy lens_defsN @ [@{thm prod.case_eq_if}])
232
+ , auto_tac (fold add_simp (get_thms thy lens_defsN @ get_thms thy alpha_defsN @ [@{thm prod.case_eq_if}])
231
233
context)])
232
234
end
233
235
@@ -323,8 +325,8 @@ fun add_alphabet (params, binding) raw_parent ty_fields thy =
323
325
val attrs = map (Attrib.attribute (Named_Target.theory_init thy)) @{attributes [simp, code_unfold, lens]}
324
326
in thy (* Add a new record for the new alphabet lenses *)
325
327
|> add_record_cmd {overloaded = false } (params, binding) raw_parent fields
326
- (* Add the record definition theorems to lens_defs *)
327
- |> Named_Target.theory_map (snd o Specification.theorems_cmd " " [((Binding.empty, []), [(Facts.named (tname ^ defs_suffix), snd lens_defs )])] [] false )
328
+ (* Add the record definition theorems to alpha_defs *)
329
+ |> Named_Target.theory_map (snd o Specification.theorems_cmd " " [((Binding.empty, []), [(Facts.named (tname ^ defs_suffix), snd alpha_defs )])] [] false )
328
330
(* Add the record splitting theorems to the alpha_splits set for proof automation *)
329
331
|> Named_Target.theory_map (snd o Specification.theorems_cmd " " [((Binding.empty, []), [(Facts.named (tname ^ splits_suffix), alpha_splits)])] [] false )
330
332
(* Reorder parent splitting theorems, so the child ones have higher priority *)
@@ -340,7 +342,7 @@ fun add_alphabet (params, binding) raw_parent ty_fields thy =
340
342
(* Add definitions for each of the lenses corresponding to each record field in-situ *)
341
343
|> Sign.qualified_path false binding
342
344
|> Named_Target.theory_map
343
- (fold (fn (n, d) => snd o Specification.definition_cmd (SOME (Binding.make (n, Position.none), NONE , NoSyn)) [] [] (lens_defs , d) true ) (map ldef lnames @ [bldef, mldef]))
345
+ (fold (fn (n, d) => snd o Specification.definition_cmd (SOME (Binding.make (n, Position.none), NONE , NoSyn)) [] [] (alpha_defs , d) true ) (map ldef lnames @ [bldef, mldef]))
344
346
(* Add definition of the underlying symmetric lens *)
345
347
|> Named_Target.theory_map
346
348
(fold (fn (n, d) => Specification.abbreviation_cmd Syntax.mode_default (SOME (Binding.make (n, Position.none), NONE , NoSyn)) [] d true ) [sldef])
0 commit comments