Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file stmt.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210(* This file is free software, part of dolmen. See file "LICENSE" for more information *)(** Interfaces for statements.
This module defines interfaces for statements, i.e top-level
declarations in files. *)moduletypeLogic=sig(** Signature used by the Logic class, which parses languages
such as tptp, smtlib, etc...
Statements of dirrent languages currently have a lot less in common
than terms, so this interface looks a lot more like a patchwork
of different logical framework directives than it should.
*)typet(** The type of statements. *)typeid(** The type of identifiers. *)typeterm(** The type of terms used in statements. *)typelocation(** The type of locations attached to statements. *)(** {2 Optional infos for statements} *)valannot:?loc:location->term->termlist->term(** Constructors for annotations. Annotations are mainly used in TPTP. *)(** {2 Generic statements} *)valimport:?loc:location->string->t(** Import directive. Same as [include_] but without filtering on the
statements to import. *)valinclude_:?loc:location->string->idlist->t(** Inlcude directive. [include file l] means to include in the current scope
the directives from file [file] that appear in [l]. If [l] is the empty list,
all directives should be imported. *)(** {2 Dimacs&iCNF Statements} *)valp_cnf:?loc:location->int->int->t(** Header of dimacs files. First argument is the number of variables,
second is the number of clauses. *)valclause:?loc:location->termlist->t(** Add to the current set of assertions the given list of terms as a clause. *)valassumption:?loc:location->termlist->t(** Solve the current set of assertions, with the given assumptions. *)(** {2 Smtlib statements} *)valpop:?loc:location->int->tvalpush:?loc:location->int->t(** Directives for manipulating the set of assertions. Push directives
creates backtrack point that can be reached using Pop directives. *)valreset_assertions:?loc:location->unit->t(** Reset all assertions that hase been pushed. *)valassert_:?loc:location->term->t(** Add an assertion to the current set of assertions. *)valcheck_sat:?loc:location->termlist->t(** Directive that instructs the prover to solve the current set of assertions,
undr some local assumptions. *)valset_logic:?loc:location->string->t(** Set the logic to be used for solving. *)valget_info:?loc:location->string->tvalset_info:?loc:location->term->t(** Getter and setter for various informations (see smtlib manual). *)valget_option:?loc:location->string->tvalset_option:?loc:location->term->t(** Getter and setter for prover options (see smtlib manual). *)valtype_decl:?loc:location->id->int->t(** Type declaration. [type_decl s n] declare [s] as a type constructor with
arity [n]. *)valtype_def:?loc:location->id->idlist->term->t(** Type definition. [type_def f args body] declare that [f(args) = body],
i.e any occurence of "f(l)" should be replaced by [body] where the "args" have been
substituted by their corresponding value in [l]. *)valdatatypes:?loc:location->(id*termlist*(id*termlist)list)list->t(** Inductive type definitions.
TODO: some more documentation. *)valfun_decl:?loc:location->id->termlist->term->t(** Symbol declaration. [fun_decl f args ret] defines [f] as a function
which takes arguments of type as described in [args] and which returns
a value of type [ret]. *)valfun_def:?loc:location->id->termlist->term->term->t(** Symbol definition. [fun_def f args ret body] means that "f(args) = (body : ret)",
i.e f is a function symbol with arguments [args], and which returns the value
[body] which is of type [ret]. *)valfuns_def_rec:?loc:location->(id*termlist*term*term)list->t(** Define a list of mutually recursive functions. Each functions has the same
definition as in [fun_def] *)valget_proof:?loc:location->unit->t(** If the last call to [check_sat] returned UNSAT, then instruct the prover to return
the proof of unsat. *)valget_unsat_core:?loc:location->unit->t(** If the last call to [check_sat] returned UNSAT, then instruct the prover to return
the unsat core of the unsatisfiability proof, i.e the smallest set of assertions
needed to prove [false]. *)valget_unsat_assumptions:?loc:location->unit->t(** If the last call to [check_sat] returned UNSAT, then instruct the prover to
return a subset of the local assumptions that is sufficient to deduce UNSAT. *)valget_model:?loc:location->unit->t(** If the last call to [check_sat] returned SAT, then return the associated model. *)valget_value:?loc:location->termlist->t(** Instructs the prover to return the values of the given closed quantifier-free terms. *)valget_assignment:?loc:location->unit->t(** Instructs the prover to return truth assignemnt for labelled formulas (see smtlib manual
for more information). *)valget_assertions:?loc:location->unit->t(** Instructs the prover to print all current assertions. *)valecho:?loc:location->string->t(** Print the given sting. *)valreset:?loc:location->unit->t(** Full reset of the prover state. *)valexit:?loc:location->unit->t(** Exit directive (used in interactive mode). *)(** {2 TPTP Statements} *)valtpi:?loc:location->?annot:term->id->string->term->tvalthf:?loc:location->?annot:term->id->string->term->tvaltff:?loc:location->?annot:term->id->string->term->tvalfof:?loc:location->?annot:term->id->string->term->tvalcnf:?loc:location->?annot:term->id->string->term->t(** TPTP directives. [tptp name role t] instructs the prover to register
a new directive with the given name, role and term. Current tptp roles are:
- ["axiom", "hypothesis", "definition", "lemma", "theorem"] acts
as new assertions/declartions
- ["assumption", "conjecture"] are proposition that need to be proved,
and then can be used to prove other propositions. They are equivalent
to the following sequence of smtlib statements:
{ul
{- [push 1]}
{- [assert (not t)]}
{- [check_sat]}
{- [pop 1]}
{- [assert t]}
}
- ["negated_conjecture"] is the same as ["conjecture"], but the given proposition
is false (i.e its negation is the proposition to prove).
- ["type"] declares a new symbol and its type
- ["plain", "unknown", "fi_domain", "fi_functors", "fi_predicates"] are valid
roles with no specified semantics
- any other role is an error
*)(** {2 Zipperposition statements} *)valdata:?loc:location->?attrs:termlist->tlist->t(** Packs a list of mutually recursive inductive type declarations into a
single statement. *)valdefs:?loc:location->?attrs:termlist->tlist->t(** Packs a list of mutually recursive definitions into a single statement. *)valrewrite:?loc:location->?attrs:termlist->term->t(** Declare a rewrite rule, i.e a universally quantified equality or equivalence that
can be oriented according to a specific ordering. *)valgoal:?loc:location->?attrs:termlist->term->t(** The goal, i.e the propositional formula to prove. *)valassume:?loc:location->?attrs:termlist->term->t(** Adds an hypothesis. *)vallemma:?loc:location->?attrs:termlist->term->t(** Lemmas. *)valdecl:?loc:location->?attrs:termlist->id->term->t(** Symbol declaration. [decl name ty] declares a new symbol [name] with type [ty]. *)valdefinition:?loc:location->?attrs:termlist->id->term->termlist->t(** Symbol definition. [def name ty term] defines a new symbol [name] of type [ty]
which is equal to [term]. *)valinductive:?loc:location->?attrs:termlist->id->termlist->(id*termlist)list->t(** Inductive type definitions. [inductive name vars l] defines an inductive type [name],
with polymorphic variables [vars], and with a list of inductive constructors [l]. *)end