GCC Code Coverage Report
Directory: . Exec Total Coverage
File: src/theory/care_graph.h Lines: 10 10 100.0 %
Date: 2021-09-18 Branches: 15 18 83.3 %

Line Exec Source
1
/******************************************************************************
2
 * Top contributors (to current version):
3
 *   Andrew Reynolds, Dejan Jovanovic, Tim King
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
 * The care graph datastructure.
14
 */
15
16
#include "cvc5_private.h"
17
18
#ifndef CVC5__THEORY__CARE_GRAPH_H
19
#define CVC5__THEORY__CARE_GRAPH_H
20
21
#include <set>
22
23
#include "expr/node.h"
24
#include "theory/theory_id.h"
25
26
namespace cvc5 {
27
namespace theory {
28
29
/**
30
 * A (ordered) pair of terms a theory cares about.
31
 */
32
101564
struct CarePair {
33
  const TNode d_a, d_b;
34
  const TheoryId d_theory;
35
36
41530
  CarePair(TNode a, TNode b, TheoryId theory)
37
41530
      : d_a(a < b ? a : b), d_b(a < b ? b : a), d_theory(theory)
38
  {
39
41530
  }
40
41
  bool operator==(const CarePair& other) const {
42
    return (d_theory == other.d_theory) && (d_a == other.d_a)
43
           && (d_b == other.d_b);
44
  }
45
46
155687
  bool operator<(const CarePair& other) const {
47
155687
    if (d_theory < other.d_theory) return true;
48
155410
    if (d_theory > other.d_theory) return false;
49
149718
    if (d_a < other.d_a) return true;
50
116361
    if (d_a > other.d_a) return false;
51
48000
    return d_b < other.d_b;
52
  }
53
54
}; /* struct CarePair */
55
56
/**
57
 * A set of care pairs.
58
 */
59
typedef std::set<CarePair> CareGraph;
60
61
}  // namespace theory
62
}  // namespace cvc5
63
64
#endif /* CVC5__THEORY__CARE_GRAPH_H */