Skip to content

Commit

Permalink
Produce assignments option
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevendeo committed Sep 29, 2023
1 parent c1e4387 commit 91fa8f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/common/solving_loop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,15 @@ let main () =
print_wrn_opt ~name:":reproducible-resource-limit" st_loc
"nonnegative integer" value
end
| ":produce-assignments", Symbol { name = Simple b; _ } ->
begin
match bool_of_string_opt b with
| None -> print_wrn_opt ~name:":verbosity" st_loc "integer" value
| Some b -> Options.set_produce_assignments b
end
| (":global-declarations"
| ":interactive-mode"
| ":produce-assertions"
| ":produce-assignments"
| ":produce-proofs"
| ":produce-unsat-assumptions"
| ":print-success"
Expand Down
3 changes: 3 additions & 0 deletions src/lib/util/options.ml
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ let output_format = ref Native
let model_type = ref Value
let infer_output_format = ref true
let unsat_core = ref false
let produce_assignments = ref false

let set_interpretation b = interpretation := b
let set_dump_models b = dump_models := b
Expand All @@ -352,6 +353,7 @@ let set_output_format b = output_format := b
let set_model_type t = model_type := t
let set_infer_output_format b = infer_output_format := b
let set_unsat_core b = unsat_core := b
let set_produce_assignments b = produce_assignments := b

let equal_mode a b =
match a, b with
Expand Down Expand Up @@ -391,6 +393,7 @@ let get_model_type () = !model_type
let get_model_type_constraints () = equal_mode_type !model_type Constraints
let get_infer_output_format () = !infer_output_format
let get_unsat_core () = !unsat_core || !save_used_context || !debug_unsat_core
let get_produce_assignments () = !produce_assignments

(** Profiling options *)

Expand Down
7 changes: 7 additions & 0 deletions src/lib/util/options.mli
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ val set_type_smt2 : bool -> unit
(** Set [unsat_core] accessible with {!val:get_unsat_core} *)
val set_unsat_core : bool -> unit

(** Set [produce_assignments] accessible with {!val:get_produce_assignments} *)
val set_produce_assignments : bool -> unit

(** Set [verbose] accessible with {!val:get_verbose} *)
val set_verbose : bool -> unit

Expand Down Expand Up @@ -764,6 +767,10 @@ val get_infer_output_format : unit -> bool
val get_unsat_core : unit -> bool
(** Default to [false] *)

(** [true] if Alt-Ergo allow to display the truth assignment for the labeled
formulas. *)
val get_produce_assignments : unit -> bool

(** {4 Profiling options} *)

(** [true] if the profiling module is activated.
Expand Down

0 comments on commit 91fa8f3

Please sign in to comment.