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§
Required Methods§
Sourcefn num_inputs(&self) -> usize
fn num_inputs(&self) -> usize
Get the number of inputs into this node.
Sourcefn function(&self) -> SmallTruthTable
fn function(&self) -> SmallTruthTable
Get the logic function of the node.
Sourcefn normalized(self) -> SimplifyResult<Self, Self::NodeId>
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.