Struct simplicity::NodeBounds
source · pub struct NodeBounds {
pub extra_cells: usize,
pub extra_frames: usize,
pub cost: Cost,
}Expand description
Bounds on the resources required by a node during execution on the Bit Machine
Fields§
§extra_cells: usizeUpper bound on the required number of cells (bits). The root additionally requires the bit width of its source and target type (input, output)
extra_frames: usizeUpper bound on the required number of frames (sum of read and write frames). The root additionally requires two frames (input, output)
cost: CostCPU cost
Implementations§
source§impl NodeBounds
impl NodeBounds
sourcepub fn iden(target_type: usize) -> NodeBounds
pub fn iden(target_type: usize) -> NodeBounds
Node bounds for an iden node
sourcepub const fn unit() -> NodeBounds
pub const fn unit() -> NodeBounds
Node bounds for a unit node
sourcepub fn injl(child: Self) -> NodeBounds
pub fn injl(child: Self) -> NodeBounds
Node bounds for an injl node
sourcepub fn injr(child: Self) -> NodeBounds
pub fn injr(child: Self) -> NodeBounds
Node bounds for an injr node
sourcepub fn take(child: Self) -> NodeBounds
pub fn take(child: Self) -> NodeBounds
Node bounds for a take node
sourcepub fn drop(child: Self) -> NodeBounds
pub fn drop(child: Self) -> NodeBounds
Node bounds for a drop node
sourcepub fn comp(left: Self, right: Self, mid_ty_bit_width: usize) -> NodeBounds
pub fn comp(left: Self, right: Self, mid_ty_bit_width: usize) -> NodeBounds
Node bounds for a comp node
sourcepub fn case(left: Self, right: Self) -> NodeBounds
pub fn case(left: Self, right: Self) -> NodeBounds
Node bounds for a case node
sourcepub fn assertl(child: Self) -> NodeBounds
pub fn assertl(child: Self) -> NodeBounds
Node bounds for a assertl node
sourcepub fn assertr(child: Self) -> NodeBounds
pub fn assertr(child: Self) -> NodeBounds
Node bounds for a assertr node
sourcepub fn pair(left: Self, right: Self) -> NodeBounds
pub fn pair(left: Self, right: Self) -> NodeBounds
Node bounds for a pair node
sourcepub fn disconnect(
left: Self,
right: Self,
left_target_b_bit_width: usize,
left_source_bit_width: usize,
left_target_bit_width: usize
) -> NodeBounds
pub fn disconnect( left: Self, right: Self, left_target_b_bit_width: usize, left_source_bit_width: usize, left_target_bit_width: usize ) -> NodeBounds
Node bounds for a disconnect node
sourcepub fn witness(target_ty_bit_width: usize) -> NodeBounds
pub fn witness(target_ty_bit_width: usize) -> NodeBounds
Node bounds for an arbitrary jet node
sourcepub fn jet<J: Jet>(jet: J) -> NodeBounds
pub fn jet<J: Jet>(jet: J) -> NodeBounds
Node bounds for an arbitrary jet node
sourcepub fn const_word(value: &Value) -> NodeBounds
pub fn const_word(value: &Value) -> NodeBounds
Node bounds for an arbitrary constant word node
sourcepub const fn fail() -> NodeBounds
pub const fn fail() -> NodeBounds
Node bounds for a fail node.
This is a bit of a silly constructor because if a fail node is actually
executed in the bit machine, it will fail instantly, while if it isn’t
executed, it will fail the “no unexecuted nodes” check. But to analyze
arbitrary programs, we need it.
Trait Implementations§
source§impl Clone for NodeBounds
impl Clone for NodeBounds
source§fn clone(&self) -> NodeBounds
fn clone(&self) -> NodeBounds
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for NodeBounds
impl Debug for NodeBounds
source§impl Hash for NodeBounds
impl Hash for NodeBounds
source§impl Ord for NodeBounds
impl Ord for NodeBounds
source§fn cmp(&self, other: &NodeBounds) -> Ordering
fn cmp(&self, other: &NodeBounds) -> 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 NodeBounds
impl PartialEq for NodeBounds
source§fn eq(&self, other: &NodeBounds) -> bool
fn eq(&self, other: &NodeBounds) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd for NodeBounds
impl PartialOrd for NodeBounds
source§fn partial_cmp(&self, other: &NodeBounds) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeBounds) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more