blob: 870d3f4beae0f75a81abfc8ef3df2b8db803a771 (
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
|
/********************* */
/*! \file care_graph.h
** \verbatim
** Top contributors (to current version):
** Tim King
** This file is part of the CVC4 project.
** Copyright (c) 2009-2017 by the authors listed in the file AUTHORS
** in the top-level source directory) and their institutional affiliations.
** All rights reserved. See the file COPYING in the top-level source
** directory for licensing information.\endverbatim
**
** \brief The care graph datastructure.
**
** The care graph datastructure.
**/
#include "cvc4_private.h"
#ifndef __CVC4__THEORY__CARE_GRAPH_H
#define __CVC4__THEORY__CARE_GRAPH_H
#include <set>
#include "expr/kind.h" // For TheoryId.
#include "expr/node.h"
namespace CVC4 {
namespace theory {
/**
* A (ordered) pair of terms a theory cares about.
*/
struct CarePair {
const TNode a, b;
const TheoryId theory;
CarePair(TNode a, TNode b, TheoryId theory)
: a(a < b ? a : b), b(a < b ? b : a), theory(theory) {}
bool operator==(const CarePair& other) const {
return (theory == other.theory) && (a == other.a) && (b == other.b);
}
bool operator<(const CarePair& other) const {
if (theory < other.theory) return true;
if (theory > other.theory) return false;
if (a < other.a) return true;
if (a > other.a) return false;
return b < other.b;
}
}; /* struct CarePair */
/**
* A set of care pairs.
*/
typedef std::set<CarePair> CareGraph;
} // namespace theory
} // namespace CVC4
#endif /* __CVC4__THEORY__CARE_GRAPH_H */
|