Setting timeout to Z3 and CVC4

This commit is contained in:
Leonardo Alt 2018-07-27 09:14:50 +02:00
parent c633ebe2e6
commit b356f6a7f9
3 changed files with 8 additions and 1 deletions

View File

@ -37,6 +37,7 @@ void CVC4Interface::reset()
m_functions.clear();
m_solver.reset();
m_solver.setOption("produce-models", true);
m_solver.setTimeLimit(queryTimeout);
}
void CVC4Interface::push()

View File

@ -231,9 +231,12 @@ public:
/// is available. Throws SMTSolverError on error.
virtual std::pair<CheckResult, std::vector<std::string>>
check(std::vector<Expression> const& _expressionsToEvaluate) = 0;
protected:
// SMT query timeout in milliseconds.
static int const queryTimeout = 10000;
};
}
}
}

View File

@ -28,7 +28,10 @@ using namespace dev::solidity::smt;
Z3Interface::Z3Interface():
m_solver(m_context)
{
// This needs to be set globally.
z3::set_param("rewriter.pull_cheap_ite", true);
// This needs to be set in the context.
m_context.set("timeout", queryTimeout);
}
void Z3Interface::reset()