src/Pure/goal.ML
changeset 23536 60a1672e298e
parent 23418 c195f6f13769
child 25301 24e027f55f45
equal deleted inserted replaced
23535:58147e5bd070 23536:60a1672e298e
    30   val extract: int -> int -> thm -> thm Seq.seq
    30   val extract: int -> int -> thm -> thm Seq.seq
    31   val retrofit: int -> int -> thm -> thm -> thm Seq.seq
    31   val retrofit: int -> int -> thm -> thm -> thm Seq.seq
    32   val conjunction_tac: int -> tactic
    32   val conjunction_tac: int -> tactic
    33   val precise_conjunction_tac: int -> int -> tactic
    33   val precise_conjunction_tac: int -> int -> tactic
    34   val recover_conjunction_tac: tactic
    34   val recover_conjunction_tac: tactic
    35   val asm_rewrite_goal_tac: bool * bool * bool -> (simpset -> tactic) -> simpset -> int -> tactic
       
    36   val rewrite_goal_tac: thm list -> int -> tactic
       
    37   val norm_hhf_tac: int -> tactic
    35   val norm_hhf_tac: int -> tactic
    38   val compose_hhf: thm -> int -> thm -> thm Seq.seq
    36   val compose_hhf: thm -> int -> thm -> thm Seq.seq
    39   val compose_hhf_tac: thm -> int -> tactic
    37   val compose_hhf_tac: thm -> int -> tactic
    40   val comp_hhf: thm -> thm -> thm
    38   val comp_hhf: thm -> thm -> thm
    41   val assume_rule_tac: Proof.context -> int -> tactic
    39   val assume_rule_tac: Proof.context -> int -> tactic
   207   SELECT_GOAL (conjunction_tac 1
   205   SELECT_GOAL (conjunction_tac 1
   208     THEN tac
   206     THEN tac
   209     THEN recover_conjunction_tac);
   207     THEN recover_conjunction_tac);
   210 
   208 
   211 
   209 
   212 (* rewriting *)
       
   213 
       
   214 (*Rewrite subgoal i only.  SELECT_GOAL avoids inefficiencies in goals_conv.*)
       
   215 fun asm_rewrite_goal_tac mode prover_tac ss =
       
   216   SELECT_GOAL
       
   217     (PRIMITIVE (MetaSimplifier.rewrite_goal_rule mode (SINGLE o prover_tac) ss 1));
       
   218 
       
   219 fun rewrite_goal_tac rews =
       
   220   let val ss = MetaSimplifier.empty_ss addsimps rews in
       
   221     fn i => fn st => asm_rewrite_goal_tac (true, false, false) (K no_tac)
       
   222       (MetaSimplifier.theory_context (Thm.theory_of_thm st) ss) i st
       
   223   end;
       
   224 
       
   225 
       
   226 (* hhf normal form *)
   210 (* hhf normal form *)
   227 
   211 
   228 val norm_hhf_tac =
   212 val norm_hhf_tac =
   229   rtac Drule.asm_rl  (*cheap approximation -- thanks to builtin Logic.flatten_params*)
   213   rtac Drule.asm_rl  (*cheap approximation -- thanks to builtin Logic.flatten_params*)
   230   THEN' SUBGOAL (fn (t, i) =>
   214   THEN' SUBGOAL (fn (t, i) =>
   231     if Drule.is_norm_hhf t then all_tac
   215     if Drule.is_norm_hhf t then all_tac
   232     else rewrite_goal_tac [Drule.norm_hhf_eq] i);
   216     else MetaSimplifier.rewrite_goal_tac [Drule.norm_hhf_eq] i);
   233 
   217 
   234 fun compose_hhf tha i thb =
   218 fun compose_hhf tha i thb =
   235   Thm.bicompose false (false, Drule.lift_all (Thm.cprem_of thb i) tha, 0) i thb;
   219   Thm.bicompose false (false, Drule.lift_all (Thm.cprem_of thb i) tha, 0) i thb;
   236 
   220 
   237 fun compose_hhf_tac th i = PRIMSEQ (compose_hhf th i);
   221 fun compose_hhf_tac th i = PRIMSEQ (compose_hhf th i);