summaryrefslogtreecommitdiff
path: root/src/expr/kind_template.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/kind_template.h')
-rw-r--r--src/expr/kind_template.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/expr/kind_template.h b/src/expr/kind_template.h
index 96c34a02a..718fd58f4 100644
--- a/src/expr/kind_template.h
+++ b/src/expr/kind_template.h
@@ -1,5 +1,6 @@
/********************* */
-/** kind_template.h
+/*! \file kind_template.h
+ ** \verbatim
** Original author: mdeters
** Major contributors: none
** Minor contributors (to current version): none
@@ -8,7 +9,9 @@
** Courant Institute of Mathematical Sciences
** New York University
** See the file COPYING in the top-level source directory for licensing
- ** information.
+ ** information.\endverbatim
+ **
+ ** \brief Template for the Node kind header.
**
** Template for the Node kind header.
**/
@@ -57,6 +60,23 @@ ${kind_printers}
return out;
}
+/** Returns true if the given kind is associative. This is used by ExprManager to
+ * decide whether it's safe to modify big expressions by changing the grouping of
+ * the arguments. */
+/* 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;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback