Skip to content
Snippets Groups Projects
Commit 4b510f29 authored by Michele Alberti's avatar Michele Alberti
Browse files

[json] Rename result into prover_answer.

parent cc99ad76
No related branches found
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ and property = { ...@@ -42,7 +42,7 @@ and property = {
type output = { type output = {
id : string; id : string;
result : prover_answer; prover_answer : prover_answer;
percentage_valid : float; percentage_valid : float;
dataset_results : string; dataset_results : string;
} }
......
...@@ -41,7 +41,7 @@ and property = private { ...@@ -41,7 +41,7 @@ and property = private {
type output = { type output = {
id : string; id : string;
result : prover_answer; prover_answer : prover_answer;
percentage_valid : float; percentage_valid : float;
dataset_results : string; dataset_results : string;
} }
......
...@@ -125,13 +125,13 @@ let log_theory_answer = ...@@ -125,13 +125,13 @@ let log_theory_answer =
Logs.info (fun m -> Logs.info (fun m ->
m "@[Verification results for theory '%s'@]" theory_name); m "@[Verification results for theory '%s'@]" theory_name);
List.iter task_answers List.iter task_answers
~f:(fun { Verification.id; result; additional_info } -> ~f:(fun { Verification.id; prover_answer; additional_info } ->
let additional_info = let additional_info =
match additional_info with Generic s -> s | Dataset _ -> None match additional_info with Generic s -> s | Dataset _ -> None
in in
Logs.app (fun m -> Logs.app (fun m ->
m "@[Goal %a:@ %a%a@]" Pretty.print_pr id m "@[Goal %a:@ %a%a@]" Pretty.print_pr id
Call_provers.print_prover_answer result Call_provers.print_prover_answer prover_answer
Fmt.(option ~none:nop (any " " ++ string)) Fmt.(option ~none:nop (any " " ++ string))
additional_info))) additional_info)))
...@@ -149,7 +149,7 @@ let verify ?format ~loadpath ?memlimit ?timelimit ?dataset prover ?prover_altern ...@@ -149,7 +149,7 @@ let verify ?format ~loadpath ?memlimit ?timelimit ?dataset prover ?prover_altern
List.iter theory_answers ~f:log_theory_answer; List.iter theory_answers ~f:log_theory_answer;
theory_answers theory_answers
let record_dataset_results id result dataset outfile = let record_dataset_results id prover_answer dataset outfile =
let percentage_valid = let percentage_valid =
let nb_valid = let nb_valid =
List.count dataset ~f:(fun record -> List.count dataset ~f:(fun record ->
...@@ -170,7 +170,7 @@ let record_dataset_results id result dataset outfile = ...@@ -170,7 +170,7 @@ let record_dataset_results id result dataset outfile =
Csv.close_out csv_out_channel; Csv.close_out csv_out_channel;
dataset_results dataset_results
in in
let output = { JSON.id; result; percentage_valid; dataset_results } in let output = { JSON.id; prover_answer; percentage_valid; dataset_results } in
let out_channel = Stdlib.open_out outfile in let out_channel = Stdlib.open_out outfile in
Yojson.Safe.to_channel out_channel (JSON.output_to_yojson output); Yojson.Safe.to_channel out_channel (JSON.output_to_yojson output);
Logs.info (fun m -> m "@[Results recorded in file '%s'@]" outfile); Logs.info (fun m -> m "@[Results recorded in file '%s'@]" outfile);
...@@ -179,8 +179,9 @@ let record_dataset_results id result dataset outfile = ...@@ -179,8 +179,9 @@ let record_dataset_results id result dataset outfile =
let record_theory_answers id outfile = let record_theory_answers id outfile =
Why3.Wstdlib.Mstr.iter (fun theory_name task_answers -> Why3.Wstdlib.Mstr.iter (fun theory_name task_answers ->
match task_answers with match task_answers with
| [ { Verification.result; additional_info = Dataset dataset; _ } ] -> | [ { Verification.prover_answer; additional_info = Dataset dataset; _ } ]
record_dataset_results id result dataset outfile ->
record_dataset_results id prover_answer dataset outfile
| _ -> failwith (Fmt.str "Unexpected answers for theory '%s'" theory_name)) | _ -> failwith (Fmt.str "Unexpected answers for theory '%s'" theory_name))
let verify_json ?memlimit ?timelimit ?outfile json = let verify_json ?memlimit ?timelimit ?outfile json =
......
...@@ -61,7 +61,7 @@ type theory_answer = answer list Wstdlib.Mstr.t ...@@ -61,7 +61,7 @@ type theory_answer = answer list Wstdlib.Mstr.t
and answer = { and answer = {
id : Decl.prsymbol; id : Decl.prsymbol;
result : Call_provers.prover_answer; prover_answer : Call_provers.prover_answer;
additional_info : additional_info; additional_info : additional_info;
} }
...@@ -223,7 +223,7 @@ let answer_generic limit config env prover config_prover driver task = ...@@ -223,7 +223,7 @@ let answer_generic limit config env prover config_prover driver task =
(prover_answer, None) (prover_answer, None)
let call_prover ?dataset ~limit config env prover config_prover driver task = let call_prover ?dataset ~limit config env prover config_prover driver task =
let result, additional_info = let prover_answer, additional_info =
match prover with match prover with
| Prover.Saver -> | Prover.Saver ->
let prover_answer, additional_info = let prover_answer, additional_info =
...@@ -243,7 +243,7 @@ let call_prover ?dataset ~limit config env prover config_prover driver task = ...@@ -243,7 +243,7 @@ let call_prover ?dataset ~limit config env prover config_prover driver task =
(prover_answer, Generic additional_info) (prover_answer, Generic additional_info)
in in
let id = Task.task_goal task in let id = Task.task_goal task in
{ id; result; additional_info } { id; prover_answer; additional_info }
let verify ?(debug = false) ?format ~loadpath ?memlimit ?timelimit ?dataset let verify ?(debug = false) ?format ~loadpath ?memlimit ?timelimit ?dataset
prover ?prover_altern file = prover ?prover_altern file =
......
...@@ -34,7 +34,7 @@ type theory_answer = answer list Wstdlib.Mstr.t ...@@ -34,7 +34,7 @@ type theory_answer = answer list Wstdlib.Mstr.t
and answer = private { and answer = private {
id : Decl.prsymbol; id : Decl.prsymbol;
result : Call_provers.prover_answer; prover_answer : Call_provers.prover_answer;
additional_info : additional_info; additional_info : additional_info;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment