1 /********************* */
2 /*! \file kind_template.h
4 ** Original author: mdeters
5 ** Major contributors: none
6 ** Minor contributors (to current version): none
7 ** This file is part of the CVC4 prototype.
8 ** Copyright (c) 2009, 2010 The Analysis of Computer Systems Group (ACSys)
9 ** Courant Institute of Mathematical Sciences
10 ** New York University
11 ** See the file COPYING in the top-level source directory for licensing
12 ** information.\endverbatim
14 ** \brief Template for the Node kind header.
16 ** Template for the Node kind header.
19 #include "cvc4_public.h"
21 #ifndef __CVC4__KIND_H
22 #define __CVC4__KIND_H
27 #include "util/Assert.h"
33 UNDEFINED_KIND
= -1, /**< undefined */
34 NULL_EXPR
, /**< Null kind */
36 LAST_KIND
/**< marks the upper-bound of this enumeration */
40 }/* CVC4::kind namespace */
42 // import Kind into the "CVC4" namespace but keep the individual kind
43 // constants under kind::
44 typedef ::CVC4::kind::Kind_t Kind
;
48 inline std::ostream
& operator<<(std::ostream
&, CVC4::Kind
) CVC4_PUBLIC
;
49 inline std::ostream
& operator<<(std::ostream
& out
, CVC4::Kind k
) {
50 using namespace CVC4::kind
;
55 case UNDEFINED_KIND
: out
<< "UNDEFINED_KIND"; break;
56 case NULL_EXPR
: out
<< "NULL"; break;
58 case LAST_KIND
: out
<< "LAST_KIND"; break;
59 default: out
<< "UNKNOWNKIND!" << int(k
); break;
65 /** Returns true if the given kind is associative. This is used by ExprManager to
66 * decide whether it's safe to modify big expressions by changing the grouping of
68 /* TODO: This could be generated. */
69 inline bool isAssociative(::CVC4::Kind k
) {
82 inline std::string
kindToString(::CVC4::Kind k
) {
88 struct KindHashStrategy
{
89 static inline size_t hash(::CVC4::Kind k
) { return k
; }
90 };/* struct KindHashStrategy */
92 }/* CVC4::kind namespace */
95 * The enumeration for the built-in atomic types.
100 };/* enum TypeConstant */
103 * We hash the constants with their values.
105 struct TypeConstantHashStrategy
{
106 static inline size_t hash(TypeConstant tc
) {
109 };/* struct BoolHashStrategy */
111 inline std::ostream
& operator<<(std::ostream
& out
, TypeConstant typeConstant
) {
112 switch(typeConstant
) {
113 $
{type_constant_descriptions
}
115 out
<< "UNKNOWN_TYPE_CONSTANT";
128 inline std::ostream
& operator<<(std::ostream
& out
, TheoryId theoryId
) {
130 $
{theory_descriptions
}
132 out
<< "UNKNOWN_THEORY";
138 inline TheoryId
kindToTheoryId(::CVC4::Kind k
) {
146 inline TheoryId
typeConstantToTheoryId(::CVC4::TypeConstant typeConstant
) {
147 switch (typeConstant
) {
148 $
{type_constant_to_theory_id
}
154 }/* theory namespace */
157 }/* CVC4 namespace */
159 #endif /* __CVC4__KIND_H */