diff options
Diffstat (limited to 'src/expr/node.h')
-rw-r--r-- | src/expr/node.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/expr/node.h b/src/expr/node.h index fd2603ffa..b40443923 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -25,6 +25,7 @@ #include "cvc4_config.h" #include "expr/kind.h" +#include "util/Assert.h" namespace CVC4 { class Node; @@ -105,6 +106,11 @@ public: bool operator==(const Node& e) const { return d_ev == e.d_ev; } bool operator!=(const Node& e) const { return d_ev != e.d_ev; } + Node operator[](int i) const { + Assert(i >= 0 && i < d_ev->d_nchildren); + return Node(d_ev->d_children[i]); + } + /** * We compare by expression ids so, keeping things deterministic and having * that subexpressions have to be smaller than the enclosing expressions. |