Wildcard symbol, i.e placeholder for an expression to be inferred, typically during type-checking.

*)

| Ttype

(*

Builtin symbol for the type of Types.

*)

| Unit

(*

Unit type.

*)

| Void

(*

Only inhabitant of the unit type.

*)

| Prop

(*

Builtin symbol for the type of propositions.

*)

| Bool

(*

The boolean type.

*)

| True

(*

The true propositional constant.

*)

| False

(*

The false propositional constant.

*)

| Eq

(*

Should all arguments be pariwise equal ?

*)

| Distinct

(*

Should all arguments be pairwise distinct ?

*)

| Ite

(*

Condional, usually applied to 3 terms (the condition, the then branch and the else branch).

*)

| Sequent

(*

Sequent as term, usually takes two argument (left side, and right side of the sequent), which are respectively a conjunction and a disjunction of propositional formulas.

*)

| Int

(*

Builtin integer type. Currently specific to Zipperposition and alt-ergo format; other languages might use constants with pre-defined name, such as tptp's "$int".

*)

| Real

(*

Builtin real type. Currently specific to Alt-ergo format; other languages might use constants with pre-defined name, such as smtlib's "real".

*)

| Minus

(*

Arithmetic unary minus.

*)

| Add

(*

Arithmetic addition.

*)

| Sub

(*

Arithmetic substraction.

*)

| Mult

(*

Arithmetic multiplication.

*)

| Div

(*

Arithmetic division quotient

*)

| Mod

(*

Arithmetic division modulo

*)

| Int_pow

(*

Integer exponentiation.

*)

| Real_pow

(*

Real exponentiation.

*)

| Lt

(*

Arithmetic "less than" comparison (strict).

*)

| Leq

(*

Arithmetic "lesser or equal" comparison.

*)

| Gt

(*

Arithmetic "greater than" comparison.

*)

| Geq

(*

Arithmetic "greater or equal" comparison.

*)

| Subtype

(*

Subtyping relation

*)

| Product

(*

Product type constructor

*)

| Union

(*

Union type constructor

*)

| Pi

(*

Pi: higher-order encoding of the forall quantifier as a constant.

*)

| Sigma

(*

Sigma: higher-order envoding of the exists quantifier of a constant.

*)

| Not

(*

Propositional negation

*)

| And

(*

Propositional conjunction

*)

| Or

(*

Propositional disjunction

*)

| Nand

(*

Propositional not-and connective

*)

| Xor

(*

Propositional exclusive disjunction

*)

| Nor

(*

Propositional not-or

*)

| Imply

(*

Propositional implication

*)

| Implied

(*

Propositional left implication (i.e implication with reversed arguments).

*)

| Equiv

(*

Propositional equivalence

*)

| Bitvof int

(*

Bitvector type (with given length)

*)

| Bitv_extractof int * int

(*

Bitvector extraction

*)

| Bitv_concat

(*

Bitvector concatenation

*)

| Array_get

(*

Array getter.

*)

| Array_set

(*

Array setter.

*)

| Adt_check

(*

Algebraic datatype head constructore checker.

*)

| Adt_project

(*

Algebraic datatype projection.

*)

| Record

(*

Record creation

*)

| Record_with

(*

Record "with" creation

*)

| Record_access

(*

Record field access

*)

| Maps_to

(*

Mapping; used in Alt-ergo triggers.

*)

| In_intervalof bool * bool

(*

Interval check; used in Alt-ergo triggers

*)

| Check

(*

Similar to cut, but does not introduce the proved term into the axioms.

*)

| Cut

(*

Insert a cut of the given term.

*)

The type of builtins symbols for terms. Some languages have specific syntax for logical connectives (tptp's'&&' or '||' for isntance) whereas some (smtlib for instance) don't and treat them as constants.

type binder =

| All

(*

Universal quantification. Each term in the list of quantified terms should represent a variable (optionnally typed using the Colon constructor.

*)

| Ex

(*

Existencial quantification Each term in the list of quantified terms should represent a variable (optionnally typed using the Colon constructor.

*)

| Pi

(*

Polymorphic type quantification in function type Each term in the list of quantified terms should represent a variable (optionnally typed using the Colon constructor.

*)

| Arrow

(*

The arrow binder, for function types. Allows for curified types, if wanted.

*)

| Let_seq

(*

Let bindings (either propositional or for terms). Term bound by a let can have many forms depending on the language, but usual shapes are:

an equality (using the builtin Eq) between a variable (optionnally typed using the Colon constructor), and a term (e.g. in tptp)

an equivalence (using the builtin Equiv) between a variable (optionnally typed using the Colon constructor), and a term/proposition (e.g. in tptp)

a variable and a term juxtaposed using the Colon constructor (e.g. in smtlib)

*)

| Let_par

(*

Similar to Let_seq; except that the list of bindings should be considered all bound at the same time/level/scope. More precisely, for Let_seq, the list of bindings is to be understood sequentially (i.e. Let_seq (b1 :: b2 ...) is semantically the same as Let_seq b1 (Let_seq b2 (..)). For Let_par, the list of bindings all happen at the same time: the defining expressions of each binding cannot refer to other bindings in the same parralel let-binding.

*)

| Fun

(*

Lambda, i.e function abstraction binder. Bound terms are the variables bound by the lambda, optionnally typed using the Colon constructor.

*)

| Choice

(*

Indefinite description, or epsilon terms. Likely to have its usual shape change following tptp's recent changes.

*)

| Description

(*

Definite description. Likely to have its usual shape change following tptp's recent changes.

*)

The type of binders, these are pretty much always builtin in all languages.

The wildcard term, usually used in place of type arguments to explicit polymorphic functions to not explicit types that can be inferred by the type-checker.

The type of types, defined as specific token by the Zipperposition format; in other languages, will be represented as a constant (the "$tType" constant in tptp for instance). Used to define new types, or quantify type variables in languages that support polymorphism.

The type of propositions. Also defined as a lexical token by the Zipperposition format. Will be defined as a constant in most other languages (for instance, "$o" in tptp).

The type of boolean, defined as a specific token by the Alt-ergo format; in other languages, it might be represented as a constant with a specific name.

The type of integers, defined as a specific token by the Zipperposition and Alt-ergo formats; in other languages, it might be represented as a constant with a specific name (for isntance, tptp's "$int") .

The type of integers, defined as a specific token by the Alt-ergo format; in other languages, it might be represented as a constant with a specific name (for isntance, tptp's "$int") .

The type of bitvectors of the given constant length, defined as a specifi token by the Alt-ergo format; in other languages, it might be represented as a constant with a specific name (for isntance, smtlib(s "bitv") .

The constants for the true and false propositional constants. Again defined as lexical token in the Zipperposition format, while treated as a constant in other languages ("$true" in tptp).

Standard logical connectives viewed as terms. implies_t is usual right implication, i.e apply implies_t [p; q] is "p implies q", while apply implied_t [p; q ] means "p is implied by q" or "q implies p".

Term without semantic meaning, used for creating "data" terms. Used in tptp's annotations, and with similar meaning as smtlib's s-expressions (as used in the sexpr function defined later).

Variable and constant constructors. While in some languages they can distinguished at the lexical level (in tptp for instance), in most languages, it is an issue dependant on scoping rules, so terms parsed from an smtlib file will have all variables parsed as constants.

Atoms are used for dimacs cnf parsing. Positive integers denotes variables, and negative integers denote the negation of the variable corresponding to their absolute value.

Used in tptp to specify constants different from other constants, for instance the 'distinct' "Apple" should be syntactically different from the "Apple" constant. Can be safely aliased to the const function as the distinct function is always given strings already enclosed with quotes, so in the example above, const would be called with "Apple" as string argument, while distinct would be called with the string "\"Apple\""

Constructors for words defined as numeric or string formats by the languages specifications. These also can be safely aliased to const, but then the provenance information is lost, which might complicate the task of a type-checker.

Represents juxtaposition of two terms, usually denoted "t : t'" in most languages, and mainly used to annotated terms with their supposed, or defined, type.

Proposition construction functions. The conjunction and disjunction are n-ary instead of binary mostly because they are in smtlib (and that is subsumes the binary case).

Application constructor, seen as higher order application rather than first-order application for the following reasons: being able to parse tptp's THF, having location attached to function symbols.

Binders for variables. Takes a list of terms as first argument for simplicity, the lists will almost always be a list of variables, optionally typed using the colon term constructor.

Pi is the polymorphic type quantification, for instance the polymorphic identity function has type: "Pi alpha. alpha -> alpha"

Letin is local binding, takes a list of equality of equivalences whose left hand-side is a variable. Letand is the parrallel version of Letin.

Forall is universal quantification

Par is universal quantification over type variables specifically (i.e. the same as forall, but only for a list of type variables, which thus may omit the colon annotations in the arguments).

Exists is existential quantification

Lambda is used for function construction

Choice is the choice operator, also called indefinite description, or also epsilon terms, i.e "Choice x. p(x)" is one "x" such that "p(x)" is true.

Description is the definite description, i.e "Description x. p(x)" is the only "x" that satisfies p.

Function type constructor, for curryfied functions. Functions that takes multiple arguments in first-order terms might take a product as only argument (see the following product function) in some languages (e.g. tptp), or be curryfied using this constructor in other languages (e.g. alt-ergo).

val in_interval : ?loc:location->t->(t * bool)->(t * bool)->t

Create a predicate for whether a term is within the given bounds (each bound is represented by a term which is tis value and a boolean which specifies whether it is strict or not).

Attach a list of attributes (also called annotations) to a term. Attributes have no logical meaning (they can be safely ignored), but may serve to give hints or meta-information.

Set the given list of terms as th attributes of the given term. Will fail (with an assertion) if the given term already have some assertion. In such cases, use add_attr instead.

Term mapping

The main use of terms mapper is to map fuctions over some terms. Traditionally, a mapping will usually only care about a few syntax cases and leav all other untouched. In these cases, it is useful to override the identity mapper, redefining only the fields needed.