return StringType(Type(d_nodeManager, new TypeNode(d_nodeManager->stringType())));
}
-KindType ExprManager::kindType() const {
- NodeManagerScope nms(d_nodeManager);
- return KindType(Type(d_nodeManager, new TypeNode(d_nodeManager->kindType())));
-}
-
RealType ExprManager::realType() const {
NodeManagerScope nms(d_nodeManager);
return RealType(Type(d_nodeManager, new TypeNode(d_nodeManager->realType())));
/** Get the type for strings. */
StringType stringType() const;
- /** Get the type for sorts. */
- KindType kindType() const;
-
/** Get the type for reals. */
RealType realType() const;
return d_node->isNull();
}
-Expr::operator bool() const {
- return !isNull();
-}
-
bool Expr::isVariable() const {
ExprManagerScope ems(*this);
Assert(d_node != NULL, "Unexpected NULL expression pointer!");
size_t operator()(CVC4::Expr e) const;
};/* struct ExprHashFunction */
+class BoolExpr;
+
/**
* Class encapsulating CVC4 expressions and methods for constructing new
* expressions.
*/
class CVC4_PUBLIC Expr {
-protected:
+
+ friend class BoolExpr;
/** The internal expression representation */
NodeTemplate<true>* d_node;
*/
bool isNull() const;
- /**
- * Check if this is a null expression.
- *
- * @return true if NOT a null expression
- */
- operator bool() const;
-
/**
* Check if this is an expression representing a variable.
*
*/
void debugPrint();
-protected:
-
/**
* Returns the actual internal node.
* @return the internal node
${getConst_instantiations}
-#line 965 "${template}"
+#line 959 "${template}"
namespace expr {
/** Get the (singleton) type for strings. */
inline TypeNode stringType();
- /** Get the (singleton) type for sorts. */
- inline TypeNode kindType();
-
/** Get the bound var list type. */
inline TypeNode boundVarListType();
return TypeNode(mkTypeConst<TypeConstant>(STRING_TYPE));
}
-/** Get the (singleton) type for sorts. */
-inline TypeNode NodeManager::kindType() {
- return TypeNode(mkTypeConst<TypeConstant>(KIND_TYPE));
-}
-
/** Get the bound var list type. */
inline TypeNode NodeManager::boundVarListType() {
return TypeNode(mkTypeConst<TypeConstant>(BOUND_VAR_LIST_TYPE));
return SubrangeType(*this);
}
-/** Is this a kind type (i.e., the type of a type)? */
-bool Type::isKind() const {
- NodeManagerScope nms(d_nodeManager);
- return d_typeNode->isKind();
-}
-
-/** Cast to a kind type */
-Type::operator KindType() const throw(AssertionException) {
- NodeManagerScope nms(d_nodeManager);
- Assert(isNull() || isKind());
- return KindType(*this);
-}
-
vector<Type> FunctionType::getArgTypes() const {
NodeManagerScope nms(d_nodeManager);
vector<Type> args;
Assert(isNull() || isArray());
}
-KindType::KindType(const Type& t) throw(AssertionException) :
- Type(t) {
- Assert(isNull() || isKind());
-}
-
SortType::SortType(const Type& t) throw(AssertionException) :
Type(t) {
Assert(isNull() || isSort());
class TesterType;
class FunctionType;
class TupleType;
-class KindType;
class SortType;
class SortConstructorType;
class PredicateSubtype;
*/
operator SubrangeType() const throw(AssertionException);
- /**
- * Is this a kind type (i.e., the type of a type)?
- * @return true if this is a kind type
- */
- bool isKind() const;
-
- /**
- * Cast to a kind type
- * @return the kind type
- */
- operator KindType() const throw(AssertionException);
-
/**
* Outputs a string representation of this type to the stream.
* @param out the stream to output to
};/* class SubrangeType */
-/**
- * Class encapsulating the kind type (the type of types).
- */
-class CVC4_PUBLIC KindType : public Type {
-
-public:
-
- /** Construct from the base type */
- KindType(const Type& type = Type()) throw(AssertionException);
-};/* class KindType */
-
/**
* Class encapsulating the bit-vector type.
*/
case kind::BUILTIN:
typeNode = nodeManager->builtinOperatorType();
break;
- case kind::SORT_TYPE:
- typeNode = nodeManager->kindType();
- break;
${typerules}
-#line 51 "${template}"
+#line 48 "${template}"
default:
Debug("getType") << "FAILURE" << std::endl;
switch(n.getKind()) {
${construles}
-#line 74 "${template}"
+#line 71 "${template}"
default:;
}
/** Get the bounds defining this subrange */
const SubrangeBounds& getSubrangeBounds() const;
- /** Is this a kind type (i.e., the type of a type)? */
- bool isKind() const;
-
-
/**
* Returns the leastUpperBound in the extended type lattice of the two types.
* If this is \top, i.e. there is no inhabited type that contains both,
( isPredicateSubtype() && getSubtypeBaseType().isSubrange() );
}
-/** Is this a kind type (i.e., the type of a type)? */
-inline bool TypeNode::isKind() const {
- return getKind() == kind::TYPE_CONSTANT &&
- getConst<TypeConstant>() == KIND_TYPE;
-}
-
/** Is this a bit-vector type */
inline bool TypeNode::isBitVector() const {
return getKind() == kind::BITVECTOR_TYPE ||
case BOOLEAN_TYPE:
out << "BOOLEAN";
break;
- case KIND_TYPE:
- out << "TYPE";
- break;
default:
out << tc;
break;
"Cannot get value unless immediately preceded by SAT/INVALID or UNKNOWN response.";
throw ModalException(msg);
}
- if(type.isKind() || type.isSortConstructor()) {
+ if(type.isSort() || type.isSortConstructor()) {
const char* msg =
"Cannot get value of a sort.";
throw ModalException(msg);
*/
SExpr getStatistic(std::string name) const throw();
- Result getStatusOfLastCommand() const {
+ /**
+ * Returns the most recent result of checkSat/query or (set-info :status).
+ */
+ Result getStatusOfLastCommand() const throw() {
return d_status;
}
not-well-founded \
"Built in type for built in operators"
-# Justified because we can have an unbounded-but-finite number of
-# sorts. Assuming we have |Z| is probably ok for now..
-sort KIND_TYPE \
- Cardinality::INTEGERS \
- not-well-founded \
- "Uninterpreted Sort"
-
variable SORT_TAG "sort tag"
parameterized SORT_TYPE SORT_TAG 0: "sort type"
# This is really "unknown" cardinality, but maybe this will be good
v3l60006.cvc \
v5l30058.cvc \
bug286.cvc \
- wrong-sel-simp.cvc
+ wrong-sel-simp.cvc \
+ rec2.cvc
FAILING_TESTS = \
- rec2.cvc \
rec5.cvc \
datatype-dump.cvc
TypeNode t3 = d_nodeManager->mkSort("T");
TS_ASSERT( t.isBoolean() );
TS_ASSERT( !t.isFunction() );
- TS_ASSERT( !t.isKind() );
TS_ASSERT( !t.isNull() );
TS_ASSERT( !t.isPredicate() );
TS_ASSERT( !t.isSort() );
TS_ASSERT_EQUALS( bt, t);
}
- void testKindType() {
- TypeNode t = d_nodeManager->kindType();
- TypeNode t2 = d_nodeManager->kindType();
- TypeNode t3 = d_nodeManager->mkSort("T");
-
- TS_ASSERT( !t.isBoolean() );
- TS_ASSERT( !t.isFunction() );
- TS_ASSERT( t.isKind() );
- TS_ASSERT( !t.isNull() );
- TS_ASSERT( !t.isPredicate() );
- TS_ASSERT( !t.isSort() );
-
- TS_ASSERT_EQUALS(t, t2);
- TS_ASSERT( t != t3);
-
- TypeNode kt = t;
- TS_ASSERT_EQUALS( kt, t );
- // TODO: Is there a way to get the type of otherType (it should == t)?
- }
-
void testMkFunctionTypeBoolToBool() {
TypeNode booleanType = d_nodeManager->booleanType();
TypeNode t = d_nodeManager->mkFunctionType(booleanType,booleanType);
TS_ASSERT( !t.isBoolean() );
TS_ASSERT( t.isFunction() );
- TS_ASSERT( !t.isKind() );
TS_ASSERT( !t.isNull() );
TS_ASSERT( t.isPredicate() );
TS_ASSERT( !t.isSort() );
TS_ASSERT( !t.isBoolean() );
TS_ASSERT( t.isFunction() );
- TS_ASSERT( !t.isKind() );
TS_ASSERT( !t.isNull() );
TS_ASSERT( !t.isPredicate() );
TS_ASSERT( !t.isSort() );
TS_ASSERT( !t.isBoolean() );
TS_ASSERT( t.isFunction() );
- TS_ASSERT( !t.isKind() );
TS_ASSERT( !t.isNull() );
TS_ASSERT( !t.isPredicate() );
TS_ASSERT( !t.isSort() );
TS_ASSERT( !t.isBoolean() );
TS_ASSERT( t.isFunction() );
- TS_ASSERT( !t.isKind() );
TS_ASSERT( !t.isNull() );
TS_ASSERT( t.isPredicate() );
TS_ASSERT( !t.isSort() );