--- a/src/Pure/Isar/object_logic.ML Tue Jul 16 18:41:00 2002 +0200
+++ b/src/Pure/Isar/object_logic.ML Tue Jul 16 18:41:18 2002 +0200
@@ -13,11 +13,12 @@
val judgment_name: Sign.sg -> string
val is_judgment: Sign.sg -> term -> bool
val drop_judgment: Sign.sg -> term -> term
- val assert_judgment: Sign.sg -> term -> term
val fixed_judgment: Sign.sg -> string -> term
+ val assert_propT: Sign.sg -> term -> term
val declare_atomize: theory attribute
val declare_rulify: theory attribute
val atomize_term: Sign.sg -> term -> term
+ val atomize_rule: Sign.sg -> cterm -> thm
val atomize_tac: int -> tactic
val full_atomize_tac: int -> tactic
val atomize_goal: int -> thm -> thm
@@ -96,11 +97,6 @@
if (c = judgment_name sg handle TERM _ => false) then t else tm
| drop_judgment _ tm = tm;
-fun assert_judgment sg (Abs (x, T, t)) = Abs (x, T, assert_judgment sg t)
- | assert_judgment sg t =
- if (is_judgment sg t handle TERM _ => true) then t
- else Const (judgment_name sg, fastype_of t --> propT) $ t;
-
fun fixed_judgment sg x =
let (*be robust wrt. low-level errors*)
val c = judgment_name sg;
@@ -111,6 +107,10 @@
val U = Term.domain_type T handle Match => aT;
in Const (c, T) $ Free (x, U) end;
+fun assert_propT sg t =
+ let val T = Term.fastype_of t
+ in if T = propT then t else Const (judgment_name sg, T --> propT) $ t end;
+
(** treatment of meta-level connectives **)
@@ -137,6 +137,8 @@
fun atomize_term sg =
drop_judgment sg o MetaSimplifier.rewrite_term sg (get_atomize sg) [];
+fun atomize_rule sg = Tactic.rewrite true (get_atomize sg);
+
fun atomize_tac i st =
if Logic.has_meta_prems (Thm.prop_of st) i then
(rewrite_prems_tac (get_atomize (Thm.sign_of_thm st)) i) st