fun show_status thy (p, f) = let val (context, defs, vcs) = SPARK_VCs.get_vcs thy true;
val vcs' = AList.coalesce (op =) (map_filter
(fn (name, (trace, status, ctxt, stmt)) => if p status then
SOME (trace, (name, status, ctxt, stmt)) else NONE) vcs);
val ctxt = thy |>
Proof_Context.init_global |>
Context.proof_map (fold Element.init context) in
[Pretty.str "Context:",
Pretty.chunks (maps (Element.pretty_ctxt ctxt) context),
val _ =
Outer_Syntax.command \<^command_keyword>\<open>spark_open_vcg\<close> "open a new SPARK environment and load a SPARK-generated .vcg file"
(Resources.provide_parse_files (Command_Span.extensions ["vcg", "fdl", "rls"]) -- Parse.parname
>> (Toplevel.theory o spark_open Fdl_Lexer.vcg_header));
val _ =
Outer_Syntax.command \<^command_keyword>\<open>spark_open\<close> "open a new SPARK environment and load a SPARK-generated .siv file"
(Resources.provide_parse_files (Command_Span.extensions ["siv", "fdl", "rls"]) -- Parse.parname
>> (Toplevel.theory o spark_open Fdl_Lexer.siv_header));
val _ =
Outer_Syntax.local_theory_to_proof \<^command_keyword>\<open>spark_vc\<close> "enter into proof mode for a specific verification condition"
(Parse.name >> prove_vc);
val _ =
Outer_Syntax.command \<^command_keyword>\<open>spark_status\<close> "show the name and state of all loaded verification conditions"
(Scan.optional
(Args.parens
( Args.$$$ "proved" >> K (is_some, K "")
|| Args.$$$ "unproved" >> K (is_none, K "")))
(K true, string_of_status) >> (fn args =>
Toplevel.keep (fn state => show_status (Toplevel.theory_of state) args)))
val _ =
Outer_Syntax.command \<^command_keyword>\<open>spark_end\<close> "close the current SPARK environment"
(Scan.optional (\<^keyword>\<open>(\<close> |-- Parse.!!!
(Parse.reserved "incomplete" --| \<^keyword>\<open>)\<close>) >> K true) false >>
(Toplevel.theory o SPARK_VCs.close));
val _ = Theory.setup (Theory.at_end (fn thy => let val _ = SPARK_VCs.is_closed thy
orelse error ("Found the end of the theory, " ^ "but the last SPARK environment is still open.") in NONE end));
end;
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.