Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
50fdaa8
initial work
keba4ok Feb 5, 2025
dead729
draft statements
keba4ok Feb 11, 2025
783a5d2
Merge branch 'main' into dev-seq-zero
keba4ok Feb 11, 2025
f4bc49b
proof drafts
keba4ok Feb 19, 2025
da9e48e
drafting
keba4ok Feb 25, 2025
af64de1
drafting
keba4ok Feb 26, 2025
17dbe18
prog draft finished
keba4ok Mar 5, 2025
750995b
proof work
keba4ok Mar 12, 2025
ed82823
proof work
keba4ok Mar 18, 2025
91e0b5a
wf condition added
keba4ok Mar 18, 2025
4a62970
reexec drafted
keba4ok Mar 19, 2025
e9dc816
acts_set proceedings
keba4ok Mar 24, 2025
8c19181
questionable version of lab solution
keba4ok Mar 25, 2025
75ac22b
reexec problem
keba4ok Mar 26, 2025
2c1469d
probable solution
keba4ok Mar 26, 2025
9f3bdb4
minor fix
keba4ok Mar 26, 2025
a19cd0c
checking out po
keba4ok Mar 26, 2025
3c677cf
reexec threads_set preservation
keba4ok Mar 27, 2025
fbe5953
reexec simrel only wf left
keba4ok Mar 27, 2025
fdb930f
new conditions, simrel for reexec done
keba4ok Mar 27, 2025
2e93573
reexec proof drafting
keba4ok Apr 1, 2025
f22eb87
some problems
keba4ok Apr 9, 2025
8924fa6
reex work
keba4ok Apr 9, 2025
90941a4
reexec simrel almost done
keba4ok Apr 16, 2025
c2e66ad
Merge remote-tracking branch 'origin/main' into dev-seq-zero
keba4ok Apr 16, 2025
9011348
fixes & reexec simrel done
keba4ok Apr 22, 2025
da63c2a
reexec step work
keba4ok Apr 23, 2025
6228c3a
new def rework
keba4ok Apr 29, 2025
d6d1a90
proceedings in reexec step
keba4ok Apr 29, 2025
077c713
reexec step work
keba4ok Apr 29, 2025
d4d31c9
reexec step work
keba4ok Apr 30, 2025
09e54d0
exec fixes, reexec problem
keba4ok May 1, 2025
cb92fd4
wf for s and s' proven
keba4ok May 5, 2025
7282dac
plenty of work
keba4ok May 10, 2025
1e483a0
reexec work
keba4ok May 11, 2025
3f1c766
reexec work
keba4ok May 11, 2025
7c6cc56
reexec work
keba4ok May 11, 2025
0e34e5a
po-work, ci fixes
keba4ok May 19, 2025
3d73e72
exec work
keba4ok May 20, 2025
8c4af14
fixes
keba4ok May 20, 2025
e5a052d
seq-exec only po left
keba4ok May 21, 2025
33bbf49
both rpo done
keba4ok May 21, 2025
98d3429
reexec attempts
keba4ok May 22, 2025
ba900c3
threads admit closed
keba4ok May 23, 2025
0de5ac2
some work
keba4ok May 23, 2025
1dda4a8
proof distribution
keba4ok May 23, 2025
0aef6c5
proof distribution
keba4ok May 23, 2025
df98979
2 cases of exec done mod 2 admits
keba4ok May 23, 2025
4319259
reexec work
keba4ok May 24, 2025
6d1aa51
attempts
keba4ok May 24, 2025
7f29ac3
big admit in exec
keba4ok May 25, 2025
fde9e65
exec2 work
keba4ok May 25, 2025
1fa2448
commentaries, additional work
keba4ok May 25, 2025
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
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"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,
"**/*.vo": true,
"**/*.vok": true,
"**/*.vos": true,
"**/*.aux": true,
"**/*.glob": true,
"**/*_cp_aux.v": true
},
"nixEnvSelector.suggestion": false,
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COQMODULE := xmm
COQTHEORIES := src/reordering/*.v src/xmm/*.v src/lib/*.v src/traces/*.v src/xmm_cons/*.v
COQTHEORIES := src/reordering/*.v src/xmm/*.v src/lib/*.v src/traces/*.v src/xmm_cons/*.v src/sequentialization/*.v

.PHONY: all theories clean tounicode

Expand Down
1 change: 0 additions & 1 deletion src/reordering/ReorderingExecA.v
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ Proof using ADD SIMREL INV INV'.
all: unfold f.
all: rewrite ?collect_rel_id, ?set_collect_id.
{ basic_solver. }
{ basic_solver. }
{ intros e EIN. unfold id.
now apply rsr_a_labeq. }
{ apply rsr_rpo_emb. }
Expand Down
44 changes: 44 additions & 0 deletions src/sequentialization/Programs.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From hahn Require Import Hahn.
From hahnExt Require Import HahnExt.
From imm Require Import Events Execution.
From xmm Require Import Instructions.
From xmm Require Import Core.
Require Import Lia Setoid Program.Basics.
Require Import Coq.Sorting.Mergesort.
Require Import Coq.Structures.OrderedType.

Open Scope nat_scope.
Open Scope program_scope.

Section Program.

Definition program_trace := thread_id -> list label.
Definition program := program_trace -> Prop.

Record program_trace_sequented (p_tr1 p_tr2 : program_trace) (t1 t2 : thread_id) : Prop :=
{ p_tr_eq : forall t, t <> t1 /\ t <> t2 -> p_tr1 t = p_tr2 t;
p_tr_empty : p_tr2 t2 = [];
p_tr_concat : p_tr2 t1 = p_tr1 t1 ++ p_tr1 t2;
}.

Definition corresp_px (exec : WCore.t) (p_tr : program_trace) : Prop :=
forall t i, (acts_set (WCore.G exec)) (ThreadEvent t i) ->
Some (lab (WCore.G exec) (ThreadEvent t i)) = nth_error (p_tr t) i.

Definition program_sequented (p1 p2 : program) (t1 t2 : thread_id) : Prop :=
forall p_tr : program_trace,
p2 p_tr -> exists p_tr', p1 p_tr' /\
program_trace_sequented p_tr' p_tr t1 t2.

Record exec_sequent (ex1 ex2 : WCore.t) (p1 p2 : program)
(t1 t2 : thread_id) : Prop := {
exec_sequented : program_sequented p1 p2 t1 t2;
traces_cond : forall p_tr1 p_tr2 : program_trace,
p1 p_tr1 -> p2 p_tr2 ->
corresp_px ex1 p_tr1 ->
corresp_px ex2 p_tr2 ->
program_trace_sequented p_tr1 p_tr2 t1 t2;
}.


End Program.
179 changes: 179 additions & 0 deletions src/sequentialization/SequentBase.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
Require Import AuxDef.
Require Import Core.
Require Import AuxRel AuxRel2.
Require Import Srf Rhb.
Require Import SimrelCommon.
Require Import StepOps.
Require Import AuxInj.
Require Import xmm_s_hb.
Require Import Lia.
From xmm Require Import Reordering.
From xmm Require Import ThreadTrace.
From xmm Require Import Programs.

From hahn Require Import Hahn.
From hahnExt Require Import HahnExt.
From imm Require Import Events Execution Execution_eco.
Require Import Setoid Morphisms Program.Basics.

Open Scope program_scope.

Set Implicit Arguments.

Section SimRelSeq.

Variable X_s X_t : WCore.t.
Variable t_1 t_2 : thread_id.
Variable mapper : actid -> actid.
Variable mappre_rev : actid -> actid.

Notation "'G_t'" := (WCore.G X_t).
Notation "'lab_t'" := (lab G_t).
Notation "'loc_t'" := (loc lab_t).
Notation "'val_t'" := (val lab_t).
Notation "'E_t'" := (acts_set G_t).
Notation "'sb_t'" := (sb G_t).
Notation "'rf_t'" := (rf G_t).
Notation "'co_t'" := (co G_t).
Notation "'rhb_t'" := (rhb G_t).
Notation "'rmw_t'" := (rmw G_t).
Notation "'rpo_t'" := (rpo G_t).
Notation "'rpo_imm_t'" := (rpo_imm G_t).
Notation "'rmw_dep_t'" := (rmw_dep G_t).
Notation "'data_t'" := (data G_t).
Notation "'ctrl_t'" := (ctrl G_t).
Notation "'addr_t'" := (addr G_t).

Notation "'G_s'" := (WCore.G X_s).
Notation "'lab_s'" := (lab G_s).
Notation "'val_s'" := (val lab_s).
Notation "'loc_s'" := (loc lab_s).
Notation "'E_s'" := (acts_set G_s).
Notation "'sb_s'" := (sb G_s).
Notation "'rf_s'" := (rf G_s).
Notation "'co_s'" := (co G_s).
Notation "'rhb_s'" := (rhb G_s).
Notation "'rmw_s'" := (rmw G_s).
Notation "'rpo_s'" := (rpo G_s).
Notation "'rpo_imm_s'" := (rpo_imm G_s).
Notation "'vf_s'" := (vf G_s).
Notation "'rmw_dep_s'" := (rmw_dep G_s).
Notation "'data_s'" := (data G_s).
Notation "'ctrl_s'" := (ctrl G_s).
Notation "'addr_s'" := (addr G_s).

Notation "'Tid_' t" := (fun e => tid e = t) (at level 1).

Definition po_seq := (Tid_ t_1 ∩₁ E_s) × (Tid_ t_2 ∩₁ E_s).

Variable ptc_1 ptc_2 : program_trace.

Definition t_12_len := length (ptc_2 t_1).
Definition t_1_len := length (ptc_1 t_1).
Definition t_2_len := length (ptc_1 t_2).

Record seq_simrel : Prop := {
seq_inj : inj_dom E_t mapper;

seq_tid_1 : forall e : actid, E_t e -> tid (mapper e) <> t_2 -> tid e = tid (mapper e);
seq_tid_2 : forall e : actid, E_t e -> tid (mapper e) = t_2 -> tid e = t_1;

seq_lab : eq_dom E_t lab_t (lab_s ∘ mapper);
seq_lab_rev : eq_dom E_s lab_s (lab_t ∘ mappre_rev);
seq_acts : E_s ≡₁ mapper ↑₁ E_t;
seq_acts_rev : E_t ≡₁ mappre_rev ↑₁ E_s;
seq_sb : sb_s ∪ po_seq ≡ mapper ↑ sb_t;
seq_rf : rf_s ≡ mapper ↑ rf_t;
seq_co : co_s ≡ mapper ↑ co_t;
seq_rmw : rmw_s ≡ mapper ↑ rmw_t;
seq_threads : threads_set G_s ≡₁ threads_set G_t ∪₁ eq t_2;

seq_ctrl : ctrl_s ≡ ∅₂;
seq_data : data_s ≡ ∅₂;
seq_addr : addr_s ≡ ∅₂;
seq_rmw_dep : rmw_dep_s ≡ ∅₂;

seq_init : fixset is_init mapper;
seq_init_rev : fixset is_init mappre_rev;
seq_codom : mapper ↑₁ E_t ⊆₁ E_s;

seq_mapeq : forall e : actid, E_t e -> tid (mapper e) <> t_2 -> mapper e = e;
seq_mapeq_rev : forall e : actid, E_s e -> tid e <> t_2 -> mappre_rev e = e;
seq_mapto : forall e : actid, E_t e -> tid (mapper e) = t_2 -> mapper e = ThreadEvent t_2 (index e - t_1_len);
seq_index : forall e : actid, E_t e -> tid (mapper e) = t_2 -> index e = t_1_len + index (mapper e);
seq_thrd : forall e : actid, E_t e -> tid (mapper e) = t_2 -> tid e = t_1;
seq_maprev : forall e : actid, E_s e -> tid e = t_2 -> mappre_rev e = ThreadEvent t_1 (index e + t_1_len);

seq_out : forall e : actid, E_t e -> tid e <> t_1 -> mapper e = e;
seq_out_snd : forall e : actid, E_t e -> tid e = t_1 -> index e < t_1_len -> mapper e = e;
seq_out_move : forall e : actid, E_t e -> tid e = t_1 -> index e >= t_1_len -> mapper e = ThreadEvent t_2 (index e - t_1_len);

seq_rest : forall e : actid, ~ E_t e -> mapper e = e;
seq_rest_rev : forall e : actid, ~ E_s e -> mappre_rev e = e;
seq_rlab : forall e : actid, ~ E_s e -> lab_s e = lab_t (mappre_rev e);
}.

Record seq_simrel_inv : Prop := {
rsr_Gt_wf : Wf G_t;
rsr_nctrl : ctrl_t ≡ ∅₂;
rsr_ndata : data_t ≡ ∅₂;
rsr_naddr : addr_t ≡ ∅₂;
rsr_nrmw_dep : rmw_dep_t ≡ ∅₂;
rsr_init_acts : is_init ⊆₁ E_t;
}.

End SimRelSeq.

Section SeqSimrelInit.

Variable X_t X_s : WCore.t.
Variable t_1 t_2 : thread_id.
Variable mapper : actid -> actid.
Variable mappre_rev : actid -> actid.

Variable ptc_1 ptc_2 : program_trace.

Notation "'G_t'" := (WCore.G X_t).
Notation "'G_s'" := (WCore.G X_s).

Hypothesis INV : seq_simrel_inv X_t.

Lemma seq_simrel_init threads
(NINIT1 : t_1 <> tid_init)
(NINIT2 : t_2 <> tid_init)
(THRD1 : threads t_1)
(THRDNEQ : t_1 <> t_2)
(INIT : threads tid_init) :
<< SIMREL : seq_simrel
(WCore.Build_t (WCore.init_exec (threads ∪₁ eq t_2)) ∅₂)
(WCore.Build_t (WCore.init_exec threads) ∅₂)
t_1 t_2
id id ptc_1 >>.
Proof using.
assert (IWF : Wf (WCore.init_exec threads)).
{ now apply WCore.wf_init_exec. }
split; vauto; ins.
{ assert (FALSE : t_2 = tid_init).
{ rewrite <- H0. unfold tid. desf.
unfold is_init in H. desf. }
desf. }
{ clear; basic_solver. }
{ clear; basic_solver. }
{ rewrite collect_rel_id; split; vauto.
unfold po_seq; ins.
assert (EMP1 : (fun e : actid => tid e = t_1)
∩₁ (fun a : actid => is_init a) ≡₁ ∅).
{ split; [|basic_solver].
intros x COND. destruct COND as [TID ISINIT].
unfold is_init in ISINIT. desf. }
assert (EMP2 : (fun e : actid => tid e = t_2)
∩₁ (fun a : actid => is_init a) ≡₁ ∅).
{ split; [|basic_solver].
intros x COND. destruct COND as [TID ISINIT].
unfold is_init in ISINIT. desf. }
rewrite EMP1, EMP2. clear; basic_solver 8. }
all : try basic_solver.
all : unfold is_init in H; desf.
Qed.

End SeqSimrelInit.
Loading