Skip to content

Litmus#21

Merged
nek0las merged 29 commits into
mainfrom
litmus
Mar 26, 2026
Merged

Litmus#21
nek0las merged 29 commits into
mainfrom
litmus

Conversation

@nek0las
Copy link
Copy Markdown
Owner

@nek0las nek0las commented Mar 14, 2026

No description provided.

nek0las and others added 29 commits March 12, 2026 17:24
Change Events.preCo from a plain Prop to a structure with two fields:
- wellTyped: the existing well-typedness condition on co pairs
- total: co is a total order on same-location writes

Update all wellformed.co instances in Litmus.lean to prove both fields.
- wellformed.rf: extend to a structure with wellTyped (existing
  conditions) and unique (each read has at most one rf source)
- Events.preCo: extend to a structure with wellTyped (existing
  conditions) and total (co is a total order on same-location writes)
- CandidateExecution: remove fr as a settable field; define it as a
  transparent @[simp] def so theorems can unfold it
- Litmus.lean: update all rfInst and preco proofs for the new structures
- Theorems.lean: prove rf_fr_subset_co (rf;fr⊆co via rf uniqueness)
co_acyclic: co is acyclic, following from wellformed.co's irrefl and
trans via the existing strictPartialOrderImpliesAcyclic lemma.

fr_co_subset_fr: fr;co ⊆ fr — if (r,w)∈fr and (w,w')∈co then
(r,w')∈fr. Proof unfolds fr, applies co transitivity, and repacks.
- Add CoWR condition to CandidateExecution: a read cannot observe a
  write older than the most recent same-location po-predecessor, needed
  to prove LKMM coherence from TSO acyclicity
- Instantiate coWR for all three litmus tests (SB, MP, LB)
- Fix two bugs in Macro.lean: rfe was X.fr instead of X.rf, and ext
  was Rel.internal instead of Rel.external
- Add X86WeakerThanLKMM.lean with theorem statement (proof pending)
- Fix tsoWeakerThanSc.lean imports and remove broken ConcreteExecution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nek0las nek0las marked this pull request as ready for review March 26, 2026 23:55
@nek0las nek0las merged commit 5c46727 into main Mar 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant