Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8ab960b
splitting vis nodes into two transitions: wip on the transition theory
YaZko Oct 23, 2025
4545e95
inversion of bind transitions ok
YaZko Oct 23, 2025
bd94505
bunch of lemmas about weak reductions must be duplicated. Getting close
YaZko Oct 23, 2025
f4a9204
Finished trans, without the ltac
YaZko Oct 24, 2025
798b082
Fixed upto bind
YaZko Oct 27, 2025
4dedeef
Iterating on the label relation interface
YaZko Oct 29, 2025
e6666e0
Enforcing the shape of relations from the very definition of the simu…
YaZko Oct 29, 2025
f2cdc10
pushed back to upto bind with new setup
YaZko Oct 29, 2025
850ca88
The family of bind lemmas. Need to think about the proper instance no…
YaZko Oct 30, 2025
2db8b97
Progress in reestablishing the metatheory, trying to simplify on the …
YaZko Oct 30, 2025
0de205c
Fixed all backward lemmas
YaZko Oct 31, 2025
90f8bab
Some tidying
YaZko Oct 31, 2025
7a32335
Finished strong simulation
YaZko Oct 31, 2025
7b1ca0e
Adapting and pulling out the monotone condition from cssim
YaZko Oct 31, 2025
6fe6f55
Pulled out not_stuck predicate, adapted complete simulation down to u…
YaZko Nov 3, 2025
15d3dfd
minor reformulation. Quite positive there's a stronger up-to bind val…
YaZko Nov 3, 2025
df61b3f
checkpoint
YaZko Nov 3, 2025
35da3c6
Finished complete simulations, but mirrored a lot strong simulations,…
YaZko Nov 3, 2025
40fc248
quick setup for symmetric
YaZko Nov 5, 2025
c878904
Better tactics, better instances
YaZko Nov 7, 2025
302f8c2
equivalence upto for sb
YaZko Nov 7, 2025
0258802
Parameterization of Seq by a value relation
YaZko Nov 14, 2025
2c6b639
Merge branch 'dev' into askrcv
Chobbes Nov 18, 2025
8276517
WIP
YaZko Apr 15, 2026
2816789
Merge branch 'askrcv' of github.com:vellvm/ctrees into askrcv
YaZko Apr 15, 2026
8420422
Finished proof rules. Not the worst state, but some thought should si…
YaZko Apr 16, 2026
01729d3
elementary laws
YaZko Apr 16, 2026
2f25152
Incompatibility lemmas and a painful fix to tactics
YaZko Apr 16, 2026
87ed644
Finished sbisim
YaZko Apr 17, 2026
7d5ee4d
Promoting the draft to main, keeping the old one for review of changes
YaZko Apr 17, 2026
46a4523
Automate working with labels
YaZko Apr 17, 2026
2bb6f9e
Capitalization
YaZko Apr 17, 2026
b0f721f
Epsilon, might be necessary to revisit it to prettify things a bit..
YaZko Apr 17, 2026
9d1cf9b
A note
rogerburtonpatel Jun 18, 2026
730b96e
Changed trans_alt, ssimalt, updated most lemmas in those files
rogerburtonpatel Jun 25, 2026
701681c
Equivalence between old and new trans.
rogerburtonpatel Jul 6, 2026
b9cec75
Fixed and finished SSimAlt
rogerburtonpatel Jul 10, 2026
9fb0cf6
Fixed Pure.v
rogerburtonpatel Jul 10, 2026
7b8ff80
Added monauto for experiements
rogerburtonpatel Jul 10, 2026
a7a1232
Moved some items, added tower induction
rogerburtonpatel Jul 10, 2026
f0ad07e
SBisimAlt for review.
rogerburtonpatel Jul 10, 2026
5c06ffd
Fixed bind in SBisimAlt
rogerburtonpatel Jul 15, 2026
e19ac79
Fixed bind in SSimAlt
rogerburtonpatel Jul 15, 2026
ca57c2a
nits from meeting
YaZko Jul 15, 2026
d37b30f
mon instance
YaZko Jul 15, 2026
c1a53b5
Rm some intermediate ss defs
rogerburtonpatel Jul 15, 2026
bce13f8
Merge branch 'askrcv' of github.com:vellvm/ctrees into askrcv
rogerburtonpatel Jul 15, 2026
053cb7a
Push lrel under ss' mon
rogerburtonpatel Jul 15, 2026
19810c5
Progress on global fixes to SSimAlt
rogerburtonpatel Jul 15, 2026
10fc3ee
More type fixes
rogerburtonpatel Jul 16, 2026
207648d
Revert ssim to before
rogerburtonpatel Jul 16, 2026
136e68f
Lots of equivalences, need cleaning
rogerburtonpatel Jul 25, 2026
ad52ae5
Factored out Estar
rogerburtonpatel Jul 26, 2026
5bc692b
Cleaned SSimAlt, removed update_val_rel, documented.
rogerburtonpatel Jul 28, 2026
c09362f
Types under sb' for bind chain argument. Now fixing files.
rogerburtonpatel Jul 30, 2026
16dbf7c
Done up to up to bind, needs some renaming. removing uvr.
rogerburtonpatel Jul 30, 2026
f7aa35a
Minor fix to proof legibility
rogerburtonpatel Jul 31, 2026
8723c74
finished functional draft of sbisimalt.v. onto tests.
rogerburtonpatel Jul 31, 2026
f4891a2
Commits before larger push forward
rogerburtonpatel Sep 29, 2026
04ed9b8
More patches. Now restructuring.
rogerburtonpatel Sep 29, 2026
0ca3858
Partway through new structure, checkpointing
rogerburtonpatel Sep 30, 2026
0020815
First step of structural refactor to get clean parallel structure bet…
rogerburtonpatel Sep 30, 2026
b1b815b
Move-arounds before larger definitional fixes.
rogerburtonpatel Oct 1, 2026
6b8d672
Large patch to many files towards full repair.
rogerburtonpatel Oct 1, 2026
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ _build
*~
.lia.cache
.aux
rocq-ctree.opam
29 changes: 14 additions & 15 deletions examples/AltBisim/BisimExample.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From CTree Require Import CTree Eq Eq.SBisimAlt Eq.IterFacts.
From CTree Require Import CTree Eq Eq.SBisimAlt Eq.OldAltEquiv.TransEquiv Eq.OldAltEquiv.SBisimEquiv Eq.IterFacts.

Import CoindNotations.
Import CTreeNotations.
Expand All @@ -18,37 +18,36 @@ Proof. step. cbn. reflexivity. Qed.
Lemma unfold_u : u ≅ br2 (trigger (print true);; u) u.
Proof. step. cbn. reflexivity. Qed.

Theorem bisim_t_u : t ~ u.
Theorem bisim_t_u : t ≃ u.
Proof.
coinduction R CH.
rewrite unfold_t, unfold_u.
apply step_sb_br; intros [].
apply sb_br; intros [].
2: {
exists true.
rewrite !bind_trigger.
apply step_sb_vis_id. intros [].
split; [| auto].
apply CH.
apply sb_vis_id; [constructor |]. intros [].
split; [apply CH | constructor].
}
{
exists false.
Fail apply CH.
Fail apply CH.
Abort.

Theorem bisim_t_u : t ~ u.
Theorem bisim_t_u : t ≃ u.
Proof.
(* We switch to the alternative characterization of bisimulation. *)
rewrite sbisim_sbisim'.
unfold sbisimT; rewrite sbisim_sbisim'.
(* The rest of the proof proceeds as before, but this time it succeeds. *)
coinduction R CH. intros.
rewrite unfold_t, unfold_u.
cbn [TransEquiv.o2n_S]. rewrite unfold_t, unfold_u.
apply step_sb'_br; intros [].
(* Notice that unlike step_sb_br, step_sb'_br has unlocked the coinduction hypothesis. *)
2: {
exists true.
rewrite !bind_trigger.
step. apply step_sb'_vis_id. intros [].
split; [| auto].
step. apply step_sb'_vis_id; [| constructor; constructor]. intros.
apply (b_chain R). apply step_sb'_passive_id; [| constructor; constructor]. intros ? [].
apply CH.
}
{
Expand All @@ -59,8 +58,8 @@ Proof.
{
exists false.
rewrite !bind_trigger.
step. apply step_sb'_vis_id. intros [].
split; [| auto].
step. apply step_sb'_vis_id; [| constructor; constructor]. intros.
apply (b_chain R). apply step_sb'_passive_id; [| constructor; constructor]. intros ? [].
apply CH.
}
{
Expand All @@ -78,7 +77,7 @@ Definition t' : ctree PrintE B2 void :=
Definition u' : ctree PrintE B2 void :=
CTree.iter (fun _ => br2 (trigger (print true);; Ret (inl tt)) (Ret (inl tt))) tt.

Theorem bisim_t'_u'_simple : t' ~ u'.
Theorem bisim_t'_u'_simple : t' ≃ u'.
Proof.
unfold t', u'.
apply sbisim_eq_iter. intros _.
Expand Down
26 changes: 13 additions & 13 deletions examples/CCS/Denotation.v
Original file line number Diff line number Diff line change
Expand Up @@ -1063,25 +1063,25 @@ Qed.

Section Theory.

Lemma plsC: forall (p q : ccs), p+q ~ q+p.
Lemma plsC: forall (p q : ccs), p+q ≃ q+p.
Proof.
apply br2_commut.
Qed.

Lemma plsA (p q r : ccs): p+(q+r) ~ (p+q)+r.
Lemma plsA (p q r : ccs): p+(q+r) ≃ (p+q)+r.
Proof.
symmetry; apply br2_assoc.
Qed.

Lemma pls0p (p : ccs) : 0 + p ~ p.
Lemma pls0p (p : ccs) : 0 + p ≃ p.
Proof.
apply br2_stuck_l.
Qed.

Lemma plsp0 (p : ccs) : p + 0 ~ p.
Lemma plsp0 (p : ccs) : p + 0 ≃ p.
Proof. now rewrite plsC, pls0p. Qed.

Lemma plsidem (p : ccs) : p + p ~ p.
Lemma plsidem (p : ccs) : p + p ≃ p.
Proof.
apply br2_idem.
Qed.
Expand All @@ -1093,7 +1093,7 @@ Section Theory.
all:rewrite eqb_sym; auto.
Qed.

Lemma paraC: forall (p q : ccs), p ∥ q ~ q ∥ p.
Lemma paraC: forall (p q : ccs), p ∥ q ≃ q ∥ p.
Proof.
coinduction r CIH; symmetric.
intros p q ? ? tr.
Expand All @@ -1113,7 +1113,7 @@ Section Theory.
reflexivity.
Qed.

Lemma para0p : forall (p : ccs), 0 ∥ p ~ p.
Lemma para0p : forall (p : ccs), 0 ∥ p ≃ p.
Proof.
coinduction R CIH.
intros.
Expand All @@ -1130,12 +1130,12 @@ Section Theory.
cbn; auto.
Qed.

Lemma parap0 : forall (p : ccs), p ∥ 0 ~ p.
Lemma parap0 : forall (p : ccs), p ∥ 0 ≃ p.
Proof.
intros; rewrite paraC; apply para0p.
Qed.

Lemma paraA : forall (p q r : ccs), p ∥ (q ∥ r) ~ (p ∥ q) ∥ r.
Lemma paraA : forall (p q r : ccs), p ∥ (q ∥ r) ≃ (p ∥ q) ∥ r.
Proof.
coinduction r CIH; intros.
split.
Expand Down Expand Up @@ -1194,7 +1194,7 @@ Section Theory.
End Theory.

Lemma para_parabang : forall p q r,
parabang (p ∥ q) r ~ p ∥ parabang q r.
parabang (p ∥ q) r ≃ p ∥ parabang q r.
Proof.
coinduction R CIH.
intros; split.
Expand Down Expand Up @@ -1310,7 +1310,7 @@ Proof.
Qed.

Lemma parabang_aux : forall p q,
parabang (p ∥ q) q ~ parabang p q.
parabang (p ∥ q) q ≃ parabang p q.
Proof.
coinduction R CIH.
split.
Expand Down Expand Up @@ -1381,7 +1381,7 @@ Proof.
Qed.

Lemma parabang_eq : forall p q,
parabang p q ~ p ∥ !q.
parabang p q ≃ p ∥ !q.
Proof.
coinduction R CIH.
intros p q; split.
Expand Down Expand Up @@ -1451,7 +1451,7 @@ Proof.
Qed.

Lemma unfold_bang' : forall p,
!p ~ !p ∥ p.
!p ≃ !p ∥ p.
Proof.
intros; unfold bang at 1.
rewrite parabang_eq. rewrite paraC; reflexivity.
Expand Down
12 changes: 6 additions & 6 deletions examples/CCS/OpDenot.v
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Proof.
exists R; split; auto.
Qed.

Definition bisim_model := fun P (q: ccs) => ⟦P⟧ ~ q.
Definition bisim_model := fun P (q: ccs) => ⟦P⟧ ≃ q.

Lemma complete : forward bisim_model.
Proof.
Expand Down Expand Up @@ -321,7 +321,7 @@ Lemma cross_model_compose : forall T t u U,
bisimilar t T ->
Operational.bisim t u ->
bisimilar u U ->
T ~ U.
T ≃ U.
Proof.
coinduction r cih.
intros * EQtT EQtu EQuU.
Expand All @@ -343,7 +343,7 @@ Qed.

Lemma cross_model_compose' : forall T t u U,
bisimilar t T ->
T ~ U ->
T ≃ U ->
bisimilar u U ->
Operational.bisim t u.
Proof.
Expand Down Expand Up @@ -373,7 +373,7 @@ Proof.
red; intros; edestruct F; eauto.
Qed.

Lemma embed_sound : forall t u, Operational.bisim t u -> ⟦t⟧ ~ ⟦u⟧.
Lemma embed_sound : forall t u, Operational.bisim t u -> ⟦t⟧ ≃ ⟦u⟧.
Proof.
intros * BIS.
apply (gfp_fp b t u) in BIS; destruct BIS as [F B]; cbn in *.
Expand Down Expand Up @@ -402,7 +402,7 @@ Proof.
eapply cross_model_compose; eauto.
Qed.

Lemma embed_complete : forall t u, ⟦t⟧ ~ ⟦u⟧ -> Operational.bisim t u.
Lemma embed_complete : forall t u, ⟦t⟧ ≃ ⟦u⟧ -> Operational.bisim t u.
Proof.
intros * BIS.
step in BIS; destruct BIS as [F B]; cbn in *.
Expand Down Expand Up @@ -431,7 +431,7 @@ Proof.
eapply cross_model_compose'; eauto.
Qed.

Theorem equiv_bisims : forall t u, ⟦t⟧ ~ ⟦u⟧ <-> Operational.bisim t u.
Theorem equiv_bisims : forall t u, ⟦t⟧ ≃ ⟦u⟧ <-> Operational.bisim t u.
Proof.
intros; split; eauto using embed_complete, embed_sound.
Qed.
Expand Down
22 changes: 11 additions & 11 deletions examples/ImpBr/ImpBr.v
Original file line number Diff line number Diff line change
Expand Up @@ -137,41 +137,41 @@ Section Theory.
at the level of uninterpreted ctrees.
|*)
Lemma branch_commut : forall (a b : stmt),
⟦Branch a b⟧ ~ ⟦Branch b a⟧.
⟦Branch a b⟧ ≃ ⟦Branch b a⟧.
Proof.
intros; apply br2_commut.
Qed.

Lemma branch_assoc : forall (a b c : stmt),
⟦Branch a (Branch b c)⟧ ~ ⟦Branch (Branch a b) c⟧.
⟦Branch a (Branch b c)⟧ ≃ ⟦Branch (Branch a b) c⟧.
Proof.
intros; cbn.
now rewrite br2_assoc.
Qed.

Lemma branch_idem : forall a : stmt,
⟦Branch a a⟧ ~ ⟦a⟧.
⟦Branch a a⟧ ≃ ⟦a⟧.
Proof.
intros; apply br2_idem.
Qed.

Lemma branch_congr : forall a a' b b',
⟦a⟧ ~ ⟦a'⟧ ->
⟦b⟧ ~ ⟦b'⟧ ->
⟦Branch a b⟧ ~ ⟦Branch a' b'⟧.
⟦a⟧ ≃ ⟦a'⟧ ->
⟦b⟧ ≃ ⟦b'⟧ ->
⟦Branch a b⟧ ≃ ⟦Branch a' b'⟧.
Proof.
intros. cbn. apply sb_br_id.
intros. cbn. apply sbisim_br_id.
intro; destruct x; rewrite ?H, ?H0; reflexivity.
Qed.

Lemma branch_block_l : forall a : stmt,
⟦Branch Block a⟧ ~ ⟦a⟧.
⟦Branch Block a⟧ ≃ ⟦a⟧.
Proof.
intros; apply br2_stuck_l.
Qed.

Lemma branch_block_r : forall a : stmt,
⟦Branch a Block⟧ ~ ⟦a⟧.
⟦Branch a Block⟧ ≃ ⟦a⟧.
Proof.
intros; apply br2_stuck_r.
Qed.
Expand All @@ -189,7 +189,7 @@ Section Theory.
Qed.

Lemma branch_block_r_interp : forall (a : stmt) s,
ℑ (Branch a Block) s ~
ℑ (Branch a Block) s ≃
ℑ a s.
Proof.
intros.
Expand Down Expand Up @@ -222,7 +222,7 @@ from Section 2 are indeed equivalent.
(Seq
(Assign "x" (Lit 0))
(Assign "x" (Lit 1)))
Block) s ~
Block) s ≃
ℑ (Assign "x" (Lit 1)) s.
Proof with (unfold interp_imp).
intros...
Expand Down
20 changes: 10 additions & 10 deletions examples/SimpleSim/SimExample.v
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,27 @@ Theorem sim_t_u : t ≲ u.
Proof.
coinduction R CH.
rewrite unfold_t, unfold_u.
apply step_ss_br_r with (x := true).
apply step_ss_vis_id. intros []. split; auto.
apply ss_br_r with (x := true).
apply ss_vis_eq. intros [].
rewrite unfold_u.
step. apply step_ss_br_r with (x := false).
apply step_ss_vis_id. intros []. split; [| auto].
step. apply ss_br_r with (x := false).
apply ss_vis_eq. intros [].
apply CH.
Qed.

Theorem bisim_u_u' : u ~ u'.
Theorem bisim_u_u' : u ≃ u'.
Proof.
coinduction R CH.
rewrite unfold_u, unfold_u'.
unfold br2. rewrite bind_br.
apply step_sb_br_id. intros.
apply sb_br_id. intros.
destruct x.
- rewrite bind_trigger.
apply step_sb_vis_id. intros []. split; [| auto].
rewrite sb_guard.
apply sb_vis_eq. intros [].
rewrite sbisim_guard.
apply CH.
- rewrite bind_trigger.
apply step_sb_vis_id. intros []. split; [| auto].
rewrite sb_guard.
apply sb_vis_eq. intros [].
rewrite sbisim_guard.
apply CH.
Qed.
Loading
Loading