src/Pure/goal.ML
changeset 23237 ac9d126456e1
parent 22902 ac833b4bb7ee
child 23356 dbe3731241c3
equal deleted inserted replaced
23236:91d71bde1112 23237:ac9d126456e1
    35   val rewrite_goal_tac: thm list -> int -> tactic
    35   val rewrite_goal_tac: thm list -> int -> tactic
    36   val norm_hhf_tac: int -> tactic
    36   val norm_hhf_tac: int -> tactic
    37   val compose_hhf: thm -> int -> thm -> thm Seq.seq
    37   val compose_hhf: thm -> int -> thm -> thm Seq.seq
    38   val compose_hhf_tac: thm -> int -> tactic
    38   val compose_hhf_tac: thm -> int -> tactic
    39   val comp_hhf: thm -> thm -> thm
    39   val comp_hhf: thm -> thm -> thm
       
    40   val assume_rule_tac: Proof.context -> int -> tactic
    40 end;
    41 end;
    41 
    42 
    42 structure Goal: GOAL =
    43 structure Goal: GOAL =
    43 struct
    44 struct
    44 
    45 
   234   (case Seq.chop 2 (compose_hhf tha 1 thb) of
   235   (case Seq.chop 2 (compose_hhf tha 1 thb) of
   235     ([th], _) => th
   236     ([th], _) => th
   236   | ([], _) => raise THM ("comp_hhf: no unifiers", 1, [tha, thb])
   237   | ([], _) => raise THM ("comp_hhf: no unifiers", 1, [tha, thb])
   237   | _  => raise THM ("comp_hhf: multiple unifiers", 1, [tha, thb]));
   238   | _  => raise THM ("comp_hhf: multiple unifiers", 1, [tha, thb]));
   238 
   239 
       
   240 
       
   241 (* non-atomic goal assumptions *)
       
   242 
       
   243 fun assume_rule_tac ctxt = norm_hhf_tac THEN' CSUBGOAL (fn (goal, i) =>
       
   244   let
       
   245     val ((_, goal'), ctxt') = Variable.focus goal ctxt;
       
   246     val goal'' = Drule.cterm_rule (singleton (Variable.export ctxt' ctxt)) goal';
       
   247     val Rs = filter_out (Logic.is_atomic o Thm.term_of) (Drule.strip_imp_prems goal'');
       
   248     val tacs = Rs |> map (fn R =>
       
   249       Tactic.etac (MetaSimplifier.norm_hhf (Thm.trivial R)) THEN_ALL_NEW assume_tac);
       
   250   in fold_rev (curry op APPEND') tacs (K no_tac) i end);
       
   251 
   239 end;
   252 end;
   240 
   253 
   241 structure BasicGoal: BASIC_GOAL = Goal;
   254 structure BasicGoal: BASIC_GOAL = Goal;
   242 open BasicGoal;
   255 open BasicGoal;