//! Tree IR โ lowering for combinator/tree-rewriting VMs.
//!
//! Tree machines are neither stack nor register. Data is binary trees
//! (nouns) addressed by axes (2=left, 3=right). Computation is
//! subject-formula evaluation: every expression is `[subject formula] โ result`.
//!
//! Tree lowering takes TIR directly (like KernelLowering) and produces
//! target-specific tree expressions โ Nock formulas, or similar combinator
//! representations for future tree VMs.
//!
//! Pipeline:
//! ```text
//! AST โ TIR โโ StackLowering โ Vec<String> (stack targets)
//! โโ LIR โ RegisterLow โ Vec<u8> (register targets)
//! โโ KIR โ KernelLow โ String (GPU kernel source)
//! โโ TreeLowering โ Vec<u8> (tree targets: Nock)
//! ```
//!
//! The key insight: TIR's structural control flow (nested IfElse/Loop bodies)
//! maps naturally to tree structure. Stack operations become tree construction
//! and axis addressing. The translation is:
//!
//! - **Stack โ Subject**: the operand stack becomes a nested cons-tree (the subject)
//! - **Push โ Literal**: `[1 value]` (Nock opcode 1 = constant)
//! - **Dup โ Slot**: `[0 axis]` (Nock opcode 0 = tree lookup)
//! - **IfElse โ Branch**: `[6 test yes no]` (Nock opcode 6 = branch)
//! - **Call โ Evaluate**: `[2 subject formula]` (Nock opcode 2 = eval)
//! - **Hash โ Jet**: jet-matched formula for Tip5 hash
//!
//! Supported targets:
//! - Nock (Nockchain) โ 13-opcode tree-rewriting machine
trident/src/ir/tree/mod.rs
ฯ 0.0%