69 val nprems_of: thm -> int |
69 val nprems_of: thm -> int |
70 val no_prems: thm -> bool |
70 val no_prems: thm -> bool |
71 val major_prem_of: thm -> term |
71 val major_prem_of: thm -> term |
72 val cprop_of: thm -> cterm |
72 val cprop_of: thm -> cterm |
73 val cprem_of: thm -> int -> cterm |
73 val cprem_of: thm -> int -> cterm |
|
74 val cconcl_of: thm -> cterm |
|
75 val cprems_of: thm -> cterm list |
74 val chyps_of: thm -> cterm list |
76 val chyps_of: thm -> cterm list |
75 exception CONTEXT of string * ctyp list * cterm list * thm list * Context.generic option |
77 exception CONTEXT of string * ctyp list * cterm list * thm list * Context.generic option |
76 val theory_of_cterm: cterm -> theory |
78 val theory_of_cterm: cterm -> theory |
77 val theory_of_thm: thm -> theory |
79 val theory_of_thm: thm -> theory |
78 val trim_context_ctyp: ctyp -> ctyp |
80 val trim_context_ctyp: ctyp -> ctyp |
395 |
397 |
396 fun cprem_of (th as Thm (_, {cert, maxidx, shyps, prop, ...})) i = |
398 fun cprem_of (th as Thm (_, {cert, maxidx, shyps, prop, ...})) i = |
397 Cterm {cert = cert, maxidx = maxidx, T = propT, sorts = shyps, |
399 Cterm {cert = cert, maxidx = maxidx, T = propT, sorts = shyps, |
398 t = Logic.nth_prem (i, prop) handle TERM _ => raise THM ("cprem_of", i, [th])}; |
400 t = Logic.nth_prem (i, prop) handle TERM _ => raise THM ("cprem_of", i, [th])}; |
399 |
401 |
|
402 fun cconcl_of (th as Thm (_, {cert, maxidx, shyps, ...})) = |
|
403 Cterm {cert = cert, maxidx = maxidx, T = propT, sorts = shyps, t = concl_of th}; |
|
404 |
|
405 fun cprems_of (th as Thm (_, {cert, maxidx, shyps, ...})) = |
|
406 map (fn t => Cterm {cert = cert, maxidx = maxidx, T = propT, sorts = shyps, t = t}) |
|
407 (prems_of th); |
|
408 |
400 fun chyps_of (Thm (_, {cert, shyps, hyps, ...})) = |
409 fun chyps_of (Thm (_, {cert, shyps, hyps, ...})) = |
401 map (fn t => Cterm {cert = cert, maxidx = ~1, T = propT, sorts = shyps, t = t}) hyps; |
410 map (fn t => Cterm {cert = cert, maxidx = ~1, T = propT, sorts = shyps, t = t}) hyps; |
402 |
411 |
403 |
412 |
404 (* implicit theory context *) |
413 (* implicit theory context *) |