This artifact contains Coq development for the paper Fair Operational Semantics.
fairness-source.zip
contains source code.fairness.zip
contains 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
eventE
inEvent.v
: FL language (Sec 4.1, Fig.3)RawTr.t
inSelectBeh.v
: Trace (Sec 4.1, Fig.3)Tr.t
inFairBeh.v
: Behavior (Sec 4.1, Fig.3)RawTr.is_fair
inSelectBeh.v
: FairTr (Sec 4.1, Fig.3)imap
inFairBeh.v
: cmap (Sec 4.2, Fig.4)
improves
inAdequacy.v
: whole-program refinement (Sec 4.1)sim
inFairSim.v
: simulation relation (Sec 4.2)
cE
andsE
inEvent.v
: TFL language (Sec 5.1, Fig.5)schedulerE
inConcurrency.v
: SFL language (Sec 5.1, Fig.5)interp_thread
andinterp_state
inConcurrency.v
: TI (Sec 5.1, Fig.5)interp_sched
inConcurrency.v
: SI (Sec 5.1, Fig.5)interp_concurrency
inConcurrency.v
: CI (Sec 5.1, Fig.5)sched_nondet
inConcurrency.v
: FAIRSch (Sec 5.2, Fig.6)
isFairSch
inSchedSim.v
: IsFairSch (Sec 5.2, Definition 5.1)
programE
inEventE
: OTFL (Sec 6, Fig.7)program
inMod.v
: corresponds to Config (Sec 6, Fig.7)prog2ths
inConcurrency.v
: corresponds to Load (Sec 6, Fig.7)Mod.t
inMod.v
: Mod (also OMod) (Sec 6, Fig.7); see the guide belowModAdd
andOMod.close
inLinking.v
: linking and close operations (Sec 6, Fig.7)
Theorem ModAdd_comm
andTheorem ModAdd_right_mono
inModAddSim.v
: properties of the module linking operation (Sec 6, Fig.7)Theorem ModClose_mono
inModCloseSim.v
: properties of the module close operation (Sec 6, Fig.7)
WMM.v
: FWMM (Sec 6.1, Fair Weak Memory Module)
FairRA.white
inFairRA.v
: ⊵ (⊵) (Sec 7, Fig.8); also see related lemmas for the rulesFairRA.black
inFairRA.v
: ♦ (♦) (Sec 7, Fig.8); also see related lemmas for the rulesFairRA.white i 1
inFairaRA.v
: ♢(i) (♢(i)) (Sec 7, Fig.8); actually a simple wrapper of ⊵stsim
inWeakest.v
: corresponds to sim (Sec 7, Fig.8)stsim_fairL
inWeakest.v
: WIN-SRC and LOSE-SRC (Sec 7, Fig.8)stsim_fairR_simple
inWeakest.v
: WIN-TGT and LOSE-TGT (Sec 7, Fig.8)stsim_yieldL
inWeakest.v
: YIELD-SRC (Sec 7, Fig.8)stsim_yieldR_simple
andstsim_sync_simple
inWeakest.v
: YIELD-TGT (Sec 7, Fig.8)Weakest.v
: contains full program logic for fairness (Sec 7); see lemmas forstsim
Theorem adequacy
inAdequacy.v
: Theorem 4.1 (Adequacy)Theorem modsim_adequacy
inModAdequacy.v
: Theorem 6.1 (Adequacy of module simulation)Theorem usersim_adequacy
inModAdequacy.v
: Theorem 7.2 (Whole program adequacy)
Theorem context_sim_simple_implies_contextual_refinement
inWeakestAdequacy.v
: Theorem 7.1 (Contextual adequacy)Theorem whole_sim_simple_implies_refinement
inWeakestAdequacy.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);AbsLock
corresponds to the SC memory version,AbsLockW
to 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_fair
inFIFOSchedSim.v
: Theorem 5.2 (FIFOSch is fair)Lemma ticketlock_fair
inTicketlockW.v
: Theorem 6.2 (TicketLock is Fair); weak memoryLemma correct
inLockClientW.v
: Module simulation between client modules; weak memoryTheorem client_all
inLockClientWAll.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/
.