src/Pure/Isar/method.ML
changeset 8335 4c117393e4e6
parent 8329 8308b7a152a3
child 8351 1b8ac0f48233
equal deleted inserted replaced
8334:7896bcbd8641 8335:4c117393e4e6
    35   val insert_facts: Proof.method
    35   val insert_facts: Proof.method
    36   val unfold: thm list -> Proof.method
    36   val unfold: thm list -> Proof.method
    37   val fold: thm list -> Proof.method
    37   val fold: thm list -> Proof.method
    38   val multi_resolve: thm list -> thm -> thm Seq.seq
    38   val multi_resolve: thm list -> thm -> thm Seq.seq
    39   val multi_resolves: thm list -> thm list -> thm Seq.seq
    39   val multi_resolves: thm list -> thm list -> thm Seq.seq
       
    40   val multi_resolveq: thm list -> thm Seq.seq -> thm Seq.seq
       
    41   val resolveq_tac: thm Seq.seq -> int -> tactic
    40   val rule_tac: thm list -> thm list -> int -> tactic
    42   val rule_tac: thm list -> thm list -> int -> tactic
    41   val rule: thm list -> Proof.method
    43   val rule: thm list -> Proof.method
    42   val erule: thm list -> Proof.method
    44   val erule: thm list -> Proof.method
    43   val drule: thm list -> Proof.method
    45   val drule: thm list -> Proof.method
    44   val frule: thm list -> Proof.method
    46   val frule: thm list -> Proof.method
   243   | multi_res i (th :: ths) rule = Seq.flat (Seq.map (res th i) (multi_res (i + 1) ths rule));
   245   | multi_res i (th :: ths) rule = Seq.flat (Seq.map (res th i) (multi_res (i + 1) ths rule));
   244 
   246 
   245 in
   247 in
   246 
   248 
   247 val multi_resolve = multi_res 1;
   249 val multi_resolve = multi_res 1;
   248 fun multi_resolves facts rules = Seq.flat (Seq.map (multi_resolve facts) (Seq.of_list rules));
   250 fun multi_resolveq facts rules = Seq.flat (Seq.map (multi_resolve facts) rules);
       
   251 fun multi_resolves facts = multi_resolveq facts o Seq.of_list;
   249 
   252 
   250 end;
   253 end;
   251 
   254 
   252 
   255 
   253 (* rule *)
   256 (* rule *)
   254 
   257 
       
   258 fun gen_resolveq_tac tac rules i st =
       
   259   Seq.flat (Seq.map (fn rule => tac [rule] i st) rules);
       
   260 
       
   261 val resolveq_tac = gen_resolveq_tac Tactic.resolve_tac;
       
   262 
       
   263 
   255 local
   264 local
   256 
   265 
   257 fun gen_rule_tac tac rules [] = tac rules
   266 fun gen_rule_tac tac rules [] = tac rules
   258   | gen_rule_tac tac erules facts =
   267   | gen_rule_tac tac erules facts = gen_resolveq_tac tac (multi_resolves facts erules);
   259       let
       
   260         val rules = multi_resolves facts erules;
       
   261         fun tactic i state = Seq.flat (Seq.map (fn rule => tac [rule] i state) rules);
       
   262       in tactic end;
       
   263 
   268 
   264 fun gen_rule tac rules = METHOD (FINDGOAL o tac rules);
   269 fun gen_rule tac rules = METHOD (FINDGOAL o tac rules);
   265 
   270 
   266 fun gen_rule' tac arg_rules ctxt = METHOD (fn facts =>
   271 fun gen_rule' tac arg_rules ctxt = METHOD (fn facts =>
   267   let val rules =
   272   let val rules =