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 std::ostream
& operator<<(std::ostream
& out
, CVC4::Kind k
) {
24 using namespace CVC4::kind
;
29 case UNDEFINED_KIND
: out
<< "UNDEFINED_KIND"; break;
30 case NULL_EXPR
: out
<< "NULL"; break;
32 case LAST_KIND
: out
<< "LAST_KIND"; break;
33 default: out
<< "UNKNOWNKIND!" << int(k
); break;
39 /** Returns true if the given kind is associative. This is used by ExprManager to
40 * decide whether it's safe to modify big expressions by changing the grouping of
42 /* TODO: This could be generated. */
43 bool isAssociative(::CVC4::Kind k
) {
56 std::string
kindToString(::CVC4::Kind k
) {
62 }/* CVC4::kind namespace */
64 std::ostream
& operator<<(std::ostream
& out
, TypeConstant typeConstant
) {
65 switch(typeConstant
) {
66 $
{type_constant_descriptions
}
67 #line 68 "${template}"
69 out
<< "UNKNOWN_TYPE_CONSTANT";
77 TheoryId
kindToTheoryId(::CVC4::Kind k
) {
79 case kind::UNDEFINED_KIND
:
83 #line 84 "${template}"
87 throw IllegalArgumentException("", "k", __PRETTY_FUNCTION__
, "bad kind");
90 TheoryId
typeConstantToTheoryId(::CVC4::TypeConstant typeConstant
)
94 $
{type_constant_to_theory_id
}
95 #line 96 "${template}"
96 case LAST_TYPE
: break;
98 throw IllegalArgumentException(
99 "", "k", __PRETTY_FUNCTION__
, "bad type constant");
102 }/* CVC4::theory namespace */
103 }/* CVC4 namespace */