Created
July 30, 2018 15:33
-
-
Save ashiato45/72337fb363027e965bfc15bd9413dfe0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Core | |
open Set | |
module type AUTOM' = sig | |
module AlphSet: Set.S | |
module StateSet: Set.S | |
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 type AUTOM = | |
functor (AlphSet: Set.S) (StateSet: Set.S) -> | |
AUTOM' | |
with module AlphSet = AlphSet | |
with module StateSet = StateSet | |
module Autom = functor (AlphSet: Set.S) (StateSet: Set.S) -> struct | |
module AlphSet = AlphSet | |
module StateSet = StateSet | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Core | |
open Set | |
module type AUTOM' = sig | |
module AlphSet: Set.S | |
module StateSet: Set.S | |
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 type AUTOM = | |
functor (AlphSet: Set.S) (StateSet: Set.S) -> | |
AUTOM' | |
with module AlphSet = AlphSet | |
with module StateSet = StateSet | |
module Autom: AUTOM | |
type alph = Zero | One [@@deriving sexp, compare] | |
module Alph: Set.Elt | |
module AlphSet: Set.S with type Elt.t = alph | |
module StringSet: Set.S with type Elt.t = string | |
module ZeroOneAutom: AUTOM' | |
with module AlphSet = AlphSet | |
with module StateSet = StringSet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment