11From Coq Require Import
22 List
33 ZArith
4- SetoidClass.
4+ SetoidClass
5+ SetoidDec.
56Import ListNotations.
67
78From SLOT Require Import
89 Setoids
910 TransitionSystem
10- Pid.
11+ Pid
12+ ListSelector.
1113
1214From Hammer Require Import
1315 Tactics.
@@ -21,7 +23,7 @@ Section IOHandler.
2123 Context {Request : Type} {Reply : Request -> Type}.
2224
2325 Definition MFunRet Ret State `{HRet : Setoid Ret} `{HState : Setoid State} :=
24- @MFun State (Ret * State) HState (@setoidPair _ _ HRet HState).
26+ @MFun State (Ret * State) HState (@pair_setoid _ _ HRet HState).
2527
2628 Class IOHandler := {
2729 h_state : Type ;
@@ -39,8 +41,7 @@ Section VM.
3941 | p_dead : (* Program terminted *)
4042 Program
4143 | p_yield :
42- (* Wait for signal.
43-
44+ (* Interrupt the computation without producing any side effects.
4445 This primitive is used to softly introduce the concept of
4546 Erlang's "reductions", and to side-step termination checker,
4647 making programs non-Turing in a practically useful, as opposed
@@ -77,6 +78,22 @@ Section VM.
7778
7879 #[export] Instance etaX : Settable _ := settable! mkVM <world; runq; sleepq; child_ctr>.
7980
81+ Program Definition vm_setoid : Setoid VM :=
82+ {| equiv a b :=
83+ let (w1, rq1, sq1, cc1) := a in
84+ let (w2, rq2, sq2, cc2) := b in
85+ let w_eq := @equiv _ h_setoid in
86+ let p_eq := @equiv _ (setoid_permutation (PID * Program )) in
87+ w_eq w1 w2 /\
88+ p_eq rq1 rq2 /\
89+ p_eq sq1 sq2 /\
90+ @equiv _ (eq_setoid _) cc1 cc2;
91+ |}.
92+ Next Obligation .
93+ sauto unfold:Reflexive,Symmetric,Transitive
94+ use:Permutation_sym,Permutation_trans.
95+ Qed .
96+
8097 Definition new_child_id (parent : PID) (v : VM) : VM * positive :=
8198 let cc := child_ctr v in
8299 let (cc, ctr) :=
0 commit comments