「‍」 Lingenic

Rely-Guarantee Logic

(⤓.md ◇.md); γ ≜ [2026-07-17T120407.600, 2026-07-17T135416.643] ∧ |γ| = 3

Rely-Guarantee Logic

Origin. Jones introduced Rely-Guarantee (1983). Compositional reasoning for concurrent programs. Rely: what environment may do. Guarantee: what this component does. Enables modular concurrent verification. Foundation for modern concurrent separation logic.

Models. Interface between component and environment. Sequential Hoare: pre/post describe state changes. Concurrent: must also describe interference. Rely R: environment's allowed transitions. Guarantee G: this thread's transitions. Composition: thread's guarantee is others' rely.

Formalism.

Rely-Guarantee specification: R, G ⊢ {P} C {Q}

  • P: precondition
  • Q: postcondition
  • R: rely (environment actions)
  • G: guarantee (this thread's actions)

Meaning: If:

  • Execution starts in state satisfying P
  • Environment's every action satisfies R Then:
  • Thread's every action satisfies G
  • If terminates, final state satisfies Q

Stability: P stable under R: if P(s) and (s,s') ∈ R, then P(s'). Rely can't invalidate preconditions. Q must be stable under R.

Parallel composition: R₁, G₁ ⊢ {P₁} C₁ {Q₁} R₂, G₂ ⊢ {P₂} C₂ {Q₂} ──────────────────────────────────────────────── R₁ ∩ R₂, G₁ ∪ G₂ ⊢ {P₁ ∧ P₂} C₁ ∥ C₂ {Q₁ ∧ Q₂} (with compatibility: G₁ ⊆ R₂ and G₂ ⊆ R₁)

Reflexivity: Id ⊆ R (rely includes stuttering).

Transitivity: R often transitive (multiple environment steps compose).

Symbols.

SymbolUnicodeNameMeaning
RRelyEnvironment may do
GGuaranteeI will do
U+22A2EntailsSpecification holds
P, QPre, PostConditions
U+2225ParallelParallel composition
stableStablePreserved by rely

Metatheory. Sound for interleaving semantics. Compositional: reason about components separately. Subsumes Owicki-Gries. Extended to separation logic (RGSep). Underpins concurrent verification frameworks. No built-in frame, but can be added.

Applies to. Concurrent algorithm verification. Operating systems. Lock-free data structures. Device drivers. Multicore programming. Protocol verification.

Limitations. Designing R, G requires insight. Global reasoning still needed sometimes. Complex for highly concurrent code. Interference specifications manual. Automation challenging. Action granularity matters.

© 2026 Lingenic LLC