diff options
author | Andrew Reynolds <andrew.j.reynolds@gmail.com> | 2020-12-08 22:08:52 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 20:08:52 -0800 |
commit | e0846857d7f0a926203695315b565b3541175525 (patch) | |
tree | ee11d9f081808f194929f3700603b729dd2e1d5c /src/theory/quantifiers/cegqi | |
parent | 6444abbbcf5f298045c32ce3d69033b8f93a41d8 (diff) |
Ensure CEGQI is applied for parametric datatypes when applicable (#5628)
Previously was a bug computing the argument types of parametric datatypes.
Diffstat (limited to 'src/theory/quantifiers/cegqi')
-rw-r--r-- | src/theory/quantifiers/cegqi/ceg_instantiator.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp index 0a5deb480..4e00a08e7 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp @@ -344,12 +344,24 @@ CegHandledStatus CegInstantiator::isCbqiSort( const DType& dt = tn.getDType(); for (unsigned i = 0, ncons = dt.getNumConstructors(); i < ncons; i++) { - for (unsigned j = 0, nargs = dt[i].getNumArgs(); j < nargs; j++) + // get the constructor type + TypeNode consType; + if (dt.isParametric()) + { + // if parametric, must instantiate the argument types + consType = dt[i].getSpecializedConstructorType(tn); + } + else + { + consType = dt[i].getConstructor().getType(); + } + for (const TypeNode& crange : consType) { - TypeNode crange = dt[i].getArgType(j); CegHandledStatus cret = isCbqiSort(crange, visited, qe); if (cret == CEG_UNHANDLED) { + Trace("cegqi-debug2") + << "Non-cbqi sort : " << tn << " due to " << crange << std::endl; visited[tn] = CEG_UNHANDLED; return CEG_UNHANDLED; } |