From: Morgan Deters Date: Fri, 21 Feb 2014 19:45:52 +0000 (-0500) Subject: Fix two variants of Node::substitute(). X-Git-Tag: cvc5-1.0.0~6987^2~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b712a12978ea0c1f0f57bb72e28dc1286dc8ac69;p=cvc5.git Fix two variants of Node::substitute(). Node::substitute() is overloaded. One version was properly substituting operators (e.g. the "f" in f(x) could be substituted). The others were ignoring anything in function position. Fixed. Thanks to Wei Wang for pointing this out. --- diff --git a/src/expr/node.h b/src/expr/node.h index e7c51f0e2..9ada7879c 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -1376,7 +1376,9 @@ NodeTemplate::substitute(Iterator1 nodesBegin, NodeBuilder<> nb(getKind()); if(getMetaKind() == kind::metakind::PARAMETERIZED) { // push the operator - nb << getOperator(); + nb << getOperator().substitute(nodesBegin, nodesEnd, + replacementsBegin, replacementsEnd, + cache); } for(const_iterator i = begin(), iend = end(); @@ -1427,7 +1429,7 @@ NodeTemplate::substitute(Iterator substitutionsBegin, NodeBuilder<> nb(getKind()); if(getMetaKind() == kind::metakind::PARAMETERIZED) { // push the operator - nb << getOperator(); + nb << getOperator().substitute(substitutionsBegin, substitutionsEnd, cache); } for(const_iterator i = begin(), iend = end();