@@ -67,34 +67,43 @@ Context
67
67
(print_sprogP : forall s p, cparams.(print_sprog) s p = p)
68
68
.
69
69
70
- Definition of_void1 {A T} (e : void1 A) : T := match e with end.
71
- Definition of_void_sum {E} : E +' void1 ~> E :=
72
- fun _ x => match x with inl1 a => a | inr1 e => of_void1 e end .
70
+ #[local]
71
+ Instance with_Error0 : with_Error (ErrEvent +' RndEvent syscall_state) (RndEvent syscall_state).
72
+ Proof .
73
+ refine {| mfun1 T x := x; mfun2 T x := x |}; done.
74
+ Qed .
73
75
74
76
#[local]
75
- Instance with_Error0 : with_Error ErrEvent void1 :=
77
+ Instance HandlerContract : EventRels (RndEvent syscall_state) :=
76
78
{|
77
- mfun1 := inl1;
78
- mfun2 := of_void_sum;
79
- mid12 := fun _ e =>
80
- match e with inl1 e => refl_equal | inr1 a => of_void1 a end ;
81
- mid21 := fun _ _ => refl_equal;
79
+ EPreRel0_ := fun A B r1 r2 =>
80
+ let : Rnd scs1 n1 := r1 in
81
+ let : Rnd scs2 n2 := r2 in
82
+ scs1 = scs2 /\ n1 = n2;
83
+ EPostRel0_ := fun A B r1 =>
84
+ match r1 in RndEvent _ A' return A' -> _ with
85
+ Rnd scs1 n1 => fun (a: syscall_state * seq u8) r2 =>
86
+ match r2 in RndEvent _ B' return B' -> _ with
87
+ Rnd scs2 n2 => fun (b: syscall_state * seq u8) => a = b
88
+ end
89
+ end
82
90
|}.
83
91
84
92
#[local]
85
- Instance HandlerContract : EventRels void1 :=
86
- {|
87
- EPreRel0_ := fun _ _ _ _ => False;
88
- EPostRel0_ := fun _ _ _ _ _ _ => True;
89
- |}.
93
+ Instance : RndE0 syscall_state (RndEvent syscall_state) := fun T => id.
90
94
91
95
#[local]
92
- Instance HandlerContract_trans {rE23 rE13} :
93
- EventRels_trans HandlerContract rE23 rE13 :=
94
- {|
95
- ERpre_trans := fun _ _ _ e => of_void1 e;
96
- ERpost_trans := fun _ _ _ e => of_void1 e;
97
- |}.
96
+ Instance : RndE0_refl HandlerContract.
97
+ Proof . by constructor. Qed .
98
+
99
+ #[local]
100
+ Instance HandlerContract_trans :
101
+ EventRels_trans HandlerContract HandlerContract HandlerContract.
102
+ Proof .
103
+ constructor.
104
+ - by move => T1 T2 T3 [scs1 n1] [scs2 n2] [scs3 n3] [-> ->] [-> ->].
105
+ - move => ??? [??] [??] [??] ?? [] -> -> [] -> -> -> /=; eauto.
106
+ Qed .
98
107
99
108
Section FIRST_PART.
100
109
0 commit comments