Module Dolmen_loop.Logic
This is an instanciation of the Logic class with the standard implementation of parsed terms and statements of Dolmen.
include Dolmen_class.Logic.S with type statement := Dolmen_std.Statement.t and type file := Dolmen_std.Loc.file
exceptionExtension_not_found of stringRaised when trying to find a language given a file extension.
Supported languages
type language=|Alt_ergoAlt-ergo's native language
|DimacsDimacs CNF format
|ICNFiCNF format
|Smtlib2 of Dolmen_smtlib2.versionSmtlib v2 latest version
|Tptp of Dolmen_tptp.versionTPTP format (including THF), latest version
|ZfZipperposition format
The languages supported by the Logic class.
val enum : (string * language) listEnumeration of languages together with an appropriate name. Can be used for command-line arguments (for instance, with cmdliner).
val string_of_language : language -> stringString representation of the variant
High-level parsing
val find : ?language:language -> ?dir:string -> string -> string optionTries and find the given file, using the language specification.
val parse_file : ?language:language -> string -> language * file * statement listGiven a filename, parse the file, and return the detected language together with the list of statements parsed.
- parameter language
specify a language; overrides auto-detection.
val parse_file_lazy : ?language:language -> string -> language * file * statement list Stdlib.Lazy.tGiven a filename, parse the file, and return the detected language together with the list of statements parsed.
- parameter language
specify a language; overrides auto-detection.
val parse_input : ?language:language -> [< `File of string | `Stdin of language | `Raw of string * language * string ] -> language * file * (unit -> statement option) * (unit -> unit)Incremental parsing of either a file (see
parse_file), stdin (with given language), or some arbitrary contents, of the form`Raw (filename, language, contents). Returns a triplet(lan, gen, cl), containing the language detextedlan, a genratro functiongenfor parsing the input, and a cleanup functionclto call in order to cleanup the file descriptors.- parameter language
specify a language for parsing, overrides auto-detection and stdin specification.
Mid-level parsing
module type S = Dolmen_intf.Language.S with type statement := statement and type file := fileThe type of language modules.
val of_language : language -> language * string * (module S)val of_extension : string -> language * string * (module S)val of_filename : string -> language * string * (module S)These function take as argument either a language, a filename, or an extension, and return a triple:
- language
- language file extension (starting with a dot)
- appropriate parsing module
Extensions should start with a dot (for instance :
".smt2")- raises Extension_not_found
when the extension is not recognized.