Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file ast.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267(* This file is free software, part of dolmen. See file "LICENSE" for more information. *)(** AST requirement for the Smtlib format.
The smtlib format is widely used among SMT solvers, and is the language
of the smtlib benchmark library. Terms are expressed as s-expressions,
and top-level directives include everything needed to use a prover
in an interactive loop (so it includes directive for getting and setting options,
getting information about the solver's internal model, etc...) *)moduletypeExtension=sigtypelocation(** The type of locations. *)typeterm(** The type of terms *)typestatement(** The type of statements *)valstatement:string->(?loc:location->termlist->statement)option(** Called on statements of the form `(<id> <term>)` where `<id>` is
not the name of a statement in the official smtlib specification. *)endmoduletypeId=sigtypet(** The type of identifiers *)typenamespace(** Namespace for identifiers *)valsort:namespacevalterm:namespacevalattr:namespace(** The namespace for sorts (also called typee), terms
and attributes, respectively. *)valmk:namespace->string->t(** Make an identifier from a name and namespace. *)valindexed:namespace->string->stringlist->t(** Create an indexed identifier. *)endmoduletypeTerm=sigtypet(** The type of terms. *)typeid(** The type of identifiers for constants. *)typelocation(** The type of locations. *)valconst:?loc:location->id->t(** Constants, i.e non predefined symbols. This includes both constants
defined by theories, defined locally in a problem, and also quantified variables. *)valstr:?loc:location->string->t(** Quoted strings. According to the smtlib manual, these can be interpreted as
either string literals (when the String theory is used), or simply constants *)valint:?loc:location->string->tvalreal:?loc:location->string->tvalhexa:?loc:location->string->tvalbinary:?loc:location->string->t(** Constants lexically recognised as numbers in different formats. According to the smtlib
manual, these should not always be interpreted as numbers since their interpretation
is actually dependent on the theory set by the problem. *)valcolon:?loc:location->t->t->t(** Juxtaposition of terms, used to annotate terms with their type. *)valapply:?loc:location->t->tlist->t(** Application. *)valletand:?loc:location->tlist->t->t(** Local parrallel bindings. The bindings are a list of terms built using
the [colon] function. *)valforall:?loc:location->tlist->t->t(** Universal quantification. *)valexists:?loc:location->tlist->t->t(** Existencial quantification. *)valmatch_:?loc:location->t->(t*t)list->t(** Pattern matching. The first term is the term to match,
and each tuple in the list is a match case, which is a pair
of a pattern and a match branch. *)valsexpr:?loc:location->tlist->t(** S-expressions. Used in smtlib's annotations, *)valannot:?loc:location->t->tlist->t(** Attach a list of attributes (also called annotations) to a term. As written
in the smtlib manual, "Term attributes have no logical meaning --
semantically, [attr t l] is equivalent to [t]" *)end(** Implementation requirements for Smtlib terms. *)moduletypeStatement=sigtypet(** The type of statements. *)typeid(** The type of identifiers. *)typeterm(** The type of terms. *)typelocation(** The type of locations. *)(** (Re)starting and terminating *)valreset:?loc:location->unit->t(** Full reset of the prover state. *)valset_logic:?loc:location->string->t(** Set the problem logic. *)valset_option:?loc:location->term->t(** Set the value of a prover option. *)valexit:?loc:location->unit->t(** Exit the interactive loop. *)(** Modifying the assertion stack *)valpush:?loc:location->int->t(** Push the given number of new level on the stack of assertions. *)valpop:?loc:location->int->t(** Pop the given number of level on the stack of assertions. *)valreset_assertions:?loc:location->unit->t(** Reset assumed assertions. *)(** Introducing new symbols *)valtype_decl:?loc:location->id->int->t(** Declares a new type constructor with given arity. *)valtype_def:?loc:location->id->idlist->term->t(** Defines an alias for types. [type_def f args body] is such that
later occurences of [f] applied to a list of arguments [l] should
be replaced by [body] where the [args] have been substituted by
their value in [l]. *)valdatatypes:?loc:location->(id*termlist*(id*termlist)list)list->t(** Inductive type definitions. *)valfun_decl:?loc:location->id->termlist->termlist->term->t(** Declares a new term symbol, and its type. [fun_decl f args ret]
declares [f] as a new function symbol which takes arguments of types
described in [args], and with return type [ret]. *)valfun_def:?loc:location->id->termlist->termlist->term->term->t(** Defines a new function. [fun_def f args ret body] is such that
applications of [f] are equal to [body] (module substitution of the arguments),
which should be of type [ret]. *)valfuns_def_rec:?loc:location->(id*termlist*termlist*term*term)list->t(** Declare a list of mutually recursive functions. *)(** Asserting and inspecting formulas *)valassert_:?loc:location->term->t(** Add a proposition to the current set of assertions. *)valget_assertions:?loc:location->unit->t(** Return the current set of assertions. *)(** Checking for satisfiablity *)valcheck_sat:?loc:location->termlist->t(** Solve the current set of assertions for satisfiability,
under the local assumptions specified. *)(** Models *)valget_model:?loc:location->unit->t(** Return the model found. *)valget_value:?loc:location->termlist->t(** Return the value of the given terms in the current model of the solver. *)valget_assignment:?loc:location->unit->t(** Return the values of asserted propositions which have been labelled using
the ":named" attribute. *)(** Proofs *)valget_proof:?loc:location->unit->t(** Return the proof of the lastest [check_sat] if it returned unsat, else
is undefined. *)valget_unsat_core:?loc:location->unit->t(** Return the unsat core of the latest [check_sat] if it returned unsat,
else is undefined. *)valget_unsat_assumptions:?loc:location->unit->t(** Return a list of local assumptions (as givne in {!check_sat},
that is enough to deduce unsat. *)(** Inspecting settings *)valget_info:?loc:location->string->t(** Get information (see smtlib manual). *)valget_option:?loc:location->string->t(** Get the value of a prover option. *)(** Scripts commands *)valecho:?loc:location->string->t(** Print back as-is, including the double quotes. *)valset_info:?loc:location->term->t(** Set information (see smtlib manual). *)end(** implementation requirement for smtlib statements. *)moduleView=structmoduletypeTy=sigtypettypeviewvalview:t->viewendmoduletypeTerm=sigtypettypetytypeviewvalty:t->tyvalview:t->viewendend