summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers/term_util.cpp
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2018-04-02 20:03:16 -0500
committerGitHub <noreply@github.com>2018-04-02 20:03:16 -0500
commit4a516e33436fb0abd9efd9b8ec92a8e65534ce3a (patch)
treebb6c864ef6da32b67f30fcc28daa2b0afde527d5 /src/theory/quantifiers/term_util.cpp
parentbc6cb232c11d65f763844c2c9274444446aee26e (diff)
Improvements to extended rewriter for Booleans and ITE (#1705)
Diffstat (limited to 'src/theory/quantifiers/term_util.cpp')
-rw-r--r--src/theory/quantifiers/term_util.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/theory/quantifiers/term_util.cpp b/src/theory/quantifiers/term_util.cpp
index 3b8d03399..5965906cb 100644
--- a/src/theory/quantifiers/term_util.cpp
+++ b/src/theory/quantifiers/term_util.cpp
@@ -773,13 +773,22 @@ bool TermUtil::containsUninterpretedConstant( Node n ) {
Node TermUtil::simpleNegate( Node n ){
if( n.getKind()==OR || n.getKind()==AND ){
std::vector< Node > children;
- for( unsigned i=0; i<n.getNumChildren(); i++ ){
- children.push_back( simpleNegate( n[i] ) );
+ for (const Node& cn : n)
+ {
+ children.push_back(simpleNegate(cn));
}
return NodeManager::currentNM()->mkNode( n.getKind()==OR ? AND : OR, children );
- }else{
- return n.negate();
}
+ return n.negate();
+}
+
+Node TermUtil::mkNegate(Kind notk, Node n)
+{
+ if (n.getKind() == notk)
+ {
+ return n[0];
+ }
+ return NodeManager::currentNM()->mkNode(notk, n);
}
bool TermUtil::isAssoc( Kind k ) {
@@ -912,6 +921,11 @@ Node TermUtil::getTypeValueOffset(TypeNode tn,
return it->second;
}
+Node TermUtil::mkTypeConst(TypeNode tn, bool pol)
+{
+ return pol ? mkTypeValue(tn, 0) : mkTypeMaxValue(tn);
+}
+
bool TermUtil::isAntisymmetric(Kind k, Kind& dk)
{
if (k == GT)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback