Skip to content

Commit

Permalink
Fix double push (#999)
Browse files Browse the repository at this point in the history
* Fix double push

* Adding test
  • Loading branch information
Stevendeo authored Dec 5, 2023
1 parent b9ca08f commit ba108a6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/frontend/frontend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,7 @@ module Make(SAT : Sat_solver_sig.S) : S with type sat_env = SAT.t = struct
ignore loc;
Util.loop ~f:(fun _ res () -> Stack.push res env.consistent_dep_stack)
~max:n ~elt:(env.res, env.expl) ~init:();
Steps.apply_without_step_limit (fun () -> SAT.push env.sat_env n);
SAT.push env.sat_env n
Steps.apply_without_step_limit (fun () -> SAT.push env.sat_env n)

let internal_pop ?(loc = Loc.dummy) (n : int) (env : env) : unit =
ignore loc;
Expand Down
21 changes: 21 additions & 0 deletions tests/dune.inc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tests/smtlib/testfile-push-pop2.dolmen.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

unknown
11 changes: 11 additions & 0 deletions tests/smtlib/testfile-push-pop2.dolmen.smt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(set-logic ALL)

(declare-const x Int)

(push 1)
(assert (> x 0))
(push 1)
(pop 1)
(pop 1)
(assert (< x 0))
(check-sat)

0 comments on commit ba108a6

Please sign in to comment.