pub struct RawInstGraph {
pub graph: DiGraph<Node, EdgeKind, RawIx>,
/* private fields */
}
Fields§
§graph: DiGraph<Node, EdgeKind, RawIx>
Implementations§
Source§impl RawInstGraph
impl RawInstGraph
Sourcepub fn reset_disabled_to_raw(
&mut self,
f: impl Fn(RawNodeIndex, &RawInstGraph) -> bool,
) -> (bool, bool)
pub fn reset_disabled_to_raw( &mut self, f: impl Fn(RawNodeIndex, &RawInstGraph) -> bool, ) -> (bool, bool)
Updates which nodes are disabled based on the predicate f
. The
hidden
of all non-disabled nodes is reset to false
so any filters
will need to be reapplied. It returns two booleans: the first indicates
if any state was modified, the second indicates if any node was
enabled/disabled.
Analyses should be reapplied after this function is called! (unless the second boolean is false)
Source§impl RawInstGraph
impl RawInstGraph
pub fn reset_visibility_to(&mut self, hidden: bool) -> bool
pub fn can_set_visibility(&self, node: &Node, hidden: bool) -> bool
pub fn set_visibility<I: IndexesInstGraph>( &mut self, node: I, hidden: bool, ) -> bool
pub fn keep_first_n( &mut self, nodes: impl Iterator<Item = RawNodeIndex>, n: usize, ) -> bool
Sourcepub fn set_visibility_when(
&mut self,
hidden: bool,
p: impl FnMut(&Self, RawNodeIndex, &Node) -> bool,
) -> bool
pub fn set_visibility_when( &mut self, hidden: bool, p: impl FnMut(&Self, RawNodeIndex, &Node) -> bool, ) -> bool
When predicate p
evaluates to true the visibility of the corresponding
node is set to hidden
. Use this when hiding nodes and the predicate is
expensive as it avoids calling the predicate a lot more than
set_visibility_all
.
Sourcepub fn set_visibility_all(
&mut self,
p: impl FnMut(&Self, RawNodeIndex, &Node) -> Option<bool>,
) -> bool
pub fn set_visibility_all( &mut self, p: impl FnMut(&Self, RawNodeIndex, &Node) -> Option<bool>, ) -> bool
When predicate p
evaluates to Some
the visibility of the corresponding
node is set to hidden
(true
) or visible
(false
).
pub fn set_visibility_many<I: IndexesInstGraph>( &mut self, hidden: bool, nodes: impl Iterator<Item = I>, ) -> bool
Sourcepub fn path_to_root_graph(
&self,
longest: bool,
) -> EdgeFiltered<Reversed<&DiGraph<Node, EdgeKind, RawIx>>, impl Fn(ReversedEdgeReference<EdgeReference<'_, EdgeKind, RawIx>>) -> bool + '_>
pub fn path_to_root_graph( &self, longest: bool, ) -> EdgeFiltered<Reversed<&DiGraph<Node, EdgeKind, RawIx>>, impl Fn(ReversedEdgeReference<EdgeReference<'_, EdgeKind, RawIx>>) -> bool + '_>
A graph with edges that aren’t part of any longest/shortest
path to a
root filtered out. The edges are also reversed, so the graph can be
walked from any node to find the longest/shortest path to a root.
Sourcepub fn path_to_leaf_graph(
&self,
longest: bool,
) -> EdgeFiltered<&DiGraph<Node, EdgeKind, RawIx>, impl Fn(EdgeReference<'_, EdgeKind, RawIx>) -> bool + '_>
pub fn path_to_leaf_graph( &self, longest: bool, ) -> EdgeFiltered<&DiGraph<Node, EdgeKind, RawIx>, impl Fn(EdgeReference<'_, EdgeKind, RawIx>) -> bool + '_>
A graph with edges that aren’t part of any longest/shortest
path to a
leaf filtered out. The graph can be walked from any node to find the
longest/shortest path to a leaf.
pub fn show_longest_path_through( &mut self, node: RawNodeIndex, ) -> (bool, Vec<RawNodeIndex>)
Source§impl RawInstGraph
impl RawInstGraph
pub fn new(parser: &Z3Parser) -> Result<Self>
pub fn index(&self, kind: NodeKind) -> RawNodeIndex
pub fn rev(&self) -> Reversed<&DiGraph<Node, EdgeKind, RawIx>>
pub fn visible_nodes(&self) -> usize
pub fn node_indices(&self) -> impl Iterator<Item = RawNodeIndex>
Sourcepub fn neighbors<'a>(
&'a self,
node: RawNodeIndex,
reach: &'a TiVec<RawNodeIndex, ReachNonDisabled>,
) -> Neighbors<'a> ⓘ
pub fn neighbors<'a>( &'a self, node: RawNodeIndex, reach: &'a TiVec<RawNodeIndex, ReachNonDisabled>, ) -> Neighbors<'a> ⓘ
Similar to self.graph.neighbors
but will walk through disabled nodes.
Note: Iterating the neighbors is not a O(1) operation.
Sourcepub fn neighbors_directed<'a>(
&'a self,
node: RawNodeIndex,
dir: Direction,
reach: &'a TiVec<RawNodeIndex, ReachNonDisabled>,
) -> Neighbors<'a> ⓘ
pub fn neighbors_directed<'a>( &'a self, node: RawNodeIndex, dir: Direction, reach: &'a TiVec<RawNodeIndex, ReachNonDisabled>, ) -> Neighbors<'a> ⓘ
Similar to self.graph.neighbors_directed
but will walk through
disabled nodes.
Note: Iterating the neighbors is not a O(1) operation.
pub fn inst_to_raw_idx(&self) -> impl Fn(InstIdx) -> RawNodeIndex
pub fn hypotheses(&self, parser: &Z3Parser, proof: ProofIdx) -> Vec<ProofIdx>
Trait Implementations§
Source§impl Debug for RawInstGraph
impl Debug for RawInstGraph
Source§impl Index<RawEdgeIndex> for RawInstGraph
impl Index<RawEdgeIndex> for RawInstGraph
Source§impl<T: IndexesInstGraph> Index<T> for RawInstGraph
impl<T: IndexesInstGraph> Index<T> for RawInstGraph
Source§impl<T: IndexesInstGraph> IndexMut<T> for RawInstGraph
impl<T: IndexesInstGraph> IndexMut<T> for RawInstGraph
Auto Trait Implementations§
impl Freeze for RawInstGraph
impl RefUnwindSafe for RawInstGraph
impl Send for RawInstGraph
impl Sync for RawInstGraph
impl Unpin for RawInstGraph
impl UnwindSafe for RawInstGraph
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more