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


Types and properties related to assertions

Author(s): Manuel Hermenegildo.

Version: 1.10#7 (2006/4/26, 19:22:13 CEST)

Version of last change: 1.7#156 (2001/11/24, 13:23:30 CET)

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.

Usage and interface (assertions_props)

Documentation on exports (assertions_props)

REGTYPE: assrt_body/1:

This predicate defines the different types of syntax admissible in the bodies of pred/1, decl/1, etc. assertions. Such a body is of the form:

      Pr [:: DP] [: CP] [=> AP] [+ GP] [# CO]

where (fields between [...] are optional):

Usage: assrt_body(X)

PROPERTY: head_pattern/1:

A head pattern can be a predicate name (functor/arity) ( predname/1) or a term. Thus, both p/3 and p(A,B,C) are valid head patterns. In the case in which the head pattern is a term, each argument of such a term can be:

Usage: head_pattern(Pr)

REGTYPE: complex_arg_property/1:

complex_arg_property(Props)

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)

REGTYPE: property_conjunction/1:

This type defines the first, unabridged format in which properties can be expressed in the bodies of assertions. It is essentially a conjunction of properties which refer to variables. The following is an example of a complex property in this format:

Usage: property_conjunction(Props)

REGTYPE: property_starterm/1:

This type defines a second, compact format in which properties can be expressed in the bodies of assertions. A property_starterm/1 is a term whose main functor is */2 and, when it appears in an assertion, the number of terms joined by */2 is exactly the arity of the predicate it refers to. A similar series of properties as in property_conjunction/1 appears, but the arity of each property is one less: the argument position to which they refer (first argument) is left out and determined by the position of the property in the property_starterm/1. The idea is that each element of the */2 term corresponds to a head argument position. Several properties can be assigned to each argument position by grouping them in curly brackets. The following is an example of a complex property in this format:

Usage: property_starterm(Props)

REGTYPE: complex_goal_property/1:

complex_goal_property(Props)

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)

PROPERTY: nabody/1:

Usage: nabody(ABody)

REGTYPE: dictionary/1:

Usage: dictionary(D)

REGTYPE: c_assrt_body/1:

This predicate defines the different types of syntax admissible in the bodies of call/1, entry/1, etc. assertions. The following are admissible:

      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)

REGTYPE: s_assrt_body/1:

This predicate defines the different types of syntax admissible in the bodies of pred/1, func/1, etc. assertions. The following are admissible:

      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)

REGTYPE: g_assrt_body/1:

This predicate defines the different types of syntax admissible in the bodies of comp/1 assertions. The following are admissible:

      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)

REGTYPE: assrt_status/1:

The types of assertion status. They have the same meaning as the program-point assertions, and are as follows:

assrt_status(true).
assrt_status(false).
assrt_status(check).
assrt_status(checked).
assrt_status(trust).

Usage: assrt_status(X)

REGTYPE: assrt_type/1:

The admissible kinds of assertions:

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(modedef).

Usage: assrt_type(X)

REGTYPE: predfunctor/1:

Usage: predfunctor(X)

REGTYPE: propfunctor/1:

Usage: propfunctor(X)

PROPERTY: docstring/1:

Usage: docstring(String)


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