- Added new "undefined" constant
authorberghofe
Fri, 21 Jul 2006 11:34:01 +0200
changeset 20172 b65eb8145f5e
parent 20171 424739228123
child 20173 c8f791af9a60
- Added new "undefined" constant - normalization_conv no longer expects term to have form "Trueprop ..."
src/HOL/HOL.thy
--- a/src/HOL/HOL.thy	Thu Jul 20 14:35:37 2006 +0200
+++ b/src/HOL/HOL.thy	Fri Jul 21 11:34:01 2006 +0200
@@ -35,6 +35,7 @@
   True          :: bool
   False         :: bool
   arbitrary     :: 'a
+  undefined     :: 'a
 
   The           :: "('a => bool) => 'a"
   All           :: "('a => bool) => bool"           (binder "ALL " 10)
@@ -185,6 +186,7 @@
   "op -->"
   The
   arbitrary
+  undefined
 
 
 subsubsection {* Generic algebraic operations *}
@@ -1281,15 +1283,21 @@
 
 exception Normalization of term;
 
-fun normalization_oracle (thy, Normalization t) = Logic.mk_equals
-  (t, HOLogic.mk_Trueprop (NBE.norm_term thy (HOLogic.dest_Trueprop t)));
+fun normalization_oracle (thy, Normalization t) =
+  Logic.mk_equals (t, NBE.norm_term thy t);
 
 fun normalization_conv ct =
   let val {sign, t, ...} = rep_cterm ct
   in Thm.invoke_oracle_i sign "HOL.Normalization" (sign, Normalization t) end;
 
+fun Trueprop_conv conv ct = (case term_of ct of
+    Const ("Trueprop", _) $ _ =>
+      let val (ct1, ct2) = Thm.dest_comb ct
+      in Thm.combination (Thm.reflexive ct1) (conv ct2) end
+  | _ => raise TERM ("Trueprop_conv", []));
+
 fun normalization_tac i = Tactical.PRIMITIVE (Drule.fconv_rule
-  (Drule.goals_conv (equal i) normalization_conv));
+  (Drule.goals_conv (equal i) (Trueprop_conv normalization_conv)));
 
 val normalization_meth =
   Method.no_args (Method.METHOD (fn _ => normalization_tac 1 THEN resolve_tac [TrueI,refl] 1));