equal
deleted
inserted
replaced
98 fun create_nom_typedecls ak_names thy = |
98 fun create_nom_typedecls ak_names thy = |
99 let |
99 let |
100 |
100 |
101 val (_,thy1) = |
101 val (_,thy1) = |
102 fold_map (fn ak => fn thy => |
102 fold_map (fn ak => fn thy => |
103 let val dt = ([],ak,NoSyn,[(ak,[@{typ nat}],NoSyn)]) |
103 let val dt = ([], Binding.name ak, NoSyn, [(Binding.name ak, [@{typ nat}], NoSyn)]) |
104 val ({inject,case_thms,...},thy1) = DatatypePackage.add_datatype true false [ak] [dt] thy |
104 val ({inject,case_thms,...},thy1) = DatatypePackage.add_datatype true false [ak] [dt] thy |
105 val inject_flat = Library.flat inject |
105 val inject_flat = Library.flat inject |
106 val ak_type = Type (Sign.intern_type thy1 ak,[]) |
106 val ak_type = Type (Sign.intern_type thy1 ak,[]) |
107 val ak_sign = Sign.intern_const thy1 ak |
107 val ak_sign = Sign.intern_const thy1 ak |
108 |
108 |
185 val def1 = HOLogic.mk_Trueprop (HOLogic.mk_eq |
185 val def1 = HOLogic.mk_Trueprop (HOLogic.mk_eq |
186 (cswap_akname $ HOLogic.mk_prod (a,b) $ c, |
186 (cswap_akname $ HOLogic.mk_prod (a,b) $ c, |
187 cif $ HOLogic.mk_eq (a,c) $ b $ (cif $ HOLogic.mk_eq (b,c) $ a $ c))) |
187 cif $ HOLogic.mk_eq (a,c) $ b $ (cif $ HOLogic.mk_eq (b,c) $ a $ c))) |
188 val def2 = Logic.mk_equals (cswap $ ab $ c, cswap_akname $ ab $ c) |
188 val def2 = Logic.mk_equals (cswap $ ab $ c, cswap_akname $ ab $ c) |
189 in |
189 in |
190 thy |> Sign.add_consts_i [("swap_" ^ ak_name, swapT, NoSyn)] |
190 thy |> Sign.add_consts_i [(Binding.name ("swap_" ^ ak_name), swapT, NoSyn)] |
191 |> PureThy.add_defs_unchecked true [((Binding.name name, def2),[])] |
191 |> PureThy.add_defs_unchecked true [((Binding.name name, def2),[])] |
192 |> snd |
192 |> snd |
193 |> OldPrimrecPackage.add_primrec_unchecked_i "" [(("", def1),[])] |
193 |> OldPrimrecPackage.add_primrec_unchecked_i "" [(("", def1),[])] |
194 end) ak_names_types thy1; |
194 end) ak_names_types thy1; |
195 |
195 |
215 |
215 |
216 val def2 = HOLogic.mk_Trueprop (HOLogic.mk_eq |
216 val def2 = HOLogic.mk_Trueprop (HOLogic.mk_eq |
217 (Const (qu_prm_name, prmT) $ mk_Cons x xs $ a, |
217 (Const (qu_prm_name, prmT) $ mk_Cons x xs $ a, |
218 Const (swap_name, swapT) $ x $ (Const (qu_prm_name, prmT) $ xs $ a))); |
218 Const (swap_name, swapT) $ x $ (Const (qu_prm_name, prmT) $ xs $ a))); |
219 in |
219 in |
220 thy |> Sign.add_consts_i [(prm_name, mk_permT T --> T --> T, NoSyn)] |
220 thy |> Sign.add_consts_i [(Binding.name prm_name, mk_permT T --> T --> T, NoSyn)] |
221 |> OldPrimrecPackage.add_primrec_unchecked_i "" [(("", def1), []),(("", def2), [])] |
221 |> OldPrimrecPackage.add_primrec_unchecked_i "" [(("", def1), []),(("", def2), [])] |
222 end) ak_names_types thy3; |
222 end) ak_names_types thy3; |
223 |
223 |
224 (* defines permutation functions for all combinations of atom-kinds; *) |
224 (* defines permutation functions for all combinations of atom-kinds; *) |
225 (* there are a trivial cases and non-trivial cases *) |
225 (* there are a trivial cases and non-trivial cases *) |
298 (* perm-eq axiom *) |
298 (* perm-eq axiom *) |
299 val axiom3 = Logic.mk_implies |
299 val axiom3 = Logic.mk_implies |
300 (HOLogic.mk_Trueprop (cprm_eq $ pi1 $ pi2), |
300 (HOLogic.mk_Trueprop (cprm_eq $ pi1 $ pi2), |
301 HOLogic.mk_Trueprop (HOLogic.mk_eq (cperm $ pi1 $ x, cperm $ pi2 $ x))); |
301 HOLogic.mk_Trueprop (HOLogic.mk_eq (cperm $ pi1 $ x, cperm $ pi2 $ x))); |
302 in |
302 in |
303 AxClass.define_class (cl_name, ["HOL.type"]) [] |
303 AxClass.define_class (Binding.name cl_name, ["HOL.type"]) [] |
304 [((Binding.name (cl_name ^ "1"), [Simplifier.simp_add]), [axiom1]), |
304 [((Binding.name (cl_name ^ "1"), [Simplifier.simp_add]), [axiom1]), |
305 ((Binding.name (cl_name ^ "2"), []), [axiom2]), |
305 ((Binding.name (cl_name ^ "2"), []), [axiom2]), |
306 ((Binding.name (cl_name ^ "3"), []), [axiom3])] thy |
306 ((Binding.name (cl_name ^ "3"), []), [axiom3])] thy |
307 end) ak_names_types thy6; |
307 end) ak_names_types thy6; |
308 |
308 |
347 val cfinite = Const ("Finite_Set.finite", HOLogic.mk_setT T --> HOLogic.boolT) |
347 val cfinite = Const ("Finite_Set.finite", HOLogic.mk_setT T --> HOLogic.boolT) |
348 |
348 |
349 val axiom1 = HOLogic.mk_Trueprop (cfinite $ (csupp $ x)); |
349 val axiom1 = HOLogic.mk_Trueprop (cfinite $ (csupp $ x)); |
350 |
350 |
351 in |
351 in |
352 AxClass.define_class (cl_name, [pt_name]) [] [((Binding.name (cl_name ^ "1"), []), [axiom1])] thy |
352 AxClass.define_class (Binding.name cl_name, [pt_name]) [] |
|
353 [((Binding.name (cl_name ^ "1"), []), [axiom1])] thy |
353 end) ak_names_types thy8; |
354 end) ak_names_types thy8; |
354 |
355 |
355 (* proves that every fs_<ak>-type together with <ak>-type *) |
356 (* proves that every fs_<ak>-type together with <ak>-type *) |
356 (* instance of fs-type *) |
357 (* instance of fs-type *) |
357 (* lemma abst_<ak>_inst: *) |
358 (* lemma abst_<ak>_inst: *) |
396 |
397 |
397 val ax1 = HOLogic.mk_Trueprop |
398 val ax1 = HOLogic.mk_Trueprop |
398 (HOLogic.mk_eq (cperm1 $ pi1 $ (cperm2 $ pi2 $ x), |
399 (HOLogic.mk_eq (cperm1 $ pi1 $ (cperm2 $ pi2 $ x), |
399 cperm2 $ (cperm3 $ pi1 $ pi2) $ (cperm1 $ pi1 $ x))); |
400 cperm2 $ (cperm3 $ pi1 $ pi2) $ (cperm1 $ pi1 $ x))); |
400 in |
401 in |
401 AxClass.define_class (cl_name, ["HOL.type"]) [] |
402 AxClass.define_class (Binding.name cl_name, ["HOL.type"]) [] |
402 [((Binding.name (cl_name ^ "1"), []), [ax1])] thy' |
403 [((Binding.name (cl_name ^ "1"), []), [ax1])] thy' |
403 end) ak_names_types thy) ak_names_types thy12; |
404 end) ak_names_types thy) ak_names_types thy12; |
404 |
405 |
405 (* proves for every <ak>-combination a cp_<ak1>_<ak2>_inst theorem; *) |
406 (* proves for every <ak>-combination a cp_<ak1>_<ak2>_inst theorem; *) |
406 (* lemma cp_<ak1>_<ak2>_inst: *) |
407 (* lemma cp_<ak1>_<ak2>_inst: *) |