This module is part of the assertions library. It provides the formal definition of the syntax of several forms of assertions and describes their meaning. It does so by defining types and properties related to the assertions themselves. The text describes, for example, the overall fields which are admissible in the bodies of assertions, where properties can be used inside these bodies, how to combine properties for a given predicate argument (e.g., conjunctions) , etc. and provides some examples.
Pr [:: DP] [: CP] [=> AP] [+ GP] [# CO]
where (fields between [...] are optional):
See the lpdoc manual for documentation on assertion comments.
Usage:assrt_body(X)
X is an assertion body.
Some useful mode definitions can be found in the basicmodes and isomodes libraries. Users can define modes using the modedef/1 declaration.
Usage:head_pattern(Pr)
Pr is a head pattern.
Props is a (possibly empty) complex argument property. Such properties can appear in two formats, which are defined by property_conjunction/1 and property_starterm/1 respectively. The two formats can be mixed provided they are not in the same field of an assertion. I.e., the following is a valid assertion:
:- pred foo(X,Y) : nonvar * var => (ground(X),ground(Y)).
Usage:complex_arg_property(Props)
Props is a (possibly empty) complex argument property
Usage:property_conjunction(Props)
Props is either a term or a conjunction of terms. The main functor and arity of each of those terms corresponds to the definition of a property. The first argument of each such term is a variable which appears as a head argument.
Usage:property_starterm(Props)
Props is either a term or several terms separated by */2. The main functor of each of those terms corresponds to that of the definition of a property, and the arity should be one less than in the definition of such property. All arguments of each such term are ground.
Props is a (possibly empty) complex goal property. Such properties can be either a term or a conjunction of terms. The main functor and arity of each of those terms corresponds to the definition of a property. Such properties apply to all executions of all goals of the predicate which comply with the assertion in which the Props appear.
The arguments of the terms in Props are implicitely augmented with a first argument which corresponds to a goal of the predicate of the assertion in which the Props appear. For example, the assertion
:- comp var(A) + not_further_inst(A).has property not_further_inst/1 as goal property, and establishes that in all executions of var(A) it should hold that not_further_inst(var(A),A).
Usage:complex_goal_property(Props)
Props is either a term or a conjunction of terms. The main functor and arity of each of those terms corresponds to the definition of a property. A first implicit argument in such terms identifies goals to which the properties apply.
Usage:nabody(ABody)
ABody is a normalized assertion body.
Usage:dictionary(D)
D is a dictionary of variable names.
Pr : CP [# CO]
where (fields between [...] are optional):
The format of the different parts of the assertion body are given by n_assrt_body/5 and its auxiliary types.
Usage:c_assrt_body(X)
X is a call assertion body.
Pr : CP => AP # CO Pr : CP => AP Pr => AP # CO Pr => AP
where:
The format of the different parts of the assertion body are given by n_assrt_body/5 and its auxiliary types.
Usage:s_assrt_body(X)
X is a predicate assertion body.
Pr : CP + GP # CO Pr : CP + GP Pr + GP # CO Pr + GP
where:
The format of the different parts of the assertion body are given by n_assrt_body/5 and its auxiliary types.
Usage:g_assrt_body(X)
X is a comp assertion body.
assrt_status(true). assrt_status(false). assrt_status(check). assrt_status(checked). assrt_status(trust).
Usage:assrt_status(X)
X is an acceptable status for an assertion.
assrt_type(pred). assrt_type(prop). assrt_type(decl). assrt_type(func). assrt_type(calls). assrt_type(success). assrt_type(comp). assrt_type(entry). assrt_type(exit). assrt_type(test). assrt_type(texec). assrt_type(modedef).
Usage:assrt_type(X)
X is an admissible kind of assertion.
Usage:predfunctor(X)
X is a type of assertion which defines a predicate.
Usage:propfunctor(X)
X is a type of assertion which defines a property.
Usage:docstring(String)
String is a text comment with admissible documentation commands. The usual formatting commands that are applicable in comment strings are defined by stringcommand/1. See the lpdoc manual for documentation on comments.