discontinued pervasive val theory = Thy_Info.get_theory -- prefer antiquotations in most situations;
authorwenzelm
Tue, 20 Jul 2010 23:09:49 +0200
changeset 37863 7f113caabcf4
parent 37862 ec81023c6861
child 37864 814b1bca7f35
discontinued pervasive val theory = Thy_Info.get_theory -- prefer antiquotations in most situations;
src/HOL/Import/proof_kernel.ML
src/HOL/Mutabelle/mutabelle.ML
src/HOL/Tools/inductive_set.ML
src/HOL/Typedef.thy
src/Pure/pure_setup.ML
src/Tools/Code/code_target.ML
src/Tools/Compute_Oracle/linker.ML
src/Tools/WWW_Find/find_theorems.ML
--- a/src/HOL/Import/proof_kernel.ML	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/HOL/Import/proof_kernel.ML	Tue Jul 20 23:09:49 2010 +0200
@@ -466,13 +466,11 @@
 
 fun innocent_varname s = Syntax.is_identifier s andalso not (String.isPrefix "u_" s)
 
-val check_name_thy = theory "Main"
-
 fun valid_boundvarname s =
-  can (fn () => Syntax.read_term_global check_name_thy ("SOME "^s^". True")) ();
+  can (fn () => Syntax.read_term_global @{theory Main} ("SOME "^s^". True")) ();
 
 fun valid_varname s =
-  can (fn () => Syntax.read_term_global check_name_thy s) ();
+  can (fn () => Syntax.read_term_global @{theory Main} s) ();
 
 fun protect_varname s =
     if innocent_varname s andalso valid_varname s then s else
--- a/src/HOL/Mutabelle/mutabelle.ML	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/HOL/Mutabelle/mutabelle.ML	Tue Jul 20 23:09:49 2010 +0200
@@ -82,7 +82,7 @@
 
 (*helper function in order to properly print a term*)
 
-fun prt x = Pretty.writeln (Syntax.pretty_term_global (theory "Main") x);
+fun prt x = Pretty.writeln (Syntax.pretty_term_global @{theory Main} x);
 
 
 (*possibility to print a given term for debugging purposes*)
@@ -460,7 +460,7 @@
 (*mutate origTerm iter times by only exchanging subterms*)
 
 fun mutate_exc origTerm commutatives iter =
- mutate 0 origTerm (theory "Main") commutatives [] iter;
+ mutate 0 origTerm @{theory Main} commutatives [] iter;
 
 
 (*mutate origTerm iter times by only inserting signature functions*)
--- a/src/HOL/Tools/inductive_set.ML	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/HOL/Tools/inductive_set.ML	Tue Jul 20 23:09:49 2010 +0200
@@ -32,7 +32,7 @@
 (**** simplify {(x1, ..., xn). (x1, ..., xn) : S} to S ****)
 
 val collect_mem_simproc =
-  Simplifier.simproc (theory "Set") "Collect_mem" ["Collect t"] (fn thy => fn ss =>
+  Simplifier.simproc @{theory Set} "Collect_mem" ["Collect t"] (fn thy => fn ss =>
     fn S as Const (@{const_name Collect}, Type ("fun", [_, T])) $ t =>
          let val (u, _, ps) = HOLogic.strip_psplits t
          in case u of
--- a/src/HOL/Typedef.thy	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/HOL/Typedef.thy	Tue Jul 20 23:09:49 2010 +0200
@@ -13,7 +13,7 @@
 begin
 
 ML {*
-structure HOL = struct val thy = theory "HOL" end;
+structure HOL = struct val thy = @{theory HOL} end;
 *}  -- "belongs to theory HOL"
 
 locale type_definition =
--- a/src/Pure/pure_setup.ML	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/Pure/pure_setup.ML	Tue Jul 20 23:09:49 2010 +0200
@@ -6,8 +6,6 @@
 
 (* the Pure theories *)
 
-val theory = Thy_Info.get_theory;
-
 Context.>> (Context.map_theory
  (Outer_Syntax.process_file (Path.explode "Pure.thy") #>
   Theory.end_theory));
--- a/src/Tools/Code/code_target.ML	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/Tools/Code/code_target.ML	Tue Jul 20 23:09:49 2010 +0200
@@ -612,7 +612,7 @@
 fun shell_command thyname cmd = Toplevel.program (fn _ =>
   (use_thy thyname; case Scan.read Token.stopper (Parse.!!! code_exprP)
     ((filter Token.is_proper o Outer_Syntax.scan Position.none) cmd)
-   of SOME f => (writeln "Now generating code..."; f (theory thyname))
+   of SOME f => (writeln "Now generating code..."; f (Thy_Info.get_theory thyname))
     | NONE => error ("Bad directive " ^ quote cmd)))
   handle Runtime.TOPLEVEL_ERROR => OS.Process.exit OS.Process.failure;
 
--- a/src/Tools/Compute_Oracle/linker.ML	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/Tools/Compute_Oracle/linker.ML	Tue Jul 20 23:09:49 2010 +0200
@@ -191,7 +191,7 @@
 fun substs_of (Instances (_,_,_,substs)) = Substtab.keys substs
 
 local
-    fun get_thm thmname = PureThy.get_thm (theory "Main") thmname
+    fun get_thm thmname = PureThy.get_thm @{theory Main} thmname
     val eq_th = get_thm "HOL.eq_reflection"
 in
   fun eq_to_meta th = (eq_th OF [th] handle THM _ => th)
--- a/src/Tools/WWW_Find/find_theorems.ML	Tue Jul 20 22:03:37 2010 +0200
+++ b/src/Tools/WWW_Find/find_theorems.ML	Tue Jul 20 23:09:49 2010 +0200
@@ -207,7 +207,7 @@
 
     fun do_find () =
       let
-        val ctxt = ProofContext.init_global (theory thy_name);
+        val ctxt = ProofContext.init_global (Thy_Info.get_theory thy_name);
         val query = get_query ();
         val (othmslen, thms) = apsnd rev
           (Find_Theorems.find_theorems ctxt NONE (SOME limit) with_dups query);