mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9869 from ethereum/smt_fix_old_z3_cex
[SMTChecker] Do not throw when counterexample is not available
This commit is contained in:
commit
a23e865645
@ -142,14 +142,17 @@ instead of a path.
|
||||
*/
|
||||
CHCSolverInterface::CexGraph Z3CHCInterface::cexGraph(z3::expr const& _proof)
|
||||
{
|
||||
CexGraph graph;
|
||||
|
||||
/// The root fact of the refutation proof is `false`.
|
||||
/// The node itself is not a hyper resolution, so we need to
|
||||
/// extract the `query` hyper resolution node from the
|
||||
/// `false` node (the first child).
|
||||
smtAssert(_proof.is_app(), "");
|
||||
smtAssert(fact(_proof).decl().decl_kind() == Z3_OP_FALSE, "");
|
||||
/// The proof has the shape above for z3 >=4.8.8.
|
||||
/// If an older version is used, this check will fail and no
|
||||
/// counterexample will be generated.
|
||||
if (!_proof.is_app() || fact(_proof).decl().decl_kind() != Z3_OP_FALSE)
|
||||
return {};
|
||||
|
||||
CexGraph graph;
|
||||
|
||||
stack<z3::expr> proofStack;
|
||||
proofStack.push(_proof.arg(0));
|
||||
|
Loading…
Reference in New Issue
Block a user