Merge branch 'master' of https://github.com/CVC4/CVC4.git
authorPaulMeng <pmtruth@hotmail.com>
Tue, 5 Jul 2016 17:56:53 +0000 (13:56 -0400)
committerPaulMeng <pmtruth@hotmail.com>
Tue, 5 Jul 2016 17:56:53 +0000 (13:56 -0400)
Conflicts:
proofs/signatures/Makefile.am
src/Makefile.am
src/expr/datatype.cpp
src/options/datatypes_options
src/options/options_template.cpp
src/options/quantifiers_options
src/proof/arith_proof.cpp
src/proof/arith_proof.h
src/proof/array_proof.cpp
src/proof/array_proof.h
src/proof/bitvector_proof.cpp
src/proof/bitvector_proof.h
src/proof/cnf_proof.cpp
src/proof/cnf_proof.h
src/proof/proof_manager.cpp
src/proof/proof_manager.h
src/proof/sat_proof.h
src/proof/sat_proof_implementation.h
src/proof/skolemization_manager.h
src/proof/theory_proof.cpp
src/proof/theory_proof.h
src/proof/uf_proof.cpp
src/proof/uf_proof.h
src/prop/cnf_stream.cpp
src/prop/cnf_stream.h
src/prop/minisat/core/Solver.cc
src/prop/prop_engine.cpp
src/prop/prop_engine.h
src/prop/theory_proxy.cpp
src/smt/smt_engine.cpp
src/smt/smt_engine_check_proof.cpp
src/theory/arrays/array_proof_reconstruction.cpp
src/theory/arrays/theory_arrays.cpp
src/theory/bv/eager_bitblaster.cpp
src/theory/bv/lazy_bitblaster.cpp
src/theory/datatypes/theory_datatypes.cpp
src/theory/quantifiers/alpha_equivalence.cpp
src/theory/quantifiers/candidate_generator.cpp
src/theory/quantifiers/candidate_generator.h
src/theory/quantifiers/ce_guided_single_inv.cpp
src/theory/quantifiers/ceg_instantiator.cpp
src/theory/quantifiers/conjecture_generator.cpp
src/theory/quantifiers/equality_infer.cpp
src/theory/quantifiers/equality_infer.h
src/theory/quantifiers/inst_match_generator.cpp
src/theory/quantifiers/inst_propagator.cpp
src/theory/quantifiers/inst_propagator.h
src/theory/quantifiers/inst_strategy_e_matching.cpp
src/theory/quantifiers/inst_strategy_e_matching.h
src/theory/quantifiers/instantiation_engine.cpp
src/theory/quantifiers/model_builder.cpp
src/theory/quantifiers/model_engine.cpp
src/theory/quantifiers/quant_conflict_find.cpp
src/theory/quantifiers/quant_conflict_find.h
src/theory/quantifiers/quant_split.cpp
src/theory/quantifiers/quant_util.cpp
src/theory/quantifiers/quantifiers_rewriter.cpp
src/theory/quantifiers/quantifiers_rewriter.h
src/theory/quantifiers/term_database.cpp
src/theory/quantifiers/term_database.h
src/theory/quantifiers/trigger.cpp
src/theory/quantifiers/trigger.h
src/theory/quantifiers_engine.cpp
src/theory/quantifiers_engine.h
src/theory/sets/kinds
src/theory/sets/theory_sets_private.cpp
src/theory/sets/theory_sets_private.h
src/theory/sets/theory_sets_rewriter.cpp
src/theory/sets/theory_sets_type_rules.h
src/theory/strings/theory_strings.cpp
src/theory/strings/theory_strings.h
src/theory/theory_engine.cpp
src/theory/theory_engine.h
src/theory/uf/equality_engine.cpp
test/regress/regress0/fmf/Makefile.am
test/regress/regress0/quantifiers/Makefile.am
test/regress/regress0/strings/Makefile.am
test/regress/regress0/sygus/Makefile.am
test/regress/regress0/sygus/max2-univ.sy

93 files changed:
1  2 
proofs/signatures/Makefile.am
src/Makefile.am
src/expr/datatype.cpp
src/expr/datatype.h
src/expr/expr_manager_template.h
src/options/quantifiers_options
src/parser/cvc/Cvc.g
src/parser/smt2/smt2.cpp
src/printer/smt2/smt2_printer.cpp
src/proof/bitvector_proof.cpp
src/prop/minisat/core/Solver.cc
src/theory/bv/bitblaster_template.h
src/theory/quantifiers/alpha_equivalence.cpp
src/theory/quantifiers/alpha_equivalence.h
src/theory/quantifiers/ambqi_builder.cpp
src/theory/quantifiers/ambqi_builder.h
src/theory/quantifiers/anti_skolem.cpp
src/theory/quantifiers/anti_skolem.h
src/theory/quantifiers/bounded_integers.cpp
src/theory/quantifiers/bounded_integers.h
src/theory/quantifiers/candidate_generator.cpp
src/theory/quantifiers/candidate_generator.h
src/theory/quantifiers/ce_guided_instantiation.cpp
src/theory/quantifiers/ce_guided_instantiation.h
src/theory/quantifiers/ce_guided_single_inv.cpp
src/theory/quantifiers/ce_guided_single_inv.h
src/theory/quantifiers/ce_guided_single_inv_ei.cpp
src/theory/quantifiers/ce_guided_single_inv_ei.h
src/theory/quantifiers/ce_guided_single_inv_sol.cpp
src/theory/quantifiers/ce_guided_single_inv_sol.h
src/theory/quantifiers/ceg_instantiator.cpp
src/theory/quantifiers/ceg_instantiator.h
src/theory/quantifiers/conjecture_generator.cpp
src/theory/quantifiers/conjecture_generator.h
src/theory/quantifiers/equality_infer.cpp
src/theory/quantifiers/equality_infer.h
src/theory/quantifiers/first_order_model.cpp
src/theory/quantifiers/first_order_model.h
src/theory/quantifiers/full_model_check.cpp
src/theory/quantifiers/full_model_check.h
src/theory/quantifiers/fun_def_engine.cpp
src/theory/quantifiers/fun_def_engine.h
src/theory/quantifiers/fun_def_process.cpp
src/theory/quantifiers/fun_def_process.h
src/theory/quantifiers/inst_match.cpp
src/theory/quantifiers/inst_match.h
src/theory/quantifiers/inst_match_generator.cpp
src/theory/quantifiers/inst_match_generator.h
src/theory/quantifiers/inst_propagator.cpp
src/theory/quantifiers/inst_propagator.h
src/theory/quantifiers/inst_strategy_cbqi.cpp
src/theory/quantifiers/inst_strategy_cbqi.h
src/theory/quantifiers/inst_strategy_e_matching.cpp
src/theory/quantifiers/inst_strategy_e_matching.h
src/theory/quantifiers/instantiation_engine.cpp
src/theory/quantifiers/instantiation_engine.h
src/theory/quantifiers/kinds
src/theory/quantifiers/local_theory_ext.cpp
src/theory/quantifiers/local_theory_ext.h
src/theory/quantifiers/macros.cpp
src/theory/quantifiers/macros.h
src/theory/quantifiers/model_builder.cpp
src/theory/quantifiers/model_builder.h
src/theory/quantifiers/model_engine.cpp
src/theory/quantifiers/model_engine.h
src/theory/quantifiers/quant_conflict_find.cpp
src/theory/quantifiers/quant_conflict_find.h
src/theory/quantifiers/quant_equality_engine.cpp
src/theory/quantifiers/quant_equality_engine.h
src/theory/quantifiers/quant_split.cpp
src/theory/quantifiers/quant_split.h
src/theory/quantifiers/quant_util.cpp
src/theory/quantifiers/quant_util.h
src/theory/quantifiers/quantifiers_attributes.cpp
src/theory/quantifiers/quantifiers_attributes.h
src/theory/quantifiers/quantifiers_rewriter.cpp
src/theory/quantifiers/quantifiers_rewriter.h
src/theory/quantifiers/relevant_domain.cpp
src/theory/quantifiers/relevant_domain.h
src/theory/quantifiers/rewrite_engine.cpp
src/theory/quantifiers/rewrite_engine.h
src/theory/quantifiers/symmetry_breaking.cpp
src/theory/quantifiers/symmetry_breaking.h
src/theory/quantifiers/term_database.cpp
src/theory/quantifiers/term_database.h
src/theory/quantifiers/theory_quantifiers.cpp
src/theory/quantifiers/theory_quantifiers.h
src/theory/quantifiers/theory_quantifiers_type_rules.h
src/theory/quantifiers/trigger.cpp
src/theory/quantifiers/trigger.h
src/theory/sets/kinds
src/theory/sets/theory_sets_private.h
src/theory/sets/theory_sets_type_rules.h

index 2b6d16cfde78b9e2e86e1a7665b8615fc59277f3,75d9f3c5ad71703fbbc55db196d0c0cf6bbab4d8..5947ad3f0dfd2b9836054b04ad3c3c826614cebf
@@@ -3,7 -3,7 +3,8 @@@
  # add support for more theories, just list them here in the same order
  # you would to the LFSC proof-checker binary.
  #
- CORE_PLFS = sat.plf smt.plf th_base.plf th_arrays.plf th_bv.plf th_bv_bitblast.plf th_real.plf th_int.plf
++
+ CORE_PLFS = sat.plf smt.plf th_base.plf th_arrays.plf th_bv.plf th_bv_bitblast.plf th_bv_rewrites.plf th_real.plf th_int.plf
  
  noinst_LTLIBRARIES = libsignatures.la
  
diff --cc src/Makefile.am
Simple merge
index d14ac26d40034576e76afe93c4493fe5ae652bb3,001f38a79499916f95006b0af072ec2d2cdfca57..12cab48ccb68b53fffda2ac93f940cb88598ef45
@@@ -859,18 -859,9 +859,10 @@@ bool DatatypeConstructor::isInterpreted
    if(self.getAttribute(DatatypeUFiniteComputedAttr())) {
      return self.getAttribute(DatatypeUFiniteAttr());
    }
 +  bool success = true;
    for(const_iterator i = begin(), i_end = end(); i != i_end; ++i) {
-     Type t = (*i).getRangeType();
-     if( t.isDatatype() ){
-       const Datatype& dt = ((DatatypeType)t).getDatatype();
-       if( !dt.isUFinite() ){
-         success = false;
-       }
-     }else if(!t.isSort() && !t.getCardinality().isFinite()) {
-       success = false;
-     }
-     if(!success ){
+     TypeNode t = TypeNode::fromType( (*i).getRangeType() );
+     if(!t.isInterpretedFinite()) {
        self.setAttribute(DatatypeUFiniteComputedAttr(), true);
        self.setAttribute(DatatypeUFiniteAttr(), false);
        return false;
index 1197b4a3bd045f95743e1f661b49a38266326d01,dfd893fe8288b789923a7a4bd272e6e9435251b4..a0c9cbe6b54aac022d363304daaa0af257565071
@@@ -613,6 -613,6 +613,9 @@@ public
    /** get the record representation for this datatype */
    inline Record * getRecord() const;
  
++  /** get the record representation for this datatype */
++  inline Record * getRecord() const;
++
    /**
     * Return the cardinality of this datatype (the sum of the
     * cardinalities of its constructors).  The Datatype must be
index 04f2f4289d0137cd29279e893e0e0f730847a985,31c911736648c95d975959fecb68448dbdaa369c..9c4e554e19145b978ec2ff8fb5b555528e263535
@@@ -124,6 -124,6 +124,9 @@@ public
    /** Get the type for regular expressions. */
    RegExpType regExpType() const;
  
++  /** Get the type for regular expressions. */
++  RegExpType regExpType() const;
++
    /** Get the type for reals. */
    RealType realType() const;
  
index 74b3011a6368c5dcc3e0d86e4323f766aeda545d,98017937876837cfa5047c386a67a27aad02ab5a..4d228bbadbbb13d646b7fcd42620ff8ff7309eef
@@@ -109,6 -111,9 +111,8 @@@ option instLevelInputOnly --inst-level-
   only input terms are assigned instantiation level zero
  option quantRepMode --quant-rep-mode=MODE  CVC4::theory::quantifiers::QuantRepMode :default CVC4::theory::quantifiers::QUANT_REP_MODE_FIRST :read-write :include "options/quantifiers_modes.h" :handler stringToQuantRepMode
   selection mode for representatives in quantifiers engine
 -
+ option instRelevantCond --inst-rlv-cond bool :default false
+  add relevancy conditions for instantiations
   
  option eagerInstQuant --eager-inst-quant bool :default false
   apply quantifier instantiation eagerly
Simple merge
Simple merge
Simple merge
index b637822267517fc017ecd875d39cf5d1923592cd,f557d506317e55626cd8a3c437c827a6d23471b2..f19e45920150a7f87b43215979532d8e8ca26f60
@@@ -516,7 -797,7 +797,7 @@@ void LFSCBitVectorProof::printTermBitbl
    case kind::BITVECTOR_SHL :
    case kind::BITVECTOR_LSHR :
    case kind::BITVECTOR_ASHR : {
--      // these are terms for which bit-blasting is not supported yet
++        // these are terms for which bit-blasting is not supported yet
      std::ostringstream paren;
      os <<"(trust_bblast_term _ ";
      paren <<")";
index 411b895143ea97e671507e99373713d0e5833b4b,d898b66a2294775bea2db88a82e5feac1a1987e6..a682a893b502e90f20df8aa8f365726bb63a700f
@@@ -379,7 -394,7 +394,7 @@@ bool Solver::addClause_(vec<Lit>& ps, b
  
          cr = ca.alloc(clauseLevel, ps, false);
          clauses_persistent.push(cr);
--      attachClause(cr);
++        attachClause(cr);
  
          if(PROOF_ON()) {
            PROOF(
@@@ -1234,12 -1249,12 +1249,12 @@@ lbool Solver::search(int nof_conflicts
  
          } else {
  
--          // If this was a final check, we are satisfiable
++            // If this was a final check, we are satisfiable
              if (check_type == CHECK_FINAL) {
--            bool decisionEngineDone = proxy->isDecisionEngineDone();
++              bool decisionEngineDone = proxy->isDecisionEngineDone();
                // Unless a lemma has added more stuff to the queues
                if (!decisionEngineDone  &&
--                (!order_heap.empty() || qhead < trail.size()) ) {
++                  (!order_heap.empty() || qhead < trail.size()) ) {
                  check_type = CHECK_WITH_THEORY;
                  continue;
                } else if (recheck) {
index cfbadbf3220d7a59ba048ba650d79b4db4cbab27,929bccada3e0831e1a16c3d8cfa1454e290ebe61..c6c0d6def7a5f285964be78ebc868e64adf207d7
@@@ -268,6 -268,6 +268,8 @@@ class EagerBitblaster : public TBitblas
  
    MinisatEmptyNotify d_notify;
  
++  MinisatEmptyNotify d_notify;
++
    Node getModelFromSatSolver(TNode a, bool fullModel);
    bool isSharedTerm(TNode node);
  
index 80066d690553d844525250d00ba7f56de3e782b3,a00d6d8a1edefcb3a7baa2df9b9e13205cad093c..a00d6d8a1edefcb3a7baa2df9b9e13205cad093c
mode 100644,100644..100755
index 8e7556eb61f81ab9363626e54905ab42efd6faa3,8e7556eb61f81ab9363626e54905ab42efd6faa3..8e7556eb61f81ab9363626e54905ab42efd6faa3
mode 100644,100644..100755
index 5192da7ded8bb631a2ff1d2ad4da45408f0cf454,97116dee4661bcf7f6d848aca118607afe57abc1..97116dee4661bcf7f6d848aca118607afe57abc1
mode 100644,100644..100755
index 3669d38b7312ebfa54f76065ba8228a34bf73bbc,3669d38b7312ebfa54f76065ba8228a34bf73bbc..3669d38b7312ebfa54f76065ba8228a34bf73bbc
mode 100644,100644..100755
index c8d18acedd0eb51c0a7a4b93b66af75e94d7ca21,c8d18acedd0eb51c0a7a4b93b66af75e94d7ca21..c8d18acedd0eb51c0a7a4b93b66af75e94d7ca21
mode 100644,100644..100755
index 72137115946bc093e6f9971304a199320307aaab,72137115946bc093e6f9971304a199320307aaab..72137115946bc093e6f9971304a199320307aaab
mode 100644,100644..100755
index d32ef59a1c6042ab24eacc6e782fe4efbf046b3d,7184624dad7d79a889c8fdd1b11f12fdd457e97f..7184624dad7d79a889c8fdd1b11f12fdd457e97f
mode 100644,100644..100755
index 7d15097bd813568d80a17f38069cbb1b094a3813,ab4bcba96650ca4320a292ceba807a77e3153d67..ab4bcba96650ca4320a292ceba807a77e3153d67
mode 100644,100644..100755
index 43f5ee2fd34f84368306e5cc2ce343c4b055d48a,a0d9bda0fe07445bedb0f4a501aecc7564284be1..a0d9bda0fe07445bedb0f4a501aecc7564284be1
mode 100644,100644..100755
index 18ef6a086383431c51ba1891fda5dfe7504c1fe9,4fc6969fc2be4f72b78dfd406174e29af88d2f75..4fc6969fc2be4f72b78dfd406174e29af88d2f75
mode 100644,100644..100755
index d9059a3e606df5bb50fc6dcb77d04f51673f3ae6,71bf7c4266125a14ab460690f7506d7a58d8eb64..71bf7c4266125a14ab460690f7506d7a58d8eb64
mode 100644,100644..100755
index 57dc3185079e39dfda9afae03cc636d5d359c8ac,c8b41c035b878ab0e970be3c1b717046d4857811..c8b41c035b878ab0e970be3c1b717046d4857811
mode 100644,100644..100755
index 33856d226b063a86d62298b864d8af798c400886,3177739ac7092452e0cfdcf49a501acf2e309b22..3177739ac7092452e0cfdcf49a501acf2e309b22
mode 100644,100644..100755
index 4d2f9a0e59a2569cc34bd9a7c8e946324980219f,4d2f9a0e59a2569cc34bd9a7c8e946324980219f..4d2f9a0e59a2569cc34bd9a7c8e946324980219f
mode 100644,100644..100755
index 6394fca3d6e4575bbec78a2fe098d38736a107b3,6394fca3d6e4575bbec78a2fe098d38736a107b3..6394fca3d6e4575bbec78a2fe098d38736a107b3
mode 100644,100644..100755
index 42e0b082036d56ae54b621e401db7708469e59d2,42e0b082036d56ae54b621e401db7708469e59d2..42e0b082036d56ae54b621e401db7708469e59d2
mode 100644,100644..100755
index 240c2ed12df01205aa911598eab0eba86acc27a0,240c2ed12df01205aa911598eab0eba86acc27a0..240c2ed12df01205aa911598eab0eba86acc27a0
mode 100644,100644..100755
index cb6f6bc418baf03109ef5d8d3eb84bb2b6f7e0fc,cb6f6bc418baf03109ef5d8d3eb84bb2b6f7e0fc..cb6f6bc418baf03109ef5d8d3eb84bb2b6f7e0fc
mode 100644,100644..100755
index da488ea9802c58a2db305a68d19d97384df00325,cd263e90ccae3244dc20bc4e09d5dda7b1d49351..cd263e90ccae3244dc20bc4e09d5dda7b1d49351
mode 100644,100644..100755
index 3d7bbcb5525d54d51774f35e5475c7514387cb8e,3d7bbcb5525d54d51774f35e5475c7514387cb8e..3d7bbcb5525d54d51774f35e5475c7514387cb8e
mode 100644,100644..100755
index 2cc49ef5a441358cda01a6ad88e2ccc949f71b01,f4eb67d7486d9ca7cd681c795b35bbdb58ed3807..f4eb67d7486d9ca7cd681c795b35bbdb58ed3807
mode 100644,100644..100755
index c89d0f2eea9a4a9d7c7dd7647efb623884dddb2a,c89d0f2eea9a4a9d7c7dd7647efb623884dddb2a..c89d0f2eea9a4a9d7c7dd7647efb623884dddb2a
mode 100644,100644..100755
index c3064116fe1dc95f45d2dbc6f7aa2260e7096db6,5190025ee87e02ccee7609326396daee38e68238..5190025ee87e02ccee7609326396daee38e68238
mode 100644,100644..100755
index 93c7bd080bcdcf03ec9b9ffe555081406babde5f,80d6ef98b585ec0957f6f33efcd6ec636238ed7a..80d6ef98b585ec0957f6f33efcd6ec636238ed7a
mode 100644,100644..100755
index a833f48d2550ab6932314680e8bd22ff6792b6bc,670f0eff3b99f16b009af97a7bff947bd439c426..670f0eff3b99f16b009af97a7bff947bd439c426
mode 100644,100644..100755
index cbe83cfa5ab60e51372062d1ab44f4067b9144fb,cbe83cfa5ab60e51372062d1ab44f4067b9144fb..cbe83cfa5ab60e51372062d1ab44f4067b9144fb
mode 100644,100644..100755
index 33c8533289e7165c844e797d1b683d30dd289115,a0665cb7fc0a1521cae2e097a0fc370e87d12624..a0665cb7fc0a1521cae2e097a0fc370e87d12624
mode 100644,100644..100755
index 411b7a5ebe4ceb61b246622fc3c623a48cffe89a,411b7a5ebe4ceb61b246622fc3c623a48cffe89a..411b7a5ebe4ceb61b246622fc3c623a48cffe89a
mode 100644,100644..100755
index cf1d14663c6f593458c71aecf4fd8e2ec947a57b,cf1d14663c6f593458c71aecf4fd8e2ec947a57b..cf1d14663c6f593458c71aecf4fd8e2ec947a57b
mode 100644,100644..100755
index 3b95281c01ed55926cd4b3fe18d23057947e2ecb,3b95281c01ed55926cd4b3fe18d23057947e2ecb..3b95281c01ed55926cd4b3fe18d23057947e2ecb
mode 100644,100644..100755
index 9109aab8af0060430a63c9edb8cc1a1ed724e339,9109aab8af0060430a63c9edb8cc1a1ed724e339..9109aab8af0060430a63c9edb8cc1a1ed724e339
mode 100644,100644..100755
index 1f6ee6562667adb5569744204da02ec3213bf211,1f6ee6562667adb5569744204da02ec3213bf211..1f6ee6562667adb5569744204da02ec3213bf211
mode 100644,100644..100755
index 8818175db4fe3ae63864cc7c08610135b0cab7b6,8818175db4fe3ae63864cc7c08610135b0cab7b6..8818175db4fe3ae63864cc7c08610135b0cab7b6
mode 100644,100644..100755
index ad287c1a3adfc60794e4d37696afa86e8f79569a,ad287c1a3adfc60794e4d37696afa86e8f79569a..ad287c1a3adfc60794e4d37696afa86e8f79569a
mode 100644,100644..100755
index bf05de3bb4e2eb1e1f6bb98eb1743a5ea61b8345,2d3bf76f628df9330d0cb18917040dcbf65187c7..2d3bf76f628df9330d0cb18917040dcbf65187c7
mode 100644,100644..100755
index a1d90700143769c2a5bc8a77039fd85ced021d24,096774c512b1dc80cfb1c825ddf7910298665d6e..096774c512b1dc80cfb1c825ddf7910298665d6e
mode 100644,100644..100755
index d4be58636966cf8b9f06baeeb3aaf4701c8a9bb8,41c9c40c8e97c42d4ffc1ec9e7880e9c8991fb01..41c9c40c8e97c42d4ffc1ec9e7880e9c8991fb01
mode 100644,100644..100755
index 0c02c7f95f2b89d5b24aa2f98815194aa1987816,6201cf1528974c32df40dd2f78c1da7cb81e27c6..6201cf1528974c32df40dd2f78c1da7cb81e27c6
mode 100644,100644..100755
index 149330c61cf6abd72b9bd03f6949464bd57cbde2,523d868b5fb40f83080fa72a035e062a7237d47f..523d868b5fb40f83080fa72a035e062a7237d47f
mode 100644,100644..100755
index 8ed59778ba2464308375d91573ebf36ae81b3b73,8ed59778ba2464308375d91573ebf36ae81b3b73..8ed59778ba2464308375d91573ebf36ae81b3b73
mode 100644,100644..100755
index 630880690fab4dfc359a2f7cd03225c1457bba59,efd765c865d0cd02f53ff28f995c2695d802f18e..efd765c865d0cd02f53ff28f995c2695d802f18e
mode 100644,100644..100755
index 028f24b277fa11736f39380d867543868097765b,e6d993294f7658fa8e765f58b12c42f9ed4c4364..e6d993294f7658fa8e765f58b12c42f9ed4c4364
mode 100644,100644..100755
index 955dc5d865627e0f54dbfaea0f675652bfbc0436,db597d03133754a477652bd4cc7486224b88c51d..db597d03133754a477652bd4cc7486224b88c51d
mode 100644,100644..100755
index d2b3740a1c4d76db59e4a50839af45f6f0040ac0,d2b3740a1c4d76db59e4a50839af45f6f0040ac0..d2b3740a1c4d76db59e4a50839af45f6f0040ac0
mode 100644,100644..100755
index b03c4ad3be84f47617402694b86d95d6f0b52c4e,b03c4ad3be84f47617402694b86d95d6f0b52c4e..b03c4ad3be84f47617402694b86d95d6f0b52c4e
mode 100644,100644..100755
index ada28c08495df5cb7bc12a1765623e7a6a8dccaf,ada28c08495df5cb7bc12a1765623e7a6a8dccaf..ada28c08495df5cb7bc12a1765623e7a6a8dccaf
mode 100644,100644..100755
index 94abf3c90a34bbd936622c92c6faf71cdd37c269,94abf3c90a34bbd936622c92c6faf71cdd37c269..94abf3c90a34bbd936622c92c6faf71cdd37c269
mode 100644,100644..100755
index 582599680494c525355cfcb6960c6cc0216b8c69,582599680494c525355cfcb6960c6cc0216b8c69..582599680494c525355cfcb6960c6cc0216b8c69
mode 100644,100644..100755
index 39ec2f0a1d5f85612f6efa62d13dfc27760d8e6f,39ec2f0a1d5f85612f6efa62d13dfc27760d8e6f..39ec2f0a1d5f85612f6efa62d13dfc27760d8e6f
mode 100644,100644..100755
index 3ae36b1d485a3fb4fcb50a5200a9c06710e57741,10a5ae41b256e09f387916081caa02840eb78f1a..10a5ae41b256e09f387916081caa02840eb78f1a
mode 100644,100644..100755
index 90667390342dcf5abf824e252b7390669ade11e8,e4f9529a81ab861d9e49ef38d43f36bd2436ce87..e4f9529a81ab861d9e49ef38d43f36bd2436ce87
mode 100644,100644..100755
index 0bbca88eb57899f7a3096403af92e864c19dc2e6,5d575969f7086f53d2a1f0facc3dc46d652d4433..5d575969f7086f53d2a1f0facc3dc46d652d4433
mode 100644,100644..100755
index 12f18aa08248bbddec1b0b9f6bfcd6665c1da749,12f18aa08248bbddec1b0b9f6bfcd6665c1da749..12f18aa08248bbddec1b0b9f6bfcd6665c1da749
mode 100644,100644..100755
index ca87a607db5fbc896ebe0da7023f7dfc894d4964,bac2aa35cd1a3a6f1154a98a53732078f91fb1ae..bac2aa35cd1a3a6f1154a98a53732078f91fb1ae
mode 100644,100644..100755
index 8b42b091617a6d671b238d6dd6b74931c6882fde,47a66b1b1333d98551c5d4966853566db88787a9..47a66b1b1333d98551c5d4966853566db88787a9
mode 100644,100644..100755
index 3f89a799ce4a7ee11bbe5c1aef8ad2d55300b91a,3f89a799ce4a7ee11bbe5c1aef8ad2d55300b91a..3f89a799ce4a7ee11bbe5c1aef8ad2d55300b91a
mode 100644,100644..100755
index 26654de4d54690b30556cea45ec1c6c9fabca411,26654de4d54690b30556cea45ec1c6c9fabca411..26654de4d54690b30556cea45ec1c6c9fabca411
mode 100644,100644..100755
index 9fb943e5ee9ebc76a7d7489f4bf9ac09383435cc,5aff1a848a50520e6f192d8d8c1c76c6854620b7..5aff1a848a50520e6f192d8d8c1c76c6854620b7
mode 100644,100644..100755
index d3682499859e0611e1ac5a8099bd4581f9accf9f,d3682499859e0611e1ac5a8099bd4581f9accf9f..d3682499859e0611e1ac5a8099bd4581f9accf9f
mode 100644,100644..100755
index 3b7787a20bca2fdb903910059eb75036c0d6ccf5,b9aab0236147408f3ad600388d957b84a57b8e77..b9aab0236147408f3ad600388d957b84a57b8e77
mode 100644,100644..100755
index 79cdae437094321d2ad49a6e24d21f5c0926b5a2,79cdae437094321d2ad49a6e24d21f5c0926b5a2..79cdae437094321d2ad49a6e24d21f5c0926b5a2
mode 100644,100644..100755
index b797f4ce91841a98a378316a2eba847ba7c45ab4,b797f4ce91841a98a378316a2eba847ba7c45ab4..b797f4ce91841a98a378316a2eba847ba7c45ab4
mode 100644,100644..100755
index 53cef796aa2ca096c4a7785aa69f98dcc3600d79,53cef796aa2ca096c4a7785aa69f98dcc3600d79..53cef796aa2ca096c4a7785aa69f98dcc3600d79
mode 100644,100644..100755
index 5aae4d640683b5451690de9b47ed34e965fabe2a,68f824c57bd578e9c268aa88c213f7a7a98d21c5..68f824c57bd578e9c268aa88c213f7a7a98d21c5
mode 100644,100644..100755
index 2071d179378a65260986915265ec43f6f78081ea,7765171090a54cf7fadd8e108040418927bfd7cf..7765171090a54cf7fadd8e108040418927bfd7cf
mode 100644,100644..100755
index b353fce2f9ece52d6f85cb4d5b1eb7593419fab3,b4b51fd842b9b88c81fbea92c47a42d1cd5aa750..b4b51fd842b9b88c81fbea92c47a42d1cd5aa750
mode 100644,100644..100755
index 2b90520fd919d9167d12f3463fcb3c88e3ab0968,2b90520fd919d9167d12f3463fcb3c88e3ab0968..2b90520fd919d9167d12f3463fcb3c88e3ab0968
mode 100644,100644..100755
index 5365dbcfae593a825868a7785ff6cb8dae6eec72,2c58b8f778af0be92473dd647b92cf2b23ab7c5c..2c58b8f778af0be92473dd647b92cf2b23ab7c5c
mode 100644,100644..100755
index 424530696a514775628bbd907d512568de44cd65,424530696a514775628bbd907d512568de44cd65..424530696a514775628bbd907d512568de44cd65
mode 100644,100644..100755
index 2a2b1358372712218085193de20e402c9eccac58,2a2b1358372712218085193de20e402c9eccac58..2a2b1358372712218085193de20e402c9eccac58
mode 100644,100644..100755
index 38fea4f45139eeeeddb7076072976b89b33e0a74,e682955e794387d9f7b38792e8a155db117040c2..e682955e794387d9f7b38792e8a155db117040c2
mode 100644,100644..100755
index 8b09d8e5dfd0ad153469d9503dc31512cbbd78ea,d3a5e178f2125c671d6d5a4292a49b39ba833d14..d3a5e178f2125c671d6d5a4292a49b39ba833d14
mode 100644,100644..100755
index a62b343a24f82313be4f42660f3de74692a28e6a,7ab3668eb7b0e281bcd83633400d4f7e8bc29419..7ab3668eb7b0e281bcd83633400d4f7e8bc29419
mode 100644,100644..100755
index efe40aaa8937e80c76d7d342fc5920b53467caff,7ad13b3a844d3b90d33f90d6bbf1a2b75cf43d27..7ad13b3a844d3b90d33f90d6bbf1a2b75cf43d27
mode 100644,100644..100755
index 6775e05361a05b0f1646a5ef69c6d1f1b6ad0cc5,6775e05361a05b0f1646a5ef69c6d1f1b6ad0cc5..6775e05361a05b0f1646a5ef69c6d1f1b6ad0cc5
mode 100644,100644..100755
index 6ba57afb4857fa82716611e0da677fe5c12cc3fc,6ba57afb4857fa82716611e0da677fe5c12cc3fc..6ba57afb4857fa82716611e0da677fe5c12cc3fc
mode 100644,100644..100755
index 38635b37b252d03fb96e81a8b3ad092d56238442,ee091919deaaccb63be97979eb6c12a0f360efe2..ee091919deaaccb63be97979eb6c12a0f360efe2
mode 100644,100644..100755
index 41f2a1c38c0cbf928339de7eebbe114a9460e936,a3da4d3987b698dd68f9a81fa30e6cb98d2ee7f3..a3da4d3987b698dd68f9a81fa30e6cb98d2ee7f3
mode 100644,100644..100755
index 3fb73749dee3e5df6d1b08957935865223da3e07,14c87a947c6be49f52124071ac69732932a3f376..c92eab4bde9badff796edd91c6ec7efdeb55ed3d
@@@ -59,11 -54,6 +59,12 @@@ typerule EMPTYSET       ::CVC4::theory:
  typerule INSERT         ::CVC4::theory::sets::InsertTypeRule
  typerule CARD           ::CVC4::theory::sets::CardTypeRule
  
 +typerule JOIN                         ::CVC4::theory::sets::RelBinaryOperatorTypeRule
 +typerule PRODUCT              ::CVC4::theory::sets::RelBinaryOperatorTypeRule
 +typerule TRANSPOSE            ::CVC4::theory::sets::RelTransposeTypeRule
 +typerule TCLOSURE         ::CVC4::theory::sets::RelTransClosureTypeRule
 +
++
  construle UNION         ::CVC4::theory::sets::SetsBinaryOperatorTypeRule
  construle INTERSECTION  ::CVC4::theory::sets::SetsBinaryOperatorTypeRule
  construle SETMINUS      ::CVC4::theory::sets::SetsBinaryOperatorTypeRule
index 21743267003afaa651b08ae369fee50ad2a7f9be,e14efd7a4b19cee7c80b40da5f9044c34e19b2b7..37071eb2ef458998c9ed9afd766d1ff7628d9917
@@@ -139,6 -137,6 +139,20 @@@ private
     */
    bool lemma(Node n, SetsLemmaTag t);
  
++  /** send out a lemma */
++  enum SetsLemmaTag {
++    SETS_LEMMA_DISEQUAL,
++    SETS_LEMMA_MEMBER,
++    SETS_LEMMA_GRAPH,
++    SETS_LEMMA_OTHER
++  };
++
++  /**
++   * returns true if a lemmas was generated
++   * returns false otherwise (found in cache)
++   */
++  bool lemma(Node n, SetsLemmaTag t);
++
    class TermInfoManager {
      TheorySetsPrivate& d_theory;
      context::Context* d_context;
index 92d6c9b6d1d1edd7863a2ea2f0884a5a4b568efd,7a8d7eed4168e865db517a8975c42736c1f7e04c..478dcbdb605f6fbff5e6471ca51b949db7950ab3
@@@ -183,98 -183,6 +183,99 @@@ struct InsertTypeRule 
    }
  };/* struct InsertTypeRule */
  
 +struct RelBinaryOperatorTypeRule {
 +  inline static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check)
 +    throw (TypeCheckingExceptionPrivate, AssertionException) {
 +    Assert(n.getKind() == kind::PRODUCT ||
 +           n.getKind() == kind::JOIN);
 +
 +    TypeNode firstRelType = n[0].getType(check);
 +    TypeNode secondRelType = n[1].getType(check);
 +    TypeNode resultType = firstRelType;
 +
 +    if(check) {
 +
 +      if(!firstRelType.isSet() || !secondRelType.isSet()) {
 +        throw TypeCheckingExceptionPrivate(n, " set operator operates on non-sets");
 +      }
 +      if(!firstRelType[0].isTuple() || !secondRelType[0].isTuple()) {
 +        throw TypeCheckingExceptionPrivate(n, " set operator operates on non-relations (sets of tuples)");
 +      }
 +
 +      std::vector<TypeNode> newTupleTypes;
 +      std::vector<TypeNode> firstTupleTypes = firstRelType[0].getTupleTypes();
 +      std::vector<TypeNode> secondTupleTypes = secondRelType[0].getTupleTypes();
 +
 +      // JOIN is not allowed to apply on two unary sets
 +      if( n.getKind() == kind::JOIN ) {
 +        if((firstTupleTypes.size() == 1) && (secondTupleTypes.size() == 1)) {
 +          throw TypeCheckingExceptionPrivate(n, " Join operates on two unary relations");
 +        } else if(firstTupleTypes.back() != secondTupleTypes.front()) {
 +          throw TypeCheckingExceptionPrivate(n, " Join operates on two non-joinable relations");
 +        }
 +        newTupleTypes.insert(newTupleTypes.end(), firstTupleTypes.begin(), firstTupleTypes.end()-1);
 +        newTupleTypes.insert(newTupleTypes.end(), secondTupleTypes.begin()+1, secondTupleTypes.end());
 +      }else if( n.getKind() == kind::PRODUCT ) {
 +        newTupleTypes.insert(newTupleTypes.end(), firstTupleTypes.begin(), firstTupleTypes.end());
 +        newTupleTypes.insert(newTupleTypes.end(), secondTupleTypes.begin(), secondTupleTypes.end());
 +      }
 +      resultType = nodeManager->mkSetType(nodeManager->mkTupleType(newTupleTypes));
 +    }
 +    return resultType;
 +  }
 +
 +  inline static bool computeIsConst(NodeManager* nodeManager, TNode n) {
 +    Assert(n.getKind() == kind::JOIN ||
 +           n.getKind() == kind::PRODUCT);
 +    return false;
 +  }
 +};/* struct RelBinaryOperatorTypeRule */
 +
 +struct RelTransposeTypeRule {
 +  inline static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check)
 +    throw (TypeCheckingExceptionPrivate, AssertionException) {
 +    Assert(n.getKind() == kind::TRANSPOSE);
 +    TypeNode setType = n[0].getType(check);
 +    if(check && !setType.isSet() && !setType.getSetElementType().isTuple()) {
 +        throw TypeCheckingExceptionPrivate(n, "relation transpose operats on non-relation");
 +    }
 +    std::vector<TypeNode> tupleTypes = setType[0].getTupleTypes();
 +    std::reverse(tupleTypes.begin(), tupleTypes.end());
 +    return nodeManager->mkSetType(nodeManager->mkTupleType(tupleTypes));
 +  }
 +
 +  inline static bool computeIsConst(NodeManager* nodeManager, TNode n) {
 +      return false;
 +    }
 +};/* struct RelTransposeTypeRule */
 +
 +struct RelTransClosureTypeRule {
 +  inline static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check)
 +    throw (TypeCheckingExceptionPrivate, AssertionException) {
 +    Assert(n.getKind() == kind::TCLOSURE);
 +    TypeNode setType = n[0].getType(check);
 +    if(check) {
 +      if(!setType.isSet() && !setType.getSetElementType().isTuple()) {
 +        throw TypeCheckingExceptionPrivate(n, " transitive closure operates on non-relation");
 +      }
 +      std::vector<TypeNode> tupleTypes = setType[0].getTupleTypes();
 +      if(tupleTypes.size() != 2) {
 +        throw TypeCheckingExceptionPrivate(n, " transitive closure operates on non-binary relations");
 +      }
 +      if(tupleTypes[0] != tupleTypes[1]) {
 +        throw TypeCheckingExceptionPrivate(n, " transitive closure operates on non-homogeneous binary relations");
 +      }
 +    }
 +    return setType;
 +  }
 +
 +  inline static bool computeIsConst(NodeManager* nodeManager, TNode n) {
 +      Assert(n.getKind() == kind::TCLOSURE);
 +      return false;
 +    }
 +};/* struct RelTransClosureTypeRule */
 +
++
  struct SetsProperties {
    inline static Cardinality computeCardinality(TypeNode type) {
      Assert(type.getKind() == kind::SET_TYPE);