NetworkNode

Trait NetworkNode 

Source
pub trait NetworkNode:
    Clone
    + Eq
    + PartialEq {
    type NodeId: IdType;

    // Required methods
    fn num_inputs(&self) -> usize;
    fn get_input(&self, i: usize) -> Self::NodeId;
    fn function(&self) -> SmallTruthTable;
    fn normalized(self) -> SimplifyResult<Self, Self::NodeId>;
}
Expand description

Basic trait of a node in a logic network.

Required Associated Types§

Source

type NodeId: IdType

ID type used to identify nodes in the network.

Required Methods§

Source

fn num_inputs(&self) -> usize

Get the number of inputs into this node.

Source

fn get_input(&self, i: usize) -> Self::NodeId

Get the i-th input.

§Panics

Panics if i > self.num_inputs().

Source

fn function(&self) -> SmallTruthTable

Get the logic function of the node.

Source

fn normalized(self) -> SimplifyResult<Self, Self::NodeId>

Bring the node into a canonical form by reordering and inverting the inputs (if possible). This increases the effectiveness of structural hashing.

The node can also be simplified to a single signal (i.e. an AND node with one input set to constant 0 would reduce to 0).

Returns a tuple with the normalized node and a boolean which is true iff the output of the node has been inverted by the normalization.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§