Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement execution of swine-z3 on SMT2 files #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SeRin-Yang
Copy link

No description provided.

Copy link
Collaborator

@Philipp15b Philipp15b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I've left a bunch of comments.

fn execute_swine(dir: &Path, file_path: &Path) {
let swine = "swine-z3";

let find_output = Command::new("find")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you'd be using find here? It should be sufficient to just do the call to swine directly.

.output().unwrap();

if cmd_output.status.success() {
println!("{}", String::from_utf8_lossy(&cmd_output.stdout));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next step would be to parse the output of SWINE and return a SatResult.

println!("{}", String::from_utf8_lossy(&cmd_output.stdout));
break;
} else {
eprintln!("Failed to execute swine({}) command with status: {}", line, cmd_output.status);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, return a Result and return an error in this case.

}
}
} else {
eprintln!("Find command execution failed");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

}
}

fn remove_lines_for_swine(input: &str) -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a doc comment saying which lines this removes.

@@ -94,6 +160,21 @@ impl<'ctx> Prover<'ctx> {
if self.min_level_with_provables.is_none() {
return ProveResult::Proof;
}

let mut smtlib = self.get_smtlib();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a next step, add an solver_type attribute of a new enum type SolverType with variants Z3 and SWINE, and then choose here whether to invoke either Z3 or SWINE.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do this like we did it for SliceVerifyMethod and the SliceOptions::slice_verify_via option in main.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants