Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

Formal Verification

14 missions · 9 completed

Missions

Open5Completed9All14
Mathematical LogicTheoretical Computer Science·Captain: mikedeng1

Compositional Shape Analysis by Means of Bi-Abduction 1: The Best Abductive Solution for Points-To Symbolic Heaps Is a Computable Disjunction of Symbolic HeapsResearch Paper

Motivation

Automatic verification of programs that manipulate pointers needs procedure specifications: preconditions saying which part of the heap a procedure touches and postconditions saying what it leaves behind. Writing them by hand does not scale to millions of lines of code. Calcagno, Distefano, O'Hearn and Yang (J. ACM 58(6), 2011) infer them compositionally with bi-abduction: when symbolic execution reaches a call whose precondition is not implied by the current state, it asks for the missing memory MMM that would make it hold. This abduction question in separation logic,

Δ∗M⊨H,\Delta * M \models H,Δ∗M⊨H,

is the engine behind the Abductor tool and, later, Facebook Infer.

The question has many solutions (M=falseM = \mathsf{false}M=false is always one), so its quality matters. The paper defines an order ≾\precsim≾ on solutions that prefers less memory and then logical strength, shows that a best solution always exists as a semantic object, and then asks whether it can be written down and computed in the language that the analysis actually manipulates: symbolic heaps. For the fragment whose only spatial predicate is points-to, it answers yes. That answer, Theorem 3.25, is the goal of this mission.

Setting

Values are natural numbers; 000 is nil and the nonzero naturals are the locations. A heap hhh is a finite partial map from locations to values; a stack sss assigns a value to every variable; a state is a pair (s,h)(s,h)(s,h). Write h=h0⊎h1h = h_0 \uplus h_1h=h0​⊎h1​ when h0,h1h_0,h_1h0​,h1​ have disjoint domains and hhh is their union. A predicate is an arbitrary set of states. On predicates:

  • s,h⊨F∗Gs,h \models F * Gs,h⊨F∗G iff h=h0⊎h1h = h_0 \uplus h_1h=h0​⊎h1​ with s,h0⊨Fs,h_0 \models Fs,h0​⊨F and s,h1⊨Gs,h_1 \models Gs,h1​⊨G;
  • s,h⊨F− ⁣ ⁣∗Gs,h \models F \mathbin{-\!\!*} Gs,h⊨F−∗G iff for every h′h'h′ disjoint from hhh with s,h′⊨Fs,h' \models Fs,h′⊨F, we have s,h⊎h′⊨Gs,h \uplus h' \models Gs,h⊎h′⊨G;
  • emp\mathsf{emp}emp holds in the empty heap, true\mathsf{true}true everywhere, and ¬\neg¬, ∨\vee∨, ∧\wedge∧, ∃X\exists X∃X, ∀X\forall X∀X are the Boolean and quantifier operations; F⊨GF \models GF⊨G is inclusion.

Symbolic heaps of the Points-to Instantiation. Expressions EEE are variables or natural-number constants. A pure formula Π\PiΠ is a conjunction of E=E′E = E'E=E′ and E≠E′E \neq E'E=E′. A spatial formula Σ\SigmaΣ is a ∗*∗-conjunction of points-to facts E↦E′E \mapsto E'E↦E′, possibly with ∗ true*\,\mathsf{true}∗true; here s,h⊨E↦E′s,h \models E \mapsto E's,h⊨E↦E′ iff [ ⁣[E] ⁣]s≠0[\![E]\!]s \neq 0[[E]]s=0 and hhh is the one-cell heap [ [ ⁣[E] ⁣]s↦[ ⁣[E′] ⁣]s ][\,[\![E]\!]s \mapsto [\![E']\!]s\,][[[E]]s↦[[E′]]s]. A symbolic heap is H=∃X⃗. Π∧ΣH = \exists \vec X.\, \Pi \wedge \SigmaH=∃X.Π∧Σ, and a disjunction D=H1∨⋯∨HnD = H_1 \vee \dots \vee H_nD=H1​∨⋯∨Hn​. In the abduction question (5), Δ∗D⊨H\Delta * D \models HΔ∗D⊨H, the left-hand side Δ=Π∧L1↦R1∗⋯∗Ln↦Rn\Delta = \Pi \wedge L_1 \mapsto R_1 * \dots * L_n \mapsto R_nΔ=Π∧L1​↦R1​∗⋯∗Ln​↦Rn​ is quantifier-free.

Orders. M≤M′M \le M'M≤M′ iff M′⊨M∗trueM' \models M * \mathsf{true}M′⊨M∗true (spatially smaller), and

M≾M′  ⟺  (M≤M′∧M′≰M)∨(M≤M′∧M′≤M∧M⊨M′).M \precsim M' \iff (M \le M' \wedge M' \not\le M) \vee (M \le M' \wedge M' \le M \wedge M \models M').M≾M′⟺(M≤M′∧M′≤M)∨(M≤M′∧M′≤M∧M⊨M′).

min⁡(F)\min(F)min(F) keeps the states of FFF no proper subheap of which (with the same stack) is in FFF. Elsewhere(F)=¬(F− ⁣ ⁣∗false)\mathrm{Elsewhere}(F) = \neg(F \mathbin{-\!\!*} \mathsf{false})Elsewhere(F)=¬(F−∗false) says that some separate heap satisfies FFF, and the compatible preorder is D≤cD′  ⟺  (D∧Elsewhere(Δ))≤(D′∧Elsewhere(Δ))D \le_c D' \iff (D \wedge \mathrm{Elsewhere}(\Delta)) \le (D' \wedge \mathrm{Elsewhere}(\Delta))D≤c​D′⟺(D∧Elsewhere(Δ))≤(D′∧Elsewhere(Δ)). Subtraction is F−G=F∧¬((¬emp)∗G)F - G = F \wedge \neg((\neg\mathsf{emp}) * G)F−G=F∧¬((¬emp)∗G).

Formalization targets

Goal: Theorem 3.25

There is a single algorithm fff such that for every quantifier-free Δ\DeltaΔ and symbolic heap HHH of the Points-to Instantiation, the disjunction D=f(Δ,H)D = f(\Delta, H)D=f(Δ,H) satisfies

Δ∗D⊨HandD≾M  for every predicate M with Δ∗M⊨H.\Delta * D \models H \quad\text{and}\quad D \precsim M \ \text{ for every predicate } M \text{ with } \Delta * M \models H.Δ∗D⊨HandD≾M  for every predicate M with Δ∗M⊨H.

Both halves are part of the goal: the best solution is expressible as a disjunction of symbolic heaps, and it is computable.

Milestones, in the order the paper's argument uses them

  1. Lemma 3.16. If DDD is a minimal solution w.r.t. ≤c\le_c≤c​, then min⁡(D∨¬Elsewhere(Δ))\min(D \vee \neg\mathrm{Elsewhere}(\Delta))min(D∨¬Elsewhere(Δ)) is the minimal solution w.r.t. ≾\precsim≾.
  2. Figure 2 derives solutions (§3.4.2). If Δ∗[D]▹H\Delta * [D] \triangleright HΔ∗[D]▹H is derivable, then Δ∗D⊨H\Delta * D \models HΔ∗D⊨H.
  3. Lemma 3.18. For all Δ,H\Delta, HΔ,H some DDD with Δ∗[D]▹H\Delta * [D] \triangleright HΔ∗[D]▹H is derivable, and the proof search terminates.
  4. Lemma 3.19. If Δ∗[D]▹H\Delta * [D] \triangleright HΔ∗[D]▹H is derivable and Δ∗F⊨H\Delta * F \models HΔ∗F⊨H, then D≤cFD \le_c FD≤c​F.
  5. Lemma 3.20. Incompat(Δ)\mathrm{Incompat}(\Delta)Incompat(Δ) and ¬Elsewhere(Δ)\neg\mathrm{Elsewhere}(\Delta)¬Elsewhere(Δ) are semantically equivalent.
  6. Lemma 3.23. Six algebraic properties of subtraction, including min⁡(F1∨⋯∨Fn)=G1∨⋯∨Gn\min(F_1 \vee \dots \vee F_n) = G_1 \vee \dots \vee G_nmin(F1​∨⋯∨Fn​)=G1​∨⋯∨Gn​ with Gi=((Fi−F1)⋯−Fn)G_i = ((F_i - F_1)\cdots - F_n)Gi​=((Fi​−F1​)⋯−Fn​).
  7. Quantifier removal for pure formulae (§3.4.4). ∃X.Π\exists X.\Pi∃X.Π is equivalent to a computable pure formula without XXX.
  8. Subtraction with quantifiers (§3.4.4). (∃X⃗.Δ)−(∃Y⃗.Δ′)(\exists\vec X.\Delta) - (\exists\vec Y.\Delta')(∃X.Δ)−(∃Y.Δ′) is a computable disjunction of symbolic heaps.

Significance

The result. Semantically the best solution is min⁡(Δ− ⁣ ⁣∗H)\min(\Delta \mathbin{-\!\!*} H)min(Δ−∗H) (Theorem 3.13 of the paper), a formula that nests − ⁣ ⁣∗-\!\!*−∗ and negation around ∗*∗, which no automatic separation-logic prover handles and which says nothing directly about the shape of the missing memory. Theorem 3.25 shows that in the points-to fragment this object collapses to a finite disjunction of symbolic heaps, the format in which an analysis draws "pictures of memory", and that it can be computed. It gives an optimal abduction procedure against which the paper's heuristic procedure can be measured.

Formalizing it. The theorem is proved in the paper, but several steps are given as sketches ("the proof of each of these properties is straightforward", "a straightforward exercise"), Lemma 3.18 has only a proof sketch, and the quantifier-free subtraction display on p. 33 is incomplete as printed (it inspects only the points-to facts and not the pure part of the subtracted heap). A machine-checked development would supply the missing arguments, fix the subtraction step, and give a verified reference implementation of optimal abduction for points-to symbolic heaps. No part of it is known to have been formalized.

Difficulty

The obvious route is to compute min⁡(Δ− ⁣ ⁣∗H)\min(\Delta \mathbin{-\!\!*} H)min(Δ−∗H) directly, but − ⁣ ⁣∗-\!\!*−∗ quantifies over all heaps, and symbolic heaps have no syntax for it. The paper splits the problem into three phases (a ≤c\le_c≤c​-minimal solution from a proof system, the incompatible solutions, and min⁡\minmin), and each phase carries its own difficulty. The proof system's minimality (Lemma 3.19) must hold against arbitrary semantic predicates, not only symbolic heaps, and it fails as soon as Δ\DeltaΔ may denote more than one heap for a given stack (the paper notes that adding list segments breaks it). Computing min⁡\minmin needs subtraction of symbolic heaps with quantifiers, which in turn needs quantifier elimination for Boolean combinations of equalities over an infinite domain, and the paper's quantifier-free subtraction step has to be repaired. Showing that the final disjunction is ≾\precsim≾-least, not merely a solution, needs all three phases.

Formalization scope

All statements live in the namespace BiAbduction.Systematic. Values are ℕ with nil 0, locations are the nonzero naturals, variables are ℕ (program and logical variables form one sort), and heaps are maps ℕ → Option ℕ with 0 unallocated and finite domain. Finiteness of heaps is essential, since min⁡\minmin relies on well-foundedness of the subheap order. Predicates are arbitrary Set (Stack × Heap). The syntax is built from ℕ, Bool, Sum, Prod and List by abbreviations, so "computed by an algorithm" is Mathlib's Computable₂ with the standard Primcodable encodings. The left-hand side Δ\DeltaΔ has no true conjunct, as in the paper's proofs; the right-hand side may have one. Figure 2 is an inductive relation in which psto may match any right-hand points-to fact. The soundness and ≤c\le_c≤c​-minimality statements assume the paper's bound-variable convention (no variable bound in HHH occurs in Δ\DeltaΔ); the goal does not need it.

The goal cannot be met by a degenerate reading. The competitors MMM range over all predicates, not only over disjunctions, and computability refers to fixed standard encodings. The points-to semantics excludes nil addresses, and heaps are finite.

A complete development needs the separation-logic algebra of predicates (associativity and commutativity of ∗*∗, the adjunction between ∗*∗ and − ⁣ ⁣∗-\!\!*−∗), properties of min⁡\minmin under finite heaps, the soundness and minimality of the proof system, quantifier elimination for equality logic, and a computability argument for list-manipulating procedures. The semantic layer and the quantifier-elimination result are reusable beyond this mission. Contributions to any milestone, and to the supporting lemmas of §3.3 (Lemmas 3.10–3.11, Theorem 3.13), are welcome.

Theorem numbers and page references are those of the accepted manuscript of the J. ACM article (72 pages), not of the typeset journal version.

Selected references

  • C. Calcagno, D. Distefano, P. W. O'Hearn, H. Yang, Compositional Shape Analysis by means of Bi-Abduction, Journal of the ACM 58(6), Article 26, 2011. https://doi.org/10.1145/2049697.2049700
  • C. Calcagno, D. Distefano, P. W. O'Hearn, H. Yang, Compositional Shape Analysis by means of Bi-Abduction, POPL 2009. https://doi.org/10.1145/1480881.1480917
  • J. Berdine, C. Calcagno, P. W. O'Hearn, Symbolic Execution with Separation Logic, APLAS 2005. https://doi.org/10.1007/11575467_5
  • J. C. Reynolds, Separation Logic: A Logic for Shared Mutable Data Structures, LICS 2002. https://doi.org/10.1109/LICS.2002.1029817
  • D. Pym, P. W. O'Hearn, H. Yang, Possible Worlds and Resources: The Semantics of BI, Theoretical Computer Science 315(1), 2004. https://doi.org/10.1016/j.tcs.2003.11.020
13 thms2 active usersReviewed
Theoretical Computer ScienceTheory of Computation·Captain: mikedeng1

Multiparty Asynchronous Session Types 3: Progress — Every Reduct of a Simple, Well-Linked Typed Program Is ≡ 0 or Reduces FurtherResearch Paper

Motivation

Distributed programs often establish a conversation among several participants, then exchange messages without waiting for each send to be received. A specification of each participant in isolation does not by itself say whether their actions will fit together. Multiparty asynchronous session types address this by describing the intended conversation once as a global type and checking each participant against a projected local type. Honda, Yoshida and Carbone develop this calculus and state a progress result for a restricted class of well-typed programs: if execution has not finished, another reduction is available. The restriction matters because independently initiated sessions can interfere and deadlock even when their communications are individually typed. Honda, Yoshida and Carbone (2016)

Setting

A program is a process before execution: it contains no message queues or restricted session channels, even after structural rearrangement, and it has no free session channels or process variables. A requester on a shared name aaa starts a session with participants numbered 222 through nnn. Each participant receives the same vector s~\widetilde ss of fresh session channels. An asynchronous send appends a message to the appropriate FIFO queue; a receive reads the queue head. Requests, sends, delegations and selections are emitting prefixes. Accepts, receives and branches are receiving prefixes. The reduction relation P⟶QP\longrightarrow QP⟶Q includes these communications, conditionals, guarded declaration unfolding, and closure under parallel composition, restriction and structural congruence ≡\equiv≡. Honda, Yoshida and Carbone (2016), Figs. 1–3 and Def. 2.1

A global type GGG specifies which numbered role sends a value or choice to another role on channel index kkk, followed by the remainder of the conversation. It may also contain parallel components and guarded recursion. A partial projection G↾pG\upharpoonright pG↾p gives role ppp its endpoint type. Global types must be linear: causally ordered actions on a common channel have both input and output dependency chains. A global type is coherent when it is linear and projects to all its participants; the runtime typing Δ\DeltaΔ is coherent when each session family comes from such a global type. Honda, Yoshida and Carbone (2016), Defs. 3.12, 4.1–4.2 and 5.9

The runtime judgement Γ⊢P▹s~Δ\Gamma\vdash P\triangleright_{\widetilde s}\DeltaΓ⊢P▹s​Δ records the types of the process and the queue channels it mentions. Type contexts remember messages already in transit and compose with endpoint types. A process is queue-full when the channels in s~\widetilde ss equal the channels occurring in Δ\DeltaΔ. A prefix is active when it is outside another prefix and outside either branch of a conditional, after permitted declaration unfolding. A process is well-linked when every reachable process has each active shared-name prefix in a redex. A process is simple when it has a typing derivation whose session environments obey the singleton and emptiness restrictions of Definition 5.25, with no delegation input or output rule. Honda, Yoshida and Carbone (2016), pp. 28–37

Formalization targets

The goal is Corollary 5.30. For every simple, well-linked program PPP whose free names have shared sorts, and every reachable process P′P'P′,

P⟶∗P′⟹P′≡0 ∨ ∃P′′  P′⟶P′′.P\longrightarrow^*P'\quad\Longrightarrow\quad P'\equiv 0\ \lor\ \exists P''\;P'\longrightarrow P''.P⟶∗P′⟹P′≡0 ∨ ∃P′′P′⟶P′′.

Here 000 is inaction, and P′≡0P'\equiv 0P′≡0 includes completed sessions whose empty queues disappear by structural congruence. The milestones are the closed-typing preservation clause of Theorem 5.19(3), the linearity and message agreement clauses of Theorem 5.22, and the immediate-step claim of Proposition 5.29(1). Those are statements of the paper and give separate targets before the progress corollary. Honda, Yoshida and Carbone (2016), pp. 34–37

Significance

For the specified class of programs, progress excludes a reachable state that is neither finished nor reducible. It combines static endpoint information with the operational facts about queues and shared-name synchronisation. The communication-safety milestone also states that a value receive is paired with a value message of matching arity, channel reception with a channel vector of matching length, and branching with an offered label. These claims describe behavior of the paper's asynchronous multiparty calculus, rather than a property of a particular implementation. Honda, Yoshida and Carbone (2016), Theorem 5.22 and Corollary 5.30

The paper supplies mathematical proofs, but this mission's statements have no completed machine-checked proofs. Formalizing the result requires a precise account of the calculus, including queue messages, scope, recursive calls, type contexts, projection and the limited form of simplicity. The definitions can support later work on subject reduction and session fidelity in the same model. A contribution may prove any milestone or the goal, or improve the shared definitions while preserving the source's hypotheses and conclusions.

Difficulty

Typing each participant does not immediately give a reduction of their parallel composition. A send can be present while a receive is blocked by an earlier queue message, and a session initiation can be blocked by a shared-name prefix in a different session. Communication safety must relate active prefixes to a unique queue and its actual head message. Progress additionally needs the restrictions on derivations and shared-name links to rule out interference among sessions. The rules for structural congruence and declaration unfolding make the location of a redex depend on more than the outer syntactic constructor. Honda, Yoshida and Carbone (2016), §§5.4–5.5

Formalization scope

Lean uses natural numbers for role identifiers, shared names, channels, labels and process variables. Channel indices are one based, following s[1..m]s[1..m]s[1..m]. A global type, value sort and endpoint type are separate syntax classes; finite branch families are lists with nonempty, distinct labels where a well-formed type is required. Recursion is read equi-recursively by an endpoint bisimulation, and global-type linearity is checked on every finite unfolding. Projection returns an optional endpoint type so undefined projections cannot acquire a default value. The session typings are finite maps represented by association lists, with distinct roles and disjoint channel domains. The judgement's subscript s~\widetilde ss lists queue channels, while the domain of Δ\DeltaΔ lists all sessions under typing.

The formalization uses named process binders and a structural-congruence relation containing alpha conversion. Received-value and call substitution is capture avoiding under explicit freshness conditions. Expression evaluation is fixed to the ordinary Boolean connectives used in the paper's typing rules. Runtime typing includes the queue rules and the partial composition of type contexts. The restricted typing system for simplicity retains runtime queue rules and excludes both delegation directions. The paper prints “[RCV]” in Definition 5.25(2), but its appendix explicitly excludes “[SREC]”; this draft follows the appendix and records that reading in its audit notes. The result quantifies over actual programs and makes simplicity imply typability, so a free, blocked input or an untyped syntax check cannot satisfy the goal. Honda, Yoshida and Carbone (2016), Def. 5.25 and Appendix B.8

Every prefix rule acts on a singleton entry s~:T@p\widetilde s:T@ps:T@p (Notation 4.5); process-variable signatures carry one singleton entry per session vector, as in [VAR]; [SREC] receives the channel names it binds, without substitution (Remark 2.2). Proposition 5.29(1) and Corollary 5.30 are false as printed for open terms: a free name of sort bool used as a conditional guard, or a free process variable, is a stuck simple process. The formal statements therefore add that the free names of the process have shared sorts and, for Proposition 5.29(1), that it has no free process variables (a program has none by definition).

The development needs Mathlib's finite sets, lists and reflexive-transitive closure, plus its own definitions of the process calculus and typing judgements. The Lean declarations in this proposal are draft statements and definitions for review; they are not proofs of the paper's results.

Selected references

  • Kohei Honda, Nobuko Yoshida and Marco Carbone, Multiparty Asynchronous Session Types, Journal of the ACM 63(1), Article 9, 2016. DOI 10.1145/2827695
12 thms1 active userReviewed
Theoretical Computer ScienceTheory of Computation·Captain: mikedeng1

Multiparty Asynchronous Session Types 1: A Global Type's One-Time Unfolding Is Linear iff Its n-th Unfolding Is Linear, for Every n ≥ 1Research Paper

Motivation

Multiparty communication protocols involve several participants who send messages over shared session channels. An implementation may send a later message before an earlier one has been received, so a written sequence of interactions does not by itself prevent a receiver from taking the wrong message. Honda, Yoshida, and Carbone use global types to specify the whole conversation and a linearity condition to rule out conflicting uses of a channel. Their condition is part of the type system that supports subject reduction and session fidelity in the same paper. Honda, Yoshida, and Carbone, 2016

Global types can contain recursion. Reading their full behaviour as a regular tree may therefore involve infinitely many copies of the same interaction. Proposition 3.13(1) says that checking just one finite unfolding suffices to determine whether every later finite unfolding satisfies the paper's linearity condition. This mission formalizes that proposition and the definitions on which its statement depends. Honda, Yoshida, and Carbone, 2016, §3.5 and Appendix A

Setting

A global type GGG describes actions among roles p,qp,qp,q on channels identified by positive indices kkk. Its constructors are a value communication p→q:k⟨U⟩.G′p\to q:k\langle U\rangle.G'p→q:k⟨U⟩.G′, a labelled branch p→q:k{ℓj:Gj}j∈Jp\to q:k\{\ell_j:G_j\}_{j\in J}p→q:k{ℓj​:Gj​}j∈J​, parallel composition G1∣G2G_1\mid G_2G1​∣G2​, recursion μt.G′\mu t.G'μt.G′, a recursion variable ttt, and termination end\mathrm{end}end. The carried value type UUU may contain shared names whose sorts include another global type, or it may be a located end-point type. The formal syntax represents end-point sends, receives, selections, branches, recursion, variables, and termination because shared global types can occur within the sorts carried by those types. Honda, Yoshida, and Carbone, 2016, Figs. 4 and 6

An action node is an occurrence of a communication or branching action in the tree of a finite unfolding. Each node has a sender, receiver, and channel index. The action order n1≺n2n_1\prec n_2n1​≺n2​ holds when one action lies before another in the same continuation or branch, according to Definition 3.7. Actions in different branches or parallel components have no order solely because they appear next to each other in the syntax. Honda, Yoshida, and Carbone, 2016, pp. 15–16

The paper refines that order into three dependency relations. An II step matches receivers; an IO step connects a receiver to a later sender; and an OO step matches both sender and channel. An input dependency is a chain of IO steps ending in II. An output dependency is a nonempty chain of OO or IO steps. A finite type is linear when every ordered pair of actions on the same channel has both dependencies, including the corresponding condition on the global types carried within its values. The last II step matters because a chain ending at an output has not checked the ordering of the final input. Honda, Yoshida, and Carbone, 2016, Defs. 3.11–3.12

Write G(n)G^{(n)}G(n) for the finite result of unfolding every recursion in GGG nnn times and replacing remaining recursion variables by end\mathrm{end}end. For a single recursion G=μt.HG=\mu t.HG=μt.H, the paper gives G(0)=H[end/t]G^{(0)}=H[\mathrm{end}/t]G(0)=H[end/t] and G(n+1)=H[G(n)/t]G^{(n+1)}=H[G^{(n)}/t]G(n+1)=H[G(n)/t]. Unfolding does not enter carried types. The one-time unfolding is G(1)G^{(1)}G(1). Honda, Yoshida, and Carbone, 2016, p. 20 and Notation A.1

Formalization targets

The milestone is the direction the paper calls the “if-direction”: for a well-formed global type and a positive unfolding index, linearity at that index implies linearity at the first one.

WellFormed⁡(G) ∧ n≥1 ∧ Linear⁡(G(n))⟹Linear⁡(G(1)).\operatorname{WellFormed}(G)\ \land\ n\ge 1\ \land\ \operatorname{Linear}(G^{(n)}) \quad\Longrightarrow\quad \operatorname{Linear}(G^{(1)}).WellFormed(G) ∧ n≥1 ∧ Linear(G(n))⟹Linear(G(1)).

The mission goal is Proposition 3.13(1), the equivalence between the first unfolding and any positive unfolding.

∀G well formed ∀n≥1,Linear⁡(G(1))⟺Linear⁡(G(n)).\forall G\text{ well formed}\,\forall n\ge 1,\qquad \operatorname{Linear}(G^{(1)}) \quad\Longleftrightarrow\quad \operatorname{Linear}(G^{(n)}).∀G well formed∀n≥1,Linear(G(1))⟺Linear(G(n)).

The lower bound n≥1n\ge1n≥1 is essential. The paper explicitly begins its Appendix A induction at n=1n=1n=1 and gives examples that satisfy linearity at the zeroth unfolding but fail after one unfolding. Proposition 3.13(2), the paper's decidability claim, is outside this mission: formalizing computational decidability would require an effective representation and decision procedure rather than a classical Decidable instance. Honda, Yoshida, and Carbone, 2016, p. 20 and Appendix A

Significance

The proposition turns a property stated over arbitrarily deep recursive behaviour into a fixed finite test. It supports the paper's decidability result and supplies the channel-ordering premise used later in coherent global types and runtime typing. Without the stabilization claim, checking a recursive global type by inspecting one finite copy would leave later channel conflicts unresolved. Honda, Yoshida, and Carbone, 2016, Props. 3.13–3.14 and Def. 4.2

The result is already proved in the paper. The formalization work is to give the paper's finite unfolding, action order, dependency chains, and recursive carried-type condition exact Lean meanings, then verify the equivalence against those meanings. The local mission currently contains open theorem statements and compiled definitions; it does not claim a machine-checked proof of Proposition 3.13(1). Those definitions can also be reused when formalizing the paper's coherence and subject-reduction results.

Difficulty

The main obstacle is the interaction between recursion and causality. Unfolding creates further occurrences of actions, while an input dependency requires a chain with a specific final II edge and an output dependency allows only OO or IO edges. The action order also depends on a node's place in a branch, continuation, or parallel component. Merely comparing channel labels across two unfoldings does not establish the required dependencies. The carried-type condition adds another level: unfolding the outer type leaves its carried types intact, but their own linearity must still be checked. Honda, Yoshida, and Carbone, 2016, Defs. 3.7, 3.11–3.12 and Appendix A

Formalization scope

Lean represents roles, labels, type variables, and channel indices by natural numbers, with channel indices interpreted as one-based. Branches are lists; WellFormed G records nonempty branches with distinct labels, closed guarded recursion, positive channel indices, and distinct sender and receiver, also checking carried global types. Both theorem statements assume it to make the paper's standing syntax conventions explicit. The sort grammar includes Boolean and natural-number sorts, shared-name sorts, and coded additional base sorts for the paper's ellipsis. The recursion constructor is named mu and the sort type SType because rec and Sort have special meanings in Lean.

Node names are finite child-index paths. Prec is the transitive closure of the five clauses of Definition 3.7. Every II, IO, or OO step includes this order. Input dependency requires at least one step, resolving the printed n≥0n\ge0n≥0 against the same sentence's mandatory final II step. Carried types are reached through value and end-point type syntax, and nested carriers are included transitively. Linear checks each such carried type at every finite unfolding. The definitions also encode the paper's positive-index and non-reflexive interaction conventions in WellFormed. A linearity predicate that ignores carried types or treats separate parallel components as ordered would change the target theorem. Honda, Yoshida, and Carbone, 2016, pp. 12–13, 16, 19–20

Useful contributions include results about finite unfolding and the action order, preservation of labels at recurring positions, and dependency-chain properties under unfolding. The two folding claims in Appendix A are not listed as milestones here because a faithful folding operation for nested recursion and multiple occurrences has not yet been specified. Their absence is a scope limit on the attack path, not an assumption in the goal.

Selected references

  • Kohei Honda, Nobuko Yoshida, and Marco Carbone, Multiparty Asynchronous Session Types, Journal of the ACM 63(1), Article 9, 2016. DOI: 10.1145/2827695.
4 thms1 active userReviewed
Mathematical LogicTheory of Computation·Captain: mikedeng1

Monitoring Metric First-Order Temporal Properties: The Monitor M_Φ Outputs Exactly the Violations (¬Φ)^(D̄,τ̄,i) of a Bounded MFOTL Formula Φ, as Regular Sets, at Every Time Point iResearch Paper

Motivation

Runtime monitoring checks a running system against a specification by inspecting its trace of events as it is produced. Policies on data, such as "every published report was approved within the last 10 days" or "each value stored in in reaches out within 5 time units", quantify over data values and constrain the time between events. Metric first-order temporal logic (MFOTL) expresses such policies: it extends first-order logic with past and future temporal operators that carry intervals of allowed time differences.

Basin, Klaedtke, Müller and Zălinescu (J. ACM 62(2), Article 15, 2015) give a monitor for MFOTL properties □Φ\square\Phi□Φ with Φ\PhiΦ bounded. It allows negation and quantification over the infinite domain N\mathbb NN without restriction, because every relation it manipulates is represented by a finite automaton: the input structures are automatic structures. The paper implements it in the prototype tool MonPoly-Reg (§6). Its correctness rests on Theorem 3.9: the monitor reports exactly the violations of Φ\PhiΦ, at every time point.

Setting

A signature S=(C,R,ι)S=(C,R,\iota)S=(C,R,ι) has finitely many constants and predicates with arities. Formulas are built from t≈t′t\approx t't≈t′ and r(t1,…,tι(r))r(t_1,\dots,t_{\iota(r)})r(t1​,…,tι(r)​) by ¬\neg¬, ∨\vee∨, ∃x\exists x∃x and the temporal operators ∙I\bullet_I∙I​ (previous), ∘I\circ_I∘I​ (next), SI\mathsf S_ISI​ (since) and UI\mathsf U_IUI​ (until), where I=[b,b′)I=[b,b')I=[b,b′) is a nonempty interval of N\mathbb NN with b′∈N∪{∞}b'\in\mathbb N\cup\{\infty\}b′∈N∪{∞}. A formula is bounded if every UI\mathsf U_IUI​ in it has b′<∞b'<\inftyb′<∞.

A temporal structure (Dˉ,τˉ)(\bar{\mathcal D},\bar\tau)(Dˉ,τˉ) assigns to each time point i∈Ni\in\mathbb Ni∈N relations rDi⊆Nι(r)r^{\mathcal D_i}\subseteq\mathbb N^{\iota(r)}rDi​⊆Nι(r) and a time stamp τi∈N\tau_i\in\mathbb Nτi​∈N; constants are rigid, τ0≤τ1≤⋯\tau_0\le\tau_1\le\cdotsτ0​≤τ1​≤⋯, and τˉ\bar\tauτˉ exceeds every bound. Satisfaction (Dˉ,τˉ,v,i)⊨φ(\bar{\mathcal D},\bar\tau,v,i)\models\varphi(Dˉ,τˉ,v,i)⊨φ is Definition 2.2; for example ψ UI ψ′\psi\,\mathsf U_I\,\psi'ψUI​ψ′ holds at iii if ψ′\psi'ψ′ holds at some j≥ij\ge ij≥i with τj−τi∈I\tau_j-\tau_i\in Iτj​−τi​∈I and ψ\psiψ holds at all k∈[i,j)k\in[i,j)k∈[i,j). For φ\varphiφ with free variables x1<⋯<xnx_1<\dots<x_nx1​<⋯<xn​, the satisfying set is

φ(Dˉ,τˉ,i)={dˉ∈Nn∣(Dˉ,τˉ,v[xˉ↦dˉ],i)⊨φ for some v}.\varphi^{(\bar{\mathcal D},\bar\tau,i)}=\{\bar d\in\mathbb N^n\mid(\bar{\mathcal D},\bar\tau,v[\bar x\mapsto\bar d],i)\models\varphi\ \text{for some }v\}.φ(Dˉ,τˉ,i)={dˉ∈Nn∣(Dˉ,τˉ,v[xˉ↦dˉ],i)⊨φ for some v}.

A domain representation is a regular language L\mathcal LL over a finite alphabet with a surjection ν:L→N\nu:\mathcal L\to\mathbb Nν:L→N whose equality relation is regular. A relation A⊆NkA\subseteq\mathbb N^kA⊆Nk is regular if the words u1⊗⋯⊗uku_1\otimes\cdots\otimes u_ku1​⊗⋯⊗uk​ (the letter-by-letter convolution, padded with #\##) with (ν(u1),…,ν(uk))∈A(\nu(u_1),\dots,\nu(u_k))\in A(ν(u1​),…,ν(uk​))∈A form a regular language.

The monitor MΦ\mathsf M_\PhiMΦ​ (Fig. 2) reads (D0,τ0),(D1,τ1),…(\mathcal D_0,\tau_0),(\mathcal D_1,\tau_1),\dots(D0​,τ0​),(D1​,τ1​),… one element per loop iteration. It extends each Dj\mathcal D_jDj​ to D^j\hat{\mathcal D}_jD^j​ with auxiliary relations pαp_\alphapα​ (and rαr_\alpharα​, sαs_\alphasα​ for since and until) for every temporal subformula α\alphaα, built incrementally by the constructions of §3.4 once a list QQQ of pending triples (α,j,S)(\alpha,j,S)(α,j,S) says that enough of the future has been read. When D^i\hat{\mathcal D}_iD^i​ is complete it outputs the set (¬Φ^)D^i(\neg\hat\Phi)^{\hat{\mathcal D}_i}(¬Φ^)D^i​ with τi\tau_iτi​, where Φ^\hat\PhiΦ^ is Φ\PhiΦ with each top-level temporal subformula α\alphaα replaced by the atom pα(xˉ)p_\alpha(\bar x)pα​(xˉ).

Formalization targets

Goal: Theorem 3.9

For every input satisfying the restrictions of §3.1 and every bounded Φ\PhiΦ:

(i)(n,O,t) output by line 9 ⟹ O=(¬Φ)(Dˉ,τˉ,n), O regular, t=τn;\text{(i)}\quad (n,O,t)\ \text{output by line 9}\ \Longrightarrow\ O=(\neg\Phi)^{(\bar{\mathcal D},\bar\tau,n)},\ O\ \text{regular},\ t=\tau_n;(i)(n,O,t) output by line 9 ⟹ O=(¬Φ)(Dˉ,τˉ,n), O regular, t=τn​; (ii)∀n∈N,n=0 or some output at index n−1 occurs,\text{(ii)}\quad \forall n\in\mathbb N,\quad n=0\ \text{or some output at index }n-1\text{ occurs},(ii)∀n∈N,n=0 or some output at index n−1 occurs,

where each output is followed by line 11 setting iii to the next index. This records counter values reached inside the while loop, including values that may never appear at a loop entry. Part (ii) excludes the vacuous reading of (i).

Milestones

  1. Lemma 3.4: φ^D^i=φ(Dˉ,τˉ,i)\hat\varphi^{\hat{\mathcal D}_i}=\varphi^{(\bar{\mathcal D},\bar\tau,i)}φ^​D^i​=φ(Dˉ,τˉ,i) once the auxiliary relations of tsub(φ)\mathit{tsub}(\varphi)tsub(φ) are correct, and regularity is preserved.
  2. Lemmas 3.5–3.8: the constructions for ∙I\bullet_I∙I​, ∘I\circ_I∘I​, SI\mathsf S_ISI​ and bounded UI\mathsf U_IUI​ produce regular relations equal to the satisfying sets, with the stated characterizations of rαr_\alpharα​ and sαs_\alphasα​.
  3. Observations (1)–(3) of the proof of Theorem 3.9 on the list QQQ and the counter iii.
  4. The claim that line 7 can always be executed, in the form: if (α,j,∅)∈Qk(\alpha,j,\emptyset)\in Q_k(α,j,∅)∈Qk​ then the build stores pαD^j=α(Dˉ,τˉ,j)p_\alpha^{\hat{\mathcal D}_j}=\alpha^{(\bar{\mathcal D},\bar\tau,j)}pαD^j​​=α(Dˉ,τˉ,j), which is regular.

Significance

Theorem 3.9 makes MΦ\mathsf M_\PhiMΦ​ a sound and complete monitor for the safety fragment □Φ\square\Phi□Φ, Φ\PhiΦ bounded: every violation at every time point is reported, nothing else is, and every output is a finitely represented (regular) set even though it may be infinite. It covers unrestricted negation and quantification, which finite-relation monitors (§4 of the paper) cannot handle. The incremental constructions of §3.4 are the template reused by later MFOTL monitors.

The paper gives a mathematical proof of its monitor's correctness. This mission asks for a Lean proof that checks the MFOTL semantics, automatic relations over N\mathbb NN, and the correctness of this particular monitor, including the until construction whose printed version is defective (see Formalization scope).

Difficulty

Two parts are hard. The regularity claims need the fundamental property of automatic structures: first-order definable relations are regular, which requires closure of padded convolution languages under Boolean operations, cylindrification, permutation of tracks and projection, the last with removal of trailing padding. The arithmetic constraints of the since and until constructions additionally need successor and offset relations definable from ≺\prec≺.

The scheduling argument is the other part. Correctness of a build at (α,j)(\alpha,j)(α,j) requires that every input relation, at time points up to j+ℓjj+\ell_jj+ℓj​ for until, was built before and not discarded since. Following only the syntax of α\alphaα does not settle this: a needed relation for a subformula at a later time point may be built in the same iteration as α\alphaα's.

Formalization scope

The domain is N\mathbb NN, as §3.1 assumes. Relations are sets of lists of natural numbers, ordered by the sorted free variables. Interval upper bounds are in N∞\mathbb N_\inftyN∞​; intervals carry the proof that they are nonempty. The representation (L,ν)(\mathcal L,\nu)(L,ν) is a single parameter shared by the hypothesis "every rDir^{\mathcal D_i}rDi​ is regular" and the regularity claims of the conclusions; it is never chosen existentially. The binary predicate ≺\prec≺ interpreted as <<< is a hypothesis.

Two hypotheses on Φ\PhiΦ besides boundedness are the paper's own "without loss of generality" assumptions: each temporal subformula occurs once in Φ\PhiΦ (§3.6), and the direct subformulas of each SI\mathsf S_ISI​, UI\mathsf U_IUI​ subformula have the same free variables (§3.4; achieved by padding with x≈xx\approx xx≈x, as in §3.5). No other restriction is placed on Φ\PhiΦ.

The printed until construction (§3.4.4) is repaired: the guard of UrU_rUr​ is "aˉ∈β^D^i+k\bar a\in\hat\beta^{\hat{\mathcal D}_{i+k}}aˉ∈β^​D^i+k​ for all ℓi−1≤k≤ℓi\ell_{i-1}\le k\le\ell_iℓi−1​≤k≤ℓi​", since the printed guard empties rαr_\alpharα​ in the paper's own example of §3.5; UsU_sUs​ keeps only tuples with j′≥1j'\ge1j′≥1, since otherwise a γ\gammaγ-witness at time point i−1i-1i−1 survives to time point iii when τi=τi−1\tau_i=\tau_{i-1}τi​=τi−1​; and time-stamp equations are encoded additively. Lemma 3.8(i) reads aˉ∈Nn\bar a\in\mathbb N^naˉ∈Nn and adds j≤ℓij\le\ell_ij≤ℓi​. "Effectively computable" in Theorem 3.9(i) is not formalized. Part (ii) uses the output at index n−1n-1n−1 as the record of the line-11 increment to nnn; for n=0n=0n=0, the counter is initialized by line 2. Loop-entry states alone can skip counter values reached within one iteration.

The monitor is a state machine whose builds and outputs are computed only from its store of relations; it never consults the satisfaction relation or satisfying sets. A formalization in which line 7 reads the semantics would turn Theorem 3.9(i) into a restatement of Lemma 3.4, and is ruled out. A build whose input is missing stores nothing, so a monitor that silently fails would violate (ii).

Contributions welcome: the theory of automatic relations (reusable beyond this mission), the semantic halves of Lemmas 3.4–3.8, and the scheduling invariants.

Selected references

  • D. Basin, F. Klaedtke, S. Müller, E. Zălinescu, Monitoring metric first-order temporal properties, J. ACM 62(2), Article 15, 2015. https://doi.org/10.1145/2699444
14 thms1 active userReviewed
CombinatoricsDynamical Systems·Captain: Rizwan G Mir

Bound L4: 33,070,982 <= R Reversible Binary 2D Moore RulesOpen Problem

Bound L4L_4L4​: 33,070,982≤R33,070,982 \le R33,070,982≤R

This mission formalizes the lower bound 33,070,982≤R33,070,982 \le R33,070,982≤R on the number of reversible binary cellular automata on the 3×33 \times 33×3 Moore neighborhood. Extending the conserved-landscape marker families to both centered and off-centered rules.

1 thm1 active userReviewed

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me