1 /********************* */
2 /*! \file kind_template.cpp
4 ** Top contributors (to current version):
5 ** Andres Noetzli, Morgan Deters, Dejan Jovanovic
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2019 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.\endverbatim
12 ** \brief [[ Add one-line brief description here ]]
14 ** [[ Add lengthier description here ]]
15 ** \todo document this file
18 #include "expr/kind.h"
23 const char* toString(CVC4::Kind k
)
25 using namespace CVC4::kind
;
30 case UNDEFINED_KIND
: return "UNDEFINED_KIND";
31 case NULL_EXPR
: return "NULL";
33 case LAST_KIND
: return "LAST_KIND";
38 std::ostream
& operator<<(std::ostream
& out
, CVC4::Kind k
)
44 /** Returns true if the given kind is associative. This is used by ExprManager to
45 * decide whether it's safe to modify big expressions by changing the grouping of
47 /* TODO: This could be generated. */
48 bool isAssociative(::CVC4::Kind k
) {
61 std::string
kindToString(::CVC4::Kind k
) {
67 }/* CVC4::kind namespace */
69 std::ostream
& operator<<(std::ostream
& out
, TypeConstant typeConstant
) {
70 switch(typeConstant
) {
71 $
{type_constant_descriptions
}
72 #line 73 "${template}"
74 out
<< "UNKNOWN_TYPE_CONSTANT";
82 TheoryId
kindToTheoryId(::CVC4::Kind k
) {
84 case kind::UNDEFINED_KIND
:
88 #line 89 "${template}"
92 throw IllegalArgumentException("", "k", __PRETTY_FUNCTION__
, "bad kind");
95 TheoryId
typeConstantToTheoryId(::CVC4::TypeConstant typeConstant
)
99 $
{type_constant_to_theory_id
}
100 #line 101 "${template}"
101 case LAST_TYPE
: break;
103 throw IllegalArgumentException(
104 "", "k", __PRETTY_FUNCTION__
, "bad type constant");
107 }/* CVC4::theory namespace */
108 }/* CVC4 namespace */