summaryrefslogtreecommitdiff
path: root/src/include/expr_value.h
blob: ca12b8e03db0c40da2e912e4eee237bb88fa8718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*********************
/** expr_value.h
 ** This file is part of the CVC4 prototype.
 **
 ** An expression node.
 **
 ** Instances of this class are generally referenced through
 ** cvc4::Expr rather than by pointer; cvc4::Expr maintains the
 ** reference count on ExprValue instances and
 **
 ** The Analysis of Computer Systems Group (ACSys)
 ** Courant Institute of Mathematical Sciences
 ** New York University
 **/

#ifndef __CVC4_EXPR_VALUE_H
#define __CVC4_EXPR_VALUE_H

#include "expr.h"

namespace CVC4 {

/**
 * This is an ExprValue.
 */
class ExprValue {
  // this header fits into one 64-bit word

  /** The ID */
  unsigned d_id        : 32;

  /** The expression's reference count.  @see cvc4::Expr. */
  unsigned d_rc        :  8;

  /** Kind of the expression */
  unsigned d_kind      :  8;

  /** Number of children */
  unsigned d_nchildren : 16;

  /** Variable number of child nodes */
  Expr     d_children[0];

public:
  /** Hash this expression.
   *  @return the hash value of this expression. */
  unsigned hash() const;

  /** Convert to (wrap in) an Expr.
   *  @return an Expr pointing to this expression. */
  operator Expr();

  // Iterator support

  typedef Expr* iterator;
  typedef Expr const* const_iterator;

  iterator begin();
  iterator end();
  iterator rbegin();
  iterator rend();

  const_iterator begin() const;
  const_iterator end() const;
  const_iterator rbegin() const;
  const_iterator rend() const;
};

} /* CVC4 namespace */

#endif /* __CVC4_EXPR_VALUE_H */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback