}
}
+// This function rewrites "in" as an "as"---this is actually expected
+// to be for model-substitution, so the "in" is a Boolean-term-converted
+// node, and "as" is the original. See how it's used in function
+// handling, below.
+Node BooleanTermConverter::rewriteAs(TNode in, TypeNode as) throw() {
+ if(in.getType() == as) {
+ return in;
+ }
+ if(in.getType().isBoolean()) {
+ Assert(d_tt.getType() == as);
+ return NodeManager::currentNM()->mkNode(kind::ITE, in, d_tt, d_ff);
+ }
+ if(as.isBoolean() && in.getType().isBitVector() && in.getType().getBitVectorSize() == 1) {
+ return NodeManager::currentNM()->mkNode(kind::EQUAL, NodeManager::currentNM()->mkConst(BitVector(1u, 1u)), in);
+ }
+ if(in.getType().isDatatype()) {
+ if(as.isBoolean() && in.getType().hasAttribute(BooleanTermAttr())) {
+ return NodeManager::currentNM()->mkNode(kind::EQUAL, d_ttDt, in);
+ }
+ Assert(as.isDatatype());
+ const Datatype* dt2 = &as.getDatatype();
+ const Datatype* dt1 = d_datatypeCache[dt2];
+ Assert(dt1 != NULL, "expected datatype in cache");
+ Assert(*dt1 == in.getType().getDatatype(), "improper rewriteAs() between datatypes");
+ Node out;
+ for(size_t i = 0; i < dt1->getNumConstructors(); ++i) {
+ DatatypeConstructor ctor = (*dt1)[i];
+ NodeBuilder<> appctorb(kind::APPLY_CONSTRUCTOR);
+ appctorb << (*dt2)[i].getConstructor();
+ for(size_t j = 0; j < ctor.getNumArgs(); ++j) {
+ appctorb << rewriteAs(NodeManager::currentNM()->mkNode(kind::APPLY_SELECTOR, ctor[j].getSelector(), in), TypeNode::fromType(SelectorType((*dt2)[i][j].getSelector().getType()).getRangeType()));
+ }
+ Node appctor = appctorb;
+ if(i == 0) {
+ out = appctor;
+ } else {
+ Node newOut = NodeManager::currentNM()->mkNode(kind::ITE, ctor.getTester(), appctor, out);
+ out = newOut;
+ }
+ }
+ return out;
+ }
+
+ Unhandled(in);
+}
+
const Datatype& BooleanTermConverter::convertDatatype(const Datatype& dt) throw() {
const Datatype*& out = d_datatypeCache[&dt];
if(out != NULL) {
} else if(mk == kind::metakind::VARIABLE) {
TypeNode t = top.getType();
if(t.isFunction()) {
- for(unsigned i = 0; i < t.getNumChildren() - 1; ++i) {
+ for(unsigned i = 0; i < t.getNumChildren(); ++i) {
TypeNode newType = convertType(t[i], false);
- if(newType != t[i]) {
+ // is this the return type? (allowed to be Bool)
+ bool returnType = (i == t.getNumChildren() - 1);
+ if(newType != t[i] && (!t[i].isBoolean() || !returnType)) {
vector<TypeNode> argTypes = t.getArgTypes();
- replace(argTypes.begin(), argTypes.end(), t[i], d_tt.getType());
- TypeNode newType = nm->mkFunctionType(argTypes, t.getRangeType());
+ for(unsigned j = 0; j < argTypes.size(); ++j) {
+ argTypes[j] = convertType(argTypes[j], false);
+ }
+ TypeNode rangeType = t.getRangeType();
+ if(!rangeType.isBoolean()) {
+ rangeType = convertType(rangeType, false);
+ }
+ TypeNode newType = nm->mkFunctionType(argTypes, rangeType);
Node n = nm->mkSkolem(top.getAttribute(expr::VarNameAttr()) + "__boolterm__",
newType, "a function introduced by Boolean-term conversion",
NodeManager::SKOLEM_EXACT_NAME);
for(unsigned j = 0; j < t.getNumChildren() - 1; ++j) {
Node var = nm->mkBoundVar(t[j]);
boundVarsBuilder << var;
- if(t[j].isBoolean()) {
- bodyBuilder << nm->mkNode(kind::ITE, var, d_tt, d_ff);
+ if(t[j] != argTypes[j]) {
+ bodyBuilder << rewriteAs(var, argTypes[j]);
} else {
bodyBuilder << var;
}
}
Node boundVars = boundVarsBuilder;
Node body = bodyBuilder;
+ if(t.getRangeType() != rangeType) {
+ Node convbody = rewriteAs(body, t.getRangeType());
+ body = convbody;
+ }
Node lam = nm->mkNode(kind::LAMBDA, boundVars, body);
Debug("boolean-terms") << "substituting " << top << " ==> " << lam << endl;
d_smt.d_theoryEngine->getModel()->addSubstitution(top, lam);
--- /dev/null
+(set-logic QF_ALL_SUPPORTED)
+(set-info :status sat)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Datatype declarations
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(declare-datatypes ()
+ ((ColorType (ColorType_Red) (ColorType_Black))
+))
+
+(declare-datatypes ()
+ ((RBTree (RBTree_Leaf) (RBTree_Node (destRBTree_Node RBTree_Node_recd)))
+
+ (RBTree_Node_recd (RBTree_Node_recd (RBTree_Node_recd_color ColorType)
+ (RBTree_Node_recd_left RBTree) (RBTree_Node_recd_elem Int)
+ (RBTree_Node_recd_right RBTree)))
+))
+
+(declare-datatypes ()
+ ((BoolColor (BoolColor (BoolColor_res Bool) (BoolColor_color ColorType)))
+))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Uninterpreted symbols
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(declare-fun v0 () Int)
+(declare-fun t () RBTree)
+;; (declare-fun NoTwoRedsFn (RBTree) BoolColor)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Defined symbols
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define-fun assembleFn ((ll RBTree) (le Int) (lr RBTree) (e Int) (rl RBTree) (re Int) (rr RBTree)) RBTree
+ (RBTree_Node (RBTree_Node_recd ColorType_Red (RBTree_Node (RBTree_Node_recd ColorType_Black ll le lr)) e (RBTree_Node (RBTree_Node_recd ColorType_Black rl re rr)))))
+
+(define-fun balanceFn ((c ColorType) (left RBTree) (elem Int) (right RBTree)) RBTree
+ (ite (= c ColorType_Black) (ite (not (ite (is-RBTree_Leaf left) false (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) true false)) true))) (ite (is-RBTree_Leaf right) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node right))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node right)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node right))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node right))) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node right)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) ColorType_Red)) (assembleFn left elem (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_elem (destRBTree_Node right)) (RBTree_Node_recd_right (destRBTree_Node right))) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node right)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node right)))) ColorType_Red)) (assembleFn left elem (RBTree_Node_recd_left (destRBTree_Node right)) (RBTree_Node_recd_elem (destRBTree_Node right)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node right)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node right)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node right))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node right))) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node right)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) ColorType_Red)) (assembleFn left elem (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_elem (destRBTree_Node right)) (RBTree_Node_recd_right (destRBTree_Node right))) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node right))) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node right)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) ColorType_Red)) (assembleFn left elem (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node right)))) (RBTree_Node_recd_elem (destRBTree_Node right)) (RBTree_Node_recd_right (destRBTree_Node right))) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))))))) (ite (is-RBTree_Leaf left) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (not (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) false (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) true false))) (ite (is-RBTree_Leaf (RBTree_Node_recd_right (destRBTree_Node left))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node left)) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_right (destRBTree_Node left)))) elem right) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)))))) (ite (is-RBTree_Leaf (RBTree_Node_recd_left (destRBTree_Node left))) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right)) (ite (and (= (RBTree_Node_recd_color (destRBTree_Node left)) ColorType_Red) (= (RBTree_Node_recd_color (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) ColorType_Red)) (assembleFn (RBTree_Node_recd_left (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_right (destRBTree_Node (RBTree_Node_recd_left (destRBTree_Node left)))) (RBTree_Node_recd_elem (destRBTree_Node left)) (RBTree_Node_recd_right (destRBTree_Node left)) elem right) (RBTree_Node (RBTree_Node_recd ColorType_Black left elem right))))))) (RBTree_Node (RBTree_Node_recd c left elem right))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Catamorphisms
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+( declare-fun memberFn ( Int RBTree ) Bool )
+
+( declare-fun EqualBlackPathsFn ( RBTree ) Int )
+
+( declare-fun insFn ( Int RBTree ) RBTree )
+
+( declare-fun insertFn ( Int RBTree ) RBTree )
+
+( declare-fun NoTwoRedsFn ( RBTree ) BoolColor )
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Goals
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;(push)
+(assert (and (is-RBTree_Leaf t)
+ (and (not (is-RBTree_Leaf (insertFn v0 t)))
+ (not (BoolColor_res (NoTwoRedsFn (RBTree_Node_recd_left (destRBTree_Node (insertFn v0 t)))))))))
+
+;;(pop)
+
+( assert ( = ( insertFn v0 t ) ( ite ( is-RBTree_Leaf ( insFn v0 t ) ) ( insFn v0 t ) ( RBTree_Node ( RBTree_Node_recd ColorType_Black ( RBTree_Node_recd_left ( destRBTree_Node ( insFn v0 t ) ) ) ( RBTree_Node_recd_elem ( destRBTree_Node ( insFn v0 t ) ) ) ( RBTree_Node_recd_right ( destRBTree_Node ( insFn v0 t ) ) ) ) ) ) ) )
+( assert ( = ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ( ite ( is-RBTree_Leaf ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ( BoolColor true ColorType_Black ) ( BoolColor ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ( or ( not ( = ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ColorType_Red ) ) ( and ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ColorType_Red ) ) ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ColorType_Red ) ) ) ) ) ) ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ) )
+( assert ( = ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ( ite ( is-RBTree_Leaf ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ( BoolColor true ColorType_Black ) ( BoolColor ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ( or ( not ( = ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ColorType_Red ) ) ( and ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ColorType_Red ) ) ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ColorType_Red ) ) ) ) ) ) ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 t ) ) ) ) ) ) ) ) )
+( assert ( = ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ( ite ( is-RBTree_Leaf ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ( BoolColor true ColorType_Black ) ( BoolColor ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ( or ( not ( = ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ColorType_Red ) ) ( and ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ColorType_Red ) ) ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ColorType_Red ) ) ) ) ) ) ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ) )
+( assert ( = ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ( ite ( is-RBTree_Leaf ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ( BoolColor true ColorType_Black ) ( BoolColor ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ( or ( not ( = ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ColorType_Red ) ) ( and ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ColorType_Red ) ) ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ColorType_Red ) ) ) ) ) ) ( RBTree_Node_recd_color ( destRBTree_Node ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ) )
+( assert ( = ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ( ite ( is-RBTree_Leaf ( insFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ( insFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ( RBTree_Node ( RBTree_Node_recd ColorType_Black ( RBTree_Node_recd_left ( destRBTree_Node ( insFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ( RBTree_Node_recd_elem ( destRBTree_Node ( insFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ( RBTree_Node_recd_right ( destRBTree_Node ( insFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ) ) ) )
+( assert ( = ( NoTwoRedsFn ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ( ite ( is-RBTree_Leaf ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ( BoolColor true ColorType_Black ) ( BoolColor ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ) ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ) ( or ( not ( = ( RBTree_Node_recd_color ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ColorType_Red ) ) ( and ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ) ColorType_Red ) ) ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ) ColorType_Red ) ) ) ) ) ) ( RBTree_Node_recd_color ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_right ( destRBTree_Node t ) ) ) ) ) ) ) ) )
+( assert ( = ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ( ite ( is-RBTree_Leaf ( insFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ( insFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ( RBTree_Node ( RBTree_Node_recd ColorType_Black ( RBTree_Node_recd_left ( destRBTree_Node ( insFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ( RBTree_Node_recd_elem ( destRBTree_Node ( insFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ( RBTree_Node_recd_right ( destRBTree_Node ( insFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ) ) ) )
+( assert ( = ( NoTwoRedsFn ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ( ite ( is-RBTree_Leaf ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ( BoolColor true ColorType_Black ) ( BoolColor ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ) ( and ( BoolColor_res ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ) ( or ( not ( = ( RBTree_Node_recd_color ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ColorType_Red ) ) ( and ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_left ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ) ColorType_Red ) ) ( not ( = ( BoolColor_color ( NoTwoRedsFn ( RBTree_Node_recd_right ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ) ColorType_Red ) ) ) ) ) ) ( RBTree_Node_recd_color ( destRBTree_Node ( insertFn v0 ( RBTree_Node_recd_left ( destRBTree_Node t ) ) ) ) ) ) ) ) )
+( check-sat )