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

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Morgan Deters, Tim King, Mathias Preiner
4
 *
5
 * This file is part of the cvc5 project.
6
 *
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.
11
 * ****************************************************************************
12
 *
13
 * Representation of abstract values.
14
 */
15
16
#include "cvc5_public.h"
17
18
#pragma once
19
20
#include <iosfwd>
21
22
#include "util/integer.h"
23
24
namespace cvc5 {
25
26
64
class AbstractValue
27
{
28
  const Integer d_index;
29
30
 public:
31
  AbstractValue(Integer index);
32
33
114
  const Integer& getIndex() const { return d_index; }
34
46
  bool operator==(const AbstractValue& val) const
35
  {
36
46
    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);
52
53
/**
54
 * Hash function for the BitVector constants.
55
 */
56
struct AbstractValueHashFunction
57
{
58
100
  inline size_t operator()(const AbstractValue& val) const {
59
100
    return IntegerHashFunction()(val.getIndex());
60
  }
61
}; /* struct AbstractValueHashFunction */
62
63
}  // namespace cvc5