for( int i=(d_models[op]->d_cond.size()-1); i>=0; i--) {
Node v = d_models[op]->d_value[i];
Trace("fmc-model-func") << "Value is : " << v << std::endl;
+ Assert( v.isConst() );
+ /*
if( !hasTerm( v ) ){
//can happen when the model basis term does not exist in ground assignment
TypeNode tn = v.getType();
}
}
v = getRepresentative( v );
+ */
if( curr.isNull() ){
Trace("fmc-model-func") << "base : " << v << std::endl;
curr = v;
}
bool TermDb::containsTerms2( Node n, std::vector< Node >& t, std::map< Node, bool >& visited ) {
- if( std::find( t.begin(), t.end(), n )!=t.end() ){
- return true;
- }else{
- if( visited.find( n )==visited.end() ){
+ if( visited.find( n )==visited.end() ){
+ if( std::find( t.begin(), t.end(), n )!=t.end() ){
+ return true;
+ }else{
visited[n] = true;
for( unsigned i=0; i<n.getNumChildren(); i++ ){
if( containsTerms2( n[i], t, visited ) ){
}
}
}
- return false;
}
+ return false;
+}
+
+bool TermDb::containsUninterpretedConstant2( Node n, std::map< Node, bool >& visited ) {
+ if( n.getKind()==UNINTERPRETED_CONSTANT ){
+ return true;
+ }else if( visited.find( n )==visited.end() ){
+ visited[n] = true;
+ for( unsigned i=0; i<n.getNumChildren(); i++ ){
+ if( containsUninterpretedConstant2( n[i], visited ) ){
+ return true;
+ }
+ }
+ }
+ return false;
}
bool TermDb::containsTerm( Node n, Node t ) {
}
}
+bool TermDb::containsUninterpretedConstant( Node n ) {
+ std::map< Node, bool > visited;
+ return containsUninterpretedConstant2( n, visited );
+}
+
Node TermDb::simpleNegate( Node n ){
if( n.getKind()==OR || n.getKind()==AND ){
std::vector< Node > children;
//helper for contains term
static bool containsTerm2( Node n, Node t, std::map< Node, bool >& visited );
static bool containsTerms2( Node n, std::vector< Node >& t, std::map< Node, bool >& visited );
+ static bool containsUninterpretedConstant2( Node n, std::map< Node, bool >& visited );
//general utilities
public:
/** simple check for whether n contains t as subterm */
static bool containsTerm( Node n, Node t );
/** simple check for contains term, true if contains at least one term in t */
static bool containsTerms( Node n, std::vector< Node >& t );
+ /** contains uninterpreted constant */
+ static bool containsUninterpretedConstant( Node n );
/** simple negate */
static Node simpleNegate( Node n );
/** is assoc */
tail_rec.smt2 \
jasmin-cdt-crash.smt2 \
loopy_coda.smt2 \
- fmc_unsound_model.smt2
+ fmc_unsound_model.smt2 \
+ am-bad-model.cvc
EXTRA_DIST = $(TESTS)
--- /dev/null
+% EXPECT: sat
+OPTION "produce-models";
+OPTION "finite-model-find";
+
+f : (BITVECTOR(2),BITVECTOR(2)) ->ARRAY INT OF INT;
+f0 : BITVECTOR(2) -> ARRAY INT OF INT;
+
+td,td1,td2: ARRAY INT OF INT;
+ASSERT td1 = td WITH[0]:= 1;
+ASSERT td2 = td WITH[0]:= 2;
+ASSERT f(0bin01,0bin00)=td1;
+ASSERT f(0bin10,0bin00)=td2;
+%ASSERT FORALL(i:BITVECTOR(2)) : f0(i)=f(0bin00,i) ;
+%Artificial bypass of quantifier for f0 definition
+ASSERT f0(0bin00) = f(0bin00,0bin00);
+ASSERT f0(0bin01) = f(0bin00,0bin01);
+ASSERT f0(0bin10) = f(0bin00,0bin10);
+ASSERT f0(0bin11) = f(0bin00,0bin11);
+ASSERT FORALL(i:BITVECTOR(2)) : f0(i)=td2 ;
+
+CHECKSAT;
+