Author(s): The CLIP Group.
Version: 1.10#7 (2006/4/26, 19:22:13 CEST)
Version of last change: 1.9#334 (2004/4/13, 13:28:2 CEST)
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.
atomic_basic
)atomic_basic
)
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.
Usage 1: name(+constant, ?string)
basic_props:native/1
)
Usage 2: name(-constant, +string)
String
can be interpreted as a number, Const
is unified with that number, otherwise with the atom whose name is String
.
basic_props:native/1
)
atom_codes(Atom, String)
String
is the list of the ASCII codes of the characters comprising the name of Atom
.
Usage 1: atom_codes(+atm, ?string)
* ISO *
basic_props:native/1
)
Usage 2: atom_codes(-atm, +string)
* ISO *
basic_props:native/1
)
number_codes(Number, String)
String
is the list of the ASCII codes of the characters comprising a representation of Number
.
Usage 1: number_codes(+num, ?string)
* ISO *
basic_props:native/1
)
Usage 2: number_codes(-num, +string)
* ISO *
basic_props:native/1
)
number_codes(Number, Base, String)
String
is the list of the ASCII codes of the characters comprising a representation of Number
in base Base
.
Usage 1: number_codes(+num, +int, ?string)
basic_props:native/1
)
Usage 2: number_codes(-num, +int, +string)
basic_props:native/1
)
atom_number(Atom, Number)
Atom
can be read as a representation of Number
.
Usage 1: atom_number(+atm, ?num)
basic_props:native/1
)
Usage 2: atom_number(-atm, +num)
basic_props:native/1
)
atom_length(Atom, Length)
Length
is the number of characters forming the name of Atom
.
Usage: atom_length(+atm, ?int)
* ISO *
basic_props:native/1
)
atom_concat(Atom_1, Atom_2, Atom_12)
Atom_12
is the result of concatenating Atom_1
followed by Atom_2
.
Usage 1: atom_concat(+atom, +atom, ?atom)
* ISO *
basic_props:native/1
)
Usage 2: atom_concat(-atom, -atom, +atom)
* ISO *
basic_props:native/1
)
Usage 3: atom_concat(-atom, +atom, +atom)
* ISO *
basic_props:native/1
)
Usage 4: atom_concat(+atom, -atom, +atom)
* ISO *
basic_props:native/1
)
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.
Usage: sub_atom(+atm, +int, +int, ?atm)
basic_props:native/1
)
Go to the first, previous, next, last section, table of contents.