Instantly share code, notes, and snippets.

Embed
What would you like to do?
open Core
open Set
module type AUTOM = functor (AlphSet: Set.S) (StateSet: Set.S) -> sig
type t = {
alph: AlphSet.t;
states: StateSet.t;
trans: StateSet.Elt.t -> AlphSet.Elt.t -> StateSet.Elt.t;
init: StateSet.Elt.t;
final: StateSet.t}
end
module Autom = functor (AlphSet: Set.S) (StateSet: Set.S) -> struct
type t = {
alph: AlphSet.t;
states: StateSet.t;
trans: StateSet.Elt.t -> AlphSet.Elt.t -> StateSet.Elt.t;
init: StateSet.Elt.t;
final: StateSet.t}
end
type alph = Zero | One [@@deriving sexp, compare]
module Alph = struct
type t = alph
let compare = compare_alph
let t_of_sexp = alph_of_sexp
let sexp_of_t = sexp_of_alph
end
module AlphSet = Set.Make(Alph)
module StringSet = Set.Make(String)
module ZeroOneAutom = Autom(AlphSet)(StringSet)
open Core
open Set
module type AUTOM = functor (AlphSet: Set.S) (StateSet: Set.S) -> sig
type t = {
alph: AlphSet.t;
states: StateSet.t;
trans: StateSet.Elt.t -> AlphSet.Elt.t -> StateSet.Elt.t;
init: StateSet.Elt.t;
final: StateSet.t}
end
module Autom: AUTOM
type alph = Zero | One [@@deriving sexp, compare]
module Alph: Set.Elt
module AlphSet: Set.S
module StringSet: Set.S
module ZeroOneAutom: AUTOM(AlphSet)(StringSet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment