>:wf(R)}. g(x,y) : D(x,y) |] ==>\
@@ -38,15 +38,15 @@
by (stac SPLITB 1);
by (REPEAT (ares_tac ([ballI,SubtypeI]@prems) 1));
by (rtac (SPLITB RS subst) 1);
-by (REPEAT (ares_tac ([letrecT,SubtypeI,pairT,splitT]@prems) 1 ORELSE
+by (REPEAT (ares_tac ([letrecT,SubtypeI,pairT,splitT]@prems) 1 ORELSE
eresolve_tac [bspec,SubtypeE,sym RS subst] 1));
qed "letrec2T";
-goal Wfd.thy "SPLIT(>,%x xs. SPLIT(xs,%y z. B(x,y,z))) = B(a,b,c)";
+goal (the_context ()) "SPLIT(>,%x xs. SPLIT(xs,%y z. B(x,y,z))) = B(a,b,c)";
by (simp_tac (ccl_ss addsimps [SPLITB]) 1);
qed "lemma";
-val prems = goalw Wfd.thy [letrec3_def]
+val prems = goalw (the_context ()) [letrec3_def]
"[| a : A; b : B; c : C; \
\ !!p q r g.[| p:A; q:B; r:C; \
\ ALL x:A. ALL y:B. ALL z:{z:C. < >> : wf(R)}. \
@@ -58,7 +58,7 @@
by (simp_tac (ccl_ss addsimps [SPLITB]) 1);
by (REPEAT (ares_tac ([ballI,SubtypeI]@prems) 1));
by (rtac (lemma RS subst) 1);
-by (REPEAT (ares_tac ([letrecT,SubtypeI,pairT,splitT]@prems) 1 ORELSE
+by (REPEAT (ares_tac ([letrecT,SubtypeI,pairT,splitT]@prems) 1 ORELSE
eresolve_tac [bspec,SubtypeE,sym RS subst] 1));
qed "letrec3T";
@@ -67,21 +67,21 @@
(*** Type Checking for Recursive Calls ***)
-val major::prems = goal Wfd.thy
+val major::prems = goal (the_context ())
"[| ALL x:{x:A. >:wf(R)}.g(x,y):D(x,y); \
\ g(a,b) : D(a,b) ==> g(a,b) : E; a:A; b:B; <, >:wf(R) |] ==> \
\ g(a,b) : E";
by (REPEAT (ares_tac ([SubtypeI,major RS bspec RS bspec,major]@prems) 1));
qed "rcall2T";
-val major::prems = goal Wfd.thy
+val major::prems = goal (the_context ())
"[| ALL x:A. ALL y:B. ALL z:{z:C.< >>:wf(R)}. g(x,y,z):D(x,y,z); \
\ g(a,b,c) : D(a,b,c) ==> g(a,b,c) : E; \
\ a:A; b:B; c:C; <>, >> : wf(R) |] ==> \
@@ -93,7 +93,7 @@
(*** Instantiating an induction hypothesis with an equality assumption ***)
-val prems = goal Wfd.thy
+val prems = goal (the_context ())
"[| g(a) = b; ALL x:{x:A. >:wf(R)}.g(x,y):D(x,y); \
\ [| c=g(a,b); g(a,b) : D(a,b) |] ==> P; \
\ a:A; b:B; <, >:wf(R) |] ==> \
@@ -126,7 +126,7 @@
by (REPEAT (ares_tac prems 1));
qed "hyprcall2T";
-val prems = goal Wfd.thy
+val prems = goal (the_context ())
"[| g(a,b,c) = d; \
\ ALL x:A. ALL y:B. ALL z:{z:C.< >>:wf(R)}.g(x,y,z):D(x,y,z); \
\ [| d=g(a,b,c); g(a,b,c) : D(a,b,c) |] ==> P; \
@@ -142,19 +142,19 @@
(*** Rules to Remove Induction Hypotheses after Type Checking ***)
-val prems = goal Wfd.thy
+val prems = goal (the_context ())
"[| ALL x:{x:A. >:wf(R)}.g(x,y):D(x,y); P |] ==> \
\ P";
by (REPEAT (ares_tac prems 1));
qed "rmIH2";
-val prems = goal Wfd.thy
+val prems = goal (the_context ())
"[| ALL x:A. ALL y:B. ALL z:{z:C.< >>:wf(R)}.g(x,y,z):D(x,y,z); \
\ P |] ==> \
\ P";
diff -r 151e76f0e3c7 -r bcf7544875b2 src/CCL/mono.ML
--- a/src/CCL/mono.ML Sat Sep 17 14:02:31 2005 +0200
+++ b/src/CCL/mono.ML Sat Sep 17 17:35:26 2005 +0200
@@ -1,46 +1,39 @@
-(* Title: CCL/mono
+(* Title: CCL/mono.ML
ID: $Id$
-Modified version of
- Title: HOL/mono
- Author: Lawrence C Paulson, Cambridge University Computer Laboratory
- Copyright 1991 University of Cambridge
-
-Monotonicity of various operations
+Monotonicity of various operations.
*)
-writeln"File HOL/mono";
-
-val prems = goal Set.thy "A<=B ==> Union(A) <= Union(B)";
+val prems = goal (the_context ()) "A<=B ==> Union(A) <= Union(B)";
by (cfast_tac prems 1);
qed "Union_mono";
-val prems = goal Set.thy "[| B<=A |] ==> Inter(A) <= Inter(B)";
+val prems = goal (the_context ()) "[| B<=A |] ==> Inter(A) <= Inter(B)";
by (cfast_tac prems 1);
qed "Inter_anti_mono";
-val prems = goal Set.thy
+val prems = goal (the_context ())
"[| A<=B; !!x. x:A ==> f(x)<=g(x) |] ==> \
\ (UN x:A. f(x)) <= (UN x:B. g(x))";
by (REPEAT (eresolve_tac [UN_E,ssubst] 1
ORELSE ares_tac ((prems RL [subsetD]) @ [subsetI,UN_I]) 1));
qed "UN_mono";
-val prems = goal Set.thy
+val prems = goal (the_context ())
"[| B<=A; !!x. x:A ==> f(x)<=g(x) |] ==> \
\ (INT x:A. f(x)) <= (INT x:A. g(x))";
by (REPEAT (ares_tac ((prems RL [subsetD]) @ [subsetI,INT_I]) 1
ORELSE etac INT_D 1));
qed "INT_anti_mono";
-val prems = goal Set.thy "[| A<=C; B<=D |] ==> A Un B <= C Un D";
+val prems = goal (the_context ()) "[| A<=C; B<=D |] ==> A Un B <= C Un D";
by (cfast_tac prems 1);
qed "Un_mono";
-val prems = goal Set.thy "[| A<=C; B<=D |] ==> A Int B <= C Int D";
+val prems = goal (the_context ()) "[| A<=C; B<=D |] ==> A Int B <= C Int D";
by (cfast_tac prems 1);
qed "Int_mono";
-val prems = goal Set.thy "[| A<=B |] ==> Compl(B) <= Compl(A)";
+val prems = goal (the_context ()) "[| A<=B |] ==> Compl(B) <= Compl(A)";
by (cfast_tac prems 1);
qed "Compl_anti_mono";
diff -r 151e76f0e3c7 -r bcf7544875b2 src/CCL/subset.ML
--- a/src/CCL/subset.ML Sat Sep 17 14:02:31 2005 +0200
+++ b/src/CCL/subset.ML Sat Sep 17 17:35:26 2005 +0200
@@ -1,23 +1,18 @@
-(* Title: CCL/subset
+(* Title: CCL/subsetI
ID: $Id$
-Modified version of
- Title: HOL/subset
- Author: Lawrence C Paulson, Cambridge University Computer Laboratory
- Copyright 1991 University of Cambridge
-
-Derived rules involving subsets
-Union and Intersection as lattice operations
+Derived rules involving subsets.
+Union and Intersection as lattice operations.
*)
(*** Big Union -- least upper bound of a set ***)
-val prems = goal Set.thy
+val prems = goal (the_context ())
"B:A ==> B <= Union(A)";
by (REPEAT (ares_tac (prems@[subsetI,UnionI]) 1));
qed "Union_upper";
-val prems = goal Set.thy
+val prems = goal (the_context ())
"[| !!X. X:A ==> X<=C |] ==> Union(A) <= C";
by (REPEAT (ares_tac [subsetI] 1
ORELSE eresolve_tac ([UnionE] @ (prems RL [subsetD])) 1));
@@ -26,13 +21,13 @@
(*** Big Intersection -- greatest lower bound of a set ***)
-val prems = goal Set.thy
+val prems = goal (the_context ())
"B:A ==> Inter(A) <= B";
by (REPEAT (resolve_tac (prems@[subsetI]) 1
ORELSE etac InterD 1));
qed "Inter_lower";
-val prems = goal Set.thy
+val prems = goal (the_context ())
"[| !!X. X:A ==> C<=X |] ==> C <= Inter(A)";
by (REPEAT (ares_tac [subsetI,InterI] 1
ORELSE eresolve_tac (prems RL [subsetD]) 1));
@@ -40,15 +35,15 @@
(*** Finite Union -- the least upper bound of 2 sets ***)
-goal Set.thy "A <= A Un B";
+goal (the_context ()) "A <= A Un B";
by (REPEAT (ares_tac [subsetI,UnI1] 1));
qed "Un_upper1";
-goal Set.thy "B <= A Un B";
+goal (the_context ()) "B <= A Un B";
by (REPEAT (ares_tac [subsetI,UnI2] 1));
qed "Un_upper2";
-val prems = goal Set.thy "[| A<=C; B<=C |] ==> A Un B <= C";
+val prems = goal (the_context ()) "[| A<=C; B<=C |] ==> A Un B <= C";
by (cut_facts_tac prems 1);
by (DEPTH_SOLVE (ares_tac [subsetI] 1
ORELSE eresolve_tac [UnE,subsetD] 1));
@@ -56,15 +51,15 @@
(*** Finite Intersection -- the greatest lower bound of 2 sets *)
-goal Set.thy "A Int B <= A";
+goal (the_context ()) "A Int B <= A";
by (REPEAT (ares_tac [subsetI] 1 ORELSE etac IntE 1));
qed "Int_lower1";
-goal Set.thy "A Int B <= B";
+goal (the_context ()) "A Int B <= B";
by (REPEAT (ares_tac [subsetI] 1 ORELSE etac IntE 1));
qed "Int_lower2";
-val prems = goal Set.thy "[| C<=A; C<=B |] ==> C <= A Int B";
+val prems = goal (the_context ()) "[| C<=A; C<=B |] ==> C <= A Int B";
by (cut_facts_tac prems 1);
by (REPEAT (ares_tac [subsetI,IntI] 1
ORELSE etac subsetD 1));
@@ -72,24 +67,24 @@
(*** Monotonicity ***)
-val [prem] = goalw Set.thy [mono_def]
+val [prem] = goalw (the_context ()) [mono_def]
"[| !!A B. A <= B ==> f(A) <= f(B) |] ==> mono(f)";
by (REPEAT (ares_tac [allI, impI, prem] 1));
qed "monoI";
-val [major,minor] = goalw Set.thy [mono_def]
+val [major,minor] = goalw (the_context ()) [mono_def]
"[| mono(f); A <= B |] ==> f(A) <= f(B)";
by (rtac (major RS spec RS spec RS mp) 1);
by (rtac minor 1);
qed "monoD";
-val [prem] = goal Set.thy "mono(f) ==> f(A) Un f(B) <= f(A Un B)";
+val [prem] = goal (the_context ()) "mono(f) ==> f(A) Un f(B) <= f(A Un B)";
by (rtac Un_least 1);
by (rtac (Un_upper1 RS (prem RS monoD)) 1);
by (rtac (Un_upper2 RS (prem RS monoD)) 1);
qed "mono_Un";
-val [prem] = goal Set.thy "mono(f) ==> f(A Int B) <= f(A) Int f(B)";
+val [prem] = goal (the_context ()) "mono(f) ==> f(A Int B) <= f(A) Int f(B)";
by (rtac Int_greatest 1);
by (rtac (Int_lower1 RS (prem RS monoD)) 1);
by (rtac (Int_lower2 RS (prem RS monoD)) 1);
@@ -107,7 +102,7 @@
fun cfast_tac prems = cut_facts_tac prems THEN' fast_tac set_cs;
-fun prover s = prove_goal Set.thy s (fn _=>[fast_tac set_cs 1]);
+fun prover s = prove_goal (the_context ()) s (fn _=>[fast_tac set_cs 1]);
val mem_rews = [trivial_set,empty_eq] @ (map prover
[ "(a : A Un B) <-> (a:A | a:B)",
diff -r 151e76f0e3c7 -r bcf7544875b2 src/CCL/typecheck.ML
--- a/src/CCL/typecheck.ML Sat Sep 17 14:02:31 2005 +0200
+++ b/src/CCL/typecheck.ML Sat Sep 17 17:35:26 2005 +0200
@@ -1,8 +1,7 @@
-(* Title: CCL/typecheck
+(* Title: CCL/typecheck.ML
ID: $Id$
Author: Martin Coen, Cambridge University Computer Laboratory
Copyright 1993 University of Cambridge
-
*)
(*** Lemmas for constructors and subtypes ***)
@@ -10,11 +9,11 @@
(* 0-ary constructors do not need additional rules as they are handled *)
(* correctly by applying SubtypeI *)
(*
-val Subtype_canTs =
+val Subtype_canTs =
let fun tac prems = cut_facts_tac prems 1 THEN
REPEAT (ares_tac (SubtypeI::canTs@icanTs) 1 ORELSE
etac SubtypeE 1)
- fun solve s = prove_goal Type.thy s (fn prems => [tac prems])
+ fun solve s = prove_goal (the_context ()) s (fn prems => [tac prems])
in map solve
["P(one) ==> one : {x:Unit.P(x)}",
"P(true) ==> true : {x:Bool.P(x)}",
@@ -28,11 +27,11 @@
"h : {x:A. t : {y:List(A).P(x$y)}} ==> h$t : {x:List(A).P(x)}"
] end;
*)
-val Subtype_canTs =
+val Subtype_canTs =
let fun tac prems = cut_facts_tac prems 1 THEN
REPEAT (ares_tac (SubtypeI::canTs@icanTs) 1 ORELSE
etac SubtypeE 1)
- fun solve s = prove_goal Type.thy s (fn prems => [tac prems])
+ fun solve s = prove_goal (the_context ()) s (fn prems => [tac prems])
in map solve
["a : {x:A. b:{y:B(a).P(