Skip to content

Commit

Permalink
support (exit) command
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcloughlin committed Nov 21, 2024
1 parent 92f6261 commit bfebf84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,19 @@ impl Context {
)
}

/// Instruct the solver to exit.
pub fn exit(&mut self) -> io::Result<()> {
let solver = self
.solver
.as_mut()
.expect("exit requires a running solver");
solver.ack_command(
&self.arena,
self.atoms.success,
self.arena.list(vec![self.atoms.exit]),
)
}

/// Push a new context frame in the solver. Same as SMTLIB's `push` command.
pub fn push(&mut self) -> io::Result<()> {
let solver = self
Expand Down
1 change: 1 addition & 0 deletions src/known_atoms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ macro_rules! for_each_known_atom {
get_unsat_core: "get-unsat-core";
set_logic: "set-logic";
set_option: "set-option";
exit: "exit";
push: "push";
pop: "pop";
bool: "Bool";
Expand Down

0 comments on commit bfebf84

Please sign in to comment.