kind_template.h
Go to the documentation of this file.
/********************* */
#include "cvc4_public.h"
#ifndef __CVC4__KIND_H
#define __CVC4__KIND_H
#include <iostream>
#include <sstream>
#include "util/exception.h"
namespace CVC4 {
namespace kind {
enum CVC4_PUBLIC Kind_t {
UNDEFINED_KIND = -1,
NULL_EXPR,
${kind_decls}
LAST_KIND
};/* enum Kind_t */
}/* CVC4::kind namespace */
// import Kind into the "CVC4" namespace but keep the individual kind
// constants under kind::
typedef ::CVC4::kind::Kind_t Kind;
namespace kind {
inline std::ostream& operator<<(std::ostream&, CVC4::Kind) CVC4_PUBLIC;
inline std::ostream& operator<<(std::ostream& out, CVC4::Kind k) {
using namespace CVC4::kind;
switch(k) {
/* special cases */
case UNDEFINED_KIND: out << "UNDEFINED_KIND"; break;
case NULL_EXPR: out << "NULL"; break;
${kind_printers}
case LAST_KIND: out << "LAST_KIND"; break;
default: out << "UNKNOWNKIND!" << int(k); break;
}
return out;
}
#line 64 "${template}"
/* TODO: This could be generated. */
inline bool isAssociative(::CVC4::Kind k) {
switch(k) {
case kind::AND:
case kind::OR:
case kind::MULT:
case kind::PLUS:
return true;
default:
return false;
}
}
inline std::string kindToString(::CVC4::Kind k) {
std::stringstream ss;
ss << k;
return ss.str();
}
struct KindHashFunction {
inline size_t operator()(::CVC4::Kind k) const {
return k;
}
};/* struct KindHashFunction */
}/* CVC4::kind namespace */
enum TypeConstant {
${type_constant_list}
#line 102 "${template}"
LAST_TYPE
};/* enum TypeConstant */
struct TypeConstantHashFunction {
inline size_t operator()(TypeConstant tc) const {
return tc;
}
};/* struct TypeConstantHashFunction */
inline std::ostream& operator<<(std::ostream& out, TypeConstant typeConstant) {
switch(typeConstant) {
${type_constant_descriptions}
#line 118 "${template}"
default:
out << "UNKNOWN_TYPE_CONSTANT";
break;
}
return out;
}
namespace theory {
enum TheoryId {
${theory_enum}
#line 130 "${template}"
THEORY_LAST
};/* enum TheoryId */
const TheoryId THEORY_FIRST = static_cast< TheoryId >(0);
const TheoryId THEORY_SAT_SOLVER = THEORY_LAST;
inline TheoryId& operator ++ (TheoryId& id) {
return id = static_cast< TheoryId >(((int)id) + 1);
}
inline std::ostream& operator<<(std::ostream& out, TheoryId theoryId) {
switch(theoryId) {
${theory_descriptions}
#line 144 "${template}"
default:
out << "UNKNOWN_THEORY";
break;
}
return out;
}
inline TheoryId kindToTheoryId(::CVC4::Kind k) {
switch(k) {
case kind::UNDEFINED_KIND:
case kind::NULL_EXPR:
break;
${kind_to_theory_id}
#line 158 "${template}"
case kind::LAST_KIND:
break;
}
throw IllegalArgumentException("", "k", __PRETTY_FUNCTION__, "bad kind");
}
inline TheoryId typeConstantToTheoryId(::CVC4::TypeConstant typeConstant) {
switch(typeConstant) {
${type_constant_to_theory_id}
#line 168 "${template}"
case LAST_TYPE:
break;
}
throw IllegalArgumentException("", "k", __PRETTY_FUNCTION__, "bad type constant");
}
}/* CVC4::theory namespace */
}/* CVC4 namespace */
#endif /* __CVC4__KIND_H */
CVC4::IllegalArgumentException
Definition exception.h:79
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
exception.h
CVC4's exception base class and some associated utilities.
CVC4::kind
Definition kind.h:58
CVC4::kind::kindToString
std::string kindToString(::CVC4::Kind k)
Definition kind.h:526
CVC4::kind::operator<<
std::ostream & operator<<(std::ostream &, CVC4::Kind)
Definition kind.h:284
CVC4::kind::isAssociative
bool isAssociative(::CVC4::Kind k)
Returns true if the given kind is associative.
Definition kind.h:513
CVC4::kind::Kind_t
Kind_t
Definition kind.h:60
CVC4::kind::$
@ $
marks the upper-bound of this enumeration
Definition kind_template.h:33
CVC4::kind::MULT
@ MULT
arithmetic multiplication (N-ary) (33)
Definition kind.h:103
CVC4::kind::UNDEFINED_KIND
@ UNDEFINED_KIND
undefined
Definition kind.h:61
CVC4::kind::NULL_EXPR
@ NULL_EXPR
Null kind.
Definition kind.h:62
CVC4::kind::PLUS
@ PLUS
arithmetic addition (N-ary) (32)
Definition kind.h:102
CVC4::kind::AND
@ AND
logical and (N-ary) (23)
Definition kind.h:89
CVC4::kind::LAST_KIND
@ LAST_KIND
marks the upper-bound of this enumeration
Definition kind.h:271
CVC4::kind::OR
@ OR
logical or (N-ary) (26)
Definition kind.h:92
CVC4::options::out
struct CVC4::options::out__option_t out
CVC4::theory::typeConstantToTheoryId
TheoryId typeConstantToTheoryId(::CVC4::TypeConstant typeConstant)
Definition kind.h:833
CVC4::theory::operator<<
std::ostream & operator<<(std::ostream &out, TheoryId theoryId)
Definition kind.h:614
CVC4::theory::operator++
TheoryId & operator++(TheoryId &id)
Definition kind.h:610
CVC4::theory::THEORY_FIRST
const TheoryId THEORY_FIRST
Definition kind.h:607
CVC4::theory::TheoryId
TheoryId
Definition kind.h:591
CVC4::theory::$
@ $
Definition kind_template.h:128
CVC4::theory::THEORY_LAST
@ THEORY_LAST
Definition kind.h:604
CVC4::theory::kindToTheoryId
TheoryId kindToTheoryId(::CVC4::Kind k)
Definition kind.h:635
CVC4::theory::THEORY_SAT_SOLVER
const TheoryId THEORY_SAT_SOLVER
Definition kind.h:608
CVC4
Definition expr.h:106
CVC4::Kind
::CVC4::kind::Kind_t Kind
Definition kind.h:279
CVC4::operator<<
std::ostream & operator<<(std::ostream &out, const TypeCheckingException &e)
CVC4::TypeConstant
TypeConstant
The enumeration for the built-in atomic types.
Definition kind.h:543
CVC4::LAST_TYPE
@ LAST_TYPE
Definition kind.h:556
CVC4::$
@ $
Definition kind_template.h:100
CVC4::TypeConstantHashFunction
We hash the constants with their values.
Definition kind_template.h:108
CVC4::TypeConstantHashFunction::operator()
size_t operator()(TypeConstant tc) const
Definition kind_template.h:109
CVC4::kind::KindHashFunction
Definition kind_template.h:88
CVC4::kind::KindHashFunction::operator()
size_t operator()(::CVC4::Kind k) const
Definition kind_template.h:89