equal
deleted
inserted
replaced
180 end; |
180 end; |
181 |
181 |
182 signature THM = |
182 signature THM = |
183 sig |
183 sig |
184 include BASIC_THM |
184 include BASIC_THM |
|
185 val no_prems : thm -> bool |
185 val no_attributes : 'a -> 'a * 'b attribute list |
186 val no_attributes : 'a -> 'a * 'b attribute list |
186 val apply_attributes : ('a * thm) * 'a attribute list -> ('a * thm) |
187 val apply_attributes : ('a * thm) * 'a attribute list -> ('a * thm) |
187 val applys_attributes : ('a * thm list) * 'a attribute list -> ('a * thm list) |
188 val applys_attributes : ('a * thm list) * 'a attribute list -> ('a * thm list) |
188 val get_name_tags : thm -> string * tag list |
189 val get_name_tags : thm -> string * tag list |
189 val put_name_tags : string * tag list -> thm -> thm |
190 val put_name_tags : string * tag list -> thm -> thm |
475 Logic.strip_imp_prems (Logic.skip_flexpairs prop); |
476 Logic.strip_imp_prems (Logic.skip_flexpairs prop); |
476 |
477 |
477 (*counts premises in a rule*) |
478 (*counts premises in a rule*) |
478 fun nprems_of (Thm {prop, ...}) = |
479 fun nprems_of (Thm {prop, ...}) = |
479 Logic.count_prems (Logic.skip_flexpairs prop, 0); |
480 Logic.count_prems (Logic.skip_flexpairs prop, 0); |
|
481 |
|
482 fun no_prems thm = nprems_of thm = 0; |
480 |
483 |
481 (*maps object-rule to conclusion*) |
484 (*maps object-rule to conclusion*) |
482 fun concl_of (Thm {prop, ...}) = Logic.strip_imp_concl prop; |
485 fun concl_of (Thm {prop, ...}) = Logic.strip_imp_concl prop; |
483 |
486 |
484 (*the statement of any thm is a cterm*) |
487 (*the statement of any thm is a cterm*) |
2253 in mut_impc1(prems, prem1, conc, mss, etc1) end |
2256 in mut_impc1(prems, prem1, conc, mss, etc1) end |
2254 |
2257 |
2255 and mut_impc1(prems, prem1, conc, mss, etc1 as (_,hyps1,_)) = |
2258 and mut_impc1(prems, prem1, conc, mss, etc1 as (_,hyps1,_)) = |
2256 let |
2259 let |
2257 fun uncond({thm,lhs,elhs,perm}) = |
2260 fun uncond({thm,lhs,elhs,perm}) = |
2258 if nprems_of thm = 0 then Some lhs else None |
2261 if no_prems thm then Some lhs else None |
2259 |
2262 |
2260 val (lhss1,mss1) = |
2263 val (lhss1,mss1) = |
2261 if maxidx_of_term prem1 <> ~1 |
2264 if maxidx_of_term prem1 <> ~1 |
2262 then (trace_term true "Cannot add premise as rewrite rule because it contains (type) unknowns:" |
2265 then (trace_term true "Cannot add premise as rewrite rule because it contains (type) unknowns:" |
2263 (Sign.deref sign_ref) prem1; |
2266 (Sign.deref sign_ref) prem1; |