functor (R : Ring.T) (R' : Ring.T->
  sig
    module M :
      sig
        type t = R.t array array
        type matrix = t
        val zero : int -> int -> t
        val init : int -> int -> (int -> int -> R.t) -> t
        val rows : t -> int
        val cols : t -> int
        val get : t -> int -> int -> R.t
        val to_string : t -> string
        module Row :
          sig
            val is_zero : R.t array array -> int -> bool
            val replace : t -> int -> R.t array -> t
            val exchange : t -> int -> int -> t
            val mult : t -> R.t -> int -> t
            val madd : t -> int -> R.t -> int -> t
          end
        val row_echelon : t -> t
        val rank : t -> int
        val nullity : t -> int
        module Labeled :
          functor (X : Alphabet.T->
            sig
              module L :
                sig
                  type key = X.t
                  type 'a t = 'Map.Make(X).t
                  val empty : 'a t
                  val is_empty : 'a t -> bool
                  val mem : key -> 'a t -> bool
                  val add : key -> '-> 'a t -> 'a t
                  val update :
                    key -> ('a option -> 'a option) -> 'a t -> 'a t
                  val singleton : key -> '-> 'a t
                  val remove : key -> 'a t -> 'a t
                  val merge :
                    (key -> 'a option -> 'b option -> 'c option) ->
                    'a t -> 'b t -> 'c t
                  val union :
                    (key -> '-> '-> 'a option) -> 'a t -> 'a t -> 'a t
                  val compare : ('-> '-> int) -> 'a t -> 'a t -> int
                  val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
                  val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
                  val for_all : (key -> '-> bool) -> 'a t -> bool
                  val exists : (key -> '-> bool) -> 'a t -> bool
                  val filter : (key -> '-> bool) -> 'a t -> 'a t
                  val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
                  val cardinal : 'a t -> int
                  val bindings : 'a t -> (key * 'a) list
                  val min_binding : 'a t -> key * 'a
                  val min_binding_opt : 'a t -> (key * 'a) option
                  val max_binding : 'a t -> key * 'a
                  val max_binding_opt : 'a t -> (key * 'a) option
                  val choose : 'a t -> key * 'a
                  val choose_opt : 'a t -> (key * 'a) option
                  val split : key -> 'a t -> 'a t * 'a option * 'a t
                  val find_opt : key -> 'a t -> 'a option
                  val find_first : (key -> bool) -> 'a t -> key * 'a
                  val find_first_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val find_last : (key -> bool) -> 'a t -> key * 'a
                  val find_last_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val map : ('-> 'b) -> 'a t -> 'b t
                  val mapi : (key -> '-> 'b) -> 'a t -> 'b t
                  val to_seq : 'a t -> (key * 'a) Seq.t
                  val to_seq_from : key -> 'a t -> (key * 'a) Seq.t
                  val add_seq : (key * 'a) Seq.t -> 'a t -> 'a t
                  val of_seq : (key * 'a) Seq.t -> 'a t
                  val find : X.t -> 'a t -> 'a
                  val iter : (X.t -> '-> unit) -> 'a t -> unit
                  val of_array : X.t array -> int t
                end
              type map = int L.t
              type t = map * map * matrix
              val matrix : t -> matrix
              val zero : X.t array -> X.t array -> t
              val set : t -> X.t -> X.t -> R.t -> unit
              val get : t -> X.t -> X.t -> R.t
              val rank : t -> int
              val nullity : t -> int
              val iter_src : (X.t -> unit) -> t -> unit
              val iter_tgt : (X.t -> unit) -> t -> unit
              val iter : (X.t -> X.t -> unit) -> t -> unit
            end
      end
    module M' :
      sig
        type t = R'.t array array
        type matrix = t
        val zero : int -> int -> t
        val init : int -> int -> (int -> int -> R'.t) -> t
        val rows : t -> int
        val cols : t -> int
        val get : t -> int -> int -> R'.t
        val to_string : t -> string
        module Row :
          sig
            val is_zero : R'.t array array -> int -> bool
            val replace : t -> int -> R'.t array -> t
            val exchange : t -> int -> int -> t
            val mult : t -> R'.t -> int -> t
            val madd : t -> int -> R'.t -> int -> t
          end
        val row_echelon : t -> t
        val rank : t -> int
        val nullity : t -> int
        module Labeled :
          functor (X : Alphabet.T->
            sig
              module L :
                sig
                  type key = X.t
                  type 'a t = 'Map.Make(X).t
                  val empty : 'a t
                  val is_empty : 'a t -> bool
                  val mem : key -> 'a t -> bool
                  val add : key -> '-> 'a t -> 'a t
                  val update :
                    key -> ('a option -> 'a option) -> 'a t -> 'a t
                  val singleton : key -> '-> 'a t
                  val remove : key -> 'a t -> 'a t
                  val merge :
                    (key -> 'a option -> 'b option -> 'c option) ->
                    'a t -> 'b t -> 'c t
                  val union :
                    (key -> '-> '-> 'a option) -> 'a t -> 'a t -> 'a t
                  val compare : ('-> '-> int) -> 'a t -> 'a t -> int
                  val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
                  val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
                  val for_all : (key -> '-> bool) -> 'a t -> bool
                  val exists : (key -> '-> bool) -> 'a t -> bool
                  val filter : (key -> '-> bool) -> 'a t -> 'a t
                  val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
                  val cardinal : 'a t -> int
                  val bindings : 'a t -> (key * 'a) list
                  val min_binding : 'a t -> key * 'a
                  val min_binding_opt : 'a t -> (key * 'a) option
                  val max_binding : 'a t -> key * 'a
                  val max_binding_opt : 'a t -> (key * 'a) option
                  val choose : 'a t -> key * 'a
                  val choose_opt : 'a t -> (key * 'a) option
                  val split : key -> 'a t -> 'a t * 'a option * 'a t
                  val find_opt : key -> 'a t -> 'a option
                  val find_first : (key -> bool) -> 'a t -> key * 'a
                  val find_first_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val find_last : (key -> bool) -> 'a t -> key * 'a
                  val find_last_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val map : ('-> 'b) -> 'a t -> 'b t
                  val mapi : (key -> '-> 'b) -> 'a t -> 'b t
                  val to_seq : 'a t -> (key * 'a) Seq.t
                  val to_seq_from : key -> 'a t -> (key * 'a) Seq.t
                  val add_seq : (key * 'a) Seq.t -> 'a t -> 'a t
                  val of_seq : (key * 'a) Seq.t -> 'a t
                  val find : X.t -> 'a t -> 'a
                  val iter : (X.t -> '-> unit) -> 'a t -> unit
                  val of_array : X.t array -> int t
                end
              type map = int L.t
              type t = map * map * matrix
              val matrix : t -> matrix
              val zero : X.t array -> X.t array -> t
              val set : t -> X.t -> X.t -> R'.t -> unit
              val get : t -> X.t -> X.t -> R'.t
              val rank : t -> int
              val nullity : t -> int
              val iter_src : (X.t -> unit) -> t -> unit
              val iter_tgt : (X.t -> unit) -> t -> unit
              val iter : (X.t -> X.t -> unit) -> t -> unit
            end
      end
    val map : (R.t -> R'.t) -> Matrix.Functor.M.t -> Matrix.Functor.M'.t
    module Labeled :
      functor (X : Alphabet.T) (X' : Alphabet.T->
        sig
          module L :
            sig
              module L :
                sig
                  type key = X.t
                  type 'a t = 'Map.Make(X).t
                  val empty : 'a t
                  val is_empty : 'a t -> bool
                  val mem : key -> 'a t -> bool
                  val add : key -> '-> 'a t -> 'a t
                  val update :
                    key -> ('a option -> 'a option) -> 'a t -> 'a t
                  val singleton : key -> '-> 'a t
                  val remove : key -> 'a t -> 'a t
                  val merge :
                    (key -> 'a option -> 'b option -> 'c option) ->
                    'a t -> 'b t -> 'c t
                  val union :
                    (key -> '-> '-> 'a option) -> 'a t -> 'a t -> 'a t
                  val compare : ('-> '-> int) -> 'a t -> 'a t -> int
                  val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
                  val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
                  val for_all : (key -> '-> bool) -> 'a t -> bool
                  val exists : (key -> '-> bool) -> 'a t -> bool
                  val filter : (key -> '-> bool) -> 'a t -> 'a t
                  val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
                  val cardinal : 'a t -> int
                  val bindings : 'a t -> (key * 'a) list
                  val min_binding : 'a t -> key * 'a
                  val min_binding_opt : 'a t -> (key * 'a) option
                  val max_binding : 'a t -> key * 'a
                  val max_binding_opt : 'a t -> (key * 'a) option
                  val choose : 'a t -> key * 'a
                  val choose_opt : 'a t -> (key * 'a) option
                  val split : key -> 'a t -> 'a t * 'a option * 'a t
                  val find_opt : key -> 'a t -> 'a option
                  val find_first : (key -> bool) -> 'a t -> key * 'a
                  val find_first_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val find_last : (key -> bool) -> 'a t -> key * 'a
                  val find_last_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val map : ('-> 'b) -> 'a t -> 'b t
                  val mapi : (key -> '-> 'b) -> 'a t -> 'b t
                  val to_seq : 'a t -> (key * 'a) Seq.t
                  val to_seq_from : key -> 'a t -> (key * 'a) Seq.t
                  val add_seq : (key * 'a) Seq.t -> 'a t -> 'a t
                  val of_seq : (key * 'a) Seq.t -> 'a t
                  val find : X.t -> 'a t -> 'a
                  val iter : (X.t -> '-> unit) -> 'a t -> unit
                  val of_array : X.t array -> int t
                end
              type map = int L.t
              type t = map * map * M.matrix
              val matrix : t -> M.matrix
              val zero : X.t array -> X.t array -> t
              val set : t -> X.t -> X.t -> R.t -> unit
              val get : t -> X.t -> X.t -> R.t
              val rank : t -> int
              val nullity : t -> int
              val iter_src : (X.t -> unit) -> t -> unit
              val iter_tgt : (X.t -> unit) -> t -> unit
              val iter : (X.t -> X.t -> unit) -> t -> unit
            end
          module L' :
            sig
              module L :
                sig
                  type key = X'.t
                  type 'a t = 'Map.Make(X').t
                  val empty : 'a t
                  val is_empty : 'a t -> bool
                  val mem : key -> 'a t -> bool
                  val add : key -> '-> 'a t -> 'a t
                  val update :
                    key -> ('a option -> 'a option) -> 'a t -> 'a t
                  val singleton : key -> '-> 'a t
                  val remove : key -> 'a t -> 'a t
                  val merge :
                    (key -> 'a option -> 'b option -> 'c option) ->
                    'a t -> 'b t -> 'c t
                  val union :
                    (key -> '-> '-> 'a option) -> 'a t -> 'a t -> 'a t
                  val compare : ('-> '-> int) -> 'a t -> 'a t -> int
                  val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
                  val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
                  val for_all : (key -> '-> bool) -> 'a t -> bool
                  val exists : (key -> '-> bool) -> 'a t -> bool
                  val filter : (key -> '-> bool) -> 'a t -> 'a t
                  val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
                  val cardinal : 'a t -> int
                  val bindings : 'a t -> (key * 'a) list
                  val min_binding : 'a t -> key * 'a
                  val min_binding_opt : 'a t -> (key * 'a) option
                  val max_binding : 'a t -> key * 'a
                  val max_binding_opt : 'a t -> (key * 'a) option
                  val choose : 'a t -> key * 'a
                  val choose_opt : 'a t -> (key * 'a) option
                  val split : key -> 'a t -> 'a t * 'a option * 'a t
                  val find_opt : key -> 'a t -> 'a option
                  val find_first : (key -> bool) -> 'a t -> key * 'a
                  val find_first_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val find_last : (key -> bool) -> 'a t -> key * 'a
                  val find_last_opt :
                    (key -> bool) -> 'a t -> (key * 'a) option
                  val map : ('-> 'b) -> 'a t -> 'b t
                  val mapi : (key -> '-> 'b) -> 'a t -> 'b t
                  val to_seq : 'a t -> (key * 'a) Seq.t
                  val to_seq_from : key -> 'a t -> (key * 'a) Seq.t
                  val add_seq : (key * 'a) Seq.t -> 'a t -> 'a t
                  val of_seq : (key * 'a) Seq.t -> 'a t
                  val find : X'.t -> 'a t -> 'a
                  val iter : (X'.t -> '-> unit) -> 'a t -> unit
                  val of_array : X'.t array -> int t
                end
              type map = int L.t
              type t = map * map * M'.matrix
              val matrix : t -> M'.matrix
              val zero : X'.t array -> X'.t array -> t
              val set : t -> X'.t -> X'.t -> R'.t -> unit
              val get : t -> X'.t -> X'.t -> R'.t
              val rank : t -> int
              val nullity : t -> int
              val iter_src : (X'.t -> unit) -> t -> unit
              val iter_tgt : (X'.t -> unit) -> t -> unit
              val iter : (X'.t -> X'.t -> unit) -> t -> unit
            end
          val map :
            (X.t -> X'.t) ->
            (X.t -> X'.t) ->
            (R.t -> R'.t) ->
            Matrix.Functor.Labeled.L.t -> Matrix.Functor.Labeled.L'.t
        end
  end