Skip to main content

SLTNode

Enum SLTNode 

Source
pub enum SLTNode<A: Hash + Eq + Clone> {
    Input {
        variable: A,
        signed: bool,
        index: Vec<SLTIndex>,
        access: BitAccess,
    },
    Constant(BigUint, BigUint, usize, bool),
    Binary(NodeId, BinaryOp, NodeId),
    Unary(UnaryOp, NodeId),
    Mux {
        cond: NodeId,
        then_expr: NodeId,
        else_expr: NodeId,
    },
    ForFold {
Show 14 fields loop_var: A, loop_width: usize, loop_signed: bool, start: SLTLoopBound, end: SLTLoopBound, inclusive: bool, step: usize, step_op: SLTStepOp, reverse: bool, result: SLTForFoldResult<A>, initials: Vec<SLTForUpdate<A>>, updates: Vec<SLTForUpdate<A>>, effects: Vec<SLTForEffect>, continue_cond: NodeId,
}, ForFoldGroup { loop_var: A, loop_width: usize, loop_signed: bool, start: BigInt, step: BigInt, trip_count: usize, entry_guard: NodeId, states: Vec<SLTForFoldGroupState<A>>, }, Concat(Vec<(NodeId, usize)>), Slice { expr: NodeId, access: BitAccess, }, Capture { expr: NodeId, key: u64, }, }

Variants§

§

Input

Fields

§variable: A
§signed: bool
§index: Vec<SLTIndex>
§access: BitAccess
§

Constant(BigUint, BigUint, usize, bool)

§

Binary(NodeId, BinaryOp, NodeId)

§

Unary(UnaryOp, NodeId)

§

Mux

Fields

§cond: NodeId
§then_expr: NodeId
§else_expr: NodeId
§

ForFold

Fields

§loop_var: A
§loop_width: usize
§loop_signed: bool
§inclusive: bool
§step: usize
§step_op: SLTStepOp
§reverse: bool
§initials: Vec<SLTForUpdate<A>>
§updates: Vec<SLTForUpdate<A>>
§continue_cond: NodeId
§

ForFoldGroup

A fixed-trip-count fold carrying multiple state values and returning their final values as one packed result.

Fields

§loop_var: A
§loop_width: usize
§loop_signed: bool
§start: BigInt
§step: BigInt
§trip_count: usize
§entry_guard: NodeId
§

Concat(Vec<(NodeId, usize)>)

§

Slice

Fields

§expr: NodeId
§access: BitAccess
§

Capture

A value materialized at a specific semantic evaluation position.

key keeps captures from distinct runtime-event operands separate even when their expressions are structurally identical.

Fields

§expr: NodeId
§key: u64

Implementations§

Source§

impl<A: Hash + Eq + Clone> SLTNode<A>

Source

pub fn fmt_expression( &self, f: &mut Formatter<'_>, arena: &SLTNodeArena<A>, ) -> Result
where A: Display,

Source§

impl<A: Debug + Display + Hash + Eq + Clone> SLTNode<A>

Source

pub fn map_addr<B, F>( &self, id: NodeId, arena: &SLTNodeArena<A>, target_arena: &mut SLTNodeArena<B>, cache: &mut HashMap<NodeId, NodeId>, f: &F, ) -> Result<NodeId, SLTNodeFactsError>
where A: Hash + Eq + Clone, B: Hash + Eq + Clone, F: Fn(&A) -> B,

Maps the address type A to B throughout the reachable graph.

The traversal is explicitly postorder so deeply nested expressions do not consume the host thread’s call stack.

Source§

impl<A: Debug + Display + Hash + Eq + Clone> SLTNode<A>

Display implementation for SLTNode - provides human-readable tree structure

This implementation formats the Signal Logic Tree (SLT) as a hierarchical ASCII tree, making it easy to visualize the expression structure. Each node type displays relevant information:

  • Input: Shows variable ID, dynamic indices (if any), and bit range [lsb:msb]
  • Constant: Displays the value in hexadecimal and width in bits
  • Binary: Shows the operation and recursively formats both operands with indentation
  • Unary: Shows the operation and recursively formats the inner expression
  • Mux: Displays condition, then-branch, and else-branch with clear labels
  • Concat: Lists concatenated parts with their widths
  • Slice: Shows the bit range extraction with the inner expression

§Example

A binary expression a + b would display as:

Binary(Add)
  Const(0x1, 32bits)
  Const(0x2, 32bits)

A more complex expression (a + b) * (c - d) would show:

Binary(Mul)
  Binary(Add)
    Const(0x1, 32bits)
    Const(0x2, 32bits)
  Binary(Sub)
    Const(0x3, 32bits)
    Const(0x4, 32bits)
Source

pub fn fmt_display( &self, f: &mut Formatter<'_>, arena: &SLTNodeArena<A>, ) -> Result

Trait Implementations§

Source§

impl<A: Clone + Hash + Eq + Clone> Clone for SLTNode<A>

Source§

fn clone(&self) -> SLTNode<A>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Debug + Hash + Eq + Clone> Debug for SLTNode<A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, A> Deserialize<'de> for SLTNode<A>
where A: Deserialize<'de> + Hash + Eq + Clone,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<A: Eq + Hash + Eq + Clone> Eq for SLTNode<A>

Source§

impl<A: Hash + Hash + Eq + Clone> Hash for SLTNode<A>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<A: PartialEq + Hash + Eq + Clone> PartialEq for SLTNode<A>

Source§

fn eq(&self, other: &SLTNode<A>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<A> Serialize for SLTNode<A>
where A: Serialize + Clone + Hash + Eq,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<A: PartialEq + Hash + Eq + Clone> StructuralPartialEq for SLTNode<A>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more