Instance Sem : Semantics := ClightSemanticsForMachines.Clight_newSem ge.Instance JR : Resources := LocksAndResources.Instance JTP : ThreadPool.ThreadPool := OrdinalPool.OrdinalThreadPool.Instance JMS : MachineSig := Concur.JuicyMachineShell.Instance DilMem : DiluteMem := HybridMachineSig.HybridCoarseMachine.DilMem.Instance scheduler : Scheduler := HybridCoarseMachine.scheduler.Instance JuicyMachine : HybridMachine := HybridCoarseMachine.HybridCoarseMachine.Definition jstate := jstate ge.Instance DR : Resources := DryHybridMachine.dryResources.Instance DTP : ThreadPool.ThreadPool := OrdinalPool.OrdinalThreadPool.Instance DMS : MachineSig := DryHybridMachine.DryHybridMachineSig.Instance DryMachine : HybridMachine := HybridCoarseMachine.HybridCoarseMachine.Definition dstate := ThreadPool.t
                         (ThreadPool := OrdinalPool.OrdinalThreadPool)
                         (*
                         @t dryResources DSem (@OrdinalPool.OrdinalThreadPool dryResources DSem)
                          *).Definition dmachine_state:= MachState(ThreadPool := OrdinalPool.OrdinalThreadPool).Definition match_st:= match_st'.

(* Specifications: *)
Lemma MTCH_cnt: forall {js tid ds}, match_st js ds -> containsThread js tid -> containsThread ds tid.
Lemma MTCH_cnt': forall {js tid ds}, match_st js ds -> containsThread ds tid -> containsThread js tid.
Lemma cnt_irr: forall tid (ds : dstate) (cnt1 cnt2: containsThread ds tid), getThreadC cnt1 = getThreadC cnt2.
Lemma MTCH_locks: forall ds js laddr rmap, match_st js ds -> lockRes ds laddr = Some rmap -> exists x, lockRes js laddr = Some x.
Lemma MTCH_getThreadC: forall js ds tid c, forall (cnt: containsThread js tid) (cnt': containsThread ds tid) (M: match_st js ds), getThreadC cnt = c -> getThreadC cnt' = c.
Lemma MTCH_compat: forall js ds m, match_st js ds -> mem_compatible js m -> mem_compatible ds m.
Lemma MTCH_updt: forall js ds tid c (H0:match_st js ds) (cnt: containsThread js tid) (cnt': containsThread ds tid), match_st (updThreadC cnt c) (updThreadC cnt' c).
Lemma MTCH_updt': forall js ds tid c m (H0:match_st js ds) (cnt: containsThread js tid) (cnt': containsThread ds tid) (Hcmpt : mem_compatible js m) (Hcmpt' : HybridMachineSig.mem_compatible ds m), match_st (updThread cnt c (add_block Hcmpt cnt (Concur.install_perm Hcmpt cnt))) (updThread cnt' c (HybridMachineSig.add_block Hcmpt' cnt' (Concur.install_perm Hcmpt cnt))).
Lemma MTCH_updLockN: forall js ds loc, match_st js ds -> match_st (updLockSet js loc None) (updLockSet ds loc (empty_map,empty_map)).
Lemma MTCH_remLockN: forall js ds loc, match_st js ds -> match_st (remLockSet js loc) (remLockSet ds loc).
Lemma match_st_age_tp_to tp n ds : match_st tp ds -> match_st (Concur.age_tp_to n tp) ds.
Lemma contains_iff_num: forall (js : jstate) (ds : dstate) (Hcnt: forall i, containsThread js i <-> containsThread ds i), OrdinalPool.num_threads js = OrdinalPool.num_threads ds.
Lemma MTCH_latestThread: forall js ds, match_st js ds -> latestThread js = latestThread ds.
Lemma perm_of_writable0: forall sh, shares.writable0_share sh -> sh <> Share.top -> perm_of_sh sh = Some Writable.
Lemma MTCH_age: forall js ds age, match_st js ds -> match_st (Concur.age_tp_to age js) ds.
Lemma MTCH_tp_update: forall js ds phi js' phi', match_st js ds -> tp_update js phi js' phi' -> match_st js' ds.
Lemma perm_of_readable' : forall sh, shares.readable_share sh -> Mem.perm_order' (perm_of_sh (Share.glb Share.Rsh sh)) Readable.
Lemma perm_of_writable' : forall sh, shares.writable0_share sh -> Mem.perm_order' (perm_of_sh sh) Writable.
Lemma lock_range_perm : forall m js ds (MATCH : match_st js ds) i (Hi : containsThread js i) (Hcmpt : mem_compatible js m) b ofs sh R (HJcanwrite : Concur.lock_at_least sh R (getThreadR Hi) b (Ptrofs.intval ofs)), Mem.range_perm (Concur.juicyRestrict_locks (Concur.mem_compat_thread_max_cohere Hcmpt Hi)) b (Ptrofs.intval ofs) (Ptrofs.intval ofs + LKSIZE) Cur Readable.
Lemma deltaMap_dec: forall dmap b ofs, deltaMap_cases dmap b ofs.
Lemma permMapsDisjoint2_empty: forall rmap, permMapsDisjoint2 (empty_map, empty_map) rmap.
Lemma po_None1: forall p, Mem.perm_order'' None p -> p = None.
Lemma sync_step_diagram: forall (m m':Memory.mem) (U:seq nat) js js' ds i ev (MATCH: match_st js ds) (dinv: invariant ds) (Hi: containsThread js i) (Hcmpt: mem_compatible js m) (HschedN: schedPeek U = Some i) (Htstep: syncStep true Hi Hcmpt js' m' ev), exists ds' : dstate, exists ev', invariant ds' /\ match_st js' ds' /\ syncStep true (MTCH_cnt MATCH Hi) (MTCH_compat _ _ _ MATCH Hcmpt) ds' m' ev'.