コード例 #1
0
bool InstantiationEngine::hasNonArithmeticVariable( Node f ){
  for( int i=0; i<(int)f[0].getNumChildren(); i++ ){
    TypeNode tn = f[0][i].getType();
    if( !tn.isInteger() && !tn.isReal() ){
      return true;
    }
  }
  return false;
}
コード例 #2
0
ファイル: inst_strategy_cbqi.cpp プロジェクト: kyledewey/CVC4
bool InstStrategyCbqi::hasNonCbqiVariable( Node q ){
  for( unsigned i=0; i<q[0].getNumChildren(); i++ ){
    TypeNode tn = q[0][i].getType();
    if( !tn.isInteger() && !tn.isReal() && !tn.isBoolean() ){
      if( options::cbqiSplx() ){
        return true;
      }else{
        //datatypes supported in new implementation
        if( !tn.isDatatype() ){
          return true;
        }
      }
    }
  }
  return false;
}
コード例 #3
0
ファイル: term_database.cpp プロジェクト: remccleeary/CVC4
Node TermDb::getFreeVariableForInstConstant( Node n ){
  TypeNode tn = n.getType();
  if( d_free_vars.find( tn )==d_free_vars.end() ){
    //if integer or real, make zero
    if( tn.isInteger() || tn.isReal() ){
      Rational z(0);
      d_free_vars[tn] = NodeManager::currentNM()->mkConst( z );
    }else{
      if( d_type_map[ tn ].empty() ){
        d_free_vars[tn] = NodeManager::currentNM()->mkSkolem( "freevar_$$", tn, "is a free variable created by termdb" );
        Trace("mkVar") << "FreeVar:: Make variable " << d_free_vars[tn] << " : " << tn << std::endl;
      }else{
        d_free_vars[tn] = d_type_map[ tn ][ 0 ];
      }
    }
  }
  return d_free_vars[tn];
}
コード例 #4
0
ファイル: symmetry_breaker.cpp プロジェクト: CVC4/CVC4
Kind SymmetryBreaker::getOrderKind(Node node)
{
  TypeNode tn = node.getType();
  if (tn.isBoolean())
  {
    return IMPLIES;
  }
  else if (tn.isReal())
  {
    return LEQ;
  }
  else if (tn.isBitVector())
  {
    return BITVECTOR_ULE;
  }
  if (tn.isFirstClass())
  {
    return EQUAL;
  }
  return UNDEFINED_KIND;
}
コード例 #5
0
ファイル: theory_fp.cpp プロジェクト: Dunedune/CVC4
  Node removeToFPGeneric (TNode node) {
    Assert(node.getKind() == kind::FLOATINGPOINT_TO_FP_GENERIC);
    
    FloatingPointToFPGeneric info = node.getOperator().getConst<FloatingPointToFPGeneric>();
    
    size_t children = node.getNumChildren();
    
    Node op;
    
    if (children == 1) {
      op = NodeManager::currentNM()->mkConst(FloatingPointToFPIEEEBitVector(info.t.exponent(),
									    info.t.significand()));
      return NodeManager::currentNM()->mkNode(op, node[0]);
      
    } else {
      Assert(children == 2);
      Assert(node[0].getType().isRoundingMode());
      
      TypeNode t = node[1].getType();
      
      if (t.isFloatingPoint()) {
	op = NodeManager::currentNM()->mkConst(FloatingPointToFPFloatingPoint(info.t.exponent(),
									      info.t.significand()));
      } else if (t.isReal()) {
	op = NodeManager::currentNM()->mkConst(FloatingPointToFPReal(info.t.exponent(),
								     info.t.significand()));
      } else if (t.isBitVector()) {
	op = NodeManager::currentNM()->mkConst(FloatingPointToFPSignedBitVector(info.t.exponent(),
										info.t.significand()));
	
      } else {
	throw TypeCheckingExceptionPrivate(node, "cannot rewrite to_fp generic due to incorrect type of second argument");
      }
      
      return NodeManager::currentNM()->mkNode(op, node[0], node[1]);
    }
    
    Unreachable("to_fp generic not rewritten");
  }