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
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
(* SPDX-License-Identifier: AGPL-3.0-or-later *)
(* Copyright © 2021-2026 OCamlPro *)
(* Written by the Owi programmers *)

module Make
    (Context : sig
      type t
    end)
    (Value : sig
      type t

      val pp : t Fmt.t

      module Ref : sig
        module Extern : sig
          type t
        end

        type i32

        module Array : Array_intf.T

        module Struct : Struct_intf.T

        type 'value t =
          | Extern of Extern.t option
          | Func of int option
          | NullExn
          | NullRef
          | I31 of i32
          | NullI31
          | Array of 'value Array.t
          | Struct of 'value Struct.t
          | ExternAsAny of Extern.t option
          | AnyAsExtern of 'value t
      end
    end)
    (Constexpr_eval :
      Constexpr_eval_intf.T
        with type value := Value.t
         and type reference := Value.t Value.Ref.t
         and type context := Context.t)
    (Memory : sig
      type t

      val get_limits : t -> Binary.Mem.Type.limits

      val init : Binary.Mem.Type.limits -> t
    end)
    (Table : Table_intf.T with type reference := Value.t Value.Ref.t)
    (Elem : Elem_intf.T with type reference := Value.t Value.Ref.t)
    (Extern_func : sig
      type t

      val to_func_type : t -> Binary.func_type
    end)
    (Data : Data_intf.T) :
  Env_intf.T
    with type extern_func := Extern_func.t
     and type value := Value.t
     and type elem := Elem.t
     and type data := Data.t
     and type table := Table.t
     and type memory := Memory.t
     and type context = Context.t = struct
  include Env0
  include
    Env_linker.Make (Context) (Value) (Constexpr_eval) (Memory) (Table) (Elem)
      (Extern_func)
      (Data)
end

module Dummmy_context = struct
  type t = unit

  let empty () = ()
end

module Concrete =
  Make (Dummmy_context) (Concrete_value) (Constexpr_eval.Concrete)
    (Concrete_memory)
    (Concrete_table)
    (Concrete_elem)
    (Concrete_extern.Func)
    (Concrete_data)
module Symbolic =
  Make (Dummmy_context) (Symbolic_value) (Constexpr_eval.Symbolic)
    (Symbolic_memory)
    (Symbolic_table)
    (Symbolic_elem)
    (Symbolic_extern.Func)
    (Symbolic_data)

module Abstract = struct
  module Context = struct
    include Abstract_domain.Context

    let empty = Abstract_domain.root_context
  end

  include
    Make (Context) (Abstract_value) (Constexpr_eval.Abstract) (Abstract_memory)
      (Abstract_table)
      (Abstract_elem)
      (Abstract_extern.Func)
      (Abstract_data)
end