src/Pure/thm.ML
changeset 18145 6757627acf59
parent 18127 9f03d8a9a81b
child 18184 43c4589a9a78
equal deleted inserted replaced
18144:4edcb5fdc3b0 18145:6757627acf59
    81   val tpairs_of: thm -> (term * term) list
    81   val tpairs_of: thm -> (term * term) list
    82   val concl_of: thm -> term
    82   val concl_of: thm -> term
    83   val prems_of: thm -> term list
    83   val prems_of: thm -> term list
    84   val nprems_of: thm -> int
    84   val nprems_of: thm -> int
    85   val cprop_of: thm -> cterm
    85   val cprop_of: thm -> cterm
    86   val cgoal_of: thm -> int -> cterm
    86   val cprem_of: thm -> int -> cterm
    87   val transfer: theory -> thm -> thm
    87   val transfer: theory -> thm -> thm
    88   val weaken: cterm -> thm -> thm
    88   val weaken: cterm -> thm -> thm
    89   val extra_shyps: thm -> sort list
    89   val extra_shyps: thm -> sort list
    90   val strip_shyps: thm -> thm
    90   val strip_shyps: thm -> thm
    91   val get_axiom_i: theory -> string -> thm
    91   val get_axiom_i: theory -> string -> thm
   449 
   449 
   450 (*the statement of any thm is a cterm*)
   450 (*the statement of any thm is a cterm*)
   451 fun cprop_of (Thm {thy_ref, maxidx, shyps, prop, ...}) =
   451 fun cprop_of (Thm {thy_ref, maxidx, shyps, prop, ...}) =
   452   Cterm {thy_ref = thy_ref, maxidx = maxidx, T = propT, t = prop, sorts = shyps};
   452   Cterm {thy_ref = thy_ref, maxidx = maxidx, T = propT, t = prop, sorts = shyps};
   453 
   453 
   454 fun cgoal_of (th as Thm {thy_ref, maxidx, shyps, prop, ...}) i =
   454 fun cprem_of (th as Thm {thy_ref, maxidx, shyps, prop, ...}) i =
   455   Cterm {thy_ref = thy_ref, maxidx = maxidx, T = propT, sorts = shyps,
   455   Cterm {thy_ref = thy_ref, maxidx = maxidx, T = propT, sorts = shyps,
   456     t = Logic.nth_prem (i, prop) handle TERM _ => raise THM ("cgoal_of", i, [th])};
   456     t = Logic.nth_prem (i, prop) handle TERM _ => raise THM ("cprem_of", i, [th])};
   457 
   457 
   458 (*explicit transfer to a super theory*)
   458 (*explicit transfer to a super theory*)
   459 fun transfer thy' thm =
   459 fun transfer thy' thm =
   460   let
   460   let
   461     val Thm {thy_ref, der, maxidx, shyps, hyps, tpairs, prop} = thm;
   461     val Thm {thy_ref, der, maxidx, shyps, hyps, tpairs, prop} = thm;
  1470 
  1470 
  1471 (*Bi-resolution of a state with a list of (flag,rule) pairs.
  1471 (*Bi-resolution of a state with a list of (flag,rule) pairs.
  1472   Puts the rule above:  rule/state.  Renames vars in the rules. *)
  1472   Puts the rule above:  rule/state.  Renames vars in the rules. *)
  1473 fun biresolution match brules i state =
  1473 fun biresolution match brules i state =
  1474     let val (stpairs, Bs, Bi, C) = dest_state(state,i);
  1474     let val (stpairs, Bs, Bi, C) = dest_state(state,i);
  1475         val lift = lift_rule (cgoal_of state i);
  1475         val lift = lift_rule (cprem_of state i);
  1476         val B = Logic.strip_assums_concl Bi;
  1476         val B = Logic.strip_assums_concl Bi;
  1477         val Hs = Logic.strip_assums_hyp Bi;
  1477         val Hs = Logic.strip_assums_hyp Bi;
  1478         val comp = bicompose_aux match (state, (stpairs, Bs, Bi, C), true);
  1478         val comp = bicompose_aux match (state, (stpairs, Bs, Bi, C), true);
  1479         fun res [] = Seq.empty
  1479         fun res [] = Seq.empty
  1480           | res ((eres_flg, rule)::brules) =
  1480           | res ((eres_flg, rule)::brules) =