Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Instances For
Iterate a function n times.
Equations
- Sparkle.Core.OracleSpec.iterateN f 0 x✝ = x✝
- Sparkle.Core.OracleSpec.iterateN f n.succ x✝ = Sparkle.Core.OracleSpec.iterateN f n (f x✝)
Instances For
Type class for oracle-driven FSM reductions with mandatory proof.
Type parameters:
tag: string literal identifying this reduction (e.g., "pcpi_mul")State: internal FSM state type (e.g., rd × rdx × rs1 × rs2)Input: input type extracted from registers (e.g., rs1 × rs2)Output: result type to inject back (e.g., product)
The equiv field requires a proof that iterating step for numCycles
from initState input and extracting the result equals compute input.
Without this proof, the instance cannot be constructed.
- step : State → State
One cycle of the FSM (pure Lean function modeling the hardware)
- initState : Input → State
Map input register values to the FSM's initial state
- extractResult : State → Output
Extract the final result from the FSM state
- compute : Input → Output
Direct computation (what the oracle actually executes)
- numCycles : Nat
Number of cycles the FSM takes
- equiv (input : Input) : extractResult tag Input (iterateN (step tag Input Output) (numCycles tag State Input Output) (initState tag Output input)) = compute tag State input
MANDATORY PROOF: iterating step = direct compute. This is the soundness guarantee. Without it, the instance cannot be constructed (unless sorry is used, which is explicit).
Register roles for pattern matching
Encode JIT register values → typed Input
Decode typed Output → (role, value) pairs to write back
Trigger condition on raw register values
Wire patterns to eliminate from IR (optional)
Instances
Mutable state for a running oracle.
Instances For
Match a name against a glob pattern.
Splits pattern on * and checks that all segments appear in order.
Examples: *pcpi_mul*_seq* matches _gen_picorv32_pcpi_mul_next_rd_seq42.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Resolve an OracleReduction instance against a JITHandle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Create a runtime oracle from a resolved OracleReduction.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One-shot: resolve + create oracle.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compose multiple oracle callbacks: first match wins.
Equations
- One or more equations did not get rendered due to their size.
Instances For
IR reduction: remove dead wires and stub output registers.
Equations
- One or more equations did not get rendered due to their size.