State Model

Definition

The UOR state model captures evaluation context — the bindings, frames, and transitions that comprise a computation. The state/ namespace provides four mutually disjoint classes.

Classes

ClassDescription
ContextEvaluation environment (Witt level, capacity)
BindingA name bound to a typed value
FrameSnapshot of context with active bindings
TransitionChange from one frame to another

These four classes are mutually owl:disjointWith — a Context is never a Binding, a Frame, or a Transition.

Context

A Context is the runtime environment:

PropertyDescription
wittLengthWitt level n of the ring
capacityMaximum number of bindings
contentAddressContent address of the context

Binding

A Binding associates an address with a value:

PropertyDescription
addressAddress within the context
contentBound value
boundTypeType of the bound value
timestampStep count when binding was created

Frame

A Frame is an immutable snapshot:

PropertyDescription
contextThe containing context (functional)
activeBindingsCount of active bindings
constraintOptional constraint on the frame

Transition

A Transition records a state change:

PropertyDescription
fromSource frame (functional)
toTarget frame (functional)
addedBindingsCount of bindings added
removedBindingsCount of bindings removed
traceComputation trace for this transition

Example Lifecycle

Context (quantum=8) → Frame-0 (0 bindings) → Transition → Frame-1 (1 binding)
                                                ↓
                                          ComputationTrace

Turtle Example

# Context: 8-bit ring with capacity for 4 bindings
<https://uor.foundation/instance/ctx-r8>
    a                   state:Context ;
    state:quantum       "8"^^xsd:nonNegativeInteger ;
    state:capacity      "4"^^xsd:nonNegativeInteger .

# Binding: address 0 holds value 42 of type u8
<https://uor.foundation/instance/binding-0>
    a                   state:Binding ;
    state:address       "0"^^xsd:nonNegativeInteger ;
    state:content       "42"^^xsd:nonNegativeInteger ;
    state:boundType     <https://uor.foundation/instance/type-u8> ;
    state:timestamp     "1"^^xsd:nonNegativeInteger .

# Frame: snapshot with one active binding
<https://uor.foundation/instance/frame-1>
    a                   state:Frame ;
    state:context       <https://uor.foundation/instance/ctx-r8> ;
    state:activeBindings "1"^^xsd:nonNegativeInteger .

# Transition: from empty frame to frame with one binding
<https://uor.foundation/instance/transition-0-1>
    a                       state:Transition ;
    state:from              <https://uor.foundation/instance/frame-0> ;
    state:to                <https://uor.foundation/instance/frame-1> ;
    state:addedBindings     "1"^^xsd:nonNegativeInteger ;
    state:removedBindings   "0"^^xsd:nonNegativeInteger .

This lifecycle is validated by SHACL test test4_state_lifecycle. See Evaluation for how evaluation triggers state transitions.