|
Jlm
|
#include <LazyCycleDetection.hpp>

Public Member Functions | |
| LazyCycleDetector (PointerObjectSet &set, const GetSuccessorsFunctor &GetSuccessors, const UnifyPointerObjectsFunctor &unifyPointerObjects) | |
| void | Initialize () |
| bool | IsInitialized () const noexcept |
| std::optional< PointerObjectIndex > | OnPropagatedNothing (PointerObjectIndex subset, PointerObjectIndex superset) |
| size_t | NumCycleDetectionAttempts () const noexcept |
| size_t | NumCyclesDetected () const noexcept |
| size_t | NumCycleUnifications () const noexcept |
Private Attributes | |
| PointerObjectSet & | Set_ |
| const GetSuccessorsFunctor & | GetSuccessors_ |
| const UnifyPointerObjectsFunctor & | UnifyPointerObjects_ |
| util::HashSet< std::pair< PointerObjectIndex, PointerObjectIndex > > | CheckedEdges_ |
| std::stack< PointerObjectIndex > | DfsStack_ |
| std::vector< uint8_t > | NodeStates_ |
| size_t | NumCycleDetectAttempts_ = 0 |
| size_t | NumCyclesDetected_ = 0 |
| size_t | NumCycleUnifications_ = 0 |
Static Private Attributes | |
| static constexpr uint8_t | NodeStateNotVisited = 0 |
| static constexpr uint8_t | NodeStateVisited = 1 |
| static constexpr uint8_t | NodeStatePopped = 2 |
Implements Lazy Cycle Detection, as described by Hardekopf and Lin, 2007: "The And and the Grasshopper"
| GetSuccessorsFunctor | is a function returning the superset edge successors of a given node |
| UnifyPointerObjectsFunctor | the functor to be called to unify a cycle, when found |
Definition at line 27 of file LazyCycleDetection.hpp.
|
inline |
Definition at line 31 of file LazyCycleDetection.hpp.
|
inline |
Call before calling any other method
Definition at line 44 of file LazyCycleDetection.hpp.
|
inlinenoexcept |
Definition at line 50 of file LazyCycleDetection.hpp.
|
inlinenoexcept |
Definition at line 141 of file LazyCycleDetection.hpp.
|
inlinenoexcept |
Definition at line 150 of file LazyCycleDetection.hpp.
|
inlinenoexcept |
Definition at line 159 of file LazyCycleDetection.hpp.
|
inline |
Call when an edge subset -> superset was visited, and zero pointees had to be propagated. Only call if subset has at least one new pointee. If a path from superset to subset is found, there is a cycle, that gets unified.
| subset | the tail of the added edge, must be unification root |
| superset | the head of the added edge, must be unification root |
Definition at line 64 of file LazyCycleDetection.hpp.
|
private |
Definition at line 170 of file LazyCycleDetection.hpp.
|
private |
Definition at line 173 of file LazyCycleDetection.hpp.
|
private |
Definition at line 166 of file LazyCycleDetection.hpp.
|
staticconstexprprivate |
Definition at line 175 of file LazyCycleDetection.hpp.
|
staticconstexprprivate |
Definition at line 177 of file LazyCycleDetection.hpp.
|
private |
Definition at line 178 of file LazyCycleDetection.hpp.
|
staticconstexprprivate |
Definition at line 176 of file LazyCycleDetection.hpp.
|
private |
Definition at line 180 of file LazyCycleDetection.hpp.
|
private |
Definition at line 181 of file LazyCycleDetection.hpp.
|
private |
Definition at line 182 of file LazyCycleDetection.hpp.
|
private |
Definition at line 165 of file LazyCycleDetection.hpp.
|
private |
Definition at line 167 of file LazyCycleDetection.hpp.