Skip to content

1.7 Constraint, Guarantee, and Composition Models

Editorial context, 2026-04-20: The questions, constraints, proposals, disagreements, and caveats below are reformulated from the saved research discussion. LLM recommendations remain attributed proposals, not decisions by the author or independently verified findings. Technical examples and quoted source passages retain their original wording.

The formal argument and worked models come from the semantic-substrate report. The literature survey and builder method provide the surrounding context. The proposed extension-set measure and concluding thesis remain together below.

Formalising constraint, guarantee, and composition

The most useful theoretical contribution you can make is probably to connect several existing formalisms into one builder-facing model.

Behaviour spaces

Let Σ\Sigma be the observable vocabulary of a component boundary: messages, events, calls, returned values, state transitions, effects, or some mixture of these.

Let

TΣ\mathcal T_\Sigma

be the universe of possible observable traces over that vocabulary.

A component MM denotes a set of behaviours:

⟦M⟧⊆TΣ.\llbracket M\rrbracket\subseteq\mathcal T_\Sigma.

A semantic constraint CC defines an admissible subset:

C⊆TΣ.C\subseteq\mathcal T_\Sigma.

Then:

[ M\models C

\quad\Longleftrightarrow\quad

\llbracket M\rrbracket\subseteq C. ]

A guarantee GG can similarly be represented as a property of traces:

G⊆TΣ.G\subseteq\mathcal T_\Sigma.

A sufficient constraint satisfies:

C⊆G.C\subseteq G.

Then every conforming component receives the guarantee immediately:

[ M\models C

\Rightarrow

M\models G. ]

This is deliberately simple. Real interface theories distinguish inputs from outputs, assumptions from guarantees and safety from progress; probabilistic, timed and security properties may require richer semantic domains than trace sets. 12

Refinement as semantic strengthening

Define behavioural refinement by:

[ M’\sqsubseteq M

\quad\Longleftrightarrow\quad

\llbracket M’\rrbracket

\subseteq

\llbracket M\rrbracket. ]

M′M' makes at least as strong a commitment: it permits no behaviour forbidden by MM.

For a trace property PP:

[ M\models P

\land

M’\sqsubseteq M

\Rightarrow

M’\models P. ]

This is the formal core of “restrict behaviour to strengthen what callers may assume”. Refinement mappings are a richer state-based mechanism for establishing corresponding implementation relationships. 3

Composition needs more than conformance

Let

M⊗NM\otimes N

denote composition.

A useful substrate needs at least three properties.

Compatibility

Compat⁡(M,N)\operatorname{Compat}(M,N)

says the two interfaces may legally be connected. Interface automata and architectural connector theories make this an explicit semantic judgement rather than assuming any matching syntax is meaningful. 14

Closure or preservation

For the property of interest PP:

[ M\models C_M,;

N\models C_N,;

\operatorname{Compat}(M,N)

\Rightarrow

M\otimes N\models P. ]

The local contracts are useful only when they imply something about their composite.

Substitutivity

For any compatible context K[−]K[-]:

[ M’\sqsubseteq M

\Rightarrow

K[M’]\sqsubseteq K[M]. ]

This is the property that lets a future implementation replace an existing component without invalidating reasoning performed against the boundary. Behavioural subtyping and interface refinement both target variants of this requirement. 56

Together they give a better definition of open-ended composition:

Future components need not be enumerated in advance. They are admitted by satisfying a stable conformance and compatibility relation, and the relevant guarantees are preserved when those components are composed or substituted.

“Open-ended” therefore does not mean “every component may be composed with every other component”.

Assume-guarantee contracts

For environment-sensitive properties, use:

Γ=(A,G)\Gamma=(A,G)

with assumption AA and guarantee GG.

Schematically:

M⊨(A,G)M\models(A,G)

when MM guarantees GG in every environment satisfying AA.

Two components can then discharge parts of each other’s assumptions. Actual composition rules vary by contract theory, but the key pattern is:

[ \begin{aligned}

M_1 &: A_1\Rightarrow G_1\

M_2 &: A_2\Rightarrow G_2\

\text{compatibility/discharge conditions}

&\Rightarrow

M_1\otimes M_2\models G_{\mathrm{system}}.

\end{aligned} ]

Modern assume-guarantee frameworks define parallel composition, logical conjunction and quotient operations with soundness/completeness results for their chosen component models. 2

This is probably the strongest existing mathematical foundation for a general “constraints -> guarantees -> composition” layer.

The inverse problem

The proposed inverse problem is:

[ \boxed{

G_{\text{desired}}

\longrightarrow

C_{\text{required}}

} ]

There are at least three established versions.

Dijkstra computes the weakest initial-state condition for a program SS to terminate in a state satisfying RR:

wp(S,R).wp(S,R).

The “weakest” part is important: any weaker predicate would admit some initial states from which the guarantee can fail. 7

Assumption-generation systems ask:

What is the weakest useful assumption on environment E\text{What is the weakest useful assumption on environment }E

such that:

M⊗E⊨P?M\otimes E\models P?

Counterexample-guided assume-guarantee verification can learn such assumptions iteratively. 8

Contract quotient asks, schematically:

X=S/MX = S/M

for the most general missing component XX such that:

[ M\otimes X

\preceq

S, ]

subject to the exact ordering and semantics of the contract theory. Quotient is explicitly used for incremental synthesis in assume-guarantee frameworks. 2

These suggest a general formulation for semantic substrate design.

Let C\mathfrak C be a family of candidate substrate constraints. Instead of asking for the “smallest” constraint syntactically, order them by allowed behaviour.

A constraint C2C_2 is more permissive than C1C_1 when:

C1⊆C2.C_1\subseteq C_2.

Then seek a maximally permissive sufficient constraint:

[ C^\star

\in

\operatorname{Max}

\left{

C\in\mathfrak C

;\middle|;

\forall M_1,\ldots,M_n,

;\left(

\bigwedge_i M_i\models C

\land

\operatorname{Compat}(M_1,\ldots,M_n)

\right)

\Rightarrow

\bigotimes_iM_i\models G

\right}. ]

There may be several incomparable maximal solutions or no effectively computable optimum. That is why “minimal semantic constraints” should mean “least restrictive sufficient constraints relative to a defined guarantee and composition model”, not “fewest rules”.

A proposal/commit transition model

The pattern from the participant-neutral system can be formalised very simply.

Let:

  • SS be canonical system states;
  • PP be possible proposals;
  • V:S×P→{true,false}V:S\times P\rightarrow\{\text{true},\text{false}\} be the validation predicate;
  • δ:S×P→S\delta:S\times P\rightarrow S be the commit transition.

Define authoritative transitions only by:

[ s\rightarrow s'

\quad\Longleftrightarrow\quad

\exists p:

V(s,p)

\land

s’=\delta(s,p). ]

The proposal generator:

g:Context→P(P)g:\text{Context}\rightarrow\mathcal P(P)

may be deterministic, stochastic, human, neural or adversarial. It is outside the trusted state-transition semantics.

Suppose the desired invariant is:

I:S→{true,false}.I:S\rightarrow\{\text{true},\text{false}\}.

If:

I(s0)I(s_0)

and

[ \forall s,p:

I(s)\land V(s,p)

\Rightarrow

I(\delta(s,p)), ]

then by induction:

[ \forall s\in\operatorname{Reachable}(s_0):

I(s). ]

This is a powerful design result for the intended application:

You do not need to constrain how a participant imagines possible next states if all authoritative transitions pass through a boundary that preserves the system invariant.

Authority can simply become part of VV:

[ V(s,p)

=

V_{\text{type}}

\land

V_{\text{invariant}}

\land

V_{\text{authority}}

\land

V_{\text{provenance}}

\land

V_{\text{resource}}. ]

Fabric’s execute/order/validate model provides a concrete distributed analogue of this separation. 9

There is one major caveat: an external effect that occurs before validation or outside the committed state machine is not covered by this proof. External effects therefore need mediation, transactional semantics, compensation, idempotency, or an authority boundary of their own.

CRDT algebra as constraint-derived coordination freedom

For the state-based CRDT family, the familiar sufficient structure is a join-semilattice:

(L,⊔)(L,\sqcup)

where merge is associative, commutative and idempotent, and local updates move state monotonically upward in the partial order.

Then different delivery orders of the same information collapse to the same join:

[ a\sqcup b

=

b\sqcup a ]

[ (a\sqcup b)\sqcup c

=

a\sqcup(b\sqcup c) ]

a⊔a=a.a\sqcup a=a.

The algebra restricts what constitutes a legal replicated datatype, and in exchange much execution-order coordination becomes unnecessary. CRDT verification literature formalises and machine-checks corresponding convergence arguments for concrete replicated data types. 1011

This is an especially clean example of:

[ \text{stronger local algebra}

\rightarrow

\text{weaker global coordination requirement}. ]

Capability semantics as an authority invariant

Let H(p,r,o)H(p,r,o) mean principal/component pp holds authority rr over object oo.

An effect:

effect⁡(p,r,o)\operatorname{effect}(p,r,o)

is permitted only if:

H(p,r,o).H(p,r,o).

If references are unforgeable and new authority can only arise through controlled creation or delegation from existing authority, the system can reason about future authority through reachability in the capability graph. That is the structural basis of object-capability reasoning and seL4’s capDL analysis. 1213

The crucial insight is that a capability model does not need to predict what code a component will execute. It limits what consequences that code can have.

The following section originally concluded the report’s research-gap discussion. Its extension-set measure is a proposed research formulation, as the original text explains. The other research gaps remain in the report.

Generativity itself needs a better formal measure

Computer science has mature measures for correctness, refinement and compatibility. “How generative is this substrate?” is less well formalised.

A useful starting point is to avoid counting raw programs and instead define the extension set of a substrate:

[ \operatorname{Ext}(C,G)

=

{

X

\mid

X\models C

\land

\forall K\in\mathcal K_C:

K[X]\models G

}. ]

This is the set of future components admissible under constraint CC while preserving GG in the relevant compatible contexts.

Then two substrates can be compared:

[ C_1

\text{ is at least as extension-permissive as }

C_2 ]

when:

[ \operatorname{Ext}(C_2,G)

\subseteq

\operatorname{Ext}(C_1,G). ]

This is a proposed research formulation, not an established metric. Its attraction is that it makes “generativity” explicitly relative to a guarantee. A completely unconstrained interface may admit more implementations in a trivial sense while supporting almost no useful system-level guarantees.

That leads to a proposed, more precise formulation of the overall research thesis:

A semantic substrate is well designed when it is maximally permissive among the substrates that preserve the chosen system guarantees under compatible composition, refinement, replacement and evolution, and when future components can establish conformance without requiring knowledge of the implementations already present.

This reframes the project from designing one human/LLM/software architecture into a theory for builders:

[ \boxed{

\text{desired guarantees}

\rightarrow

\text{weakest sufficient semantics}

\rightarrow

\text{enforceable boundaries}

\rightarrow

\text{composition laws}

\rightarrow

\text{open-ended systems}

} ]

That chain has direct foundations in refinement, interface and contract theory, weakest-precondition reasoning, capability security, algebraic distributed systems, type/effect systems, Unix composition and declarative programming. What remains open is their integration into a practical theory of semantic substrate design. 3271310141516

Citation definitions for the imported report sections

The definitions below are local copies of the entries used in these passages. The complete original bibliography remains in the report. The copies are separate from the original source text.

Library sources