Skip to content

Commit

Permalink
Uncomment part of the test
Browse files Browse the repository at this point in the history
  • Loading branch information
hra687261 authored and filipeom committed May 31, 2024
1 parent bbe5835 commit 50a135b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/test_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,33 @@ module Make (M : Mappings_intf.S) = struct
let symbol_x = Symbol.("x" @: Ty_int) in
let x = Expr.mk_symbol symbol_x in
assert_sat (Solver.check solver []);

Solver.push solver;
Solver.add solver Int.[ x >= int 0 ];
assert_sat (Solver.check solver []);
assert (
let v = Solver.get_value solver x in
Expr.equal v (int 0) );
Solver.pop solver 1;

Solver.push solver;
Solver.add solver [ x = int 3 ];
assert_sat (Solver.check solver []);
assert (
let v = Solver.get_value solver Int.(x * x) in
Expr.equal v (int 9) );
Solver.pop solver 1;
(* assert_sat (Solver.check solver []);
let model = Solver.model ~symbols:[ symbol_x ] solver in
let val_x = Option.bind model (fun m -> Model.evaluate m symbol_x) in
assert (Option.is_some val_x); *)

Solver.push solver;
Solver.add solver Int.[ x >= int 0 || x < int 0 ];
assert_sat (Solver.check solver []);
(* necessary, otherwise the solver doesn't know x and can't produce a model
for it *)
let model = Solver.model ~symbols:[ symbol_x ] solver in
let val_x = Option.bind model (fun m -> Model.evaluate m symbol_x) in
assert (Option.is_some val_x);
Solver.pop solver 1;

Solver.add solver [ x = int 5 ];
assert_sat (Solver.check solver []);
let model = Solver.model solver in
Expand Down

0 comments on commit 50a135b

Please sign in to comment.