summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/cegqi
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2021-02-17 21:15:39 -0600
committerGitHub <noreply@github.com>2021-02-17 21:15:39 -0600
commit0bd5ef36d2b773912c3049f8f3fed62eaf0fa68b (patch)
tree10885ad08d1a3b7d311b21a8223183e8cfe611d1 /src/theory/quantifiers/cegqi
parent7ca17deba3b0f0308bda304ac739caf43e9536c0 (diff)
Eliminate non-static members in term util (#5919)
This makes it so that TermUtil is now a collection of static methods. Further refactoring will make this a standalone file of utility methods. This breaks all dependencies on the TermUtil object in QuantifiersEngine. It also starts breaking some of the depenendencies on quantifiers engine in sygus.
Diffstat (limited to 'src/theory/quantifiers/cegqi')
-rw-r--r--src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp5
-rw-r--r--src/theory/quantifiers/cegqi/ceg_instantiator.cpp18
2 files changed, 14 insertions, 9 deletions
diff --git a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp
index d620da7b5..f107c56e5 100644
--- a/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp
+++ b/src/theory/quantifiers/cegqi/ceg_arith_instantiator.cpp
@@ -870,10 +870,7 @@ CegTermType ArithInstantiator::solve_arith(CegInstantiator* ci,
{
// redo, split integer/non-integer parts
bool useCoeff = false;
- Integer coeff = ci->getQuantifiersEngine()
- ->getTermUtil()
- ->d_one.getConst<Rational>()
- .getNumerator();
+ Integer coeff(1);
for (std::map<Node, Node>::iterator it = msum.begin(); it != msum.end();
++it)
{
diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
index b2fff012e..8b60152a8 100644
--- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
+++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp
@@ -1246,6 +1246,7 @@ Node CegInstantiator::applySubstitutionToLiteral( Node lit, std::vector< Node >&
bool pol = lit.getKind()!=NOT;
//arithmetic inequalities and disequalities
if( atom.getKind()==GEQ || ( atom.getKind()==EQUAL && !pol && atom[0].getType().isReal() ) ){
+ NodeManager* nm = NodeManager::currentNM();
Assert(atom.getKind() != GEQ || atom[1].isConst());
Node atom_lhs;
Node atom_rhs;
@@ -1253,20 +1254,27 @@ Node CegInstantiator::applySubstitutionToLiteral( Node lit, std::vector< Node >&
atom_lhs = atom[0];
atom_rhs = atom[1];
}else{
- atom_lhs = NodeManager::currentNM()->mkNode( MINUS, atom[0], atom[1] );
+ atom_lhs = nm->mkNode(MINUS, atom[0], atom[1]);
atom_lhs = Rewriter::rewrite( atom_lhs );
- atom_rhs = getQuantifiersEngine()->getTermUtil()->d_zero;
+ atom_rhs = nm->mkConst(Rational(0));
}
//must be an eligible term
if( isEligible( atom_lhs ) ){
//apply substitution to LHS of atom
TermProperties atom_lhs_prop;
- atom_lhs = applySubstitution( NodeManager::currentNM()->realType(), atom_lhs, vars, subs, prop, non_basic, atom_lhs_prop );
+ atom_lhs = applySubstitution(nm->realType(),
+ atom_lhs,
+ vars,
+ subs,
+ prop,
+ non_basic,
+ atom_lhs_prop);
if( !atom_lhs.isNull() ){
if( !atom_lhs_prop.d_coeff.isNull() ){
- atom_rhs = Rewriter::rewrite( NodeManager::currentNM()->mkNode( MULT, atom_lhs_prop.d_coeff, atom_rhs ) );
+ atom_rhs = nm->mkNode(MULT, atom_lhs_prop.d_coeff, atom_rhs);
+ atom_rhs = Rewriter::rewrite(atom_rhs);
}
- lret = NodeManager::currentNM()->mkNode( atom.getKind(), atom_lhs, atom_rhs );
+ lret = nm->mkNode(atom.getKind(), atom_lhs, atom_rhs);
if( !pol ){
lret = lret.negate();
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback