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 |
102118 |
struct CarePair { |
33 |
|
const TNode d_a, d_b; |
34 |
|
const TheoryId d_theory; |
35 |
|
|
36 |
43380 |
CarePair(TNode a, TNode b, TheoryId theory) |
37 |
43380 |
: d_a(a < b ? a : b), d_b(a < b ? b : a), d_theory(theory) |
38 |
|
{ |
39 |
43380 |
} |
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 |
159866 |
bool operator<(const CarePair& other) const { |
47 |
159866 |
if (d_theory < other.d_theory) return true; |
48 |
159617 |
if (d_theory > other.d_theory) return false; |
49 |
155373 |
if (d_a < other.d_a) return true; |
50 |
120346 |
if (d_a > other.d_a) return false; |
51 |
51320 |
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 */ |