diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2021-05-27 15:02:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 20:02:43 +0000 |
commit | 8d63f44d93ae91c5b89a9cf866ba33c954465398 (patch) | |
tree | d38a3f502cbfc3ae0a50a9e9e32788f14c72d37f /src | |
parent | c95d4c5473e8c26832fef89a9a42275517a42613 (diff) |
Fix spurious assertion for trivial abduction (#6629)
Fixes 2nd benchmark from #6605.
Diffstat (limited to 'src')
-rw-r--r-- | src/smt/abduction_solver.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/smt/abduction_solver.cpp b/src/smt/abduction_solver.cpp index 6be05c6b7..ff1337fe1 100644 --- a/src/smt/abduction_solver.cpp +++ b/src/smt/abduction_solver.cpp @@ -105,20 +105,22 @@ bool AbductionSolver::getAbductInternal(Node& abd) } // get the grammar type for the abduct Node agdtbv = d_sssf.getAttribute(SygusSynthFunVarListAttribute()); - Assert(!agdtbv.isNull()); - Assert(agdtbv.getKind() == kind::BOUND_VAR_LIST); - // convert back to original - // must replace formal arguments of abd with the free variables in the - // input problem that they correspond to. - std::vector<Node> vars; - std::vector<Node> syms; - SygusVarToTermAttribute sta; - for (const Node& bv : agdtbv) + if(!agdtbv.isNull()) { - vars.push_back(bv); - syms.push_back(bv.hasAttribute(sta) ? bv.getAttribute(sta) : bv); + Assert(agdtbv.getKind() == kind::BOUND_VAR_LIST); + // convert back to original + // must replace formal arguments of abd with the free variables in the + // input problem that they correspond to. + std::vector<Node> vars; + std::vector<Node> syms; + SygusVarToTermAttribute sta; + for (const Node& bv : agdtbv) + { + vars.push_back(bv); + syms.push_back(bv.hasAttribute(sta) ? bv.getAttribute(sta) : bv); + } + abd = abd.substitute(vars.begin(), vars.end(), syms.begin(), syms.end()); } - abd = abd.substitute(vars.begin(), vars.end(), syms.begin(), syms.end()); // if check abducts option is set, we check the correctness if (options::checkAbducts()) |