summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/sygus/cegis_unif.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-04-07 13:36:15 -0500
committerGitHub <noreply@github.com>2021-04-07 18:36:15 +0000
commit04a494e251a8cc2c90bb429e2858f1c4eb8f88ff (patch)
tree03b1a5792f2f6ca5537353b86682f427090668da /src/theory/quantifiers/sygus/cegis_unif.cpp
parent5059658ee0d6fc65e4cb1652c605895d016cd274 (diff)
Replace calls to NodeManager::mkSkolem with SkolemManager::mkDummySkolem (#6291)
This is in preparation for refactoring skolem creation throughout the code base to improve proofs and migrate Theory::expandDefinitions to Rewriter::expandDefinitions. This PR also eliminates some unused code in TheoryArithPrivate. Followup PRs will start formalizing/eliminating calls to mkDummySkolem.
Diffstat (limited to 'src/theory/quantifiers/sygus/cegis_unif.cpp')
-rw-r--r--src/theory/quantifiers/sygus/cegis_unif.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/theory/quantifiers/sygus/cegis_unif.cpp b/src/theory/quantifiers/sygus/cegis_unif.cpp
index 9a5c6146d..84e9f1070 100644
--- a/src/theory/quantifiers/sygus/cegis_unif.cpp
+++ b/src/theory/quantifiers/sygus/cegis_unif.cpp
@@ -14,6 +14,7 @@
#include "theory/quantifiers/sygus/cegis_unif.h"
+#include "expr/skolem_manager.h"
#include "expr/sygus_datatype.h"
#include "options/quantifiers_options.h"
#include "printer/printer.h"
@@ -417,7 +418,8 @@ CegisUnifEnumDecisionStrategy::CegisUnifEnumDecisionStrategy(
Node CegisUnifEnumDecisionStrategy::mkLiteral(unsigned n)
{
NodeManager* nm = NodeManager::currentNM();
- Node new_lit = nm->mkSkolem("G_cost", nm->booleanType());
+ SkolemManager* sm = nm->getSkolemManager();
+ Node newLit = sm->mkDummySkolem("G_cost", nm->booleanType());
unsigned new_size = n + 1;
// allocate an enumerator for each candidate
@@ -425,13 +427,13 @@ Node CegisUnifEnumDecisionStrategy::mkLiteral(unsigned n)
{
Node c = ci.first;
TypeNode ct = c.getType();
- Node eu = nm->mkSkolem("eu", ct);
+ Node eu = sm->mkDummySkolem("eu", ct);
Node ceu;
if (!d_useCondPool && !ci.second.d_enums[0].empty())
{
// make a new conditional enumerator as well, starting the
// second type around
- ceu = nm->mkSkolem("cu", ci.second.d_ce_type);
+ ceu = sm->mkDummySkolem("cu", ci.second.d_ce_type);
}
// register the new enumerators
for (unsigned index = 0; index < 2; index++)
@@ -452,7 +454,7 @@ Node CegisUnifEnumDecisionStrategy::mkLiteral(unsigned n)
{
Trace("cegis-unif-enum") << "...increasing enum number for hd " << ei
<< " to new size " << new_size << "\n";
- registerEvalPtAtSize(c, ei, new_lit, new_size);
+ registerEvalPtAtSize(c, ei, newLit, new_size);
}
}
// enforce fairness between number of enumerators and enumerator size
@@ -483,7 +485,7 @@ Node CegisUnifEnumDecisionStrategy::mkLiteral(unsigned n)
datatypes.push_back(sdt.getDatatype());
std::vector<TypeNode> dtypes = nm->mkMutualDatatypeTypes(
datatypes, unresolvedTypes, NodeManager::DATATYPE_FLAG_PLACEHOLDER);
- d_virtual_enum = nm->mkSkolem("_ve", dtypes[0]);
+ d_virtual_enum = sm->mkDummySkolem("_ve", dtypes[0]);
d_tds->registerEnumerator(
d_virtual_enum, Node::null(), d_parent, ROLE_ENUM_CONSTRAINED);
}
@@ -497,7 +499,7 @@ Node CegisUnifEnumDecisionStrategy::mkLiteral(unsigned n)
Node size_ve = nm->mkNode(DT_SIZE, d_virtual_enum);
Node fair_lemma =
nm->mkNode(GEQ, size_ve, nm->mkConst(Rational(pow_two - 1)));
- fair_lemma = nm->mkNode(OR, new_lit, fair_lemma);
+ fair_lemma = nm->mkNode(OR, newLit, fair_lemma);
Trace("cegis-unif-enum-lemma")
<< "CegisUnifEnum::lemma, fairness size:" << fair_lemma << "\n";
// this lemma relates the number of conditions we enumerate and the
@@ -510,7 +512,7 @@ Node CegisUnifEnumDecisionStrategy::mkLiteral(unsigned n)
}
}
- return new_lit;
+ return newLit;
}
void CegisUnifEnumDecisionStrategy::initialize(
@@ -526,6 +528,7 @@ void CegisUnifEnumDecisionStrategy::initialize(
}
// initialize type information for candidates
NodeManager* nm = NodeManager::currentNM();
+ SkolemManager* sm = nm->getSkolemManager();
for (const Node& e : es)
{
Trace("cegis-unif-enum-debug") << "...adding strategy point " << e << "\n";
@@ -570,7 +573,7 @@ void CegisUnifEnumDecisionStrategy::initialize(
// allocate a condition enumerator for each candidate
for (std::pair<const Node, StrategyPtInfo>& ci : d_ce_info)
{
- Node ceu = nm->mkSkolem("cu", ci.second.d_ce_type);
+ Node ceu = sm->mkDummySkolem("cu", ci.second.d_ce_type);
setUpEnumerator(ceu, ci.second, 1);
}
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback