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

adding an option to pass a time limit to vampire #139

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/command_line/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ pub enum Command {
/// - additional knowledge used to construct the claim (e.g., user guide, proof outline).
#[arg(verbatim_doc_comment)]
files: Vec<PathBuf>,

/// The time limit in seconds to prove each conjecture passed to Vampire
#[arg(long, short, default_value_t = 30)]
time_limit: u16,
},
}

Expand Down
3 changes: 2 additions & 1 deletion src/command_line/procedures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub fn main() -> Result<()> {
no_proof_search,
save_problems: out_dir,
files,
time_limit,
} => {
let files =
Files::sort(files).context("unable to sort the given files by their function")?;
Expand Down Expand Up @@ -140,7 +141,7 @@ pub fn main() -> Result<()> {
let mut success = true;
for problem in problems {
// TODO: Handle the error cases properly
let report = Vampire.prove(problem)?;
let report = Vampire.prove(problem, time_limit)?;
if !matches!(report.status()?, Status::Success(Success::Theorem)) {
success = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/verifying/prover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ pub trait Prover {
type Report: Report;
type Error;

fn prove(&self, problem: Problem) -> Result<Self::Report, Self::Error>;
fn prove(&self, problem: Problem, time_limit: u16) -> Result<Self::Report, Self::Error>;
}
4 changes: 2 additions & 2 deletions src/verifying/prover/vampire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ impl Prover for Vampire {
type Error = VampireError;
type Report = VampireReport;

fn prove(&self, problem: Problem) -> Result<Self::Report, Self::Error> {
fn prove(&self, problem: Problem, time_limit: u16) -> Result<Self::Report, Self::Error> {
let mut child = Command::new("vampire")
.args(["--mode", "casc"])
.args(["--mode", "casc", "--time_limit", &time_limit.to_string()])
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down
Loading