val genuineN: string val quasi_genuineN: string val potentialN: string val noneN: string val unknownN: string val no_nunchakuN: string
val run_chaku_on_prop: Proof.state -> params -> mode -> int -> term list -> term -> string * isa_model option val run_chaku_on_subgoal: Proof.state -> params -> mode -> int -> string * isa_model option end;
structure Nunchaku : NUNCHAKU = struct
open Nunchaku_Util; open Nunchaku_Collect; open Nunchaku_Problem; open Nunchaku_Translate; open Nunchaku_Model; open Nunchaku_Reconstruct; open Nunchaku_Display; open Nunchaku_Tool;
(* Give the soft timeout a chance. *) val timeout_slack = seconds 1.0;
fun run_chaku_on_prop state
({mode_of_operation_params = {solvers, falsify, assms, spy, overlord, expect},
scope_of_search_params = {wfs, whacks, min_bound, max_bound, bound_increment, cards, monos},
output_format_params = {verbose, debug, evals, atomss, ...},
optimization_params = {specialize, ...},
timeout_params = {timeout, wf_timeout}})
mode i all_assms subgoal = let val ctxt = Proof.context_of state;
val time_start = Time.now ()
valprint = writeln; val print_n = if mode = Normal then writeln else K (); fun print_v f = if verbose then writeln (f ()) else (); fun print_d f = if debug then writeln (f ()) else ();
val das_wort_Model = if falsify then"Countermodel"else"Model"; val das_wort_model = if falsify then"countermodel"else"model";
fun run () = let val outcome as (outcome_code, _) = let val (poly_axioms, isa_problem as {sound, complete, ...}) =
isa_problem_of_subgoal ctxt falsify wfs whacks cards debug wf_timeout evals
(if assms then all_assms else []) subgoal; val _ = print_d (fn () => "*** Isabelle problem ***\n" ^
str_of_isa_problem ctxt isa_problem); val ugly_nun_problem = nun_problem_of_isa ctxt isa_problem; val _ = print_d (fn () => "*** Ugly Nunchaku problem ***\n" ^
str_of_nun_problem ugly_nun_problem); val (nice_nun_problem, pool) = nice_nun_problem ugly_nun_problem; val _ = print_d (fn () => "*** Nice Nunchaku problem ***\n" ^
str_of_nun_problem nice_nun_problem);
fun print_any_hints () = if has_lonely_bool_var subgoal then print"Hint: Maybe you forgot a colon after the lemma's name?" elseif has_syntactic_sorts subgoal then print"Hint: Maybe you forgot a type constraint?" else
();
fun get_isa_model_opt output = let val nice_nun_model = nun_model_of_str output; val _ = print_d (fn () => "*** Nice Nunchaku model ***\n" ^
str_of_nun_model nice_nun_model); val ugly_nun_model = ugly_nun_model pool nice_nun_model; val _ = print_d (fn () => "*** Ugly Nunchaku model ***\n" ^
str_of_nun_model ugly_nun_model);
val pat_completes = pat_completes_of_isa_problem isa_problem; val raw_isa_model = isa_model_of_nun ctxt pat_completes atomss ugly_nun_model; val _ = print_d (fn () => "*** Raw Isabelle model ***\n" ^
str_of_isa_model ctxt raw_isa_model);
val cleaned_isa_model = clean_up_isa_model ctxt raw_isa_model; val _ = print_d (fn () => "*** Cleaned-up Isabelle model ***\n" ^
str_of_isa_model ctxt cleaned_isa_model); in
cleaned_isa_model end;
fun isa_model_opt output = if debug then SOME (get_isa_model_opt output) elsetry get_isa_model_opt output;
val model_str = isa_model_opt #> pretty_of_isa_model_opt ctxt #> Pretty.string_of;
val _ = spying spy (fn () => (state, i, "outcome: " ^ outcome_code)); in if expect = "" orelse outcome_code = expect then outcome else error ("Unexpected outcome: " ^ quote outcome_code) end;
fun run_chaku_on_subgoal state params mode i = let val ctxt = Proof.context_of state; val goal = Thm.prop_of (#goal (Proof.raw_goal state)); in if Logic.no_prems goal then
(writeln "No subgoal!"; (noneN, NONE)) else let val subgoal = fst (Logic.goal_params goal i); val all_assms = map Thm.term_of (Assumption.all_assms_of ctxt); in
run_chaku_on_prop state params mode i all_assms subgoal end end;
end;
¤ Dauer der Verarbeitung: 0.16 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.