当前位置: 首页>>代码示例>>C++>>正文


C++ PrettyCheckArgument函数代码示例

本文整理汇总了C++中PrettyCheckArgument函数的典型用法代码示例。如果您正苦于以下问题:C++ PrettyCheckArgument函数的具体用法?C++ PrettyCheckArgument怎么用?C++ PrettyCheckArgument使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PrettyCheckArgument函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PrettyCheckArgument

bool LogicInfo::isDifferenceLogic() const {
  PrettyCheckArgument(d_locked, *this,
                      "This LogicInfo isn't locked yet, and cannot be queried");
  PrettyCheckArgument(
      isTheoryEnabled(theory::THEORY_ARITH), *this,
      "Arithmetic not used in this LogicInfo; cannot ask whether it's difference logic");
  return d_differenceLogic;
}
开发者ID:4tXJ7f,项目名称:CVC4,代码行数:8,代码来源:logic_info.cpp

示例2: throw

Type SymbolTable::lookupType(const std::string& name,
                             const std::vector<Type>& params) const throw() {
  pair<vector<Type>, Type> p = (*d_typeMap->find(name)).second;
  PrettyCheckArgument(p.first.size() == params.size(), params,
                "type constructor arity is wrong: "
                "`%s' requires %u parameters but was provided %u",
         name.c_str(), p.first.size(), params.size());
  if(p.first.size() == 0) {
    PrettyCheckArgument(p.second.isSort(), name.c_str());
    return p.second;
  }
  if(p.second.isSortConstructor()) {
    if(Debug.isOn("sort")) {
      Debug("sort") << "instantiating using a sort constructor" << endl;
      Debug("sort") << "have formals [";
      copy( p.first.begin(), p.first.end() - 1,
            ostream_iterator<Type>(Debug("sort"), ", ") );
      Debug("sort") << p.first.back() << "]" << endl
                    << "parameters   [";
      copy( params.begin(), params.end() - 1,
            ostream_iterator<Type>(Debug("sort"), ", ") );
      Debug("sort") << params.back() << "]" << endl
                    << "type ctor    " << name << endl
                    << "type is      " << p.second << endl;
    }

    Type instantiation =
      SortConstructorType(p.second).instantiate(params);

    Debug("sort") << "instance is  " << instantiation << endl;

    return instantiation;
  } else if(p.second.isDatatype()) {
    PrettyCheckArgument(DatatypeType(p.second).isParametric(), name, "expected parametric datatype");
    return DatatypeType(p.second).instantiate(params);
  } else {
    if(Debug.isOn("sort")) {
      Debug("sort") << "instantiating using a sort substitution" << endl;
      Debug("sort") << "have formals [";
      copy( p.first.begin(), p.first.end() - 1,
            ostream_iterator<Type>(Debug("sort"), ", ") );
      Debug("sort") << p.first.back() << "]" << endl
                    << "parameters   [";
      copy( params.begin(), params.end() - 1,
            ostream_iterator<Type>(Debug("sort"), ", ") );
      Debug("sort") << params.back() << "]" << endl
                    << "type ctor    " << name << endl
                    << "type is      " << p.second << endl;
    }

    Type instantiation = p.second.substitute(p.first, params);

    Debug("sort") << "instance is  " << instantiation << endl;

    return instantiation;
  }
}
开发者ID:jinala,项目名称:CVC4,代码行数:57,代码来源:symbol_table.cpp

示例3: find

size_t Record::getIndex(std::string name) const {
  FieldVector::const_iterator i = find(*d_fields, name);
  PrettyCheckArgument(i != d_fields->end(), name,
                      "requested field `%s' does not exist in record",
                      name.c_str());
  return i - d_fields->begin();
}
开发者ID:g2graman,项目名称:CVC4,代码行数:7,代码来源:record.cpp

示例4: d_sat

Result::Result(enum Sat s, std::string inputName)
    : d_sat(s),
      d_validity(VALIDITY_UNKNOWN),
      d_which(TYPE_SAT),
      d_unknownExplanation(UNKNOWN_REASON),
      d_inputName(inputName) {
  PrettyCheckArgument(s != SAT_UNKNOWN,
                      "Must provide a reason for satisfiability being unknown");
}
开发者ID:dddejan,项目名称:CVC4,代码行数:9,代码来源:result.cpp

示例5: nms

const Datatype& DatatypeType::getDatatype() const {
  NodeManagerScope nms(d_nodeManager);
  if( d_typeNode->isParametricDatatype() ) {
    PrettyCheckArgument( (*d_typeNode)[0].getKind() == kind::DATATYPE_TYPE, this);
    const Datatype& dt = (*d_typeNode)[0].getConst<Datatype>();
    return dt;
  } else {
    return d_typeNode->getDatatype();
  }
}
开发者ID:jinala,项目名称:CVC4,代码行数:10,代码来源:type.cpp

示例6: d_type

ArrayStoreAll::ArrayStoreAll(const ArrayType& type, const Expr& expr)
    : d_type(), d_expr() {
  // this check is stronger than the assertion check in the expr manager that
  // ArrayTypes are actually array types
  // because this check is done in production builds too
  PrettyCheckArgument(
      type.isArray(), type,
      "array store-all constants can only be created for array types, not `%s'",
      type.toString().c_str());

  PrettyCheckArgument(
      expr.getType().isComparableTo(type.getConstituentType()), expr,
      "expr type `%s' does not match constituent type of array type `%s'",
      expr.getType().toString().c_str(), type.toString().c_str());

  PrettyCheckArgument(expr.isConst(), expr,
                      "ArrayStoreAll requires a constant expression");

  // Delay allocation until the checks above have been performed. If these fail,
  // the memory for d_type and d_expr should not leak. The alternative is catch,
  // delete and re-throw.
  d_type.reset(new ArrayType(type));
  d_expr.reset(new Expr(expr));
}
开发者ID:4tXJ7f,项目名称:CVC4,代码行数:24,代码来源:array_store_all.cpp

示例7: PrettyCheckArgument

Type& Type::operator=(const Type& t) {
  PrettyCheckArgument(d_typeNode != NULL, this, "Unexpected NULL typenode pointer!");
  PrettyCheckArgument(t.d_typeNode != NULL, t, "Unexpected NULL typenode pointer!");

  if(this != &t) {
    if(d_nodeManager == t.d_nodeManager) {
      NodeManagerScope nms(d_nodeManager);
      *d_typeNode = *t.d_typeNode;
    } else {
      // This happens more than you think---every time you set to or
      // from the null Type.  It's tricky because each node manager
      // must be in play at the right time.

      NodeManagerScope nms1(d_nodeManager);
      *d_typeNode = TypeNode::null();

      NodeManagerScope nms2(t.d_nodeManager);
      *d_typeNode = *t.d_typeNode;

      d_nodeManager = t.d_nodeManager;
    }
  }
  return *this;
}
开发者ID:jinala,项目名称:CVC4,代码行数:24,代码来源:type.cpp

示例8: PrettyCheckArgument

std::string SExpr::getValue() const {
  PrettyCheckArgument(isAtom(), this);
  switch (d_sexprType) {
    case SEXPR_INTEGER:
      return d_integerValue.toString();
    case SEXPR_RATIONAL: {
      // We choose to represent rationals as decimal strings rather than
      // "numerator/denominator."  Perhaps an additional SEXPR_DECIMAL
      // could be added if we need both styles, even if it's backed by
      // the same Rational object.
      std::stringstream ss;
      ss << std::fixed << d_rationalValue.getDouble();
      return ss.str();
    }
    case SEXPR_STRING:
    case SEXPR_KEYWORD:
      return d_stringValue;
    case SEXPR_NOT_ATOM:
      return std::string();
  }
  return std::string();
}
开发者ID:CVC4,项目名称:CVC4,代码行数:22,代码来源:sexpr.cpp

示例9: throw

SubrangeType::SubrangeType(const Type& t)
  throw(IllegalArgumentException) :
  Type(t) {
  PrettyCheckArgument(isNull() || isSubrange(), this);
}
开发者ID:jinala,项目名称:CVC4,代码行数:5,代码来源:type.cpp


注:本文中的PrettyCheckArgument函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。