Expand description
Statement / Expression walker — the runtime interpreter.
Holds the mutable bookkeeping a circuit accumulates during
execution (public transcript, witness outputs, popeq reads, the
current contract state, the local variable scope) and walks the
body IR producing an [ExecuteCircuitResult]-shaped output.
Today this handles the registry-shape body — Statement::Seq /
Const / Expr, Expression::Var / Literal / Call (witness
only) / AdtOp / EltRef. Surfaces a clear Unimplemented
error for anything else so callers know exactly which IR node
the interpreter needs to grow next.
Structs§
- Emitted
Event - One
emitoccurrence: the tag and version the contract declared, plus the state value the VM logged. - Interp
State - Mutable state the interpreter maintains during a single circuit execution.
- VmSession
- Persistent on-chain VM stack threaded across sequential
AdtOp,Emit, andclaimContractCallqueries within a single circuit or constructor run.
Functions§
- encode_
input - Encode the circuit’s input arguments as a single concatenated
AlignedValue(matching the JS-emitpartialProofData.input = _descriptor_N.toValue(arg)shape). - encode_
output - Encode the circuit’s result value as an
AlignedValue. - eval_
expression - Evaluate an expression, possibly with side effects on
InterpState(witness calls updateprivate_transcript_outputs; adt-op invocations append topublic_transcriptand updatecontract_state). - run_
statement - Walk a Statement tree, threading mutable interpreter state. Returns
the last-expression value (the circuit’s implicit return), or
Value::Nullif no expression contributed a value.
Type Aliases§
- VarMap
- Fast non-cryptographic variable map used for interpreter
localsandargsscopes.