Skip to content

Add more tests and Java module overrides for Graphs SimplePath, AreConnectedIn and IsStronglyConnected#126

Merged
lemmy merged 2 commits into
masterfrom
mku-GraphsOverrides
Jul 9, 2026
Merged

Add more tests and Java module overrides for Graphs SimplePath, AreConnectedIn and IsStronglyConnected#126
lemmy merged 2 commits into
masterfrom
mku-GraphsOverrides

Conversation

@lemmy

@lemmy lemmy commented Jul 8, 2026

Copy link
Copy Markdown
Member

Check the operators exhaustively against their pure TLA+ definitions and the ConnectionsIn oracle over all graphs on up to three nodes, plus edge cases (self-loops, arguments outside the node set, composite/non-normalized node values).

[Tests]


Add Graphs module overrides for SimplePath, AreConnectedIn and IsStronglyConnected

Register three Java overrides in TLCOverrides. SimplePath enumerates simple paths via DFS instead of materializing SeqOf(node, Cardinality(node)); AreConnectedIn and IsStronglyConnected use BFS (the latter forward and on the transpose) rather than the quadratic all-pairs pure-TLA+ definitions.

The overrides cut GraphsTests (exhaustive checks over all graphs on up to four nodes \cup Graphs({1, 2, 3})) from ~15 to ~5 minutes.

TLC's code is not reused: its only Value-based graph algorithm, TransitiveClosure.Warshall, is non-reflexive, drops isolated nodes and is O(V^3), so it fits none of these operators.

[TLC]

@lemmy lemmy added the enhancement New feature or request label Jul 8, 2026
@lemmy lemmy requested a review from Copilot July 8, 2026 18:22

This comment was marked as outdated.

@lemmy lemmy force-pushed the mku-GraphsOverrides branch from 3757257 to 861f2f7 Compare July 8, 2026 18:34
Check the operators exhaustively against their pure TLA+ definitions and
the ConnectionsIn oracle over all graphs on up to three nodes, plus edge
cases (self-loops, arguments outside the node set, composite/non-normalized
node values).

[Tests]

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
@lemmy lemmy force-pushed the mku-GraphsOverrides branch from 861f2f7 to fdeaf96 Compare July 8, 2026 18:43
@lemmy lemmy changed the title Add tests for Graphs SimplePath, AreConnectedIn and IsStronglyConnected Add more tests and Java module overrides for Graphs SimplePath, AreConnectedIn and IsStronglyConnected Jul 8, 2026
@lemmy lemmy requested a review from Copilot July 8, 2026 20:03

This comment was marked as resolved.

@lemmy lemmy force-pushed the mku-GraphsOverrides branch 3 times, most recently from 3d12680 to 9c46ed8 Compare July 8, 2026 20:46
…nglyConnected

Register three Java overrides in TLCOverrides. SimplePath enumerates
simple paths via DFS instead of materializing SeqOf(node, Cardinality(node));
AreConnectedIn and IsStronglyConnected use BFS (the latter forward and on the
transpose) rather than the quadratic all-pairs pure-TLA+ definitions.

The overrides cut GraphsTests (exhaustive checks over all graphs on up to
four nodes `\cup Graphs({1, 2, 3})`) from ~15 to ~5 minutes.

TLC's code is not reused: its only Value-based graph algorithm,
TransitiveClosure.Warshall, is non-reflexive, drops isolated nodes and is
O(V^3), so it fits none of these operators.

[TLC]

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
@lemmy lemmy force-pushed the mku-GraphsOverrides branch from 9c46ed8 to effde97 Compare July 8, 2026 20:48
@lemmy lemmy marked this pull request as ready for review July 8, 2026 21:08
@lemmy lemmy requested a review from muenchnerkindl July 8, 2026 21:15
@muenchnerkindl

Copy link
Copy Markdown
Contributor

LGTM, thanks!

@lemmy lemmy merged commit dac9808 into master Jul 9, 2026
6 checks passed
@lemmy lemmy deleted the mku-GraphsOverrides branch July 9, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

3 participants