Node c = ei->d_constructor.get();
cons.push_back( c );
eqc_cons[ eqc ] = c;
+ m->assertRepresentative( c );
}else{
//if eqc contains a symbol known to datatypes (a selector), then we must assign
+#if 0
bool shouldConsider = false;
eq::EqClassIterator eqc_i = eq::EqClassIterator( eqc, &d_equalityEngine );
while( !eqc_i.isFinished() ){
}
++eqc_i;
}
-/*
+#else
+ //should assign constructors to EQC if they have a selector or a tester
bool shouldConsider = ( ei && ei->d_selectors ) || hasTester( eqc );
- */
+#endif
if( shouldConsider ){
nodes.push_back( eqc );
}
bool addCons = false;
const Datatype& dt = ((DatatypeType)(eqc.getType()).toType()).getDatatype();
if( !d_equalityEngine.hasTerm( eqc ) ){
+ Assert( false );
+ /*
if( !dt.isCodatatype() ){
Trace("dt-cmi") << "NOTICE : Datatypes: need to assign constructor for " << eqc << std::endl;
Trace("dt-cmi") << " Type : " << eqc.getType() << std::endl;
neqc = *te;
}
}
+ */
}else{
Trace("dt-cmi") << "NOTICE : Datatypes: no constructor in equivalence class " << eqc << std::endl;
Trace("dt-cmi") << " Type : " << eqc.getType() << std::endl;
//must try the infinite ones first
if( pcons[i] && (r==1)==dt[ i ].isFinite() ){
neqc = DatatypesRewriter::getInstCons( eqc, dt, i );
- for( unsigned j=0; j<neqc.getNumChildren(); j++ ){
- //if( sels[i].find( j )==sels[i].end() && DatatypesRewriter::isTermDatatype( neqc[j] ) ){
- if( !d_equalityEngine.hasTerm( neqc[j] ) && DatatypesRewriter::isTermDatatype( neqc[j] ) ){
- nodes.push_back( neqc[j] );
- }
- }
+ //for( unsigned j=0; j<neqc.getNumChildren(); j++ ){
+ // //if( sels[i].find( j )==sels[i].end() && DatatypesRewriter::isTermDatatype( neqc[j] ) ){
+ // if( !d_equalityEngine.hasTerm( neqc[j] ) && DatatypesRewriter::isTermDatatype( neqc[j] ) ){
+ // nodes.push_back( neqc[j] );
+ // }
+ //}
break;
}
}
Trace("dt-cmi") << "Assign : " << neqc << std::endl;
m->assertEquality( eqc, neqc, true );
eqc_cons[ eqc ] = neqc;
+ m->assertRepresentative( neqc );
}
//m->assertRepresentative( neqc );
if( addCons ){
bool CegInstantiation::needsModel( Theory::Effort e ) {
return true;
}
+bool CegInstantiation::needsFullModel( Theory::Effort e ) {
+ return false;
+}
void CegInstantiation::check( Theory::Effort e, unsigned quant_e ) {
if( quant_e==QuantifiersEngine::QEFFORT_MODEL ){
public:
bool needsCheck( Theory::Effort e );
bool needsModel( Theory::Effort e );
+ bool needsFullModel( Theory::Effort e );
/* Call during quantifier engine's check */
void check( Theory::Effort e, unsigned quant_e );
/* Called for new quantifiers */
CodeTimer codeTimer(d_time);
bool needsCheck = false;
bool needsModel = false;
+ bool needsFullModel = false;
std::vector< QuantifiersModule* > qm;
if( d_model->getNumAssertedQuantifiers()>0 ){
needsCheck = e>=Theory::EFFORT_LAST_CALL; //always need to check at or above last call
needsCheck = true;
if( d_modules[i]->needsModel( e ) ){
needsModel = true;
+ if( d_modules[i]->needsFullModel( e ) ){
+ needsFullModel = true;
+ }
}
}
}
//build the model if any module requested it
if( quant_e==QEFFORT_MODEL && needsModel ){
Assert( d_builder!=NULL );
- Trace("quant-engine-debug") << "Build model, fullModel = " << d_builder->optBuildAtFullModel() << "..." << std::endl;
+ Trace("quant-engine-debug") << "Build model, fullModel = " << ( needsFullModel || d_builder->optBuildAtFullModel() ) << "..." << std::endl;
d_builder->d_addedLemmas = 0;
- d_builder->buildModel( d_model, d_builder->optBuildAtFullModel() );
+ d_builder->buildModel( d_model, needsFullModel || d_builder->optBuildAtFullModel() );
//we are done if model building was unsuccessful
if( d_builder->d_addedLemmas>0 ){
success = false;
if( d_hasAddedLemma ){
break;
//otherwise, complete the model generation if necessary
- }else if( quant_e==QEFFORT_MODEL && needsModel && options::produceModels() && !d_builder->optBuildAtFullModel() ){
+ }else if( quant_e==QEFFORT_MODEL && needsModel && options::produceModels() && !needsFullModel && !d_builder->optBuildAtFullModel() ){
Trace("quant-engine-debug") << "Build completed model..." << std::endl;
d_builder->buildModel( d_model, true );
}
virtual bool needsCheck( Theory::Effort e ) { return e>=Theory::EFFORT_LAST_CALL; }
/* whether this module needs a model built */
virtual bool needsModel( Theory::Effort e ) { return false; }
+ /* whether this module needs a model built */
+ virtual bool needsFullModel( Theory::Effort e ) { return false; }
/* reset at a round */
virtual void reset_round( Theory::Effort e ){}
/* Call during quantifier engine's check */
continue;
}
TypeNode t = TypeSet::getType(it);
- TypeNode tb = t.getBaseType();
+ if(t.isTuple() || t.isRecord()) {
+ t = NodeManager::currentNM()->getDatatypeForTupleRecord(t);
+ }
+ TypeNode tb = t.getBaseType();
if (!assignOne) {
set<Node>* repSet = typeRepSet.getSet(tb);
if (repSet != NULL && !repSet->empty()) {
#include "theory/uf/options.h"
#include "smt/options.h"
#include "theory/rewriter.h"
+#include "theory/quantifiers/options.h"
using namespace CVC4;
using namespace std;
for( size_t i=0; i<n.getNumChildren(); i++ ){
bool processChild = true;
if( n.getKind()==kind::FORALL || n.getKind()==kind::EXISTS ){
- processChild = i==1;
+ processChild = options::userPatternsQuant()==theory::quantifiers::USER_PAT_MODE_IGNORE ? i==1 : i>=1;
}
if( processChild ){
children.push_back( n[i] );
for( size_t i=0; i<n.getNumChildren(); i++ ){
bool processChild = true;
if( n.getKind()==kind::FORALL || n.getKind()==kind::EXISTS ){
- processChild = i>=1;
+ processChild = options::userPatternsQuant()==theory::quantifiers::USER_PAT_MODE_IGNORE ? i==1 : i>=1;
}
if( processChild ){
children.push_back( simplify( n[i], var_bound ) );
swap_t1_np_nf_ai_00005_007.cvc.smt \
x2.smt \
x3.smt \
- parsing_ringer.cvc \
bug272.smt \
bug272.minimized.smt \
constarr.smt2 \
# and make sure to distribute it
#EXTRA_DIST += \
# error.cvc
+# disabled for now (problem is related to records in model):
+# parsing_ringer.cvc
# synonyms for "check"
.PHONY: regress regress0 test
fc-unsat-pent.smt2 \
fc-pigeonhole19.smt2 \
Hoare-z3.931718.smt \
- bug0909.smt2
+ bug0909.smt2 \
+ lst-no-self-rev-exp.smt2
EXTRA_DIST = $(TESTS)
-# disabled for now :
-# lst-no-self-rev-exp.smt2
#if CVC4_BUILD_PROFILE_COMPETITION
#else
-; COMMAND-LINE: --finite-model-find --uf-ss-fair
+; COMMAND-LINE: --finite-model-find --dt-rewrite-error-sel
; EXPECT: sat
(set-logic ALL_SUPPORTED)
(declare-datatypes () ((Nat (succ (pred Nat)) (zero)) (Lst (cons (hd Nat) (tl Lst)) (nil))))
(declare-sort I_app 0)
(declare-sort I_rev 0)
+(declare-fun a () I_app)
+(declare-fun b () I_app)
+(assert (not (= a b)))
+
(declare-fun app_0_3 (I_app) Lst)
(declare-fun app_1_4 (I_app) Lst)
(declare-fun rev_0_5 (I_rev) Lst)