Repository navigation
trace: enumerate Traces(P) — correctness path + differential tests (#60) - #69
Merged
Merged
Conversation
Phase 3. `traces()` explores every branch of the reduction, turns each maximal run into a `Trace`, and dedups on the set-of-events key: independent interleavings share a key and collapse to one, genuine branches stay distinct. Differential guarantees (mechanized): - unfolding round-trip: ⋃ linearizations over traces(P) equals the set of maximal label-runs of the full `Lts::explore(P)` — nothing hidden. - interleaving absorbed / branching kept: diamond = 1 trace (2 linearizations), chain = 1 trace (1), race = 2 traces; terminal start = 1 empty trace. Also fixes the test channel helper: `*⌜P⌝ ≡ P` collapses a drop/quote nesting to `⌜0⌝`, so the previous `ch()` produced `≡N`-equal channels; nest a non-reducing lift instead for genuinely distinct names. (The earlier phase-1/2 tests still passed because they never asserted channel distinctness — this makes them test what they claim.) Exposes `event.rs` `initial_state`/`Tagged` as `pub(crate)` for the enumerator. Refs #60 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Replace the stale `ch()` doc that still claimed the drop/quote nesting was pairwise ≢N (it canonically collapses to ⌜0⌝); document the lift nesting. - Note `dfs` recursion depth is bounded by `max_events`. - Note the `lts_label_runs` test helper assumes an acyclic LTS. Refs #60 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3 — the first user-visible milestone. Builds on #58 (stepper) and #59 (Trace).
What
traces(start, max_events, max_traces) -> (Vec<Trace>, bool)incrates/stratum-lts/src/trace.rs.Trace::from_run; dedup onTrace::key().n!interleavings, then dedups — cheap-to-reason, optimized in trace: persistent-set optimization (trace-faithful enumeration) #64). Bounds:max_eventsper run,max_traceson the result; the boolean flags truncation asLts::is_truncateddoes.Differential guarantees (the trust-earning tests)
unfolding_round_trip_matches_full_lts— for a causal chain concurrent with an independent reaction,⋃ linearizations over traces(P)equals, as label sequences, the set of maximal runs of the fullLts::explore(P). This mechanizes the "no truth hidden" theorem: the trace-set is a lossless compression of the interleaving LTS.interleaving_absorbed_branching_kept— diamond → 1 trace (2 linearizations); chain → 1 trace (1 linearization); race → 2 traces.terminal_start_is_one_empty_trace.Also in this PR
*⌜P⌝ ≡ Pcanonically, so the oldch()drop/quote nesting collapsed every channel to⌜0⌝— the phase-1/2 tests passed only because they never asserted channel-distinctness. Rebuiltch()to nest a non-reducing lift, giving genuinely≡N-distinct channels (touchesevent.rs+trace.rstest modules only). The diamond test is what surfaced this.event.rsinitial_state/Taggedaspub(crate)for the enumerator.fmt / clippy
-D warnings/cargo test --workspacegreen locally.Closes #60