arXiv:2610.41202cs.PLOct 2026

Manuscript Offprint

arXiv:2610.41202

Iris on Indirection Theory: Lightweight Higher-order Ghost State

Darius Foo, Viet-Anh Nguyen, Wei-Ngan Chin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Today, semantic models of languages with concurrency and higher-order state are constructed using step-indexed predicates over resources and higher-order ghost state. There are two main lines of work for constructing such models. On the one hand, Iris provides these in full generality, at the cost of a large body of mechanised domain theory that is difficult to learn and port to new proof assistants. On the other hand, Indirection Theory is much simpler through the use of ordinary dependent types, but its foundation in separation algebra limits the expressiveness of its resource model compared to Iris-style higher-order ghost state. We resolve this conundrum by showing that Indirection Theory can be as expressive as Iris. To that end, we give a lightweight mechanisation of Indirection Theory in Lean, generalised so knots contain resources from an Iris-style resource algebra functor. We then reconstruct the Iris base logic on top of it. The advantage of this approach is in the elementary metatheory: a user can follow the whole construction without domain theory. We conduct two case studies to show that the base logic is expressive and faithful to Iris: a biorthogonal logical relation for higher-order state, and an Iris-style program logic with invariants and user-definable ghost state, complete enough to verify concurrent and higher-order programs.

Keywords: separation logic, step-indexing, indirection theory, higher-order ghost state, Iris, Lean

1 Introduction

In the semantics of programming languages, one often encounters definitions that are apparently circular, and hence not well-founded. Step-indexing breaks this circularity by stratifying the definitions by a natural number index.

For example, to define a (binary) logical relation for the untyped lambda calculus, we can state the relation on values V\mathcal{V} as follows (E\mathcal{E} is the relation on expressions).

Vn≜{(λx.e1,λx.e2)∣∀k<n.∀(v1,v2)∈Vk.(e1[v1/x],e2[v2/x])∈Ek}\begin{array}{r l}&{\mathcal{V}_{n}\triangleq\{(\lambda x.e_{1},\lambda x.e_{2})\mid\forall k<n.}\\ &{\quad\forall(v_{1},v_{2})\in\mathcal{V}_{k}.(e_{1}[v_{1}/x],e_{2}[v_{2}/x])\in\mathcal{E}_{k}\}}\end{array}

Having the recursive occurrences at k<nk<n makes the definition well-founded.

Despite its elegance and conceptual simplicity, explicit low-level index manipulation does not scale well, obscuring proofs with index arithmetic. Modern presentations thus hide indices behind modal logics [13, 6], which provide essential high-level facilities such as defining guarded recursive predicates, and reasoning by Löb induction. Lightweight implementations of these modal logics exist. In IxFree [26], for example, one can write the following definition instead, using the ▹\triangleright (later) modality.

V≜{(λx.e1,λx.e2)∣∀(v1,v2)∈▹V.(e1[v1/x],e2[v2/x])∈▹E}\begin{array}{r l}&{\mathcal{V}\triangleq\{(\lambda x.e_{1},\lambda x.e_{2})\mid}\\ &{\quad\forall(v_{1},v_{2})\in\triangleright\mathcal{V}.(e_{1}[v_{1}/x],e_{2}[v_{2}/x])\in\triangleright\mathcal{E}\}}\end{array}

For this calculus, the domain of step-indexed propositions that IxFree provides is sufficient. For more advanced language features such as state and concurrency, however, we would need a domain of propositions over heaps, and even defining one is a problem. A classic example of this occurs in a language with first-class locks [15], each guarding a resource invariant [25], a proposition describing the resources the lock protects. A naive model may be given as follows.

Heap≜Loc→finResRes≜Val∣LockHPropHProp≜Heap→Prop\begin{aligned}Heap&\triangleq Loc\rightarrow_{fin}Res\\ Res&\triangleq Val\mid Lock HProp\\ HProp&\triangleq Heap\rightarrow Prop\end{aligned}

There is a circularity in the semantic domains: unfolding Heap and HProp in Res gives

Res≜Val∣Lock((Loc→finRes)→Prop)Res\triangleq Val\mid Lock\left((Loc\rightarrow_{fin}Res)\rightarrow Prop\right)

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org. Conference acronym 'XX, Woodstock, NY

© 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM ISBN 978-1-4503-XXXX-X/2018/06

https://doi.org/XXXXXXX.XXXXXXX

where Res occurs negatively. This equation has no solution in the category of sets, and a proof assistant would reject it.

The problem of circular domain equations has been extensively studied, and has led to two main lines of work. The more well-known one is Iris [17], which solves the equations in the category of complete ordered families of equivalences (COFEs). The other is Indirection Theory, which uses “only

Foo et al.

simple, elementary mathematics” [16], i.e., ordinary dependent types, to construct a knot containing approximations of predicates.

Researchers building on these frameworks today face a tradeoff. Due to its maturity and generality, Iris is a large and complex framework, and working at its core demands deep expertise. The developers of PulseCore noted the requirement for “considerable expertise and effort in mechanized domain theory” [14] when considering a port to F★. A faithful port such as Iris-Lean [18, 12] is a similarly substantial development of about 60K lines of code. In contrast, Indirection Theory is substantially simpler (the original construction is only 400 LoC [16], though that is the core alone, without a base logic, ghost state or a program logic), and has been used successfully in the Verified Software Toolchain (VST) [3, 4] and more recently in PulseCore [14]. However, it is built on separation algebra, which restricts the model from having the full expressiveness of Iris’s higher-order ghost state: Indirection Theory-based VST “could express only limited higher-order ghost state”, motivating a reimplementation on top of Iris [24], and PulseCore implements “two primitive kinds of higher order ghost state: invariants and predicates”, relying on encodings for the others [14]. Whether these limitations are inherent or an artifact of these developments is unclear.

We show that the limitations are not inherent. To that end, we develop a lightweight mechanisation of Indirection Theory in Lean [11], generalised to carry resources from a resource algebra functor. It is lightweight in that the metatheory is elementary: a user can follow the whole construction without domain theory. We implement the Iris base logic on top of it, which is small yet expressive. The development is self-contained and compact, taking under 1,700 LoC.

To demonstrate that the base logic is faithful to Iris, we use it in two case studies: a biorthogonal logical relation for a heap-manipulating language, and a program logic for a concurrent, heap-manipulating one. The program logic is complete enough to verify concurrent and higher-order programs, as we show on several small examples.

In summary, we make the following contributions:

  • A lightweight implementation of Indirection Theory in Lean, generalised to support user-definable higher-order ghost state, thus making the construction of higher-order semantic models accessible to a wider audience and clarifying the connection to Iris’s machinery (§3)
  • A case study in direct use of the library: a biorthogonal logical relation for a language with higher-order state (§4)
  • A reconstruction of Iris-style higher-order ghost state, impredicative invariants, and weakest preconditions atop Indirection Theory, complete enough to verify concurrent and higher-order programs (§5)
P,Q::=Γϕ⊤∣P∧Q∣P∨Q∣P⇒Q∣∀x.P∣∃x.P∣P∗Q∣P⊸Q(separation)∣▹P∣t≡u(step−indexing)∣□P∣Own(a)∣⟺P(resources)\begin{array}{r l r}{P,Q::=}&{\Gamma\phi^{\top}\mid P\land Q\mid P\lor Q\mid P\Rightarrow Q}&{}\\ &{\mid\forall x.P\mid\exists x.P}&{}\\ &{\mid P*Q\mid P\multimap Q}&{\mathrm{(s e p a r a t i o n)}}\\ &{\mid\triangleright P\mid t\equiv u}&{\mathrm{(s t e p-i n d e x i n g)}}\\ &{\mid\Box P\mid O w n(a)\mid\Longleftrightarrow P}&{\mathrm{(r e s o u r c e s)}}\end{array}

Figure 1. The primitive connectives of the Iris base logic.

References (15)