equal
deleted
inserted
replaced
18 val prove_casedist_thms : config -> string list -> |
18 val prove_casedist_thms : config -> string list -> |
19 descr list -> (string * sort) list -> thm -> |
19 descr list -> (string * sort) list -> thm -> |
20 attribute list -> theory -> thm list * theory |
20 attribute list -> theory -> thm list * theory |
21 val prove_primrec_thms : config -> string list -> |
21 val prove_primrec_thms : config -> string list -> |
22 descr list -> (string * sort) list -> |
22 descr list -> (string * sort) list -> |
23 (string -> thm list) -> thm list list -> thm list list -> |
23 (string -> thm list) -> thm list list -> thm list list * thm list list -> |
24 simpset -> thm -> theory -> (string list * thm list) * theory |
24 thm -> theory -> (string list * thm list) * theory |
25 val prove_case_thms : config -> string list -> |
25 val prove_case_thms : config -> string list -> |
26 descr list -> (string * sort) list -> |
26 descr list -> (string * sort) list -> |
27 string list -> thm list -> theory -> (thm list list * string list) * theory |
27 string list -> thm list -> theory -> (thm list list * string list) * theory |
28 val prove_split_thms : config -> string list -> |
28 val prove_split_thms : config -> string list -> |
29 descr list -> (string * sort) list -> |
29 descr list -> (string * sort) list -> |
86 |
86 |
87 |
87 |
88 (*************************** primrec combinators ******************************) |
88 (*************************** primrec combinators ******************************) |
89 |
89 |
90 fun prove_primrec_thms (config : config) new_type_names descr sorts |
90 fun prove_primrec_thms (config : config) new_type_names descr sorts |
91 injects_of constr_inject dist_rewrites dist_ss induct thy = |
91 injects_of constr_inject (dist_rewrites, other_dist_rewrites) induct thy = |
92 let |
92 let |
93 val _ = message config "Constructing primrec combinators ..."; |
93 val _ = message config "Constructing primrec combinators ..."; |
94 |
94 |
95 val big_name = space_implode "_" new_type_names; |
95 val big_name = space_implode "_" new_type_names; |
96 val thy0 = Sign.add_path big_name thy; |
96 val thy0 = Sign.add_path big_name thy; |
168 fun mk_unique_tac ((((i, (tname, _, constrs)), elim), T), T') (tac, intrs) = |
168 fun mk_unique_tac ((((i, (tname, _, constrs)), elim), T), T') (tac, intrs) = |
169 let |
169 let |
170 val distinct_tac = |
170 val distinct_tac = |
171 (if i < length newTs then |
171 (if i < length newTs then |
172 full_simp_tac (HOL_ss addsimps (nth dist_rewrites i)) 1 |
172 full_simp_tac (HOL_ss addsimps (nth dist_rewrites i)) 1 |
173 else full_simp_tac dist_ss 1); |
173 else full_simp_tac (HOL_ss addsimps (flat other_dist_rewrites)) 1); |
174 |
174 |
175 val inject = map (fn r => r RS iffD1) |
175 val inject = map (fn r => r RS iffD1) |
176 (if i < length newTs then nth constr_inject i |
176 (if i < length newTs then nth constr_inject i |
177 else injects_of tname); |
177 else injects_of tname); |
178 |
178 |