require the b2i file ending in the boogie_open command (for consistency with the theory header)
authorboehmes
Wed, 17 Nov 2010 09:22:23 +0100
changeset 40580 0592d3a39c08
parent 40579 98ebd2300823
child 40581 4e10046d7aaa
child 40582 968c481aa18c
require the b2i file ending in the boogie_open command (for consistency with the theory header)
NEWS
src/HOL/Boogie/Examples/Boogie_Dijkstra.thy
src/HOL/Boogie/Examples/Boogie_Max.thy
src/HOL/Boogie/Examples/Boogie_Max_Stepwise.thy
src/HOL/Boogie/Examples/VCC_Max.thy
src/HOL/Boogie/Tools/boogie_commands.ML
--- a/NEWS	Wed Nov 17 08:14:56 2010 +0100
+++ b/NEWS	Wed Nov 17 09:22:23 2010 +0100
@@ -355,6 +355,9 @@
     cvc3_options
     yices_options
 
+* Boogie output files (.b2i files) need to be declared in the
+theory header.
+
 * Removed [split_format ... and ... and ...] version of
 [split_format].  Potential INCOMPATIBILITY.
 
--- a/src/HOL/Boogie/Examples/Boogie_Dijkstra.thy	Wed Nov 17 08:14:56 2010 +0100
+++ b/src/HOL/Boogie/Examples/Boogie_Dijkstra.thy	Wed Nov 17 09:22:23 2010 +0100
@@ -80,7 +80,7 @@
 *}
 
 
-boogie_open "Boogie_Dijkstra"
+boogie_open "Boogie_Dijkstra.b2i"
 
 declare [[smt_certificates="Boogie_Dijkstra.certs"]]
 declare [[smt_fixed=true]]
--- a/src/HOL/Boogie/Examples/Boogie_Max.thy	Wed Nov 17 08:14:56 2010 +0100
+++ b/src/HOL/Boogie/Examples/Boogie_Max.thy	Wed Nov 17 09:22:23 2010 +0100
@@ -37,7 +37,7 @@
 \end{verbatim}
 *}
 
-boogie_open "Boogie_Max"
+boogie_open "Boogie_Max.b2i"
 
 declare [[smt_certificates="Boogie_Max.certs"]]
 declare [[smt_fixed=true]]
--- a/src/HOL/Boogie/Examples/Boogie_Max_Stepwise.thy	Wed Nov 17 08:14:56 2010 +0100
+++ b/src/HOL/Boogie/Examples/Boogie_Max_Stepwise.thy	Wed Nov 17 09:22:23 2010 +0100
@@ -37,7 +37,7 @@
 \end{verbatim}
 *}
 
-boogie_open "Boogie_Max"
+boogie_open "Boogie_Max.b2i"
 
 boogie_status -- {* gives an overview of all verification conditions *}
 
--- a/src/HOL/Boogie/Examples/VCC_Max.thy	Wed Nov 17 08:14:56 2010 +0100
+++ b/src/HOL/Boogie/Examples/VCC_Max.thy	Wed Nov 17 09:22:23 2010 +0100
@@ -45,7 +45,7 @@
 \end{verbatim}
 *}
 
-boogie_open (quiet) "VCC_Max"
+boogie_open (quiet) "VCC_Max.b2i"
 
 declare [[smt_certificates="VCC_Max.certs"]]
 declare [[smt_fixed=true]]
--- a/src/HOL/Boogie/Tools/boogie_commands.ML	Wed Nov 17 08:14:56 2010 +0100
+++ b/src/HOL/Boogie/Tools/boogie_commands.ML	Wed Nov 17 09:22:23 2010 +0100
@@ -17,8 +17,11 @@
 fun boogie_open ((quiet, base_name), offsets) thy =
   let
     val ext = "b2i"
-    fun add_ext path = path |> snd (Path.split_ext path) <> ext ? Path.ext ext
-    val base_path = add_ext (Path.explode base_name)
+    fun check_ext path = snd (Path.split_ext path) = ext orelse
+      error ("Bad file ending of file " ^ quote (Path.implode path) ^ ", " ^
+        "expected file ending " ^ quote ext)
+
+    val base_path = Path.explode base_name |> tap check_ext
     val (full_path, _) =
       Thy_Load.check_file [Thy_Load.master_directory thy] base_path