Skip to content

Instantly share code, notes, and snippets.

@ed-george
Created January 11, 2019 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ed-george/de64f279097fd162bd17ef118ee7aff5 to your computer and use it in GitHub Desktop.
Save ed-george/de64f279097fd162bd17ef118ee7aff5 to your computer and use it in GitHub Desktop.
data class DFA(
val states: Set<State>,
val inputs: Set<Input>,
val delta: (State, Input) -> State,
val initialState: State,
val isFinalState: (State) -> Boolean
)
data class State(val name: String)
data class Input(val value: String)
val a = Input("press")
val s0 = State("off")
val s1 = State("on")
data class State(val name: String)
data class Input(val value: String)
val a = Input("press")
val s0 = State("off")
val s1 = State("on")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment