Module Ft_turing.Execute

val check_input : string -> string list -> string -> int

check_input input blank does sanity checks on input and returns its length if all is good

val convert : string -> string -> int -> ( string, CCVector.rw ) CCVector.t

convert input blank length convert a string input into a resizable vector

val is_final : ( 'a, 'b * bool ) Stdlib.Hashtbl.t -> 'a -> bool

is_final tbl state simple boolean to check if a state is contained in the Hashtbl of all known states

val is_blocked : Stdlib.Format.formatter -> ( string, 'a ) CCVector.t -> string -> string -> int -> print:bool -> unit

is_blocked tape state read index state_tbl print

val terminate : Stdlib.Format.formatter -> string -> string -> bool -> ( string, 'a ) CCVector.t -> int -> ( string, 'b * bool ) Stdlib.Hashtbl.t -> unit

terminate current_state read print tape index state_tbl is called when machine is estimated to be in a final or blocked state

val move_direction : Lang.direction -> int

move_direction direction converts a given action field direction to an incrementation or decrementation of the index in the recursive interpretation

val tape_size : int Stdlib.ref
val blank_char : string Stdlib.ref
val index_checker : int -> ( string, CCVector.rw ) CCVector.t -> int
val execution : Stdlib.Format.formatter -> print:bool -> (( string, 'a * bool ) Stdlib.Hashtbl.t * ( string * string, string * string * Lang.direction ) Stdlib.Hashtbl.t) -> ( string, CCVector.rw ) CCVector.t -> int -> string -> unit

execution tables tape index current_state recursively reads and writes on given tape at given index in regards to current state by following the transitions found in transitions and states tables

val interpreter : Stdlib.Format.formatter -> ((string list * string * string * (( string, 'a * bool ) Stdlib.Hashtbl.t * ( string * string, string * string * Lang.direction ) Stdlib.Hashtbl.t)) * string) -> unit

interpreter machine input function sets up the execution of the turing machine machine on the input.