File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,8 @@ Section defn.
122122 h_handler _ req := mailbox_step req;
123123 h_initial := new;
124124 h_spawn pid mb_t := put pid {| mb_t := mb_t; mb_q := empty |};
125+ h_spawn_covariance pid mb_t s s' H := ltac:(now rewrite H);
125126 h_terminate pid := delete pid;
127+ h_terminate_covariance pid s s' H := ltac:(now rewrite H);
126128 |}.
127129End defn.
Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ Section storage_handler.
7777 h_handler _ req := storage_mfun req;
7878 h_initial := stor.new;
7979 h_spawn _ _ := id;
80+ h_spawn_covariance _ _ _ _ H := H;
8081 h_terminate _ := id;
82+ h_terminate_covariance _ _ _ H := H;
8183 |}.
8284End storage_handler.
8385
Original file line number Diff line number Diff line change @@ -17,14 +17,21 @@ Section IOHandler.
1717 Definition MFunRet Ret State `{HRet : Setoid Ret} `{HState : Setoid State} :=
1818 @MFun State (Ret * State) HState (@pair_setoid _ _ HRet HState).
1919
20+
2021 Class IOHandler := {
2122 h_state : Type ;
2223 h_setoid : Setoid h_state;
2324 h_handler (pid : Ref) (req : Request) : MFunRet (Reply req) h_state;
2425 h_initial : h_state;
2526
2627 h_spawn (pid : Ref) (mailbox_t : Set ) : h_state -> h_state;
28+ h_spawn_covariance : forall pid mailbox_t s s',
29+ s == s' ->
30+ h_spawn pid mailbox_t s == h_spawn pid mailbox_t s';
2731 h_terminate (pid : Ref) : h_state -> h_state;
32+ h_terminate_covariance : forall pid s s',
33+ s == s' ->
34+ h_terminate pid s == h_terminate pid s';
2835 }.
2936End IOHandler.
3037
You can’t perform that action at this time.
0 commit comments