src/Pure/Isar/object_logic.ML
changeset 13376 59975b8417e2
parent 13334 27149d72bdff
child 14226 7afe0e5bcc83
     1.1 --- a/src/Pure/Isar/object_logic.ML	Tue Jul 16 18:41:00 2002 +0200
     1.2 +++ b/src/Pure/Isar/object_logic.ML	Tue Jul 16 18:41:18 2002 +0200
     1.3 @@ -13,11 +13,12 @@
     1.4    val judgment_name: Sign.sg -> string
     1.5    val is_judgment: Sign.sg -> term -> bool
     1.6    val drop_judgment: Sign.sg -> term -> term
     1.7 -  val assert_judgment: Sign.sg -> term -> term
     1.8    val fixed_judgment: Sign.sg -> string -> term
     1.9 +  val assert_propT: Sign.sg -> term -> term
    1.10    val declare_atomize: theory attribute
    1.11    val declare_rulify: theory attribute
    1.12    val atomize_term: Sign.sg -> term -> term
    1.13 +  val atomize_rule: Sign.sg -> cterm -> thm
    1.14    val atomize_tac: int -> tactic
    1.15    val full_atomize_tac: int -> tactic
    1.16    val atomize_goal: int -> thm -> thm
    1.17 @@ -96,11 +97,6 @@
    1.18        if (c = judgment_name sg handle TERM _ => false) then t else tm
    1.19    | drop_judgment _ tm = tm;
    1.20  
    1.21 -fun assert_judgment sg (Abs (x, T, t)) = Abs (x, T, assert_judgment sg t)
    1.22 -  | assert_judgment sg t =
    1.23 -      if (is_judgment sg t handle TERM _ => true) then t
    1.24 -      else Const (judgment_name sg, fastype_of t --> propT) $ t;
    1.25 -
    1.26  fun fixed_judgment sg x =
    1.27    let  (*be robust wrt. low-level errors*)
    1.28      val c = judgment_name sg;
    1.29 @@ -111,6 +107,10 @@
    1.30      val U = Term.domain_type T handle Match => aT;
    1.31    in Const (c, T) $ Free (x, U) end;
    1.32  
    1.33 +fun assert_propT sg t =
    1.34 +  let val T = Term.fastype_of t
    1.35 +  in if T = propT then t else Const (judgment_name sg, T --> propT) $ t end;
    1.36 +
    1.37  
    1.38  
    1.39  (** treatment of meta-level connectives **)
    1.40 @@ -137,6 +137,8 @@
    1.41  fun atomize_term sg =
    1.42    drop_judgment sg o MetaSimplifier.rewrite_term sg (get_atomize sg) [];
    1.43  
    1.44 +fun atomize_rule sg = Tactic.rewrite true (get_atomize sg);
    1.45 +
    1.46  fun atomize_tac i st =
    1.47    if Logic.has_meta_prems (Thm.prop_of st) i then
    1.48      (rewrite_prems_tac (get_atomize (Thm.sign_of_thm st)) i) st