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: usize
Upper 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: usize
Upper bound on the required number of frames (sum of read and write frames). The root additionally requires two frames (input, output)
cost: Cost
CPU 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(word: &Word) -> NodeBounds
pub fn const_word(word: &Word) -> 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 more