Session Resolution

Definition

Session resolution is the multi-turn inference protocol in which a sequence of RelationQuery evaluations shares a common Context. Each resolved query appends a Binding to a BindingAccumulator, monotonically reducing the aggregate free site space for subsequent queries.

A Session is the bounded collection of query/response pairs that share this accumulator. Sessions are the unit of coherent multi-turn reasoning in Prism deployments.

Monotonicity Invariant

The binding monotonicity invariant (GR_1) guarantees:

freeRank(B_{i+1}) ≤ freeRank(B_i) for all i in a Session S.

The aggregateSiteDeficit on the BindingAccumulator tracks the total remaining free sites across all accumulated bindings. This value can only decrease as the session progresses — accumulated knowledge cannot increase uncertainty.

SessionResolver

A SessionResolver is the top-level resolver for multi-turn Prism deployments. It maintains the BindingAccumulator across evaluations via the sessionAccumulator property.

SessionQuery

A SessionQuery extends RelationQuery by explicitly declaring session membership via the sessionMembership property. This allows the conformance suite to validate session-scoped site reduction.

Session Boundaries

A SessionBoundary marks a context-reset event within a session stream. The SessionBoundaryType vocabulary enum classifies the reason:

IndividualMeaning
state:ExplicitResetCaller requested context reset
state:ConvergenceBoundaryNo further queries can reduce the aggregate site deficit
state:ContradictionBoundaryNew query produced a type contradiction with an accumulated binding

Each boundary records the priorContext (the state before reset) and the freshContext (the clean state for subsequent queries).

Session Identity Algebra (GR_ series)

Amendment 27 adds five GR_ identity individuals formalizing the session resolution algebra:

IdentityStatement
GR_1Binding monotonicity: freeRank(B_{i+1}) ≤ freeRank(B_i)
GR_2Empty session is identity: freeRank(B_0) = total site space
GR_3Convergence: session terminates iff freeRank reaches minimum
GR_4Disjoint bindings compose without site conflict
GR_5ContradictionBoundary fires iff ∃ conflicting bindings at same address

Amendment 44 adds two more GR_ identities for session-level coherence:

IdentityStatement
GR_6Session join monotonicity: freeRank(join(S_A, S_B)) ≤ freeRank(S_A) + freeRank(S_B)
GR_7Session inclusion: S_A ⊆ S_B implies freeRank(S_A) ≥ freeRank(S_B)

Amendment 48 adds three axiomatic and eight derivational identities for multi-session coordination:

IdentityStatement
GR_8Composition validity: compose(S_A, S_B) valid at Q_k iff datum agreement holds at every tower level Q_0…Q_k
GR_9ContextLease disjointness: leasedSites(L_A) ∩ leasedSites(L_B) = ∅ for distinct leases on the same SharedContext
GR_10ExecutionPolicy confluence: different policies produce the same final resolved state (Church–Rosser)
MC_1Lease partition conserves budget: Σᵢ freeRank(L_i) = freeRank(C)
MC_2Per-lease binding monotonicity: GR_1 holds within each leased sub-domain
MC_3Composition freeRank via inclusion-exclusion
MC_4Disjoint-lease additivity: freeRank(compose(S_A, S_B)) = freeRank(S_A) + freeRank(S_B) when GR_9 holds
MC_5Policy-invariant final binding set
MC_6Full lease coverage implies composed grounding (σ = 1)
MC_7Distributed O(1) resolution: stepCount = 0 on a fully grounded composed context
MC_8Parallelism bound: per-session work ≤ ⌈n/k⌉ for k uniform-partition leases

Multi-Session Coordination (Amendment 48)

SharedContext and ContextLease

A SharedContext is a Context visible to more than one Session simultaneously. Concurrent write conflicts are prevented by partitioning its sites across ContextLease instances.

Each ContextLease holds:

The SharedContext links active leases via leaseSet. Lease disjointness (GR_9) is enforced structurally: each lease claims a non-overlapping FreeRank.

SessionComposition

A SessionComposition records that a Session was formed by merging the binding sets of two or more predecessor sessions:

An invalid composition (compositionCompatible = false) triggers a ContradictionBoundary on the target session.

ExecutionPolicy

A ExecutionPolicy defines how a SessionResolver orders pending RelationQuery instances, linked via executionPolicy.

The ExecutionPolicyKind enum provides four scheduling strategies:

IndividualStrategy
resolver:FifoPolicyArrival order (pre-Amendment 48 implicit default)
resolver:MinFreeRankFirstCheapest resolutions first — favours early grounding gain
resolver:MaxFreeRankFirstHardest resolutions first — maximises information gain per step
resolver:DisjointFirstSite-disjoint queries first — minimises SharedContext contention

All four strategies are policy-confluent (GR_10): they converge to identical final binding sets.

Related