Branch data Line data Source code
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-2024 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::internal { 27 : : namespace theory { 28 : : 29 : : /** 30 : : * A (ordered) pair of terms a theory cares about. 31 : : */ 32 : : struct CarePair { 33 : : const TNode d_a, d_b; 34 : : const TheoryId d_theory; 35 : : 36 : 110875 : CarePair(TNode a, TNode b, TheoryId theory) 37 [ + + ][ + + ]: 110875 : : d_a(a < b ? a : b), d_b(a < b ? b : a), d_theory(theory) 38 : : { 39 : 110875 : } 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 : 444894 : bool operator<(const CarePair& other) const { 47 [ + + ]: 444894 : if (d_theory < other.d_theory) return true; 48 [ + + ]: 443042 : if (d_theory > other.d_theory) return false; 49 [ + + ]: 428489 : if (d_a < other.d_a) return true; 50 [ + + ]: 212330 : if (d_a > other.d_a) return false; 51 : 152222 : 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 */