GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/util/abstract_value.h Lines: 6 6 100.0 %
Date: 2021-03-23 Branches: 1 2 50.0 %

Line Exec Source
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-2021 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
46
class AbstractValue
28
{
29
  const Integer d_index;
30
31
 public:
32
  AbstractValue(Integer index);
33
34
78
  const Integer& getIndex() const { return d_index; }
35
34
  bool operator==(const AbstractValue& val) const
36
  {
37
34
    return d_index == val.d_index;
38
  }
39
  bool operator!=(const AbstractValue& val) const { return !(*this == val); }
40
  bool operator<(const AbstractValue& val) const
41
  {
42
    return d_index < val.d_index;
43
  }
44
  bool operator<=(const AbstractValue& val) const
45
  {
46
    return d_index <= val.d_index;
47
  }
48
  bool operator>(const AbstractValue& val) const { return !(*this <= val); }
49
  bool operator>=(const AbstractValue& val) const { return !(*this < val); }
50
}; /* class AbstractValue */
51
52
std::ostream& operator<<(std::ostream& out, const AbstractValue& val);
53
54
/**
55
 * Hash function for the BitVector constants.
56
 */
57
struct AbstractValueHashFunction
58
{
59
70
  inline size_t operator()(const AbstractValue& val) const {
60
70
    return IntegerHashFunction()(val.getIndex());
61
  }
62
}; /* struct AbstractValueHashFunction */
63
64
}/* CVC4 namespace */