Go to the first, previous, next, last section, table of contents.


Program assertions

Author(s): The CLIP Group, clip@dia.fi.upm.es, http://www.clip.dia.fi.upm.es/, Facultad de Informática, Universidad Politécnica de Madrid.

Version: 1.3#124 (1999/11/27, 4:4:5 MET)

The assertions package adds a number of new declaration definitions and new operator definitions which allow including program assertions in user programs. Such assertions can be used to describe predicates, properties, modules, applications, etc. These descriptions can be formal specifications (such as preconditions and post-conditions) or machine-readable textual comments.

This module is part of the assertions library. It defines the basic code-related assertions, i.e., those intended to be used mainly by compilation-related tools, such as the static analyzer or the run-time test generator.

Giving specifications for predicates and other program elements is the main functionality documented here. The exact syntax of comments is described in the autodocumenter ( lpdoc [Knu84,Her99]) manual, although some support for adding machine-readable comments in assertions is also mentioned here.

There are two kinds of assertions: predicate assertions and program point assertions. All predicate assertions are currently placed as directives in the source code, i.e., preceded by ":-". Program point assertions are placed as goals in clause bodies.

More info

The facilities provided by the library are documented in the description of its component modules. This documentation is intended to provide information only at a "reference manual" level. For a more tutorial introduction to the subject and some more examples please see the document "An Assertion Language for Debugging of Constraint Logic Programs (Technical Report CLIP2/97.1)". The assertion language implemented in this library is modeled after this design document, although, due to implementation issues, it may differ in some details. The purpose of this manual is to document precisely what the implementation of the library supports at any given point in time.

Some attention points

Usage and interface (assrt)

Documentation on new declarations (assrt)

DECLARATION: pred/1:

Usage: :- pred(AssertionBody).

DECLARATION: pred/2:

Usage: :- pred(AssertionStatus,AssertionBody).

DECLARATION: calls/1:

Usage: :- calls(AssertionBody).

DECLARATION: calls/2:

Usage: :- calls(AssertionStatus,AssertionBody).

DECLARATION: success/1:

Usage: :- success(AssertionBody).

DECLARATION: success/2:

Usage: :- success(AssertionStatus,AssertionBody).

DECLARATION: comp/1:

Usage: :- comp(AssertionBody).

DECLARATION: comp/2:

Usage: :- comp(AssertionStatus,AssertionBody).

DECLARATION: prop/1:

Usage: :- prop(AssertionBody).

DECLARATION: prop/2:

Usage: :- prop(AssertionStatus,AssertionBody).

DECLARATION: regtype/1:

Usage: :- regtype(AssertionBody).

DECLARATION: type/1:

Usage:

DECLARATION: regtype/2:

Usage: :- regtype(AssertionStatus,AssertionBody).

DECLARATION: type/2:

Usage:

DECLARATION: entry/1:

Usage: :- entry(AssertionBody).

DECLARATION: modedef/1:

Usage: :- modedef(AssertionBody).

DECLARATION: decl/1:

Usage: :- decl(AssertionBody).

DECLARATION: decl/2:

Usage: :- decl(AssertionStatus,AssertionBody).

DECLARATION: comment/2:

Usage: :- comment(Pred,Comment).

Documentation on exports (assrt)

PREDICATE: check/1:

Usage: check(PropertyConjunction)

PREDICATE: trust/1:

Usage: trust(PropertyConjunction)

PREDICATE: true/1:

Usage: true(PropertyConjunction)

PREDICATE: false/1:

Usage: false(PropertyConjunction)


Go to the first, previous, next, last section, table of contents.