explicit theory qualifier for session "HOL-Proofs": its theory name space overlaps with session "HOL", even for further imports;
authorwenzelm
Mon, 10 Apr 2017 13:30:55 +0200
changeset 65456 31e8a86971a8
parent 65455 ff09d29498b0
child 65457 2bf0d2fcd506
explicit theory qualifier for session "HOL-Proofs": its theory name space overlaps with session "HOL", even for further imports;
etc/options
src/HOL/ROOT
src/Pure/Thy/sessions.scala
src/Pure/Tools/build.scala
--- a/etc/options	Mon Apr 10 13:19:24 2017 +0200
+++ b/etc/options	Mon Apr 10 13:30:55 2017 +0200
@@ -113,6 +113,9 @@
 option profiling : string = ""
   -- "ML profiling (possible values: time, allocations)"
 
+option theory_qualifier : string = ""
+  -- "explicit theory qualifier for special sessions (default: session name)"
+
 
 section "ML System"
 
--- a/src/HOL/ROOT	Mon Apr 10 13:19:24 2017 +0200
+++ b/src/HOL/ROOT	Mon Apr 10 13:30:55 2017 +0200
@@ -18,7 +18,8 @@
   description {*
     HOL-Main with explicit proof terms.
   *}
-  options [document = false, quick_and_dirty = false, record_proofs = 2, parallel_proofs = 0]
+  options [document = false, theory_qualifier = "HOL",
+    quick_and_dirty = false, record_proofs = 2, parallel_proofs = 0]
   theories "~~/src/HOL/Library/Old_Datatype"
   files
     "Tools/Quickcheck/Narrowing_Engine.hs"
--- a/src/Pure/Thy/sessions.scala	Mon Apr 10 13:19:24 2017 +0200
+++ b/src/Pure/Thy/sessions.scala	Mon Apr 10 13:30:55 2017 +0200
@@ -97,7 +97,8 @@
               case None => Base.bootstrap
               case Some(parent) => sessions(parent)
             }
-          val resources = new Resources(parent_base, default_qualifier = session_name)
+          val resources = new Resources(parent_base,
+            default_qualifier = info.theory_qualifier getOrElse session_name)
 
           if (verbose || list_files) {
             val groups =
@@ -209,6 +210,12 @@
     meta_digest: SHA1.Digest)
   {
     def timeout: Time = Time.seconds(options.real("timeout") * options.real("timeout_scale"))
+
+    def theory_qualifier: Option[String] =
+      options.string("theory_qualifier") match {
+        case "" => None
+        case qualifier => Some(qualifier)
+      }
   }
 
   object Selection
--- a/src/Pure/Tools/build.scala	Mon Apr 10 13:19:24 2017 +0200
+++ b/src/Pure/Tools/build.scala	Mon Apr 10 13:30:55 2017 +0200
@@ -224,7 +224,8 @@
             ML_Syntax.print_string0(File.platform_path(output))
 
         if (pide && !Sessions.is_pure(name)) {
-          val resources = new Resources(deps(parent), default_qualifier = name)
+          val resources = new Resources(deps(parent),
+            default_qualifier = info.theory_qualifier getOrElse name)
           val session = new Session(options, resources)
           val handler = new Handler(progress, session, name)
           session.init_protocol_handler(handler)