+ Output the assertions after preprocessing and before clausification.\n\
Can also specify \"assertions:pre-PASS\" or \"assertions:post-PASS\",\n\
where PASS is one of the preprocessing passes: definition-expansion\n\
- boolean-terms constrain-subtypes substitution skolem-quant simplify\n\
- static-learning ite-removal repeat-simplify rewrite-apply-to-const\n\
- theory-preprocessing.\n\
+ boolean-terms constrain-subtypes substitution strings-pp skolem-quant\n\
+ simplify static-learning ite-removal repeat-simplify\n\
+ rewrite-apply-to-const theory-preprocessing.\n\
PASS can also be the special value \"everything\", in which case the\n\
assertions are printed before any preprocessing (with\n\
\"assertions:pre-everything\") or after all preprocessing completes\n\
} else if(!strcmp(p, "boolean-terms")) {
} else if(!strcmp(p, "constrain-subtypes")) {
} else if(!strcmp(p, "substitution")) {
+ } else if(!strcmp(p, "strings-pp")) {
} else if(!strcmp(p, "skolem-quant")) {
} else if(!strcmp(p, "simplify")) {
} else if(!strcmp(p, "static-learning")) {
// Assertions ARE guaranteed to be rewritten by this point
if( d_smt.d_logic.isTheoryEnabled(THEORY_STRINGS) ) {
+ dumpAssertions("pre-strings-pp", d_assertionsToPreprocess);
CVC4::theory::strings::StringsPreprocess sp;
- sp.simplify( d_assertionsToPreprocess );
+ std::vector<Node> newNodes;
+ newNodes.push_back(d_assertionsToPreprocess[d_realAssertionsEnd - 1]);
+ sp.simplify( d_assertionsToPreprocess, newNodes );
+ if(newNodes.size() > 1) {
+ d_assertionsToPreprocess[d_realAssertionsEnd - 1] = NodeManager::currentNM()->mkNode(kind::AND, newNodes);
+ }
for (unsigned i = 0; i < d_assertionsToPreprocess.size(); ++ i) {
d_assertionsToPreprocess[i] = Rewriter::rewrite( d_assertionsToPreprocess[i] );
}
+ dumpAssertions("post-strings-pp", d_assertionsToPreprocess);
}
if( d_smt.d_logic.isQuantified() ){
dumpAssertions("pre-skolem-quant", d_assertionsToPreprocess);
return retNode;
}
-void StringsPreprocess::simplify(std::vector< Node > &vec_node) {
- std::vector< Node > new_nodes;
+void StringsPreprocess::simplify(std::vector< Node > &vec_node, std::vector< Node > &new_nodes) {
for( unsigned i=0; i<vec_node.size(); i++ ){
vec_node[i] = simplify( vec_node[i], new_nodes );
}
+}
+
+void StringsPreprocess::simplify(std::vector< Node > &vec_node) {
+ std::vector< Node > new_nodes;
+ simplify(vec_node, new_nodes);
vec_node.insert( vec_node.end(), new_nodes.begin(), new_nodes.end() );
}
void simplifyRegExp( Node s, Node r, std::vector< Node > &ret, std::vector< Node > &nn );
Node simplify( Node t, std::vector< Node > &new_nodes );
public:
+ void simplify(std::vector< Node > &vec_node, std::vector< Node > &new_nodes);
void simplify(std::vector< Node > &vec_node);
StringsPreprocess();
};