1 /******************************************************************************
2 * Top contributors (to current version):
3 * Andres Noetzli, Morgan Deters, Aina Niemetz
5 * This file is part of the cvc5 project.
7 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 * in the top-level source directory and their institutional affiliations.
9 * All rights reserved. See the file COPYING in the top-level source
10 * directory for licensing information.
11 * ****************************************************************************
13 * Template for the Node kind header.
16 #include "cvc5_public.h"
23 #include "base/exception.h"
24 #include "theory/theory_id.h"
31 UNDEFINED_KIND
= -1, /**< undefined */
32 NULL_EXPR
, /**< Null kind */
34 $
{kind_decls
} LAST_KIND
/**< marks the upper-bound of this enumeration */
41 // import Kind into the "cvc5" namespace but keep the individual kind
42 // constants under kind::
43 typedef ::cvc5::kind::Kind_t Kind
;
48 * Converts an kind to a string. Note: This function is also used in
49 * `safe_print()`. Changing this functions name or signature will result in
50 * `safe_print()` printing "<unsupported>" instead of the proper strings for
54 * @return The name of the kind
56 const char* toString(cvc5::Kind k
);
59 * Writes a kind name to a stream.
61 * @param out The stream to write to
62 * @param k The kind to write to the stream
65 std::ostream
& operator<<(std::ostream
&, cvc5::Kind
);
67 /** Returns true if the given kind is associative. This is used by ExprManager to
68 * decide whether it's safe to modify big expressions by changing the grouping of
70 /* TODO: This could be generated. */
71 bool isAssociative(::cvc5::Kind k
);
72 std::string
kindToString(::cvc5::Kind k
);
74 struct KindHashFunction
76 inline size_t operator()(::cvc5::Kind k
) const { return k
; }
77 }; /* struct KindHashFunction */
82 * The enumeration for the built-in atomic types.
87 $
{type_constant_list
} LAST_TYPE
89 }; /* enum TypeConstant */
92 * We hash the constants with their values.
94 struct TypeConstantHashFunction
96 inline size_t operator()(TypeConstant tc
) const { return tc
; }
97 }; /* struct TypeConstantHashFunction */
99 const char* toString(TypeConstant tc
);
100 std::ostream
& operator<<(std::ostream
& out
, TypeConstant typeConstant
);
104 ::cvc5::theory::TheoryId
kindToTheoryId(::cvc5::Kind k
);
105 ::cvc5::theory::TheoryId
typeConstantToTheoryId(
106 ::cvc5::TypeConstant typeConstant
);
108 } // namespace theory
111 #endif /* CVC5__KIND_H */