Update copyright headers.
[cvc5.git] / src / util / abstract_value.h
1 /********************* */
2 /*! \file abstract_value.h
3 ** \verbatim
4 ** Top contributors (to current version):
5 ** Morgan Deters, Tim King
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
11 **
12 ** \brief Representation of abstract values
13 **
14 ** Representation of abstract values.
15 **/
16
17 #include "cvc4_public.h"
18
19 #pragma once
20
21 #include <iosfwd>
22
23 #include "util/integer.h"
24
25 namespace CVC4 {
26
27 class CVC4_PUBLIC AbstractValue {
28 const Integer d_index;
29
30 public:
31 AbstractValue(Integer index);
32
33 const Integer& getIndex() const { return d_index; }
34 bool operator==(const AbstractValue& val) const
35 {
36 return d_index == val.d_index;
37 }
38 bool operator!=(const AbstractValue& val) const { return !(*this == val); }
39 bool operator<(const AbstractValue& val) const
40 {
41 return d_index < val.d_index;
42 }
43 bool operator<=(const AbstractValue& val) const
44 {
45 return d_index <= val.d_index;
46 }
47 bool operator>(const AbstractValue& val) const { return !(*this <= val); }
48 bool operator>=(const AbstractValue& val) const { return !(*this < val); }
49 };/* class AbstractValue */
50
51 std::ostream& operator<<(std::ostream& out, const AbstractValue& val) CVC4_PUBLIC;
52
53 /**
54 * Hash function for the BitVector constants.
55 */
56 struct CVC4_PUBLIC AbstractValueHashFunction {
57 inline size_t operator()(const AbstractValue& val) const {
58 return IntegerHashFunction()(val.getIndex());
59 }
60 };/* struct AbstractValueHashFunction */
61
62 }/* CVC4 namespace */