Updating the copyright headers and scripts.
[cvc5.git] / src / smt_util / nary_builder.h
1 /********************* */
2 /*! \file nary_builder.h
3 ** \verbatim
4 ** Top contributors (to current version):
5 ** Tim King, Morgan Deters
6 ** This file is part of the CVC4 project.
7 ** Copyright (c) 2009-2016 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
11 **
12 ** \brief [[ Add one-line brief description here ]]
13 **
14 ** [[ Add lengthier description here ]]
15 ** \todo document this file
16 **/
17
18
19 #include "cvc4_private.h"
20
21 #pragma once
22
23 #include <vector>
24 #include "expr/node.h"
25
26 namespace CVC4{
27 namespace util {
28
29 class NaryBuilder {
30 public:
31 static Node mkAssoc(Kind k, const std::vector<Node>& children);
32 static Node zeroArity(Kind k);
33 };/* class NaryBuilder */
34
35 class RePairAssocCommutativeOperators {
36 public:
37 RePairAssocCommutativeOperators();
38 ~RePairAssocCommutativeOperators();
39
40 Node rePairAssocCommutativeOperators(TNode n);
41
42 static bool isAssociateCommutative(Kind k);
43
44 size_t size() const;
45 void clear();
46 private:
47 Node case_assoccomm(TNode n);
48 Node case_other(TNode n);
49
50 typedef std::hash_map<Node, Node, NodeHashFunction> NodeMap;
51 NodeMap d_cache;
52 };/* class RePairAssocCommutativeOperators */
53
54 }/* util namespace */
55 }/* CVC4 namespace */