Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
07addc2
Moved branch from Aneris repo
jihgfee Aug 14, 2023
8fdc7a8
Moved no drop dup model
jihgfee Aug 14, 2023
9b33b9e
Bumped main
jihgfee Oct 17, 2023
902b075
Bumped state interp def and slight refactoring
jihgfee Nov 2, 2023
db8c7a7
Bumped removal of ports_in_use up until config_wp
jihgfee Nov 2, 2023
63ac216
Proved config_wp with some admits
jihgfee Nov 2, 2023
64dc07c
Bumped state_interp
jihgfee Nov 2, 2023
3e707a0
Bumped up to adequacy
jihgfee Nov 2, 2023
c5eb158
Typo
jihgfee Nov 6, 2023
7ecd081
Removed events, changed buffer coherence, bumped config, proved WPs
jihgfee Nov 8, 2023
e24487d
Clean up
jihgfee Nov 16, 2023
6a08b3c
WIP: Proof of partial fair termination
jihgfee Nov 21, 2023
36fa66c
WIP: Partial termination
jihgfee Nov 21, 2023
047b826
Added mixed trace monotonicity lemmas
jihgfee Nov 22, 2023
809c726
Bumped adequacy and applied it to retransmit example
jihgfee Nov 23, 2023
2192aa0
Added dead fragments to adequacy
jihgfee Nov 23, 2023
2359266
Moved partial_termination_alt.v -> partial_termination.v
jihgfee Nov 23, 2023
e55a687
Clean up
jihgfee Nov 23, 2023
6c3cc5e
Proved an admitted lemma
jihgfee Nov 23, 2023
4648043
Closed another admitted lemma
jihgfee Nov 23, 2023
bff361e
Refactoring: Made model more flexible
jihgfee Nov 23, 2023
2aaf1c5
Clean up lemma
jihgfee Nov 24, 2023
023fbaf
Moved adequacy.v
jihgfee Nov 24, 2023
dd46b28
Generalised some theorems
jihgfee Dec 4, 2023
3e36a99
Bump Coq 8.19 and slight refactoring
jihgfee Feb 12, 2024
9a25792
Pushed inftraces for fairneris
jihgfee Feb 21, 2024
f95afc6
Added record update as submodule
jihgfee Feb 21, 2024
196d55e
Fix build, update nix flake, don't compile fairis
ineol Feb 23, 2024
1e3f9ca
Port `fuel.v` to Fairneris, w/o config steps yet
ineol Feb 23, 2024
f479ce6
Add config steps to `fuel.v`
ineol Feb 23, 2024
1fff528
Update `resources.v`
ineol Feb 24, 2024
a62b2dd
Adapt Fairis to the network setting
ineol Mar 15, 2024
7a4aad3
Lift fuel resources to joint models
ineol Mar 15, 2024
46e5252
Adding network-matching in the state interp
ineol Mar 15, 2024
564fee0
Make more files compile
ineol Mar 19, 2024
ce44c60
More nits
ineol Mar 19, 2024
f28fe45
Rewrite the model in the new setting
ineol Mar 19, 2024
f455334
New fairness predicate?
ineol Mar 19, 2024
a100960
Port retransmit model to the new fairness
ineol Mar 21, 2024
51113ff
Prove config_wp
ineol Mar 21, 2024
026a52e
Generalize `upto_stutter` to prepare for projection
ineol Mar 21, 2024
af8838e
Destutter of joint_models
ineol Mar 22, 2024
df7ad60
Transfer network fairness accross stutter, match
ineol Mar 27, 2024
7aa6ddd
Properties of trace trimming
ineol Mar 27, 2024
ee553c7
Trimming preserves network fairness
ineol Mar 28, 2024
1af9fdd
Prove that trimming preserves sched fairness
ineol Mar 28, 2024
846c027
Network fairness implies user net fairness
ineol Mar 28, 2024
78f37fe
Prove adequacy for Fairneris
ineol Apr 26, 2024
a3f0fc9
Prove update lemmas
ineol Apr 29, 2024
0c1abbb
Add `LiveModelEq` constraint to `anerisG`
ineol Apr 29, 2024
29a28ad
Remove assumption that trace is infinite from fairness preservation
ineol May 2, 2024
08c818f
Updated stenning code to be verified
jihgfee Apr 30, 2024
a26f8e4
Adequacy: upward preservation of fairness
ineol May 2, 2024
d8cb38f
Transport ◊ ℓ↓ P from model trace to the prog exec
ineol May 6, 2024
55805c8
MU at the Aneris level, with lifting lemmas
jihgfee Apr 29, 2024
f07c444
WIP update_model MU lemma
jihgfee Apr 30, 2024
6ff1269
Added rule for SSWP pure steps
jihgfee Apr 30, 2024
c80f1ca
Bump branch
jihgfee Apr 30, 2024
cf5f547
Added remaining socket lemmas
jihgfee Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "external/paco"]
path = external/paco
url = https://github.com/snu-sf/paco.git
[submodule "external/coq-record-update"]
path = external/coq-record-update
url = https://github.com/tchajed/coq-record-update.git
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files.exclude": {
"**/*.vo": true,
"**/*.vok": true,
"**/*.vos": true,
"**/*.aux": true,
"**/*.glob": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
}
}
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TRILLIUM_DIR := 'trillium'
FAIRIS_DIR := 'fairis'
LOCAL_SRC_DIRS := $(TRILLIUM_DIR) $(FAIRIS_DIR)
FAIRNERIS_DIR := 'fairneris'
LOCAL_SRC_DIRS := $(TRILLIUM_DIR) $(FAIRNERIS_DIR)
SRC_DIRS := $(LOCAL_SRC_DIRS) 'external'

ALL_VFILES := $(shell find $(SRC_DIRS) -name "*.v")
Expand Down Expand Up @@ -43,15 +43,15 @@ clean:
rm -f .coqdeps.d

# project-specific targets
.PHONY: build clean-trillium clean-fairis trillium fairis
.PHONY: build clean-trillium clean-fairis clean-fairneris trillium fairis fairneris

VPATH= $(TRILLIUM_DIR) $(FAIRIS_DIR)
VPATH= $(TRILLIUM_DIR) $(FAIRNERIS_DIR)
VPATH_FILES := $(shell find $(VPATH) -name "*.v")

build: $(VPATH_FILES:.v=.vo)

fairis :
@$(MAKE) build VPATH=$(FAIRIS_DIR)
fairneris :
@$(MAKE) build VPATH=$(FAIRNERIS_DIR)

trillium :
@$(MAKE) build VPATH=$(TRILLIUM_DIR)
Expand All @@ -64,5 +64,5 @@ clean-local:
clean-trillium:
@$(MAKE) clean-local LOCAL_SRC_DIRS=$(TRILLIUM_DIR)

clean-fairis:
@$(MAKE) clean-local LOCAL_SRC_DIRS=$(FAIRIS_DIR)
clean-fairneris:
@$(MAKE) clean-local LOCAL_SRC_DIRS=$(FAIRNERIS_DIR)
4 changes: 3 additions & 1 deletion _CoqProject
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-Q trillium trillium
-Q fairis trillium.fairness
-Q fairneris fairneris

-Q external/stdpp/stdpp stdpp
-Q external/stdpp/stdpp_unstable stdpp.unstable
Expand All @@ -8,6 +8,7 @@
-Q external/iris/iris_unstable iris.unstable
-Q external/iris/iris_heap_lang iris.heap_lang
-Q external/paco/src Paco
-Q external/coq-record-update/src RecordUpdate

-arg -w -arg -notation-overridden
-arg -w -arg -redundant-canonical-projection
Expand All @@ -19,3 +20,4 @@
-arg -w -arg -deprecated-instance-without-locality
-arg -w -arg -deprecated-typeclasses-transparency-without-locality
-arg -w -arg -future-coercion-class-field
-arg -w -arg -argument-scope-delimiter
1 change: 1 addition & 0 deletions external/coq-record-update
Submodule coq-record-update added at b49883
2 changes: 1 addition & 1 deletion external/iris
Submodule iris updated from ab54fb to 93cb01
2 changes: 1 addition & 1 deletion external/stdpp
Submodule stdpp updated from 800125 to cafd71
6 changes: 3 additions & 3 deletions fairis/map_included_utils.v
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,13 @@ Proof.
rewrite !map_included_spec.
intros HP Hle k v1 HSome1.
pose proof HSome1 as HP'.
apply map_filter_lookup_Some_1_1 in HSome1.
apply map_filter_lookup_Some_1_2 in HP'.
apply map_lookup_filter_Some_1_1 in HSome1.
apply map_lookup_filter_Some_1_2 in HP'.
pose proof HSome1 as HSome2.
apply Hle in HSome2 as [v2 [HSome2 HR]].
specialize (HP k v1 v2 HSome1 HSome2 HP').
exists v2. split; [|done].
by apply map_filter_lookup_Some_2.
by apply map_lookup_filter_Some_2.
Qed.

Lemma map_included_subseteq_r `{∀ A, Lookup K A (MAP A)} {A}
Expand Down
209 changes: 209 additions & 0 deletions fairneris/algebra/disj_gsets.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
From stdpp Require Export sets gmap mapset.
From iris.algebra Require Export cmra.
From iris.algebra Require Import updates local_updates big_op.

Record disj_gsets K `{Countable K} := DGSets { dgsets_of : (gset (gset K)) }.
Global Arguments dgsets_of {_ _ _} _.
Global Arguments DGSets {_ _ _} _.

Definition eq_or_disj `{Countable K} (X Y : gset K) : Prop :=
X = Y ∨ X ## Y.

Lemma eq_or_disj_comm `{Countable K} (x y : gset K) :
eq_or_disj x y → eq_or_disj y x.
Proof. rewrite /eq_or_disj. intros [Hdisj | Hidjs]; eauto. Qed.

Lemma eq_or_disj_singleton `{Countable K} (x y : K) :
eq_or_disj {[x]} {[y]}.
Proof. rewrite /eq_or_disj. destruct (decide (x = y)); set_solver. Qed.

Section disj_gsets.
Context `{Countable K}.
Local Arguments op _ _ !_ !_ /.
Local Arguments cmra_op _ !_ !_ /.
Local Arguments ucmra_op _ !_ !_ /.

Canonical Structure disj_gsetsO := leibnizO (disj_gsets K).

Definition have_disj_elems (X Y : gset (gset K)) : Prop :=
∀ x y, x ∈ X → y ∈ Y → eq_or_disj x y.

Definition all_disjoint (X : gset (gset K)) : Prop := have_disj_elems X X.

Local Instance disj_gsets_valid_instance : Valid (disj_gsets K) :=
λ X, all_disjoint (dgsets_of X).
Local Instance disj_gsets_unit_instance : Unit (disj_gsets K) := DGSets ∅.
Local Instance disj_gsets_op_instance : Op (disj_gsets K) :=
λ X Y, DGSets (dgsets_of X ∪ dgsets_of Y).
Local Instance disj_gsets_pcore_instance : PCore (disj_gsets K) := λ x, Some x.

Lemma have_disj_elems_comm X Y : have_disj_elems X Y → have_disj_elems Y X.
Proof. intros HXY x y ??; destruct (HXY y x); rewrite /eq_or_disj; auto. Qed.

Lemma all_disjoint_union X Y :
(all_disjoint X ∧ all_disjoint Y ∧ have_disj_elems X Y) ↔ all_disjoint (X ∪ Y).
Proof.
split.
- intros (HX & HY & HXY) x y [Hx|Hx]%elem_of_union [Hy|Hy]%elem_of_union.
+ by apply HX.
+ by apply HXY.
+ apply have_disj_elems_comm in HXY. by apply HXY.
+ by apply HY.
- intros HXY; split_and!.
+ intros ????; apply HXY; set_solver.
+ intros ????; apply HXY; set_solver.
+ intros ????; apply HXY; set_solver.
Qed.

Lemma have_disj_elems_subseteq X Y X' Y' :
X ⊆ X' → Y ⊆ Y' → have_disj_elems X' Y' → have_disj_elems X Y.
Proof. intros ?? HX'Y' ????; apply HX'Y'; set_solver. Qed.

Lemma have_disj_elems_singleton z X :
(∀ x, x ∈ X → z = x ∨ z ## x) ↔ have_disj_elems {[z]} X.
Proof.
split.
- intros Hz ? y ->%elem_of_singleton ?; apply Hz; done.
- intros HX x Hx; apply HX; set_solver.
Qed.

Lemma have_disj_elems_union X Y Z :
have_disj_elems X Y →
have_disj_elems X Z →
have_disj_elems X (Y ∪ Z).
Proof.
intros Hdisj1 Hdisj2.
intros y1 y2 Hin1 Hin2%elem_of_union.
destruct Hin2 as [Hin2|Hin2].
- by apply Hdisj1.
- by apply Hdisj2.
Qed.

Lemma have_disj_elems_union_2 X Y Z :
all_disjoint Z →
have_disj_elems X Z →
have_disj_elems Y Z →
have_disj_elems X Y →
have_disj_elems (X ∪ Z) (Y ∪ Z).
Proof.
intros Hdisj HdisjXZ HdisjYZ HdisjXY.
apply have_disj_elems_union.
- apply have_disj_elems_comm.
apply have_disj_elems_union;
[ apply have_disj_elems_comm, HdisjXY | apply HdisjYZ ].
- apply have_disj_elems_comm.
apply have_disj_elems_union;
[ apply have_disj_elems_comm, HdisjXZ | apply Hdisj ].
Qed.

Lemma all_disjoint_subseteq X X' : X ⊆ X' → all_disjoint X' → all_disjoint X.
Proof. intros ? ?; eapply have_disj_elems_subseteq; eauto. Qed.

Lemma all_disjoint_singleton z : all_disjoint {[z]}.
Proof. apply have_disj_elems_singleton; set_solver. Qed.

Lemma elem_of_all_disjoint_eq x1 x2 x (X : gset (gset K)) :
all_disjoint X → x1 ∈ X → x2 ∈ X → x ∈ x1 → x ∈ x2 → x1 = x2.
Proof.
intros Hdisj Hin1 Hin2 Hxin1 Hxin2.
destruct (Hdisj x1 x2 Hin1 Hin2) as [->|Hdisj']; [done|].
by specialize (Hdisj' x Hxin1 Hxin2).
Qed.

Lemma elem_of_all_disjoint_neq x1 x2 x (X : gset (gset K)) :
all_disjoint X → x1 ∈ X → x2 ∈ X → x ∈ x1 → x ∉ x2 → x1 ## x2.
Proof.
intros Hdisj Hin1 Hin2 Hxin1 Hxin2.
destruct (Hdisj x1 x2 Hin1 Hin2) as [->|Hdisj']; [done|done].
Qed.

Lemma disjoint_empty_ne (X Y : gset K) :
X ## Y → X ≠ ∅ → Y ≠ ∅ → X ≠ Y.
Proof. intros Hdisj HX HY. set_solver. Qed.

Lemma have_disj_elems_both_singletons x y : have_disj_elems {[x]} {[y]} ↔ x = y ∨ x ## y.
Proof. rewrite -have_disj_elems_singleton; set_solver. Qed.

Lemma have_disj_elems_empty X : have_disj_elems ∅ X.
Proof. intros ? y ?%elem_of_empty; done. Qed.

Lemma all_disjoint_empty : all_disjoint ∅.
Proof. apply have_disj_elems_empty. Qed.

Lemma disj_gsets_included X Y : DGSets X ≼ DGSets Y ↔ X ⊆ Y.
Proof.
split.
- move=> [[Z]]; rewrite /= /disj_gsets_op_instance /=; set_solver.
- intros (Z&->&?)%subseteq_disjoint_union_L.
exists (DGSets Z); done.
Qed.
Lemma disj_gsets_valid (X : gset (gset K)) :
✓ (DGSets X) ↔ all_disjoint X.
Proof. done. Qed.
Lemma disj_gsets_valid_op X Y :
✓ (DGSets X ⋅ DGSets Y) ↔ all_disjoint X ∧ all_disjoint Y ∧ have_disj_elems X Y.
Proof. rewrite all_disjoint_union; done. Qed.
Lemma disj_gsets_valid_op_singletons_disjoint x y :
✓ (DGSets {[x]} ⋅ DGSets {[y]}) ↔ x = y ∨ x ## y.
Proof.
rewrite disj_gsets_valid_op have_disj_elems_both_singletons.
split; [tauto|by auto using all_disjoint_singleton].
Qed.
Lemma disj_gsets_op_union X Y : DGSets X ⋅ DGSets Y = DGSets (X ∪ Y).
Proof. done. Qed.

Lemma disj_gsets_ra_mixin : RAMixin (disj_gsets K).
Proof.
apply ra_total_mixin.
- eauto.
- intros [X] [] [] ?%leibniz_equiv; simplify_eq; done.
- intros ?? ->%leibniz_equiv; done.
- intros ?? ->%leibniz_equiv; done.
- intros [] [] []; rewrite /= /disj_gsets_op_instance /= assoc_L; done.
- intros [] []; rewrite /= /disj_gsets_op_instance /= comm_L; done.
- intros []; rewrite /= /disj_gsets_op_instance /= union_idemp_L; done.
- done.
- done.
- intros [] []; rewrite disj_gsets_valid_op; intros (?&?&?); done.
Qed.
Canonical Structure disj_gsetsR := discreteR (disj_gsets K) disj_gsets_ra_mixin.

Global Instance disj_gsets_cmra_discrete : CmraDiscrete disj_gsetsR.
Proof. apply discrete_cmra_discrete. Qed.

Global Instance disj_gsets_core_id X : CoreId (DGSets X).
Proof. by constructor. Qed.

Lemma disj_gsets_ucmra_mixin : UcmraMixin (disj_gsets K).
Proof.
split; [done| |done].
intros [X]; rewrite /= /disj_gsets_op_instance /=; f_equiv; set_solver.
Qed.
Canonical Structure disj_gsetsUR := Ucmra (disj_gsets K) disj_gsets_ucmra_mixin.

Local Arguments op _ _ _ _ : simpl never.

Lemma disj_gsets_alloc_op_local_update X Y Z :
all_disjoint Z →
have_disj_elems Z X →
(DGSets X, DGSets Y) ~l~> (DGSets Z ⋅ DGSets X, DGSets Z ⋅ DGSets Y).
Proof. intros; apply op_local_update_discrete; rewrite disj_gsets_valid_op; done. Qed.
Lemma disj_gsets_alloc_union_local_update X Y Z :
all_disjoint Z →
have_disj_elems Z X →
(DGSets X, DGSets Y) ~l~> (DGSets (Z ∪ X), DGSets (Z ∪ Y)).
Proof. apply disj_gsets_alloc_op_local_update. Qed.

Lemma disj_gset_alloc_empty_local_update X Z :
all_disjoint Z →
have_disj_elems Z X →
(DGSets X, DGSets ∅) ~l~> (DGSets (Z ∪ X), DGSets Z).
Proof.
intros. rewrite -{2}(right_id_L _ union Z).
apply disj_gsets_alloc_union_local_update; done.
Qed.
End disj_gsets.

Global Arguments disj_gsetsO _ {_ _}.
Global Arguments disj_gsetsR _ {_ _}.
Global Arguments disj_gsetsUR _ {_ _}.
Loading