// The representation is now the skolem
return skolem;
}
-
- if(node.getKind() == kind::FORALL || node.getKind() == kind::EXISTS) {
+
+ if (node.getKind() == kind::FORALL || node.getKind() == kind::EXISTS
+ || node.getKind() == kind::LAMBDA
+ || node.getKind() == kind::CHOICE)
+ {
// Remember if we're inside a quantifier
inQuant = true;
}else if( !inTerm && hasNestedTermChildren( node ) ){
return cached.isNull() ? Node(node) : cached;
}
- if(node.getKind() == kind::FORALL || node.getKind() == kind::EXISTS) {
+ if (node.getKind() == kind::FORALL || node.getKind() == kind::EXISTS
+ || node.getKind() == kind::LAMBDA
+ || node.getKind() == kind::CHOICE)
+ {
// Remember if we're inside a quantifier
inQuant = true;
}else if( !inTerm && hasNestedTermChildren( node ) ){
// sygus attribute to mark the conjecture as a sygus conjecture
Trace("sygus-infer") << "Make outer sygus conjecture..." << std::endl;
- Node sygusVar = nm->mkBoundVar("sygus", nm->booleanType());
+ Node sygusVar = nm->mkSkolem("sygus", nm->booleanType());
SygusAttribute ca;
sygusVar.setAttribute(ca, true);
Node instAttr = nm->mkNode(INST_ATTRIBUTE, sygusVar);
Node n,
std::vector<Node> node_values,
std::string str_value) override;
- bool ppDontRewriteSubterm(TNode atom) override
- {
- return atom.getKind() == kind::FORALL || atom.getKind() == kind::EXISTS;
- }
private:
void assertUniversal( Node n );
Debug("register::internal") << "PreRegisterVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl;
- if( ( parent.getKind() == kind::FORALL ||
- parent.getKind() == kind::EXISTS ||
- parent.getKind() == kind::REWRITE_RULE ||
- parent.getKind() == kind::SEP_STAR ||
- parent.getKind() == kind::SEP_WAND ||
- ( parent.getKind() == kind::SEP_LABEL && current.getType().isBoolean() )
- // parent.getKind() == kind::CARDINALITY_CONSTRAINT
- ) &&
- current != parent ) {
+ if ((parent.getKind() == kind::FORALL || parent.getKind() == kind::EXISTS
+ || parent.getKind() == kind::LAMBDA
+ || parent.getKind() == kind::CHOICE
+ || parent.getKind() == kind::REWRITE_RULE
+ || parent.getKind() == kind::SEP_STAR
+ || parent.getKind() == kind::SEP_WAND
+ || (parent.getKind() == kind::SEP_LABEL && current.getType().isBoolean())
+ // parent.getKind() == kind::CARDINALITY_CONSTRAINT
+ )
+ && current != parent)
+ {
Debug("register::internal") << "quantifier:true" << std::endl;
return true;
}
Debug("register::internal") << "SharedTermsVisitor::alreadyVisited(" << current << "," << parent << ")" << std::endl;
- if( ( parent.getKind() == kind::FORALL ||
- parent.getKind() == kind::EXISTS ||
- parent.getKind() == kind::REWRITE_RULE ||
- parent.getKind() == kind::SEP_STAR ||
- parent.getKind() == kind::SEP_WAND ||
- ( parent.getKind() == kind::SEP_LABEL && current.getType().isBoolean() )
- // parent.getKind() == kind::CARDINALITY_CONSTRAINT
- ) &&
- current != parent ) {
+ if ((parent.getKind() == kind::FORALL || parent.getKind() == kind::EXISTS
+ || parent.getKind() == kind::LAMBDA
+ || parent.getKind() == kind::CHOICE
+ || parent.getKind() == kind::REWRITE_RULE
+ || parent.getKind() == kind::SEP_STAR
+ || parent.getKind() == kind::SEP_WAND
+ || (parent.getKind() == kind::SEP_LABEL && current.getType().isBoolean())
+ // parent.getKind() == kind::CARDINALITY_CONSTRAINT
+ )
+ && current != parent)
+ {
Debug("register::internal") << "quantifier:true" << std::endl;
return true;
}
*/
virtual Node ppRewrite(TNode atom) { return atom; }
- /**
- * Don't preprocess subterm of this term
- */
- virtual bool ppDontRewriteSubterm(TNode atom) { return false; }
-
/**
* Notify preprocessed assertions. Called on new assertions after
* preprocessing before they are asserted to theory engine.
}
// the atom should not have free variables
+ Debug("theory") << "TheoryEngine::preRegister: " << preprocessed
+ << std::endl;
Assert(!preprocessed.hasFreeVar());
// Pre-register the terms in the atom
Theory::Set theories = NodeVisitor<PreRegisterVisitor>::run(d_preRegistrationVisitor, preprocessed);
Trace("theory-pp") << "ppTheoryRewrite { " << term << endl;
Node newTerm;
- if (theoryOf(term)->ppDontRewriteSubterm(term)) {
+ // do not rewrite inside quantifiers
+ if (term.getKind() == kind::FORALL || term.getKind() == kind::EXISTS
+ || term.getKind() == kind::CHOICE
+ || term.getKind() == kind::LAMBDA)
+ {
newTerm = Rewriter::rewrite(term);
- } else {
+ }
+ else
+ {
NodeBuilder<> newNode(term.getKind());
if (term.getMetaKind() == kind::metakind::PARAMETERIZED) {
newNode << term.getOperator();