uninterpreted_constant.h
Go to the documentation of this file.
/********************* */
#include "cvc4_public.h"
#pragma once
#include "expr/type.h"
#include <iostream>
namespace CVC4 {
class CVC4_PUBLIC UninterpretedConstant {
const Type d_type;
const Integer d_index;
public:
UninterpretedConstant(Type type, Integer index) throw(IllegalArgumentException) :
d_type(type),
d_index(index) {
CheckArgument(type.isSort(), type, "uninterpreted constants can only be created for uninterpreted sorts, not `%s'", type.toString().c_str());
CheckArgument(index >= 0, index, "index >= 0 required for uninterpreted constant index, not `%s'", index.toString().c_str());
}
~UninterpretedConstant() throw() {
}
Type getType() const throw() {
return d_type;
}
const Integer& getIndex() const throw() {
return d_index;
}
bool operator==(const UninterpretedConstant& uc) const throw() {
return d_type == uc.d_type && d_index == uc.d_index;
}
bool operator!=(const UninterpretedConstant& uc) const throw() {
return !(*this == uc);
}
bool operator<(const UninterpretedConstant& uc) const throw() {
return d_type < uc.d_type ||
(d_type == uc.d_type && d_index < uc.d_index);
}
bool operator<=(const UninterpretedConstant& uc) const throw() {
return d_type < uc.d_type ||
(d_type == uc.d_type && d_index <= uc.d_index);
}
bool operator>(const UninterpretedConstant& uc) const throw() {
return !(*this <= uc);
}
bool operator>=(const UninterpretedConstant& uc) const throw() {
return !(*this < uc);
}
};/* class UninterpretedConstant */
std::ostream& operator<<(std::ostream& out, const UninterpretedConstant& uc) CVC4_PUBLIC;
struct CVC4_PUBLIC UninterpretedConstantHashFunction {
inline size_t operator()(const UninterpretedConstant& uc) const {
return TypeHashFunction()(uc.getType()) * IntegerHashFunction()(uc.getIndex());
}
};/* struct UninterpretedConstantHashFunction */
}/* CVC4 namespace */
CVC4::IllegalArgumentException
Definition exception.h:79
CVC4::Integer
Definition integer_gmp_imp.h:34
CVC4::Type
Class encapsulating CVC4 expression types.
Definition type.h:89
CVC4::UninterpretedConstant
Definition uninterpreted_constant.h:26
CVC4::UninterpretedConstant::getIndex
const Integer & getIndex() const
Definition uninterpreted_constant.h:45
CVC4::UninterpretedConstant::operator==
bool operator==(const UninterpretedConstant &uc) const
Definition uninterpreted_constant.h:49
CVC4::UninterpretedConstant::operator!=
bool operator!=(const UninterpretedConstant &uc) const
Definition uninterpreted_constant.h:52
CVC4::UninterpretedConstant::~UninterpretedConstant
~UninterpretedConstant()
Definition uninterpreted_constant.h:39
CVC4::UninterpretedConstant::operator>=
bool operator>=(const UninterpretedConstant &uc) const
Definition uninterpreted_constant.h:67
CVC4::UninterpretedConstant::operator<=
bool operator<=(const UninterpretedConstant &uc) const
Definition uninterpreted_constant.h:60
CVC4::UninterpretedConstant::operator>
bool operator>(const UninterpretedConstant &uc) const
Definition uninterpreted_constant.h:64
CVC4::UninterpretedConstant::UninterpretedConstant
UninterpretedConstant(Type type, Integer index)
Definition uninterpreted_constant.h:32
CVC4::UninterpretedConstant::operator<
bool operator<(const UninterpretedConstant &uc) const
Definition uninterpreted_constant.h:56
CVC4::UninterpretedConstant::getType
Type getType() const
Definition uninterpreted_constant.h:42
cvc4_public.h
Macros that should be defined everywhere during the building of the libraries and driver binary,...
CVC4_PUBLIC
#define CVC4_PUBLIC
Definition cvc4_public.h:30
CVC4
Definition expr.h:106
CVC4::operator<<
std::ostream & operator<<(std::ostream &out, const TypeCheckingException &e)
CVC4::CheckArgument
void CheckArgument(bool cond, const T &arg, const char *fmt,...)
Definition exception.h:140
CVC4::IntegerHashFunction
Definition integer_gmp_imp.h:508
CVC4::TypeHashFunction
Hash function for Types.
Definition type.h:69
CVC4::UninterpretedConstantHashFunction
Hash function for the BitVector constants.
Definition uninterpreted_constant.h:78
CVC4::UninterpretedConstantHashFunction::operator()
size_t operator()(const UninterpretedConstant &uc) const
Definition uninterpreted_constant.h:79
type.h
Interface for expression types.