Skip to content

Commit

Permalink
Models: export the map of term |-> get-value(term) computed in UF
Browse files Browse the repository at this point in the history
  • Loading branch information
iguerNL authored and Halbaroth committed Oct 4, 2023
1 parent 741f26c commit c203ad1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/lib/frontend/frontend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,6 @@ module Make(SAT : Sat_solver_sig.S) : S with type sat_env = SAT.t = struct
(Some time) (Some steps)






let init_with_replay_used acc f =
assert (Sys.file_exists f);
let cin = open_in f in
Expand Down
6 changes: 2 additions & 4 deletions src/lib/frontend/models.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ type t = {
constants : ModelMap.t;
functions : ModelMap.t;
arrays : ModelMap.t;
objectives: (Expr.t * objective_value) Util.MI.t
objectives: (Expr.t * objective_value) Util.MI.t;
terms_values : (Shostak.Combine.r * string) Expr.Map.t
}

module Pp_smtlib_term = struct
Expand Down Expand Up @@ -437,9 +438,6 @@ module SmtlibCounterExample = struct
) fprofs;
!records

let output_arrays_counterexample fmt _arrays =
fprintf fmt "@ ; Arrays not yet supported@ "

let output_objectives fmt objectives =
(* TODO: we can decide to print objectives to stderr if
Options.get_objectives_in_interpretation() is enabled *)
Expand Down
5 changes: 4 additions & 1 deletion src/lib/frontend/models.mli
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ type t = {
constants : ModelMap.t;
functions : ModelMap.t;
arrays : ModelMap.t;
objectives: (Expr.t * objective_value) Util.MI.t
objectives: (Expr.t * objective_value) Util.MI.t;
terms_values : (Shostak.Combine.r * string) Expr.Map.t
(** A map from terms to their values in the model (as a
representative of type X.r and as a string. *)
}

val output_concrete_model : t Fmt.t
Expand Down
3 changes: 2 additions & 1 deletion src/lib/reasoners/uf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,8 @@ let extract_concrete_model ~prop_model ~optimized_splits env =
in
let objectives = compute_objectives ~optimized_splits env mrepr in
{ Models.propositional = prop_model;
functions; constants; arrays; objectives }
functions; constants; arrays; objectives;
terms_values = mrepr }
))
else
None

0 comments on commit c203ad1

Please sign in to comment.