src/Pure/drule.ML
changeset 20227 435601e8e53d
parent 20077 4fc9a4fef219
child 20260 990dbc007ca6
equal deleted inserted replaced
20226:6ea469c03314 20227:435601e8e53d
    65   val symmetric_fun: thm -> thm
    65   val symmetric_fun: thm -> thm
    66   val extensional: thm -> thm
    66   val extensional: thm -> thm
    67   val equals_cong: thm
    67   val equals_cong: thm
    68   val imp_cong: thm
    68   val imp_cong: thm
    69   val swap_prems_eq: thm
    69   val swap_prems_eq: thm
    70   val equal_abs_elim: cterm  -> thm -> thm
       
    71   val equal_abs_elim_list: cterm list -> thm -> thm
       
    72   val asm_rl: thm
    70   val asm_rl: thm
    73   val cut_rl: thm
    71   val cut_rl: thm
    74   val revcut_rl: thm
    72   val revcut_rl: thm
    75   val thin_rl: thm
    73   val thin_rl: thm
    76   val triv_forall_equality: thm
    74   val triv_forall_equality: thm
   912            raise THM("cterm_instantiate: incompatible theories",0,[th])
   910            raise THM("cterm_instantiate: incompatible theories",0,[th])
   913        | TYPE (msg, _, _) => raise THM(msg, 0, [th])
   911        | TYPE (msg, _, _) => raise THM(msg, 0, [th])
   914 end;
   912 end;
   915 
   913 
   916 
   914 
   917 (** Derived rules mainly for METAHYPS **)
       
   918 
       
   919 (*Given the term "a", takes (%x.t)==(%x.u) to t[a/x]==u[a/x]*)
       
   920 fun equal_abs_elim ca eqth =
       
   921   let val {thy=thya, t=a, ...} = rep_cterm ca
       
   922       and combth = combination eqth (reflexive ca)
       
   923       val {thy,prop,...} = rep_thm eqth
       
   924       val (abst,absu) = Logic.dest_equals prop
       
   925       val cert = cterm_of (Theory.merge (thy,thya))
       
   926   in  transitive (symmetric (beta_conversion false (cert (abst$a))))
       
   927            (transitive combth (beta_conversion false (cert (absu$a))))
       
   928   end
       
   929   handle THM _ => raise THM("equal_abs_elim", 0, [eqth]);
       
   930 
       
   931 (*Calling equal_abs_elim with multiple terms*)
       
   932 fun equal_abs_elim_list cts th = foldr (uncurry equal_abs_elim) th (rev cts);
       
   933 
       
   934 
       
   935 (* global schematic variables *)
   915 (* global schematic variables *)
   936 
   916 
   937 fun unvarify th =
   917 fun unvarify th =
   938   let
   918   let
   939     val thy = Thm.theory_of_thm th;
   919     val thy = Thm.theory_of_thm th;