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


Basic data types and properties

Author(s): Daniel Cabeza, Manuel Hermenegildo.

Version: 1.11#222 (2004/5/24, 13:8:7 CEST)

Version of last change: 1.11#166 (2004/2/3, 21:12:16 CET)

This library contains the set of basic properties used by the builtin predicates, and which constitute the basic data types and properties of the language. They can be used both as type testing builtins within programs (by calling them explicitly) and as properties in assertions.

Usage and interface (basic_props)

Documentation on exports (basic_props)

REGTYPE: term/1:

The most general type (includes all possible terms).

General properties: term(X)

Usage: term(X)

REGTYPE: int/1:

The type of integers. The range of integers is [-2^2147483616, 2^2147483616). Thus for all practical purposes, the range of integers can be considered infinite.

General properties: int(T)

Usage: int(T)

REGTYPE: nnegint/1:

The type of non-negative integers, i.e., natural numbers.

General properties: nnegint(T)

Usage: nnegint(T)

REGTYPE: flt/1:

The type of floating-point numbers. The range of floats is the one provided by the C double type, typically [4.9e-324, 1.8e+308] (plus or minus). There are also three special values: Infinity, either positive or negative, represented as 1.0e1000 and -1.0e1000; and Not-a-number, which arises as the result of indeterminate operations, represented as 0.Nan

General properties: flt(T)

Usage: flt(T)

REGTYPE: num/1:

The type of numbers, that is, integer or floating-point.

General properties: num(T)

Usage: num(T)

REGTYPE: atm/1:

The type of atoms, or non-numeric constants. The size of atoms is unbound.

General properties: atm(T)

Usage: atm(T)

REGTYPE: struct/1:

The type of compound terms, or terms with non-zeroary functors. By now there is a limit of 255 arguments.

General properties: struct(T)

Usage: struct(T)

REGTYPE: gnd/1:

The type of all terms without variables.

General properties: gnd(T)

Usage: gnd(T)

REGTYPE: constant/1:

General properties: constant(T)

Usage: constant(T)

REGTYPE: callable/1:

General properties: callable(T)

Usage: callable(T)

REGTYPE: operator_specifier/1:

The type and associativity of an operator is described by the following mnemonic atoms:

xfx
Infix, non-associative: it is a requirement that both of the two subexpressions which are the arguments of the operator must be of lower precedence than the operator itself.
xfy
Infix, right-associative: only the first (left-hand) subexpression must be of lower precedence; the right-hand subexpression can be of the same precedence as the main operator.
yfx
Infix, left-associative: same as above, but the other way around.
fx
Prefix, non-associative: the subexpression must be of lower precedence than the operator.
fy
Prefix, associative: the subexpression can be of the same precedence as the operator.
xf
Postfix, non-associative: the subexpression must be of lower precedence than the operator.
yf
Postfix, associative: the subexpression can be of the same precedence as the operator.

General properties: operator_specifier(X)

Usage: operator_specifier(X)

REGTYPE: list/1:

A list is formed with successive applications of the functor '.'/2, and its end is the atom []. Defined as

list([]).
list([_1|L]) :-
        list(L).

General properties: list(L)

Usage: list(L)

REGTYPE: list/2:

list(L, T)

L is a list, and for all its elements, T holds.

Meta-predicate with arguments: list(?,pred(1)).

General properties: list(L, T)

Usage: list(L, T)

PROPERTY: member/2:

General properties: member(X, L)

Usage: member(X, L)

REGTYPE: sequence/2:

A sequence is formed with zero, one or more occurrences of the operator ','/2. For example, a, b, c is a sequence of three atoms, a is a sequence of one atom.

Meta-predicate with arguments: sequence(?,pred(1)).

General properties: sequence(S, T)

Usage: sequence(S, T)

REGTYPE: sequence_or_list/2:

Meta-predicate with arguments: sequence_or_list(?,pred(1)).

General properties: sequence_or_list(S, T)

Usage: sequence_or_list(S, T)

REGTYPE: character_code/1:

General properties: character_code(T)

character_code(T)

Usage: character_code(T)

REGTYPE: string/1:

A string is a list of character codes. The usual syntax for strings "string" is allowed, which is equivalent to [0's,0't,0'r,0'i,0'n,0'g] or [115,116,114,105,110,103]. There is also a special Ciao syntax when the list is not complete: "st"||R is equivalent to [0's,0't|R].

General properties: string(T)

string(T)

Usage: string(T)

REGTYPE: predname/1:

General properties: predname(P)

Usage: predname(P)

REGTYPE: atm_or_atm_list/1:

General properties: atm_or_atm_list(T)

Usage: atm_or_atm_list(T)

PROPERTY: compat/2:

This property captures the notion of type or property compatibility. The instantiation or constraint state of the term is compatible with the given property, in the sense that assuming that imposing that property on the term does not render the store inconsistent. For example, terms X (i.e., a free variable), [Y|Z], and [Y,Z] are all compatible with the regular type list/1, whereas the terms f(a) and [1|2] are not.

Meta-predicate with arguments: compat(?,pred(1)).

General properties: compat(Term, Prop)

Usage: compat(Term, Prop)

PROPERTY: iso/1:

General properties: iso(G)

Usage: iso(G)

PROPERTY: not_further_inst/2:

General properties: not_further_inst(G, V)

Usage: not_further_inst(G, V)

PROPERTY: sideff/2:

sideff(G, X)

Declares that G is side-effect free (if its execution has no observable result other than its success, its failure, or its abortion), soft (if its execution may have other observable results which, however, do not affect subsequent execution, e.g., input/output), or hard (e.g., assert/retract).

Meta-predicate with arguments: sideff(goal,?).

General properties: sideff(G, X)

Usage: sideff(G, X)

PROPERTY: regtype/1:

Meta-predicate with arguments: regtype(goal).

General properties: regtype(G)

Usage: regtype(G)

PROPERTY: native/1:

Meta-predicate with arguments: native(goal).

General properties: native(P)

Usage: native(Pred)

PROPERTY: native/2:

Meta-predicate with arguments: native(goal,?).

General properties: native(P, K)

Usage: native(Pred, Key)

PROPERTY: eval/1:

A property, defined as follows:




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