tuned Mirabelle's theory selection
authordesharna
Tue, 27 Jul 2021 13:39:18 +0200
changeset 74069 ffbd1b7e5439
parent 74068 62e4ec8cff38
child 74072 dc98bb7a439b
child 74073 6c8473b4f518
tuned Mirabelle's theory selection
src/HOL/Tools/Mirabelle/mirabelle.ML
--- a/src/HOL/Tools/Mirabelle/mirabelle.ML	Mon Jul 26 13:12:22 2021 +0200
+++ b/src/HOL/Tools/Mirabelle/mirabelle.ML	Tue Jul 27 13:39:18 2021 +0200
@@ -134,7 +134,10 @@
 
 fun check_theories strs =
   let
-    val theories = map read_theory_range strs;
+    fun theory_import_name s =
+      #theory_name (Resources.import_name (Session.get_name ()) Path.current s);
+    val theories = map read_theory_range strs
+      |> map (apfst theory_import_name);
     fun get_theory name =
       if null theories then SOME NONE
       else get_first (fn (a, b) => if a = name then SOME b else NONE) theories;
@@ -173,8 +176,7 @@
           fun make_commands (thy_index, (thy, segments)) =
             let
               val thy_long_name = Context.theory_long_name thy;
-              val thy_name = Context.theory_name thy;
-              val check_thy = check_theory thy_name;
+              val check_thy = check_theory thy_long_name;
               fun make_command {command = tr, prev_state = st, state = st', ...} =
                 let
                   val name = Toplevel.name_of tr;