Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * The care graph datastructure. 11 : : */ 12 : : 13 : : #include "cvc5_private.h" 14 : : 15 : : #ifndef CVC5__THEORY__CARE_GRAPH_H 16 : : #define CVC5__THEORY__CARE_GRAPH_H 17 : : 18 : : #include <set> 19 : : 20 : : #include "expr/node.h" 21 : : #include "theory/theory_id.h" 22 : : 23 : : namespace cvc5::internal { 24 : : namespace theory { 25 : : 26 : : /** 27 : : * A (ordered) pair of terms a theory cares about. 28 : : */ 29 : : struct CarePair 30 : : { 31 : : const TNode d_a, d_b; 32 : : const TheoryId d_theory; 33 : : 34 : 117247 : CarePair(TNode a, TNode b, TheoryId theory) 35 [ + + ][ + + ]: 117247 : : d_a(a < b ? a : b), d_b(a < b ? b : a), d_theory(theory) 36 : : { 37 : 117247 : } 38 : : 39 : : bool operator==(const CarePair& other) const 40 : : { 41 : : return (d_theory == other.d_theory) && (d_a == other.d_a) 42 : : && (d_b == other.d_b); 43 : : } 44 : : 45 : 451447 : bool operator<(const CarePair& other) const 46 : : { 47 [ + + ]: 451447 : if (d_theory < other.d_theory) return true; 48 [ + + ]: 449504 : if (d_theory > other.d_theory) return false; 49 [ + + ]: 434096 : if (d_a < other.d_a) return true; 50 [ + + ]: 224548 : if (d_a > other.d_a) return false; 51 : 161806 : 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::internal 63 : : 64 : : #endif /* CVC5__THEORY__CARE_GRAPH_H */