-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
496 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
/Cargo.lock | ||
/.idea/ | ||
/*.smt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
// author: Kevin Laeufer <[email protected]> | ||
|
||
use clap::Parser; | ||
use libpatron::ir::SerializableIrNode; | ||
use libpatron::ir::*; | ||
use libpatron::*; | ||
|
||
#[derive(Parser, Debug)] | ||
|
@@ -21,4 +21,27 @@ fn main() { | |
let (ctx, sys) = btor2::parse_file(&args.filename).expect("Failed to load btor2 file!"); | ||
println!("Loaded: {}", sys.name); | ||
println!("{}", sys.serialize_to_str(&ctx)); | ||
println!(); | ||
println!(); | ||
let k_max = 25; | ||
let checker_opts = mc::SmtModelCheckerOptions { | ||
check_constraints: true, | ||
check_bad_states_individually: true, | ||
}; | ||
let solver = mc::BITWUZLA_CMD; | ||
println!( | ||
"Checking up to {k_max} using {} and the following options:\n{checker_opts:?}", | ||
solver.name | ||
); | ||
let checker = mc::SmtModelChecker::new(solver, checker_opts); | ||
let res = checker.check(&ctx, &sys, k_max).unwrap(); | ||
match res { | ||
mc::ModelCheckResult::Success => { | ||
println!("unsat"); | ||
} | ||
mc::ModelCheckResult::Fail(_) => { | ||
println!("sat"); | ||
todo!("print witness") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,4 @@ extern crate lazy_static; | |
|
||
pub mod btor2; | ||
pub mod ir; | ||
mod mc; | ||
mod smt; | ||
pub mod mc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
// Copyright 2023 The Regents of the University of California | ||
// released under BSD 3-Clause License | ||
// author: Kevin Laeufer <[email protected]> | ||
mod state; | ||
mod smt; | ||
mod state; | ||
|
||
pub use smt::{ | ||
ModelCheckResult, SmtModelChecker, SmtModelCheckerOptions, SmtSolverCmd, BITWUZLA_CMD, | ||
}; | ||
pub use state::{State, Value, ValueRef, Witness}; |
Oops, something went wrong.