src/HOL/Boogie/Tools/boogie_commands.ML
changeset 37944 4b7afae88c57
parent 36960 01594f816e3a
child 38756 d07959fabde6
equal deleted inserted replaced
37943:3cbd7fa164b1 37944:4b7afae88c57
   266 val vc_offsets = Scan.optional (Args.bracks (Parse.list1
   266 val vc_offsets = Scan.optional (Args.bracks (Parse.list1
   267   (Parse.string --| Args.colon -- Parse.nat))) []
   267   (Parse.string --| Args.colon -- Parse.nat))) []
   268 
   268 
   269 val _ =
   269 val _ =
   270   Outer_Syntax.command "boogie_open"
   270   Outer_Syntax.command "boogie_open"
   271     "Open a new Boogie environment and load a Boogie-generated .b2i file."
   271     "open a new Boogie environment and load a Boogie-generated .b2i file"
   272     Keyword.thy_decl
   272     Keyword.thy_decl
   273     (scan_opt "quiet" -- Parse.name -- vc_offsets >> 
   273     (scan_opt "quiet" -- Parse.name -- vc_offsets >> 
   274       (Toplevel.theory o boogie_open))
   274       (Toplevel.theory o boogie_open))
   275 
   275 
   276 
   276 
   294     scan_val "without" vc_labels >> VC_Without) ||
   294     scan_val "without" vc_labels >> VC_Without) ||
   295   Scan.succeed VC_Complete
   295   Scan.succeed VC_Complete
   296 
   296 
   297 val _ =
   297 val _ =
   298   Outer_Syntax.command "boogie_vc"
   298   Outer_Syntax.command "boogie_vc"
   299     "Enter into proof mode for a specific verification condition."
   299     "enter into proof mode for a specific verification condition"
   300     Keyword.thy_goal
   300     Keyword.thy_goal
   301     (vc_name -- vc_opts >> (fn args =>
   301     (vc_name -- vc_opts >> (fn args =>
   302       (Toplevel.print o Toplevel.theory_to_proof (boogie_vc args))))
   302       (Toplevel.print o Toplevel.theory_to_proof (boogie_vc args))))
   303 
   303 
   304 
   304 
   327 fun status_cmd f = Toplevel.no_timing o Toplevel.keep (fn state =>
   327 fun status_cmd f = Toplevel.no_timing o Toplevel.keep (fn state =>
   328   f (Toplevel.theory_of state))
   328   f (Toplevel.theory_of state))
   329 
   329 
   330 val _ =
   330 val _ =
   331   Outer_Syntax.improper_command "boogie_status"
   331   Outer_Syntax.improper_command "boogie_status"
   332     "Show the name and state of all loaded verification conditions."
   332     "show the name and state of all loaded verification conditions"
   333     Keyword.diag
   333     Keyword.diag
   334     (status_test >> status_cmd ||
   334     (status_test >> status_cmd ||
   335      status_vc >> status_cmd ||
   335      status_vc >> status_cmd ||
   336      Scan.succeed (status_cmd boogie_status))
   336      Scan.succeed (status_cmd boogie_status))
   337 
   337 
   338 
   338 
   339 val _ =
   339 val _ =
   340   Outer_Syntax.command "boogie_end"
   340   Outer_Syntax.command "boogie_end"
   341     "Close the current Boogie environment."
   341     "close the current Boogie environment"
   342     Keyword.thy_decl
   342     Keyword.thy_decl
   343     (Scan.succeed (Toplevel.theory boogie_end))
   343     (Scan.succeed (Toplevel.theory boogie_end))
   344 
   344 
   345 
   345 
   346 val setup = Theory.at_end (fn thy =>
   346 val setup = Theory.at_end (fn thy =>