20#ifndef __CVC4__CARDINALITY_H
21#define __CVC4__CARDINALITY_H
26#include "util/integer.h"
41 "Beth index must be a nonnegative integer, not %s.",
70 static const Integer s_realCard;
73 static const Integer s_unknownCard;
76 static const Integer s_largeFiniteCard;
117 "Cardinality must be a nonnegative integer, not %ld.", card);
127 "Cardinality must be a nonnegative integer, not %s.",
165 return d_card >= s_largeFiniteCard;
178 return isFinite() || d_card == s_intCard;
187 CheckArgument(isFinite(), *
this,
"This cardinality is not finite.");
188 CheckArgument(!isLargeFinite(), *
this,
"This cardinality is finite, but too large to represent.");
199 "This cardinality is not infinite (or is unknown).");
Representation for a Beth number, used only to construct Cardinality objects.
CardinalityBeth(const Integer &beth)
const Integer & getNumber() const
Representation for an unknown cardinality.
A simple representation of a cardinality.
Integer getFiniteCardinality() const
In the case that this cardinality is finite, return its cardinality.
Integer getBethNumber() const
In the case that this cardinality is infinite, return its Beth number.
Cardinality & operator+=(const Cardinality &c)
Assigning addition of this cardinality with another.
std::string toString() const
Return a string representation of this cardinality.
Cardinality(long card)
Construct a finite cardinality equal to the integer argument.
bool isFinite() const
Returns true iff this cardinality is finite.
Cardinality & operator*=(const Cardinality &c)
Assigning multiplication of this cardinality with another.
static const Cardinality REALS
The cardinality of the set of real numbers.
bool isInfinite() const
Returns true iff this cardinality is infinite.
static const Cardinality UNKNOWN_CARD
The unknown cardinality.
Cardinality(CardinalityUnknown)
Construct an unknown cardinality.
bool isUnknown() const
Returns true iff this cardinality is unknown.
bool isLargeFinite() const
Returns true iff this cardinality is finite and large (i.e., at the ceiling of representable finite c...
Cardinality(const Integer &card)
Construct a finite cardinality equal to the integer argument.
Cardinality operator^(const Cardinality &c) const
Exponentiation of two cardinalities.
Cardinality(CardinalityBeth beth)
Construct an infinite cardinality equal to the given Beth number.
static const Cardinality INTEGERS
The cardinality of the set of integers.
Cardinality & operator^=(const Cardinality &c)
Assigning exponentiation of this cardinality with another.
Cardinality operator+(const Cardinality &c) const
Add two cardinalities.
bool isCountable() const
Returns true iff this cardinality is finite or countably infinite.
CardinalityComparison
Used as a result code for Cardinality::compare().
Cardinality operator*(const Cardinality &c) const
Multiply two cardinalities.
Cardinality::CardinalityComparison compare(const Cardinality &c) const
Compare two cardinalities.
std::string toString(int base=10) const
Macros that should be defined everywhere during the building of the libraries and driver binary,...
CVC4's exception base class and some associated utilities.
void CheckArgument(bool cond, const T &arg, const char *fmt,...)