54 include BASIC_DRULE |
54 include BASIC_DRULE |
55 val outer_params: term -> (string * typ) list |
55 val outer_params: term -> (string * typ) list |
56 val generalize: string list * string list -> thm -> thm |
56 val generalize: string list * string list -> thm -> thm |
57 val list_comb: cterm * cterm list -> cterm |
57 val list_comb: cterm * cterm list -> cterm |
58 val strip_comb: cterm -> cterm * cterm list |
58 val strip_comb: cterm -> cterm * cterm list |
59 val strip_type: ctyp -> ctyp list * ctyp |
|
60 val beta_conv: cterm -> cterm -> cterm |
59 val beta_conv: cterm -> cterm -> cterm |
61 val flexflex_unique: Proof.context option -> thm -> thm |
60 val flexflex_unique: Proof.context option -> thm -> thm |
62 val export_without_context: thm -> thm |
61 val export_without_context: thm -> thm |
63 val export_without_context_open: thm -> thm |
62 val export_without_context_open: thm -> thm |
64 val store_thm: binding -> thm -> thm |
63 val store_thm: binding -> thm -> thm |
153 fun stripc (p as (ct, cts)) = |
152 fun stripc (p as (ct, cts)) = |
154 let val (ct1, ct2) = Thm.dest_comb ct |
153 let val (ct1, ct2) = Thm.dest_comb ct |
155 in stripc (ct1, ct2 :: cts) end handle CTERM _ => p |
154 in stripc (ct1, ct2 :: cts) end handle CTERM _ => p |
156 in stripc (ct, []) end; |
155 in stripc (ct, []) end; |
157 |
156 |
158 (* cterm version of strip_type: maps [T1,...,Tn]--->T to ([T1,T2,...,Tn], T) *) |
|
159 fun strip_type cT = (case Thm.typ_of cT of |
|
160 Type ("fun", _) => |
|
161 let |
|
162 val [cT1, cT2] = Thm.dest_ctyp cT; |
|
163 val (cTs, cT') = strip_type cT2 |
|
164 in (cT1 :: cTs, cT') end |
|
165 | _ => ([], cT)); |
|
166 |
|
167 (*Beta-conversion for cterms, where x is an abstraction. Simply returns the rhs |
157 (*Beta-conversion for cterms, where x is an abstraction. Simply returns the rhs |
168 of the meta-equality returned by the beta_conversion rule.*) |
158 of the meta-equality returned by the beta_conversion rule.*) |
169 fun beta_conv x y = |
159 fun beta_conv x y = |
170 Thm.dest_arg (Thm.cprop_of (Thm.beta_conversion false (Thm.apply x y))); |
160 Thm.dest_arg (Thm.cprop_of (Thm.beta_conversion false (Thm.apply x y))); |
171 |
161 |