This artifact contains Coq development for the paper Fair Operational Semantics.
fairness-source.zipcontains source code.fairness.zipcontains a docker image (fairness.tar) where you can find the pre-compiled Coq development. Use following commands to run the image:
sudo docker load < fairness.tar
docker run -it pldi2023ae /bin/bash
cd fairness # in the container
Requirement: opam (>=2.0.0), Coq 8.15.0
- Install dependencies with opam
./configure
- Build the project
make build -j
eventEinEvent.v: FL language (Sec 4.1, Fig.3)RawTr.tinSelectBeh.v: Trace (Sec 4.1, Fig.3)Tr.tinFairBeh.v: Behavior (Sec 4.1, Fig.3)RawTr.is_fairinSelectBeh.v: FairTr (Sec 4.1, Fig.3)imapinFairBeh.v: cmap (Sec 4.2, Fig.4)
improvesinAdequacy.v: whole-program refinement (Sec 4.1)siminFairSim.v: simulation relation (Sec 4.2)
cEandsEinEvent.v: TFL language (Sec 5.1, Fig.5)schedulerEinConcurrency.v: SFL language (Sec 5.1, Fig.5)interp_threadandinterp_stateinConcurrency.v: TI (Sec 5.1, Fig.5)interp_schedinConcurrency.v: SI (Sec 5.1, Fig.5)interp_concurrencyinConcurrency.v: CI (Sec 5.1, Fig.5)sched_nondetinConcurrency.v: FAIRSch (Sec 5.2, Fig.6)
isFairSchinSchedSim.v: IsFairSch (Sec 5.2, Definition 5.1)
programEinEventE: OTFL (Sec 6, Fig.7)programinMod.v: corresponds to Config (Sec 6, Fig.7)prog2thsinConcurrency.v: corresponds to Load (Sec 6, Fig.7)Mod.tinMod.v: Mod (also OMod) (Sec 6, Fig.7); see the guide belowModAddandOMod.closeinLinking.v: linking and close operations (Sec 6, Fig.7)
Theorem ModAdd_commandTheorem ModAdd_right_monoinModAddSim.v: properties of the module linking operation (Sec 6, Fig.7)Theorem ModClose_monoinModCloseSim.v: properties of the module close operation (Sec 6, Fig.7)
WMM.v: FWMM (Sec 6.1, Fair Weak Memory Module)
FairRA.whiteinFairRA.v: ⊵ (⊵) (Sec 7, Fig.8); also see related lemmas for the rulesFairRA.blackinFairRA.v: ♦ (♦) (Sec 7, Fig.8); also see related lemmas for the rulesFairRA.white i 1inFairaRA.v: ♢(i) (♢(i)) (Sec 7, Fig.8); actually a simple wrapper of ⊵stsiminWeakest.v: corresponds to sim (Sec 7, Fig.8)stsim_fairLinWeakest.v: WIN-SRC and LOSE-SRC (Sec 7, Fig.8)stsim_fairR_simpleinWeakest.v: WIN-TGT and LOSE-TGT (Sec 7, Fig.8)stsim_yieldLinWeakest.v: YIELD-SRC (Sec 7, Fig.8)stsim_yieldR_simpleandstsim_sync_simpleinWeakest.v: YIELD-TGT (Sec 7, Fig.8)Weakest.v: contains full program logic for fairness (Sec 7); see lemmas forstsim
Theorem adequacyinAdequacy.v: Theorem 4.1 (Adequacy)Theorem modsim_adequacyinModAdequacy.v: Theorem 6.1 (Adequacy of module simulation)Theorem usersim_adequacyinModAdequacy.v: Theorem 7.2 (Whole program adequacy)
Theorem context_sim_simple_implies_contextual_refinementinWeakestAdequacy.v: Theorem 7.1 (Contextual adequacy)Theorem whole_sim_simple_implies_refinementinWeakestAdequacy.v: Theorem 7.2 (Whole program adequacy)
LockClientSC.v: CLI and CLS (Sec 1, Sec 3, Sec 8); SC memory version (the paper has typos, code in Sec 1 is the correct one)LockClientW.v: CLI and CLS (Sec 1, Sec 3, Sec 8); weak memory version (the paper has typos, code in Sec 1 is the correct one)FairLock.v: ABSLock (Sec 3.1, Fig.2);AbsLockcorresponds to the SC memory version,AbsLockWto the weak memory version.TicketLockSC.v: TicketLock (Sec 3.1); SC memory versionTicketLockW.v: TicketLock (Sec 3.1); weak memory versionFIFOSched.v: FIFOSch (Sec 5.2, Fig.6)Theorem fifo_is_fairinFIFOSchedSim.v: Theorem 5.2 (FIFOSch is fair)Lemma ticketlock_fairinTicketlockW.v: Theorem 6.2 (TicketLock is Fair); weak memoryLemma correctinLockClientW.v: Module simulation between client modules; weak memoryTheorem client_allinLockClientWAll.v: Case Study (Sec 8)
This artifact contains an improved version of the module system compared to the paper. We will revise the paper accordingly. The main difference is that Mod is extended to include OMod (Sec 6, Fig.7) and OMod is removed.
The paper is currently missing update modalities for MONO and DEC rules in Sec 7, Fig.8. We will correct the paper. We also developed additional lemmas for stsim to reduce proof complexity, as can be found in src/logic/Weakest.v. Proof of the case study is based on those lemmas, as can be found in src/example/.