module Args_wrapper:sig
..end
Pre-processing of transformations with arguments, including parsing and typing in the context of a task.
exception Parse_error of string
exception Arg_expected of string * string
exception Arg_theory_not_found of string
exception Arg_expected_none of string
exception Arg_pr_not_found of Decl.prsymbol
exception Arg_qid_not_found of Ptree.qualid
exception Arg_error of string
exception Arg_parse_type_error of Loc.position * string * exn
val build_naming_tables : Task.task -> Trans.naming_table
builds a naming tabl from a task, suitable for both parsing/typing transformation arguments and for printing the task, with coherent identifiers names.
type
symbol =
| |
Tstysymbol of |
| |
Tsprsymbol of |
| |
Tslsymbol of |
val find_symbol : string -> Trans.naming_table -> symbol
transformations with argument are themselves given types to control
the interpretation of their raw string arguments. The type trans_typ
of such transformations is elegantly defined as a GADT
type (_, _)
trans_typ =
| |
Ttrans : |
(* | transformation with no argument, and exactly one resulting task | *) |
| |
Ttrans_l : |
(* | transformation with no argument, and many resulting tasks | *) |
| |
Tenvtrans : |
(* | transformation with no argument but depending on the environment, and exactly one resulting task | *) |
| |
Tenvtrans_l : |
(* | transformation with no argument but depending on the environment, and many resulting tasks | *) |
| |
Tstring : |
(* | transformation with a string as argument | *) |
| |
Tint : |
(* | transformation with an integer argument | *) |
| |
Tty : |
(* | transformation with a Why3 type as argument | *) |
| |
Ttysymbol : |
(* | transformation with a Why3 type symbol as argument | *) |
| |
Tprsymbol : |
(* | transformation with a Why3 proposition symbol as argument | *) |
| |
Tprlist : |
(* | transformation with a list of Why3 proposition symbols as argument. The symbols must be separated by commas | *) |
| |
Tlsymbol : |
(* | transformation with a Why3 logic symbol as argument | *) |
| |
Tsymbol : |
(* | transformation with a Why3 symbol as argument, either a type symbol, a logic symbol or a proposotion symbol | *) |
| |
Tlist : |
(* | transformation with a list Why3 symbol as argument, either a type symbol, a logic symbol or a proposotion symbol. The symbols must be separated by commas | *) |
| |
Tidentlist : |
(* | transformation with a list of identifiers as argument. The identifiers do not need to exist in the task, typically they could be fresh symbols | *) |
| |
Ttermlist : |
(* | transformation with a list of terms as argument. | *) |
| |
Ttermlist_same : |
(* | transformation with a list of same type term: the int is the predefined length of the list | *) |
| |
Tterm : |
(* | transformation with a Why3 term as argument | *) |
| |
Tformula : |
(* | transformation with a Why3 formula as argument | *) |
| |
Ttheory : |
(* | transformation with a Why3 theory name as argument | *) |
| |
Topt : |
(* | transformation with an optional argument. The first string is the keyword introducing that optional argument | *) |
| |
Toptbool : |
(* | transformation with an optional boolean argument. The first string is the keyword for that optional argument, its presence meaning "true" | *) |
the functions below wrap arguments of transformations, turning string arguments into arguments of proper types. arguments of type term of formula are parsed and typed, name resolution using the proper naming table.
val wrap_l : ('a, Task.task list) trans_typ -> 'a -> Trans.trans_with_args_l
val wrap : ('a, Task.task) trans_typ -> 'a -> Trans.trans_with_args
val wrap_and_register : desc:Pp.formatted -> string -> ('a, 'b) trans_typ -> 'a -> unit
val parse_and_type_list : lang:string -> as_fmla:bool -> string -> Trans.naming_table -> Term.term list
val set_argument_parsing_functions : Env.fformat ->
parse_term:(Trans.naming_table -> Stdlib.Lexing.lexbuf -> Ptree.term) ->
parse_term_list:(Trans.naming_table ->
Stdlib.Lexing.lexbuf -> Ptree.term list) ->
parse_qualid:(Stdlib.Lexing.lexbuf -> Ptree.qualid) ->
parse_list_qualid:(Stdlib.Lexing.lexbuf -> Ptree.qualid list) ->
parse_list_ident:(Stdlib.Lexing.lexbuf -> Ptree.ident list) -> unit