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


Basic predicates handling names of constants

Author(s): The CLIP Group.

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

Version of last change: 1.11#169 (2004/2/3, 21:36:40 CET)

The Ciao system provides builtin predicates which allow dealing with names of constants (atoms or numbers). Note that sometimes strings (character code lists) are more suitable to handle sequences of characters.

Usage and interface (atomic_basic)

Documentation on exports (atomic_basic)

PREDICATE: name/2:

name(Const, String)

String is the list of the ASCII codes of the characters comprising the name of Const. Note that if Const is an atom whose name can be interpreted as a number (e.g. '96'), the predicate is not reversible, as that atom will not be constructed when Const is uninstantiated. Thus it is recommended that new programs use the ISO-compliant predicates atom_codes/2 or number_codes/2, as these predicates do not have this inconsistency.

General properties:

Usage 1:

Usage 2:

PREDICATE: atom_codes/2:

atom_codes(Atom, String) * ISO *

String is the list of the ASCII codes of the characters comprising the name of Atom.

General properties:

Usage 1:

Usage 2:

PREDICATE: number_codes/2:

number_codes(Number, String) * ISO *

String is the list of the ASCII codes of the characters comprising a representation of Number.

General properties:

Usage 1:

Usage 2:

PREDICATE: number_codes/3:

number_codes(Number, String, Base)

String is the list of the ASCII codes of the characters comprising a representation of Number in base Base.

General properties:

Usage 1:

Usage 2:

PREDICATE: atom_number/2:

atom_number(Atom, Number)

Atom can be read as a representation of Number.

General properties:

Usage 1:

Usage 2:

PREDICATE: atom_length/2:

atom_length(Atom, Length) * ISO *

Length is the number of characters forming the name of Atom.

General properties:

Usage:

PREDICATE: atom_concat/3:

atom_concat(Atom_1, Atom_2, Atom_12) * ISO *

Atom_12 is the result of concatenating Atom_1 followed by Atom_2.

General properties:

Usage 1:

Usage 2:

Usage 3:

Usage 4:

PREDICATE: sub_atom/4:

sub_atom(Atom, Before, Length, Sub_atom)

Sub_atom is formed with Length consecutive characters of Atom after the Before character. For example, the goal sub_atom(summer,1,4,umme) succeeds.

General properties:

Usage:


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