Skip to content

Commit 46a4523

Browse files
committed
Automate working with labels
1 parent 7d5ee4d commit 46a4523

2 files changed

Lines changed: 21 additions & 24 deletions

File tree

theories/Eq/Sbisim.v

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -383,20 +383,13 @@ Section sbisim_heterogenous_theory.
383383
step in Sbisimu; apply Sbisimu in TR; destruct TR as (? & ? & TR & Sbis'' & EQl').
384384
do 2 eexists; repeat split; eauto.
385385
eapply INC; eauto.
386-
(* todo ltac *)
387-
apply Leq_eq in EQl.
388-
rewrite flipL_Leq in EQl'.
389-
apply Leq_eq in EQl'.
390-
subst; auto.
386+
now simpL.
391387
+ step in Sbisimu; apply Sbisimu in TR; destruct TR as (? & ? & TR & Sbis & EQl).
392388
apply bwd in TR; destruct TR as (? & ? & TR & Sbis' & HL).
393389
step in Sbisimt; apply Sbisimt in TR; destruct TR as (? & ? & TR & Sbis'' & EQl').
394390
do 2 eexists; repeat split; eauto.
395391
eapply INC; eauto.
396-
apply Leq_eq in EQl.
397-
rewrite flipL_Leq in EQl'.
398-
apply Leq_eq in EQl'.
399-
subst; auto.
392+
now simpL.
400393
Qed.
401394

402395
#[global] Instance seq_chain_ctx {c : Chain (sb L)} :
@@ -458,20 +451,13 @@ Section sbisim_heterogenous_theory.
458451
step in Sbisimu; apply Sbisimu in TR; destruct TR as (? & ? & TR & Sbis'' & EQl').
459452
do 2 eexists; repeat split; eauto.
460453
eapply INC; eauto.
461-
(* todo ltac *)
462-
apply Leq_eq in EQl'.
463-
rewrite flipL_Leq in EQl.
464-
apply Leq_eq in EQl.
465-
subst; auto.
454+
now simpL.
466455
+ step in Sbisimu; apply Sbisimu in TR; destruct TR as (? & ? & TR & Sbis & EQl).
467456
apply bwd in TR; destruct TR as (? & ? & TR & Sbis' & HL).
468457
step in Sbisimt; apply Sbisimt in TR; destruct TR as (? & ? & TR & Sbis'' & EQl').
469458
do 2 eexists; repeat split; eauto.
470459
eapply INC; eauto.
471-
apply Leq_eq in EQl'.
472-
rewrite flipL_Leq in EQl.
473-
apply Leq_eq in EQl.
474-
subst; auto.
460+
now simpL.
475461
Qed.
476462

477463
(*| Subrelations. |*)
@@ -1569,8 +1555,7 @@ Section SBisim_vs_SSim.
15691555
playR in EQ'.
15701556
ex2; split3; eauto.
15711557
eapply IH; eauto.
1572-
rewrite flipL_Leq in H0.
1573-
apply Leq_eq in H,H0; subst; auto.
1558+
now simpL.
15741559
Qed.
15751560

15761561
#[global] Instance sbisim_ss_chain_ctx {c : Chain (ss L)} :
@@ -1588,8 +1573,7 @@ Section SBisim_vs_SSim.
15881573
playL in EQ'.
15891574
ex2; split3; eauto.
15901575
eapply IH; eauto.
1591-
rewrite flipL_Leq in H.
1592-
apply Leq_eq in H,H0; subst; auto.
1576+
now simpL.
15931577
Qed.
15941578

15951579
#[global] Instance sbisim_ssim_goal :
@@ -1667,8 +1651,7 @@ Section Two_ss_is_not_sb.
16671651
symmetry in H. apply H.
16681652
- step. split; [apply H |].
16691653
destruct H as [_ ?].
1670-
(* todo: this should be nicer *)
1671-
eapply lequiv_ss; [apply flipL_Leq |].
1654+
simpL.
16721655
cbn; intros.
16731656
apply H in H0 as (? & ? & ? & ? & ?); answer.
16741657
symmetry; auto.

theories/Eq/Trans.v

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,10 +2369,24 @@ Proof.
23692369
all: dependent induction H; constructor.
23702370
Qed.
23712371

2372+
(* This one is a bit ugly: we will have proper instance to
2373+
lift [lequiv] arguments of (bi)simulations to [weq] result.
2374+
This instance does the last bit to allow the rewriting by [lequiv]
2375+
directly.
2376+
*)
2377+
#[global] Instance weq_body {E B X}:
2378+
Proper (Coinduction.lattice.weq ==> eq ==> eq ==> eq ==> iff)
2379+
(@body (rel (S E B X) (S E B X)) _).
2380+
Proof.
2381+
cbn; intros R L EQ ?? <- ?? <- ?? <-; split; intros H.
2382+
all:apply EQ; auto.
2383+
Qed.
2384+
23722385
Ltac simpL :=
23732386
repeat match goal with
23742387
| h : build_rel (flipL _) _ _ |- _ => rewrite flipL_Leq in h
23752388
| h : build_rel Leq _ _ |- _ => apply Leq_eq in h
2389+
| |- context[flipL Leq] => rewrite flipL_Leq
23762390
end; subst.
23772391

23782392
(* (*| *)

0 commit comments

Comments
 (0)