src/HOL/Tools/transfer.ML
changeset 49625 06cf80661e7a
parent 48066 c6783c9b87bf
child 49975 faf4afed009f
equal deleted inserted replaced
49624:9d34cfe1dbdf 49625:06cf80661e7a
     6 
     6 
     7 signature TRANSFER =
     7 signature TRANSFER =
     8 sig
     8 sig
     9   val prep_conv: conv
     9   val prep_conv: conv
    10   val get_relator_eq: Proof.context -> thm list
    10   val get_relator_eq: Proof.context -> thm list
       
    11   val get_sym_relator_eq: Proof.context -> thm list
    11   val transfer_add: attribute
    12   val transfer_add: attribute
    12   val transfer_del: attribute
    13   val transfer_del: attribute
    13   val transfer_rule_of_term: Proof.context -> term -> thm
    14   val transfer_rule_of_term: Proof.context -> term -> thm
    14   val transfer_tac: bool -> Proof.context -> int -> tactic
    15   val transfer_tac: bool -> Proof.context -> int -> tactic
    15   val transfer_prover_tac: Proof.context -> int -> tactic
    16   val transfer_prover_tac: Proof.context -> int -> tactic
    45       relator_eq = Item_Net.merge (r1, r2) }
    46       relator_eq = Item_Net.merge (r1, r2) }
    46 )
    47 )
    47 
    48 
    48 fun get_relator_eq ctxt = ctxt
    49 fun get_relator_eq ctxt = ctxt
    49   |> (Item_Net.content o #relator_eq o Data.get o Context.Proof)
    50   |> (Item_Net.content o #relator_eq o Data.get o Context.Proof)
    50   |> map (Thm.symmetric o mk_meta_eq)
    51   |> map safe_mk_meta_eq
       
    52 
       
    53 fun get_sym_relator_eq ctxt = ctxt
       
    54   |> (Item_Net.content o #relator_eq o Data.get o Context.Proof)
       
    55   |> map (Thm.symmetric o safe_mk_meta_eq)
    51 
    56 
    52 fun get_transfer_raw ctxt = ctxt
    57 fun get_transfer_raw ctxt = ctxt
    53   |> (Item_Net.content o #transfer_raw o Data.get o Context.Proof)
    58   |> (Item_Net.content o #transfer_raw o Data.get o Context.Proof)
    54 
    59 
    55 fun get_known_frees ctxt = ctxt
    60 fun get_known_frees ctxt = ctxt
   128 (* Tactic to correspond a value to itself *)
   133 (* Tactic to correspond a value to itself *)
   129 fun eq_tac ctxt = SUBGOAL (fn (t, i) =>
   134 fun eq_tac ctxt = SUBGOAL (fn (t, i) =>
   130   let
   135   let
   131     val T = RelT (HOLogic.dest_Trueprop (Logic.strip_assums_concl t))
   136     val T = RelT (HOLogic.dest_Trueprop (Logic.strip_assums_concl t))
   132     val cT = ctyp_of (Proof_Context.theory_of ctxt) T
   137     val cT = ctyp_of (Proof_Context.theory_of ctxt) T
   133     val rews = get_relator_eq ctxt
   138     val rews = get_sym_relator_eq ctxt
   134     val thm1 = Drule.instantiate' [SOME cT] [] @{thm Rel_eq_refl}
   139     val thm1 = Drule.instantiate' [SOME cT] [] @{thm Rel_eq_refl}
   135     val thm2 = Raw_Simplifier.rewrite_rule rews thm1
   140     val thm2 = Raw_Simplifier.rewrite_rule rews thm1
   136   in
   141   in
   137     rtac thm2 i
   142     rtac thm2 i
   138   end handle Match => no_tac | TERM _ => no_tac)
   143   end handle Match => no_tac | TERM _ => no_tac)