pub struct ErrorGraphNode {
error_level: usize,
config: ACSTAConfig,
parents: Vec<ErrorGraphEdge>,
self_loops: Vec<u32>,
back_edges: Vec<ErrorGraphEdge>,
}Expand description
Node in the error graph
Fields§
§error_level: usizeDistance to an error configuration
config: ACSTAConfigConfiguration
parents: Vec<ErrorGraphEdge>Parent nodes
ErrorGraphEdges to nodes with a smaller distance to an error
self_loops: Vec<u32>Rules that result in a self-loop
back_edges: Vec<ErrorGraphEdge>ErrorGraphEdges to a equal or higher error level node, potentially
part of a cycle
Implementations§
Source§impl ErrorGraphNode
impl ErrorGraphNode
Sourcepub fn parents(&self) -> impl Iterator<Item = &ErrorGraphEdge>
pub fn parents(&self) -> impl Iterator<Item = &ErrorGraphEdge>
Get the error graph edges leading to the parents of the current node
The edges returned here will have an error level smaller than the current node
Sourcepub fn self_loops(&self) -> impl Iterator<Item = &u32>
pub fn self_loops(&self) -> impl Iterator<Item = &u32>
Get all rules that can be self-loops
Sourcepub fn back_edges(&self) -> impl Iterator<Item = &ErrorGraphEdge>
pub fn back_edges(&self) -> impl Iterator<Item = &ErrorGraphEdge>
Get rules that can lead to higher or equal error level
Sourcepub fn config(&self) -> &ACSTAConfig
pub fn config(&self) -> &ACSTAConfig
Get the configuration of the current node
Sourcepub fn error_level(&self) -> usize
pub fn error_level(&self) -> usize
Get the error level of the current node
Sourcepub fn new_roots_from_spec(
spec: &DisjunctionTargetConfig,
ta: &ACSThresholdAutomaton,
) -> PartiallyOrderedConfigMap<Rc<RefCell<ErrorGraphNode>>>
pub fn new_roots_from_spec( spec: &DisjunctionTargetConfig, ta: &ACSThresholdAutomaton, ) -> PartiallyOrderedConfigMap<Rc<RefCell<ErrorGraphNode>>>
Create new root error nodes from the specification
Note: This function only returns the root of the error graph, to
construct the full graph
ErrorGraphNode::compute_predecessors_and_insert_to_graph
for all computed nodes until the to_explore_queue is empty
Sourcepub fn compute_predecessors_and_insert_to_graph(
cfg_node_map: &mut PartiallyOrderedConfigMap<Rc<RefCell<ErrorGraphNode>>>,
to_explore_queue: &mut VecDeque<Rc<RefCell<ErrorGraphNode>>>,
node_to_explore: &Rc<RefCell<ErrorGraphNode>>,
ta: &ACSThresholdAutomaton,
)
pub fn compute_predecessors_and_insert_to_graph( cfg_node_map: &mut PartiallyOrderedConfigMap<Rc<RefCell<ErrorGraphNode>>>, to_explore_queue: &mut VecDeque<Rc<RefCell<ErrorGraphNode>>>, node_to_explore: &Rc<RefCell<ErrorGraphNode>>, ta: &ACSThresholdAutomaton, )
Compute the predecessor of node_to_compute_succs in ta, adding nodes
that still require exploration to to_explore_queue while checking that
no smaller or equal node exists in cfg_node_map
This function corresponds to ComputePredBasis of Algorithm 1 in the
paper
Safety: This function assumes that none of the nodes in the error graph still have an existing borrow
Sourcefn insert_existing_smaller_node(
smaller_or_eq_node: &Rc<RefCell<ErrorGraphNode>>,
node_to_explore: &Rc<RefCell<ErrorGraphNode>>,
edge_to_insert: ErrorGraphEdge,
rule_id: u32,
)
fn insert_existing_smaller_node( smaller_or_eq_node: &Rc<RefCell<ErrorGraphNode>>, node_to_explore: &Rc<RefCell<ErrorGraphNode>>, edge_to_insert: ErrorGraphEdge, rule_id: u32, )
Insert the new configuration and corresponding edge into the error graph, in case there exists an already inserted node with a smaller or equal configuration
This function corresponds to line 20-21 in Algorithm 1
Sourcefn insert_existing_bigger_node(
bigger_node: &Rc<RefCell<ErrorGraphNode>>,
cfg_to_insert: ACSTAConfig,
edge_to_insert: ErrorGraphEdge,
)
fn insert_existing_bigger_node( bigger_node: &Rc<RefCell<ErrorGraphNode>>, cfg_to_insert: ACSTAConfig, edge_to_insert: ErrorGraphEdge, )
Insert the new configuration and corresponding edge into the error graph, in case there exists an already inserted node with a bigger configuration
This function corresponds to line 24-26 in Algorithm 1
Trait Implementations§
Source§impl Clone for ErrorGraphNode
impl Clone for ErrorGraphNode
Source§fn clone(&self) -> ErrorGraphNode
fn clone(&self) -> ErrorGraphNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ErrorGraphNode
impl Debug for ErrorGraphNode
Source§impl From<ErrorGraphNode> for Rc<RefCell<ErrorGraphNode>>
impl From<ErrorGraphNode> for Rc<RefCell<ErrorGraphNode>>
Source§fn from(value: ErrorGraphNode) -> Self
fn from(value: ErrorGraphNode) -> Self
Source§impl Ord for ErrorGraphNode
impl Ord for ErrorGraphNode
Source§fn cmp(&self, other: &ErrorGraphNode) -> Ordering
fn cmp(&self, other: &ErrorGraphNode) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ErrorGraphNode
impl PartialEq for ErrorGraphNode
Source§impl PartialOrd for ErrorGraphNode
impl PartialOrd for ErrorGraphNode
impl Eq for ErrorGraphNode
impl StructuralPartialEq for ErrorGraphNode
Auto Trait Implementations§
impl Freeze for ErrorGraphNode
impl !RefUnwindSafe for ErrorGraphNode
impl !Send for ErrorGraphNode
impl !Sync for ErrorGraphNode
impl Unpin for ErrorGraphNode
impl !UnwindSafe for ErrorGraphNode
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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