Instance JSem : Semantics := ClightSemanticsForMachines.Clight_newSem ge.

(* Specifications: *)
Lemma getThreadR_nth i tp cnti : nth_error (getThreadsR tp) i = Some (@getThreadR _ _ _ i tp cnti).
Lemma getThreadsR_but i tp cnti : Permutation (getThreadsR tp) (@getThreadR _ _ _ i tp cnti :: all_but i (getThreadsR tp)).
Lemma eqtype_refl n i cnti cntj : @eqtype.eq_op (fintype.ordinal_eqType n) (@fintype.Ordinal n i cnti) (@fintype.Ordinal n i cntj) = true.
Lemma eqtype_refl' n i j cnti cntj : i = j -> @eqtype.eq_op (fintype.ordinal_eqType n) (@fintype.Ordinal n i cnti) (@fintype.Ordinal n j cntj) = true.
Lemma eqtype_neq n i j cnti cntj : i <> j -> @eqtype.eq_op (fintype.ordinal_eqType n) (@fintype.Ordinal n i cnti) (@fintype.Ordinal n j cntj) = false.
Lemma updThreadR_but i tp cnti phi : Permutation (getThreadsR (@updThreadR _ _ _ i tp cnti phi)) (phi :: all_but i (getThreadsR tp)).
Lemma updThread_but i tp cnti c phi : Permutation (getThreadsR (@updThread _ _ _ i tp cnti c phi)) (phi :: all_but i (getThreadsR tp)).
Lemma getLocksR_updLockSet_Some tp addr phi : Permutation (getLocksR (updLockSet(resources:=LocksAndResources) tp addr (Some phi))) (phi :: getLocksR (remLockSet tp addr)).
Lemma getLocksR_updLockSet_None (tp : jstate ge) addr : getLocksR (updLockSet tp addr None) = getLocksR (remLockSet tp addr).
Lemma getLocksR_SSome (tp : jstate ge) addr phi : lockRes tp addr = Some (Some phi) -> Permutation (getLocksR tp) (phi :: getLocksR (remLockSet tp addr)).
Lemma getLocksR_SNone (tp : jstate ge) addr : lockRes tp addr = Some None -> getLocksR (remLockSet tp addr) = getLocksR tp.
Lemma getLocksR_None (tp : jstate ge) addr : lockRes tp addr = None -> getLocksR (remLockSet tp addr) = getLocksR tp.
Lemma maps_getthread i tp cnti : Permutation (maps tp) (@getThreadR _ _ _ i tp cnti :: all_but i (maps tp)).
Lemma maps_updthread i tp cnti c phi : Permutation (maps (@updThread _ _ _ i tp cnti c phi)) (phi :: all_but i (maps tp)).
Lemma maps_updthreadR i tp cnti phi : Permutation (maps (@updThreadR _ _ _ i tp cnti phi)) (phi :: all_but i (maps tp)).
Lemma maps_updlock1 (tp : jstate ge) addr : maps (updLockSet tp addr None) = maps (remLockSet tp addr).
Lemma maps_updlock2 (tp : jstate ge) addr phi : Permutation (maps (updLockSet tp addr (Some phi))) (phi :: maps (remLockSet tp addr)).
Lemma maps_getlock1 tp addr : lockRes tp addr = None -> maps (remLockSet tp addr) = maps tp.
Lemma maps_getlock2 (tp : jstate ge) addr : lockRes tp addr = Some None -> maps (remLockSet tp addr) = maps tp.
Lemma maps_getlock3 (tp : jstate ge) addr phi : lockRes tp addr = Some (Some phi) -> Permutation (maps tp) (phi :: maps (remLockSet tp addr)).
Lemma maps_addthread tp v1 v2 phi : Permutation (maps (addThread tp v1 v2 phi)) (phi :: maps tp).
Lemma maps_age_to i tp : maps (age_tp_to i tp) = map (age_to i) (maps tp).
Lemma maps_remLockSet_updThread i tp addr cnti c phi : maps (remLockSet (@updThread _ _ _ i tp cnti c phi) addr) = maps (@updThread _ _ _ i (remLockSet tp addr) cnti c phi).
Lemma getThread_level i tp cnti Phi : join_all tp Phi -> level (@getThreadR _ _ _ i tp cnti) = level Phi.
Lemma join_sub_level {A} `{JA : sepalg.Join A} `{_ : ageable A} {_ : Perm_alg A} {_ : Age_alg A} : forall x y : A, join_sub x y -> level x = level y.
Lemma joins_level {A} `{JA : sepalg.Join A} `{_ : ageable A} {_ : Perm_alg A} {_ : Age_alg A} : forall x y : A, joins x y -> level x = level y.