From a84ad01f18b860e22027622d3397367570a2523c Mon Sep 17 00:00:00 2001 From: ajreynol Date: Sat, 13 Jun 2015 16:06:49 +0200 Subject: Avoid instantiating with array constants. --- src/theory/quantifiers_engine.cpp | 2 ++ src/theory/rep_set.cpp | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/theory') diff --git a/src/theory/quantifiers_engine.cpp b/src/theory/quantifiers_engine.cpp index 020a2e552..a2d68f7c9 100644 --- a/src/theory/quantifiers_engine.cpp +++ b/src/theory/quantifiers_engine.cpp @@ -1100,6 +1100,8 @@ Node EqualityQueryQuantifiersEngine::getInternalRepresentative( Node a, Node f, r = getRepresentative( r ); }else{ if( r.getType().isSort() ){ + //TODO : this can happen in rare cases + // say x:(Array Int U), select( x, 0 ), x assigned (const @u1). Trace("internal-rep-warn") << "No representative for UF constant." << std::endl; } } diff --git a/src/theory/rep_set.cpp b/src/theory/rep_set.cpp index 4ab8df72f..70b7d31f4 100644 --- a/src/theory/rep_set.cpp +++ b/src/theory/rep_set.cpp @@ -48,10 +48,13 @@ int RepSet::getNumRepresentatives( TypeNode tn ) const{ } void RepSet::add( TypeNode tn, Node n ){ - Trace("rsi-debug") << "Add rep #" << d_type_reps[tn].size() << " for " << tn << " : " << n << std::endl; - Assert( n.getType().isSubtypeOf( tn ) ); - d_tmap[ n ] = (int)d_type_reps[tn].size(); - d_type_reps[tn].push_back( n ); + //for now, do not add array constants FIXME + if( !tn.isArray() || !n.isConst() ){ + Trace("rsi-debug") << "Add rep #" << d_type_reps[tn].size() << " for " << tn << " : " << n << std::endl; + Assert( n.getType().isSubtypeOf( tn ) ); + d_tmap[ n ] = (int)d_type_reps[tn].size(); + d_type_reps[tn].push_back( n ); + } } int RepSet::getIndexFor( Node n ) const { @@ -179,8 +182,8 @@ bool RepSetIterator::initialize(){ d_incomplete = true; } } - //enumerate if the sort is reasonably small, the upper bound of 1000 is chosen arbitrarily for now - }else if( tn.getCardinality().isFinite() && !tn.getCardinality().isLargeFinite() && + //enumerate if the sort is reasonably small, not an Array, the upper bound of 1000 is chosen arbitrarily for now + }else if( !tn.isArray() && tn.getCardinality().isFinite() && !tn.getCardinality().isLargeFinite() && tn.getCardinality().getFiniteCardinality().toUnsignedInt()<=1000 ){ d_rep_set->complete( tn ); }else{ -- cgit v1.2.3