package orsetto

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type event

The basis event type (erased when created).

type 'r fin

The type of a final state (erased when created).

type 'r t

The type of automatons parameterized by final identifier type. An imperative programming interface is provided below for elaboration.

val create : 'r fin Seq.t -> 'r t

Use create s to make a new DFA with all the final states of s.

val copy : 'r t -> 'r t

Use copy dfa to copy the internal state of dfa into a new machine, ready to advance from the same point.

val reset : 'r t -> unit

Use reset dfa to reset the internal state of dfa to its initial state, ready to advance on new events.

val advance : 'r t -> event -> unit

Use advance dfa event to advance dfa with event. Raises Failure if dfa has rejected an event previously.

val rejected : 'r t -> bool

Use finished dfa to check whether dfa has rejected an event and and may not be advanced any further.

val accepted : 'r t -> bool

Use accepted dfa to check whether dfa has reached a final state. A DFA may still be further advanced after reaching one of its final states the first time.

val finish : 'r t -> 'r

Use finish dfa to get the final value dfa. Raise Not_found if no final value is available, i.e. either because it has rejected an event or it has not yet reached an accepting state.