Skip to content

Commit

Permalink
do not save a replay file
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Nov 16, 2023
1 parent 66029b1 commit 0e3c136
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/bmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn main() {
let checker_opts = mc::SmtModelCheckerOptions {
check_constraints: true,
check_bad_states_individually: true,
save_smt_replay: false,
};
let solver = mc::BITWUZLA_CMD;
if args.verbose {
Expand Down
9 changes: 8 additions & 1 deletion src/mc/smt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ pub struct SmtModelCheckerOptions {
pub check_constraints: bool,
/// Perform one SMT solver check per assertion instead of combining them into a single check.
pub check_bad_states_individually: bool,
/// If true, the communication with the SMT solver will be logged into a `replay.smt` file.
pub save_smt_replay: bool,
}

pub struct SmtModelChecker {
Expand All @@ -50,9 +52,14 @@ impl SmtModelChecker {
k_max: u64,
) -> Result<ModelCheckResult> {
assert!(k_max > 0 && k_max <= 2000, "unreasonable k_max={}", k_max);
let replay_file = if self.opts.save_smt_replay {
Some(std::fs::File::create("replay.smt")?)
} else {
None
};
let mut smt_ctx = easy_smt::ContextBuilder::new()
.solver(self.solver.name, self.solver.args)
.replay_file(Some(std::fs::File::create("replay.smt")?))
.replay_file(replay_file)
.build()?;

// z3 only supports the non-standard as-const array syntax when the logic is set to ALL
Expand Down

0 comments on commit 0e3c136

Please sign in to comment.