Struct chalk_recursive::fixed_point::search_graph::SearchGraph
source · pub(super) struct SearchGraph<K, V>{
indices: FxHashMap<K, DepthFirstNumber>,
nodes: Vec<Node<K, V>>,
}
Expand description
The “search graph” stores in-progress goals that are still being solved.
Fields§
§indices: FxHashMap<K, DepthFirstNumber>
§nodes: Vec<Node<K, V>>
Implementations§
source§impl<K, V> SearchGraph<K, V>
impl<K, V> SearchGraph<K, V>
pub(crate) fn new() -> Self
pub(crate) fn lookup(&self, goal: &K) -> Option<DepthFirstNumber>
sourcepub(crate) fn insert(
&mut self,
goal: &K,
stack_depth: StackDepth,
solution: V,
) -> DepthFirstNumber
pub(crate) fn insert( &mut self, goal: &K, stack_depth: StackDepth, solution: V, ) -> DepthFirstNumber
Insert a new search node in the tree. The node will be in the initial state for a search node:
- stack depth as given
- links set to its own DFN
- solution is initially an identity substitution for coinductive goals
or
NoSolution
for other goals
sourcepub(crate) fn rollback_to(&mut self, dfn: DepthFirstNumber)
pub(crate) fn rollback_to(&mut self, dfn: DepthFirstNumber)
Clears all nodes with a depth-first number greater than or equal dfn
.
sourcepub(crate) fn move_to_cache(
&mut self,
dfn: DepthFirstNumber,
cache: &Cache<K, V>,
)
pub(crate) fn move_to_cache( &mut self, dfn: DepthFirstNumber, cache: &Cache<K, V>, )
Removes all nodes with a depth-first-number greater than or
equal to dfn
, adding their final solutions into the cache.
Trait Implementations§
source§impl<K, V> Index<DepthFirstNumber> for SearchGraph<K, V>
impl<K, V> Index<DepthFirstNumber> for SearchGraph<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for SearchGraph<K, V>
impl<K, V> RefUnwindSafe for SearchGraph<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for SearchGraph<K, V>
impl<K, V> Sync for SearchGraph<K, V>
impl<K, V> Unpin for SearchGraph<K, V>
impl<K, V> UnwindSafe for SearchGraph<K, V>where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more