From 2655c4ad6a09a67b6f049d8c376e6c5463e10f52 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Wed, 1 May 2013 14:02:17 -0400 Subject: [PATCH] Fix to boolean-terms; resolves bug #507 --- src/smt/boolean_terms.cpp | 70 ++++++++++++++++++++++++--- src/smt/boolean_terms.h | 2 + test/regress/regress0/Makefile.am | 3 +- test/regress/regress0/bug507.smt2 | 78 +++++++++++++++++++++++++++++++ 4 files changed, 146 insertions(+), 7 deletions(-) create mode 100644 test/regress/regress0/bug507.smt2 diff --git a/src/smt/boolean_terms.cpp b/src/smt/boolean_terms.cpp index f8f2330e1..0063035ff 100644 --- a/src/smt/boolean_terms.cpp +++ b/src/smt/boolean_terms.cpp @@ -111,6 +111,52 @@ static inline bool isBoolean(TNode top, unsigned i) { } } +// 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) { @@ -392,12 +438,20 @@ Node BooleanTermConverter::rewriteBooleanTermsRec(TNode top, theory::TheoryId pa } 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 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); @@ -409,14 +463,18 @@ Node BooleanTermConverter::rewriteBooleanTermsRec(TNode top, theory::TheoryId pa 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); diff --git a/src/smt/boolean_terms.h b/src/smt/boolean_terms.h index e5f18b68d..904d47b5f 100644 --- a/src/smt/boolean_terms.h +++ b/src/smt/boolean_terms.h @@ -65,6 +65,8 @@ class BooleanTermConverter { /** The cache used during Boolean term datatype conversion */ BooleanTermDatatypeCache d_datatypeCache; + Node rewriteAs(TNode in, TypeNode as) throw(); + /** * Scan a datatype for and convert as necessary. */ diff --git a/test/regress/regress0/Makefile.am b/test/regress/regress0/Makefile.am index b1e2f6491..12d7ab397 100644 --- a/test/regress/regress0/Makefile.am +++ b/test/regress/regress0/Makefile.am @@ -148,7 +148,8 @@ BUG_TESTS = \ bug480.smt2 \ bug484.smt2 \ bug486.cvc \ - bug497.cvc + bug497.cvc \ + bug507.smt2 TESTS = $(SMT_TESTS) $(SMT2_TESTS) $(CVC_TESTS) $(TPTP_TESTS) $(BUG_TESTS) diff --git a/test/regress/regress0/bug507.smt2 b/test/regress/regress0/bug507.smt2 new file mode 100644 index 000000000..75a63e328 --- /dev/null +++ b/test/regress/regress0/bug507.smt2 @@ -0,0 +1,78 @@ +(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 ) -- 2.30.2