Skip to content

Commit 9120d44

Browse files
committed
Execute swine directly in the command line
1 parent 9b6388a commit 9120d44

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

z3rro/src/prover.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,23 @@ pub enum ProveResult<'ctx> {
4545
Unknown(ReasonUnknown),
4646
}
4747

48-
/// Execute swine-z3 on the file located at file_path
48+
/// Execute swine on the file located at file_path
4949
fn execute_swine(file_path: &Path) -> Result<SatResult, CommandError> {
50-
match env::var("SWINE") {
51-
// Use "export SWINE=<path_for_swine>" to set the path for swine in the SWINE variable.
52-
Ok(swine) => {
53-
let output = Command::new(swine).arg(file_path).output();
54-
55-
match output {
56-
Ok(output) => {
57-
let stdout = String::from_utf8_lossy(&output.stdout);
58-
59-
if stdout.contains("unsat") {
60-
Ok(SatResult::Unsat)
61-
} else if stdout.contains("sat") {
62-
Ok(SatResult::Sat)
63-
} else {
64-
Ok(SatResult::Unknown)
65-
}
66-
}
67-
Err(e) => Err(CommandError::ProcessError(e)),
50+
let output = Command::new("swine").arg(file_path).output();
51+
52+
match output {
53+
Ok(output) => {
54+
let stdout = String::from_utf8_lossy(&output.stdout);
55+
56+
if stdout.contains("unsat") {
57+
Ok(SatResult::Unsat)
58+
} else if stdout.contains("sat") {
59+
Ok(SatResult::Sat)
60+
} else {
61+
Ok(SatResult::Unknown)
6862
}
6963
}
70-
Err(e) => Err(CommandError::EnvVarError(e)),
64+
Err(e) => Err(CommandError::ProcessError(e)),
7165
}
7266
}
7367

0 commit comments

Comments
 (0)