package preface

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file join_semilattice.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
open QCheck2

module Suite
    (R : Model.COVARIANT_0)
    (L : Preface_specs.JOIN_SEMILATTICE with type t = R.t) =
struct
  module Laws = Preface_laws.Join_semilattice.For (L)

  let print = Format.asprintf "%a" R.pp

  let join_semilattice_1 count =
    let print = Print.tup3 print print print in
    let generator = Gen.tup3 R.generator R.generator R.generator in
    Util.test ~count ~print generator Laws.join_semilattice_1
      (fun lhs rhs (x, y, z) ->
        let left = lhs x y z
        and right = rhs x y z in
        R.equal left right )
  ;;

  let join_semilattice_2 count =
    let print = Print.tup2 print print in
    let generator = Gen.tup2 R.generator R.generator in
    Util.test ~count ~print generator Laws.join_semilattice_2
      (fun lhs rhs (x, y) ->
        let left = lhs x y
        and right = rhs x y in
        R.equal left right )
  ;;

  let join_semilattice_3 count =
    let generator = R.generator in
    Util.test ~count ~print generator Laws.join_semilattice_3 (fun lhs rhs x ->
        let left = lhs x
        and right = rhs x in
        R.equal left right )
  ;;

  let tests ~count =
    [
      join_semilattice_1 count
    ; join_semilattice_2 count
    ; join_semilattice_3 count
    ]
  ;;
end
OCaml

Innovation. Community. Security.