Skip to content

safety proof of EWD687a#215

Merged
muenchnerkindl merged 2 commits into
masterfrom
ewd687a
Jul 21, 2026
Merged

safety proof of EWD687a#215
muenchnerkindl merged 2 commits into
masterfrom
ewd687a

Conversation

@muenchnerkindl

Copy link
Copy Markdown
Collaborator

Updated EWD687a according to the changes in the Graphs community module, and contributed a proof of the safety property of the algorithm.

Signed-off-by: Stephan Merz <stephan.merz@loria.fr>
Comment thread specifications/ewd687a/EWD687a.tla Outdated
(* there is no need to change upEdge[p] in the Idle subaction. *)
(***************************************************************************)
Idle(p) == /\ active' = [active EXCEPT ![p] = FALSE]
Idle(p) == /\ active[p] \* otherwise this step is subsumed by stuttering

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest elaborating on why this is an issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would require an extra case distinction in the proof of the tree invariant. But your remark prompted me to adapt the comment explaining the Idle action.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incidentally, I noticed that you had added an action constraint to the model used for animation precisely to rule out such stuttering steps caused by the Idle action. I removed that because it has become unnecessary with the changed definition.

Comment thread specifications/ewd687a/EWD687a.tla Outdated
/\ O.edge # {} => G!IsTreeWithRoot(O, Leader)
\* All nodes of the overlay tree are non-neutral.
/\ N:: \A n \in O.node: ~neutral(n))
\* The original definition includes every node occurring in the tree

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment about the original definition can likely be omitted.

Comment thread specifications/ewd687a/MCEWD687a.cfg Outdated
P3 = P3
\* MV CONSTANT definitions
MaxCounter = 3
Leader = L

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only keep Leader or L?

@lemmy lemmy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lemmy

lemmy commented Jul 20, 2026

Copy link
Copy Markdown
Member

Can the reduction of proof effort be soley attributed to the introduction of GraphTheorems?

@muenchnerkindl

Copy link
Copy Markdown
Collaborator Author

Can the reduction of proof effort be soley attributed to the introduction of GraphTheorems?

In fact, the previous proof did not establish DT1Inv (i.e., correctness of the algorithm). It did show that the overlay graph was acyclic, but a dag is not quite enough, one really needs a tree. It had also suggested a strengthening of DT1Inv by adding an additional conjunct to acyclicity. Replacing the acyclicity condition with the tree predicate was enough for the proof to go through, based on the lemmas about graphs. Also, I took inspiration from the way acyclicity was expressed for proving a general lemma that implies that a tree is acyclic. Overall, the work done by Claude was very useful, even it didn't quite manage to prove overall correctness.

A technicality was that the tree invariant made use of an instance introduced in a LET construct, which I would not know how to explain to the PM. I'll take this into account when revisiting the handling of INSTANCE by the PM, but dropping LET-bound instances would perhaps also be a candidate for simplifying the language?

Signed-off-by: Stephan Merz <stephan.merz@loria.fr>
@muenchnerkindl
muenchnerkindl merged commit 91c22ea into master Jul 21, 2026
7 checks passed
@muenchnerkindl
muenchnerkindl deleted the ewd687a branch July 21, 2026 11:36
@lemmy

lemmy commented Jul 21, 2026

Copy link
Copy Markdown
Member

...dropping LET-bound instances would perhaps also be a candidate for simplifying the language?

That would cripple the current TLC REPL, which relies solely on LET-bound instances to load modules due to the absence of EXTENDS support.

> % tlcrepl
Welcome to the TLA+ REPL!
TLC2 Version 2026.04.27.203507
Enter a constant-level TLA+ expression.
(tla+) LET B == INSTANCE Bags IN B!SetToBag({})
<<>>

@muenchnerkindl

Copy link
Copy Markdown
Collaborator Author

...dropping LET-bound instances would perhaps also be a candidate for simplifying the language?

That would criplle the current TLC REPL, which relies solely on LET-bound instances to load modules due to the absence of EXTENDS support.

Understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants