@@ -8,13 +8,13 @@ Import ListNotations.
88From SLOT Require
99 Setoids
1010 TransitionSystem
11- Pid
11+ Ref
1212 ListSelector
1313 IOHandler
1414 Mailbox.
1515
1616Import Setoids TransitionSystem ListSelector Mailbox.
17- Export Pid IOHandler.
17+ Export Ref IOHandler.
1818
1919From Hammer Require Import
2020 Hammer.
@@ -57,7 +57,7 @@ Section VM.
5757
5858 Record Process :=
5959 mkProcess
60- { pid : PID ;
60+ { pid : Ref ;
6161 proc_mb_t : Set ;
6262 cont : @Program proc_mb_t;
6363 }.
@@ -72,10 +72,10 @@ Section VM.
7272 runq : list Process;
7373 (* Counter that gets incremented when process spawns a child.
7474 This counter is used as a suffix of the child's pid *)
75- child_ctr : Pid .FMap.t positive;
75+ ref_ctr : Ref .FMap.t positive;
7676 }.
7777
78- #[export] Instance etaVM : Settable _ := settable! mkVM <world; runq; child_ctr >.
78+ #[export] Instance etaVM : Settable _ := settable! mkVM <world; runq; ref_ctr >.
7979
8080 Global Program Definition vm_setoid : Setoid VM :=
8181 {| equiv a b :=
@@ -92,19 +92,19 @@ Section VM.
9292 use:Permutation_sym,Permutation_trans.
9393 Qed .
9494
95- Definition new_child_id (parent : PID ) (v : VM) : VM * positive :=
96- let cc := child_ctr v in
95+ Definition make_ref (parent : Ref ) (v : VM) : VM * positive :=
96+ let cc := ref_ctr v in
9797 let (cc, ctr) :=
98- match Pid .FMap.find parent cc with
98+ match Ref .FMap.find parent cc with
9999 | Some ctr =>
100- (Pid .FMap.add parent (ctr + 1) cc, ctr)
100+ (Ref .FMap.add parent (ctr + 1) cc, ctr)
101101 | None =>
102- (Pid .FMap.add parent 2 cc, 1)
102+ (Ref .FMap.add parent 2 cc, 1)
103103 end in
104- (v<| child_ctr := cc |>, ctr).
104+ (v<| ref_ctr := cc |>, ctr).
105105
106- Definition do_spawn {Mailbox : Set } (parent : PID ) (prog : @Program Mailbox) (v : VM) : (PID * VM) :=
107- let (v, child_pid_suffix) := new_child_id parent v in
106+ Definition do_spawn {Mailbox : Set } (parent : Ref ) (prog : @Program Mailbox) (v : VM) : (Ref * VM) :=
107+ let (v, child_pid_suffix) := make_ref parent v in
108108 let rq := runq v in
109109 let new_pid := parent ++ [child_pid_suffix] in
110110 let new_process := {|
@@ -120,14 +120,14 @@ Section VM.
120120 {|
121121 world := w;
122122 runq := [];
123- child_ctr := Pid .FMap.empty _;
123+ ref_ctr := Ref .FMap.empty _;
124124 |} in
125125 let (_, vm) := do_spawn [] p vm in
126126 vm.
127127
128128 Definition vmte_canon_rel (a b : Process) :=
129129 (* Order of events is canonical when pid a =< pid b: *)
130- match PIDOrd .compare_ (pid a) (pid b) with
130+ match RefOrd .compare_ (pid a) (pid b) with
131131 | Gt => False
132132 | _ => True
133133 end .
@@ -141,7 +141,7 @@ Section VM.
141141 Lemma vmte_canon_rel_total a b : vmte_canon_rel a b \/ vmte_canon_rel b a.
142142 Proof .
143143 unfold Decidable.decidable, vmte_canon_rel.
144- sauto use:PIDOrd .compare_asymm.
144+ sauto use:RefOrd .compare_asymm.
145145 Qed .
146146
147147 Global Instance vmevCanonOrder : CanonicalOrder vmte_canon_rel :=
0 commit comments