Skip to main content
QUICK REVIEW

[Paper Review] A Recipe for State-and-Effect Triangles

Bart Jacobs|arXiv (Cornell University)|Mar 27, 2017
Logic, programming, and type systemsComputer Science10 references5 citations
TL;DR

This paper presents a systematic categorical method for constructing state-and-effect triangles—diagrams unifying state transformers, predicate transformers, and computations—by leveraging Jon Beck's monadicity theorem. It shows that such triangles naturally arise from adjunctions via dualizing objects like 2, 3, or [0,1], providing a unified framework for modeling deterministic, probabilistic, and quantitative program semantics across diverse mathematical structures.

ABSTRACT

In the semantics of programming languages one can view programs as state transformers, or as predicate transformers. Recently the author has introduced state-and-effect triangles which capture this situation categorically, involving an adjunction between state- and predicate-transformers. The current paper exploits a classical result in category theory, part of Jon Beck's monadicity theorem, to systematically construct such a state-and-effect triangle from an adjunction. The power of this construction is illustrated in many examples, covering many monads occurring in program semantics, including (probabilistic) power domains.

Motivation & Objective

  • To provide a systematic, category-theoretic construction of state-and-effect triangles from adjunctions, generalizing existing semantic models.
  • To unify the duality between state-based and logic-based program semantics (Heisenberg vs. Schrödinger views) in a categorical framework.
  • To demonstrate the broad applicability of the construction across Boolean, three-valued, and probabilistic (quantitative) settings via dualizing objects.
  • To clarify the role of monads and Eilenberg-Moore categories in modeling state spaces and effect modules in program semantics.
  • To offer a new perspective on Beck’s monadicity theorem by organizing it to yield state-and-effect triangles as a natural outcome.

Proposed method

  • The construction begins with an adjunction between categories, using a dualizing object (e.g., 2, 3, or [0,1]) to generate a state-and-effect triangle via hom-functors.
  • The upper adjunction in the triangle arises from the adjunction between the base category and the dualizing object, forming a duality between predicates and states.
  • The state transformer functor (Stat) maps to the Eilenberg-Moore category of the induced monad, capturing algebraic state spaces.
  • The predicate transformer functor (Pred) operates in the opposite direction, mapping to the opposite of the logic category, reflecting weakest precondition semantics.
  • The Kleisli category of the monad captures the computational morphisms, with sequential composition corresponding to program composition.
  • The construction ensures the two triangles in the diagram commute, enforcing consistency between state, predicate, and computation semantics.

Experimental results

Research questions

  • RQ1How can state-and-effect triangles be systematically generated from adjunctions in category theory?
  • RQ2What role does the choice of dualizing object (e.g., 2, 3, [0,1]) play in generating different semantic models?
  • RQ3In what way does Beck’s monadicity theorem enable the construction of state-and-effect triangles?
  • RQ4How do the resulting triangles unify state-based and logic-based program semantics across different computational models?
  • RQ5What mathematical structures (e.g., Boolean algebras, C*-algebras, compact Hausdorff spaces) can be captured by this construction?

Key findings

  • The construction yields a canonical state-and-effect triangle from any adjunction, with the dualizing object determining the nature of the semantics.
  • For the dualizing object 2, the method recovers classical Boolean semantics, including standard weakest precondition logic.
  • For the dualizing object [0,1], the method generates probabilistic semantics, modeling quantitative predicates and valuations.
  • The use of 3 as a dualizing object yields Plotkin-style three-valued semantics, useful for partial or non-deterministic computation.
  • The induced monad captures the computational essence, with its Eilenberg-Moore category modeling state spaces and its Kleisli category modeling computations.
  • The framework unifies diverse models—from power domains to C*-algebras—under a single categorical recipe, demonstrating broad applicability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.