pub trait Context {
    type EdgeLabel: Clone;
    type NodeLabel;
    type NodeValue: PartialEq + Eq + Clone;

    // Required methods
    fn get_graph(&self) -> &DiGraph<Self::NodeLabel, Self::EdgeLabel>;
    fn merge(
        &self,
        val1: &Self::NodeValue,
        val2: &Self::NodeValue
    ) -> Self::NodeValue;
    fn update_edge(
        &self,
        value: &Self::NodeValue,
        edge: EdgeIndex
    ) -> Option<Self::NodeValue>;
}
Expand description

The context of a fixpoint computation.

All trait methods have access to the FixpointProblem structure, so that context informations are accessible through it.

Required Associated Types§

source

type EdgeLabel: Clone

the type of edge labels of the underlying graph

source

type NodeLabel

the type of node labels of the underlying graph

source

type NodeValue: PartialEq + Eq + Clone

The type of the value that gets assigned to each node. The values should form a partially ordered set.

Required Methods§

source

fn get_graph(&self) -> &DiGraph<Self::NodeLabel, Self::EdgeLabel>

Get the graph on which the fixpoint computation operates.

source

fn merge( &self, val1: &Self::NodeValue, val2: &Self::NodeValue ) -> Self::NodeValue

This function describes how to merge two values

source

fn update_edge( &self, value: &Self::NodeValue, edge: EdgeIndex ) -> Option<Self::NodeValue>

This function describes how the value at the end node of an edge is computed from the value at the start node of the edge. The function can return None to indicate that no end value gets generated through this edge. E.g. In a control flow graph, if the edge cannot be taken for the given start value, this function should return None.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, T: Context<'a>> Context for cwe_checker_lib::analysis::backward_interprocedural_fixpoint::GeneralizedContext<'a, T>

§

type EdgeLabel = Edge<'a>

§

type NodeLabel = Node<'a>

§

type NodeValue = NodeValue<<T as Context<'a>>::Value>

source§

impl<'a, T: Context<'a>> Context for cwe_checker_lib::analysis::forward_interprocedural_fixpoint::GeneralizedContext<'a, T>

§

type EdgeLabel = Edge<'a>

§

type NodeLabel = Node<'a>

§

type NodeValue = NodeValue<<T as Context<'a>>::Value>