summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-12-10 15:47:18 -0600
committerGitHub <noreply@github.com>2021-12-10 21:47:18 +0000
commitbcd447593e30dd08c6dfc2e162505b9e815fd29b (patch)
tree2dfd99b5c66a14bd6940b2a05d434a975c275cda /src/theory/quantifiers
parent43170db86742dd5fbe33b4bdc9a938f6c1ceae5d (diff)
Refactor and fixes related to getSpecializedConstructorTerm (#7774)
Fixes cvc5/cvc5-projects#381.
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r--src/theory/quantifiers/cegqi/ceg_instantiator.cpp2
-rw-r--r--src/theory/quantifiers/quant_split.cpp2
-rw-r--r--src/theory/quantifiers/quantifiers_rewriter.cpp6
-rw-r--r--src/theory/quantifiers/skolemize.cpp4
-rw-r--r--src/theory/quantifiers/sygus/sygus_grammar_cons.cpp7
5 files changed, 10 insertions, 11 deletions
diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
index 9556d3f9c..ec33fe5fd 100644
--- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
+++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
@@ -357,7 +357,7 @@ CegHandledStatus CegInstantiator::isCbqiSort(
if (dt.isParametric())
{
// if parametric, must instantiate the argument types
- consType = dt[i].getSpecializedConstructorType(tn);
+ consType = dt[i].getInstantiatedConstructorType(tn);
}
else
{
diff --git a/src/theory/quantifiers/quant_split.cpp b/src/theory/quantifiers/quant_split.cpp
index 55fa2a1e5..e6cee778b 100644
--- a/src/theory/quantifiers/quant_split.cpp
+++ b/src/theory/quantifiers/quant_split.cpp
@@ -167,7 +167,7 @@ void QuantDSplit::check(Theory::Effort e, QEffort quant_e)
for (unsigned j = 0, ncons = dt.getNumConstructors(); j < ncons; j++)
{
std::vector<Node> vars;
- TypeNode dtjtn = dt[j].getSpecializedConstructorType(tn);
+ TypeNode dtjtn = dt[j].getInstantiatedConstructorType(tn);
Assert(dtjtn.getNumChildren() == dt[j].getNumArgs() + 1);
for (unsigned k = 0, nargs = dt[j].getNumArgs(); k < nargs; k++)
{
diff --git a/src/theory/quantifiers/quantifiers_rewriter.cpp b/src/theory/quantifiers/quantifiers_rewriter.cpp
index ba10a2efc..2002c73db 100644
--- a/src/theory/quantifiers/quantifiers_rewriter.cpp
+++ b/src/theory/quantifiers/quantifiers_rewriter.cpp
@@ -906,9 +906,9 @@ bool QuantifiersRewriter::getVarElimLit(Node body,
// take into account if parametric
if (dt.isParametric())
{
- tspec = c.getSpecializedConstructorType(lit[0].getType());
- cons = nm->mkNode(
- APPLY_TYPE_ASCRIPTION, nm->mkConst(AscriptionType(tspec)), cons);
+ TypeNode ltn = lit[0].getType();
+ tspec = c.getInstantiatedConstructorType(ltn);
+ cons = c.getInstantiatedConstructor(ltn);
}
else
{
diff --git a/src/theory/quantifiers/skolemize.cpp b/src/theory/quantifiers/skolemize.cpp
index f116b2f3c..9f2f9c91c 100644
--- a/src/theory/quantifiers/skolemize.cpp
+++ b/src/theory/quantifiers/skolemize.cpp
@@ -137,8 +137,8 @@ void Skolemize::getSelfSel(const DType& dt,
TypeNode tspec;
if (dt.isParametric())
{
- tspec = dc.getSpecializedConstructorType(n.getType());
- Trace("sk-ind-debug") << "Specialized constructor type : " << tspec
+ tspec = dc.getInstantiatedConstructorType(n.getType());
+ Trace("sk-ind-debug") << "Instantiated constructor type : " << tspec
<< std::endl;
Assert(tspec.getNumChildren() == dc.getNumArgs());
}
diff --git a/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp b/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp
index 438afbe82..95d3a5ab5 100644
--- a/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp
+++ b/src/theory/quantifiers/sygus/sygus_grammar_cons.cpp
@@ -483,7 +483,7 @@ void CegGrammarConstructor::collectSygusGrammarTypesFor(
{
// get the specialized constructor type, which accounts for
// parametric datatypes
- TypeNode ctn = dt[i].getSpecializedConstructorType(range);
+ TypeNode ctn = dt[i].getInstantiatedConstructorType(range);
std::vector<TypeNode> argTypes = ctn.getArgTypes();
for (size_t j = 0, nargs = argTypes.size(); j < nargs; ++j)
{
@@ -1010,12 +1010,11 @@ void CegGrammarConstructor::mkSygusDefaultGrammar(
{
Trace("sygus-grammar-def") << "...for " << dt[l].getName() << std::endl;
Node cop = dt[l].getConstructor();
- TypeNode tspec = dt[l].getSpecializedConstructorType(types[i]);
+ TypeNode tspec = dt[l].getInstantiatedConstructorType(types[i]);
// must specialize if a parametric datatype
if (dt.isParametric())
{
- cop = nm->mkNode(
- APPLY_TYPE_ASCRIPTION, nm->mkConst(AscriptionType(tspec)), cop);
+ cop = dt[l].getInstantiatedConstructor(types[i]);
}
if (dt[l].getNumArgs() == 0)
{
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback