![]() |
YAP 7.1.0
|
The following predicates are used to manipulate atoms, strings, lists of codes and lists of chars. More...
The following predicates are used to manipulate atoms, strings, lists of codes and lists of chars.
class hide_atom/1 |
hide_atom(+ Atom)
Make atom Atom invisible, by removing it from the Atom Table
Existing referebces are still active Defining a new atom with the same characters will result in a different atom.xs
class hidden_atom/1 |
hidden_atom( +Atom )
Is true if the atom Ãtom is not visible to Prolog?
class unhide_atom/1 |
unhide_atom(+ Atom)
Make hidden atom Atom visible
Note that the operation fails if another atom with name Atom was defined since
class char_code/2 |
char_code(? A,? I)
defined in the ISO standard
The built-in succeeds with A bound to character represented as an atom, and I bound to the character code represented as an integer At least, one of either A or I must be bound before the call
class name/2 |
name( A, L)
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) The argument A will be unified with an atomic symbol and L with the list of the ASCII codes for the characters of the external representation of A
will return:
and
will return:
class string_to_atomic/2 |
string_to_atomic(?S, ?Atomic)
Unify from a string S with a number, if S can be parsed as such, or otherwise to an atom
Examples:
class atomic_to_string/1 |
atomic_to_string(?Atomic.?String)
class string_to_atom/2 |
string_to_atom(?String, ?Atom)
class atom_to_string/1 |
atom_to_string(?Atom.?String)
class atom_string/1 |
atom_string(?Atom.?String)
class atom_chars/2 |
atom_chars(? A,? L)
defined in the ISO standard
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) The argument A must be unifiable with an atom, and the argument L with the list of the characters of A
class atom_codes/2 |
atom_codes(?Atom, ?Codes)
class number_chars/2 |
number_chars(? I,? L)
defined in the ISO standard
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) The argument I must be unifiable with a number, and the argument L with the list of the characters of the external representation of I
class number_codes/2 |
number_codes(? I,? L)
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) The argument I must be unifiable with a number, and the argument L must be unifiable with a list of UNICODE numbers representing the number
class number_atom/2 |
number_atom(? I,? A)
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) The argument I must be unifiable with a number, and the argument A must be unifiable with an atom representing the number
class number_string/2 |
number_string(? I,? L)
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) The argument I must be unifiable with a number, and the argument L must be unifiable with a term string representing the number
class atom_length/2 |
atom_length(+ A,? I)
defined in the ISO standard
The predicate holds when the first argument is an atom, and the second unifies with the number of characters forming that atom If bound, I must be a non-negative integer
class atomic_length/2 |
atomic_length(+ A,? I)
defined in the ISO standard
The predicate holds when the first argument is a number or atom, and the second unifies with the number of characters needed to represent the number, or atom
class downcase_text_to_atom/2 |
downcase_text_to_atom(+Text, -Atom)
Convert all upper case code-points in text Text to downcase Unify the result as atom Atom with the second argument
class upcase_text_to_atom/2 |
upcase_text_to_atom(+Text, -Atom)
Convert all lower case code-points in text Text to up case Unify the result as atom Atom with the second argument
class downcase_text_to_string/2 |
downcase_text_to_string(+Text, -String)
Convert all upper case code-points in text Text to downcase Unify the result as string String with the second argument
class upcase_text_to_string/2 |
upcase_text_to_string(+Text, -String)
Convert all lower case code-points in text Text to up case Unify the result as string String with the second argument
class downcase_text_to_codes/2 |
downcase_text_to_codes(+Text, -Codes)
Convert all upper case code-points in text Text to downcase Unify the result as a sequence of codes Codes with the second argument
class upcase_text_to_codes/2 |
upcase_text_to_codes(+Text, -Codes)
Convert all lower case code-points in text Text to up case Unify the result as a sequence of codes Codes with the second argument
class downcase_text_to_chars/2 |
downcase_text_to_chars(+Text, -Chars)
Convert all upper case code-points in text Text to downcase Unify the result as a sequence of chars Chars with the second argument
class upcase_text_to_chars/2 |
upcase_text_to_chars(+Text, -Chars)
Convert all lower case code-points in text Text to up case Unify the result as a sequence of chars Chars with the second argument
class atom_number/2 |
atom_number(? Atom,? Number)
atom_number(? String,? Number)
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) If the argument Atom is an atom, Number must be the number corresponding to the characters in Atom, otherwise the characters in Atom must encode a number Number
The predicate holds when at least one of the arguments is ground (otherwise, an error message will be displayed) If the argument String is a string term, String must be the number corresponding to the characters in Atom, otherwise the characters in String must encode the number Number
class sub_atom/5 |
sub_atom(+ A,? Bef, ? Size, ? After, ? At_out)
defined in the ISO standard
True when A and At_out are atoms such that the name of At_out has size Size and is a sub-string of the name of A, such that Bef is the number of characters before and After the number of characters afterwards
Note that A must always be known, but At_out can be unbound when calling this built-in If all the arguments for sub_atom/5 but A are unbound, the built-in will backtrack through all possible sub-strings of A
class sub_string/5 |
sub_string(+ S,? Bef, ? Size, ? After, ? S_out)
defined in the ISO standard
True when S and S_out are strings such that the S_out has size Size and is a sub-string of S, Bef is the number of characters before, and After the number of characters afterwards
Note that S must always be known, but S_out can be unbound when calling this built-in If all the arguments for sub_string/5 but S are unbound, the built-in will generate all possible sub-strings of S
Accepts both atoms and strings
wchar_t ** name |
Definition at line 585 of file SWI-Prolog.h.
Macros | |
#define | HAS_CACHE_REGS 1 |
#define | CastToNumeric(x) CastToNumeric__(x PASS_REGS) |
#define | SUB_ATOM_HAS_MIN 1 |
#define | SUB_ATOM_HAS_SIZE 2 |
#define | SUB_ATOM_HAS_AFTER 4 |
#define | SUB_ATOM_HAS_VAL 8 |
#define | SUB_ATOM_HAS_ATOM 16 |
#define | SUB_ATOM_HAS_UTF8 32 |
Functions | |
void | Yap_InitBackAtoms (void) |
void | Yap_InitAtomPreds (void) |
Variables | |
char ** | name |