Skip to content

Commit d636e78

Browse files
authored
Merge pull request #189 from jmid/rm-addgc
Remove STM_spec.AddGC functor
2 parents 4901ce4 + 070fab3 commit d636e78

File tree

4 files changed

+0
-66
lines changed

4 files changed

+0
-66
lines changed

lib/STM_spec.ml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -105,51 +105,3 @@ sig
105105
model's result.
106106
Note: [s] is in this case the model's state prior to command execution. *)
107107
end
108-
109-
module AddGC(Spec : Spec) : Spec = struct
110-
type cmd =
111-
| GC_minor
112-
| UserCmd of Spec.cmd
113-
114-
type state = Spec.state
115-
type sut = Spec.sut
116-
117-
let init_state = Spec.init_state
118-
let init_sut () = Spec.init_sut ()
119-
let cleanup sut = Spec.cleanup sut
120-
121-
let show_cmd c = match c with
122-
| GC_minor -> "<GC.minor>"
123-
| UserCmd c -> Spec.show_cmd c
124-
125-
let gen_cmd s =
126-
(Gen.frequency
127-
[(1,Gen.return GC_minor);
128-
(5,Gen.map (fun c -> UserCmd c) (Spec.arb_cmd s).gen)])
129-
130-
let shrink_cmd s c = match c with
131-
| GC_minor -> Iter.empty
132-
| UserCmd c ->
133-
match (Spec.arb_cmd s).shrink with
134-
| None -> Iter.empty (* no shrinker provided *)
135-
| Some shk -> Iter.map (fun c' -> UserCmd c') (shk c)
136-
137-
let arb_cmd s = make ~print:show_cmd ~shrink:(shrink_cmd s) (gen_cmd s)
138-
139-
let next_state c s = match c with
140-
| GC_minor -> s
141-
| UserCmd c -> Spec.next_state c s
142-
143-
let precond c s = match c with
144-
| GC_minor -> true
145-
| UserCmd c -> Spec.precond c s
146-
147-
let run c s = match c with
148-
| GC_minor -> (Gc.minor (); Res (unit, ()))
149-
| UserCmd c -> Spec.run c s
150-
151-
let postcond c s r = match c,r with
152-
| GC_minor, Res ((Unit,_),_) -> true
153-
| UserCmd c, r -> Spec.postcond c s r
154-
| _,_ -> false
155-
end

lib/STM_spec.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,3 @@ sig
122122
model's result. A [postcond] function should be a pure.
123123
Note: [s] is in this case the model's state prior to command execution. *)
124124
end
125-
126-
module AddGC : functor (Spec : Spec) -> Spec

src/neg_tests/ref_stm_dom_tests.ml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,9 @@ open Ref_stm_spec
22

33
module RT_int = STM_domain.Make(RConf_int)
44
module RT_int64 = STM_domain.Make(RConf_int64)
5-
6-
(*module RConf_int_GC = STM_base.AddGC(RConf_int)*)
7-
(*module RConf_int64_GC = STM_base.AddGC(RConf_int64)*)
8-
9-
(*module RT_int_GC = STM_domain.Make(RConf_int_GC)*)
10-
(*module RT_int64_GC = STM_domain.Make(RConf_int64_GC)*)
115
;;
126
QCheck_runner.run_tests_main
137
(let count = 1000 in
148
[RT_int.neg_agree_test_par ~count ~name:"STM int ref test parallel";
15-
(*RT_int_GC.neg_agree_test_par ~count ~name:"STM int ref test parallel (w/AddGC functor)";*)
169
RT_int64.neg_agree_test_par ~count ~name:"STM int64 ref test parallel";
17-
(*RT_int64_GC.neg_agree_test_par ~count ~name:"STM int64 ref test parallel (w/AddGC functor)";*)
1810
])

src/neg_tests/ref_stm_thread_tests.ml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,9 @@ open Ref_stm_spec
22

33
module RT_int = STM_thread.Make(RConf_int)
44
module RT_int64 = STM_thread.Make(RConf_int64)
5-
6-
(*module RConf_int_GC = STM_base.AddGC(RConf_int)*)
7-
(*module RConf_int64_GC = STM_base.AddGC(RConf_int64)*)
8-
9-
(*module RT_int_GC = STM_thread.Make(RConf_int_GC)*)
10-
(*module RT_int64_GC = STM_thread.Make(RConf_int64_GC)*)
115
;;
126
QCheck_runner.run_tests_main
137
(let count = 1000 in
148
[RT_int.agree_test_conc ~count ~name:"STM int ref test with Thread";
15-
(*RT_int_GC.agree_test_conc ~count ~name:"STM int ref test with Thread (w/AddGC functor)";*)
169
RT_int64.neg_agree_test_conc ~count ~name:"STM int64 ref test with Thread";
17-
(*RT_int64_GC.agree_test_conc ~count ~name:"STM int64 ref test with Thread (w/AddGC functor)";*)
1810
])

0 commit comments

Comments
 (0)