src/Provers/splitter.ML
changeset 5553 ae42b36a50c2
parent 5437 f68b9d225942
child 6130 30b84ad2131d
equal deleted inserted replaced
5552:dcd3e7711cac 5553:ae42b36a50c2
     9 infix 4 addsplits delsplits;
     9 infix 4 addsplits delsplits;
    10 
    10 
    11 signature SPLITTER_DATA =
    11 signature SPLITTER_DATA =
    12 sig
    12 sig
    13   structure Simplifier: SIMPLIFIER
    13   structure Simplifier: SIMPLIFIER
    14   val mk_meta_eq    : thm -> thm
    14   val mk_eq         : thm -> thm
    15   val meta_eq_to_iff: thm (* "x == y ==> x = y"                    *)
    15   val meta_eq_to_iff: thm (* "x == y ==> x = y"                    *)
    16   val iffD          : thm (* "[| P = Q; Q |] ==> P"                *)
    16   val iffD          : thm (* "[| P = Q; Q |] ==> P"                *)
    17   val disjE         : thm (* "[| P | Q; P ==> R; Q ==> R |] ==> R" *)
    17   val disjE         : thm (* "[| P | Q; P ==> R; Q ==> R |] ==> R" *)
    18   val conjE         : thm (* "[| P & Q; [| P; Q |] ==> R |] ==> R" *)
    18   val conjE         : thm (* "[| P & Q; [| P; Q |] ==> R |] ==> R" *)
    19   val exE           : thm (* "[|  x. P x; !!x. P x ==> Q |] ==> Q" *)
    19   val exE           : thm (* "[|  x. P x; !!x. P x ==> Q |] ==> Q" *)
    45 val Const ("==>", _) $ (Const ("Trueprop", _) $
    45 val Const ("==>", _) $ (Const ("Trueprop", _) $
    46          (Const (const_or , _) $ _ $ _)) $ _ = #prop (rep_thm(Data.disjE));
    46          (Const (const_or , _) $ _ $ _)) $ _ = #prop (rep_thm(Data.disjE));
    47 
    47 
    48 fun split_format_err() = error("Wrong format for split rule");
    48 fun split_format_err() = error("Wrong format for split rule");
    49 
    49 
    50 fun split_thm_info thm = case concl_of (Data.mk_meta_eq thm) of
    50 fun split_thm_info thm = case concl_of (Data.mk_eq thm) of
    51      Const("==", _)$(Var _$t)$c =>
    51      Const("==", _)$(Var _$t)$c =>
    52         (case strip_comb t of
    52         (case strip_comb t of
    53            (Const(a,_),_) => (a,case c of (Const(s,_)$_)=>s=const_not|_=> false)
    53            (Const(a,_),_) => (a,case c of (Const(s,_)$_)=>s=const_not|_=> false)
    54          | _              => split_format_err())
    54          | _              => split_format_err())
    55    | _ => split_format_err();
    55    | _ => split_format_err();
   286    i      : number of subgoal the tactic should be applied to
   286    i      : number of subgoal the tactic should be applied to
   287 *****************************************************************************)
   287 *****************************************************************************)
   288 
   288 
   289 fun split_tac [] i = no_tac
   289 fun split_tac [] i = no_tac
   290   | split_tac splits i =
   290   | split_tac splits i =
   291   let val splits = map Data.mk_meta_eq splits;
   291   let val splits = map Data.mk_eq splits;
   292       fun const(thm) =
   292       fun const(thm) =
   293             (case concl_of thm of _$(t as _$lhs)$_ =>
   293             (case concl_of thm of _$(t as _$lhs)$_ =>
   294                (case strip_comb lhs of (Const(a,_),args) =>
   294                (case strip_comb lhs of (Const(a,_),args) =>
   295                   (a,(thm,fastype_of t,length args))
   295                   (a,(thm,fastype_of t,length args))
   296                 | _ => split_format_err())
   296                 | _ => split_format_err())