module PRF_sequencer:sig..end
For mapping two-dimensional natural deduction proof trees onto one-dimensional proof sequences of type PRF_sequencer.t_prf_seq.
val matrix_of_string : string -> string array arraymatrix_of_string s forms rows by splitting s on character '\n', forms columns by applying UTF8_segmenter.utf_8_grapheme_clusters to each row, and converts the result to arrays.
val matrix_of_file : string -> string array arraySame as matrix_of_string, but reads string from file located at the provided path.
type t_state =
| |
State of |
type t_symbol =
| |
Space |
| |
Dash |
| |
Letter of |
| |
Out |
type t_action =
| |
Left |
| |
Right |
| |
Up |
| |
Down |
| |
Stay |
type t_token =
| |
HSEP |
| |
RSEP of |
| |
VSEP |
| |
FML_LETTER of |
| |
RULE_LETTER of |
type t_stack =
| |
Stack of |
type t_automaton = {
|
transition : |
|
end_state : |
}
exception Error of string
exception Automaton_error of t_state
val default_automaton : t_automatonval lexer_of_matrix : ?print_trace:bool ->
?automaton:t_automaton ->
string array array -> t_token listlexer_of_matrix m evaluates to lexer_of_matrix ~print_trace:false ~automaton:default_automaton m.
val lexer_of_string : ?print_trace:bool -> string -> t_token listlexer_of_string s evaluates to lexer_of_matrix (matrix_of_string s).
val lexer_of_file : ?print_trace:bool -> string -> t_token listlexer_of_file path evaluates to lexer_of_matrix (matrix_of_file path).
type t_prf_seq =
| |
Prf_seq of |
val string_of_token : t_token -> stringstring_of_token token evaluates to
match token with
|FML_LETTER s -> s
|RULE_LETTER s -> s
|HSEP -> ";"
|RSEP n -> "#" ^ (string_of_int n)
|VSEP -> ":"
val prf_seq_of_string : ?print_trace:bool -> string -> t_prf_seqprf_seq_of_string prf_tree evaluates to Prf_seq (String.concat "" (List.map string_of_token (lexer_of_string s))).
If prf_tree is a string conforming to the grammar roughly specified in prf_tree.txt, then prf_seq_of_string prf_tree evaluates to Prf_seq prf_seq, where prf_seq is a string conforming to the grammar specified in prf_seq.txt, and otherwise to prf_seq_of_string ~print_trace:true prf_tree.
prf_seq_of_string ~print_trace:true prf_tree evaluates to the same thing, but prints the trace of PRF_sequencer.default_automaton to stderr, and raises exception Automaton_error state if prf_tree does not conform to the grammar.
val prf_seq_of_file : ?print_trace:bool -> string -> t_prf_seqSame as PRF_sequencer.prf_seq_of_string, but reads from the file located at the provided path.