pub struct Engine<O, P, G, D>{ /* private fields */ }Expand description
Aria Engine — the Spec state machine with pluggable backends.
Implementations§
Source§impl<O, P, GB, D> Engine<O, P, GB, D>
impl<O, P, GB, D> Engine<O, P, GB, D>
Sourcepub fn new(
config: AriaConfig,
optical: O,
predictor: P,
graph_backend: GB,
diffuser: D,
) -> Self
pub fn new( config: AriaConfig, optical: O, predictor: P, graph_backend: GB, diffuser: D, ) -> Self
Create a new engine with backends and config.
Sourcepub fn init(&self, psi0: Vec<Complex64>, g0: Graph, a0: Condition) -> State
pub fn init(&self, psi0: Vec<Complex64>, g0: Graph, a0: Condition) -> State
Init: create the initial state per FORMAL_SPEC §5.
ψ = ψ₀, z = I(ψ₀), G = G₀, t = 0, prevRes = d(I(ψ₀), P(I(ψ₀), a(0)))
Sourcepub fn apply(
&self,
state: State,
action: Action,
a: Condition,
) -> Result<State, AriaError>
pub fn apply( &self, state: State, action: Action, a: Condition, ) -> Result<State, AriaError>
Apply a single named action to the state.
Returns the new state on success, or an invariant violation. This is the Spec’s Next relation turned into a deterministic function.
Sourcepub fn step_phi(&self, state: State, a: Condition) -> Result<State, AriaError>
pub fn step_phi(&self, state: State, a: Condition) -> Result<State, AriaError>
Step one full Φ-cycle: OpticalStep → Predict → Match → Diffuse (𝐂4).
This is the preferred schedule. Each sub-step checks invariants. Returns the state after the full cycle, or the first invariant violation.
Sourcepub fn run(
&self,
state: State,
scheduler: &mut Scheduler,
steps: u64,
a: Condition,
) -> Result<(State, Trace), AriaError>
pub fn run( &self, state: State, scheduler: &mut Scheduler, steps: u64, a: Condition, ) -> Result<(State, Trace), AriaError>
Run the engine for a number of steps with a scheduler.
Returns the final state and a trace of all steps.
Sourcepub fn check(&self, state: &State, a: Condition) -> InvariantReport
pub fn check(&self, state: &State, a: Condition) -> InvariantReport
Check all invariants on the current state without applying an action.
Sourcepub fn config(&self) -> &AriaConfig
pub fn config(&self) -> &AriaConfig
Access config.