Next: mpg-ref-subsumes_term, Previous: mpg-ref-stream_property, Up: mpg-bpr [Contents][Index]
sub_atom/5
ISOsub_atom(+Atom,-Before,-Length,-After,-SubAtom)
The characters of SubAtom form a sublist of the characters of Atom, such that the number of characters preceding SubAtom is Before, the number of characters after SubAtom is After, and the length of SubAtom is Length.
atom, must be nonvar
The atom from which a part is selected.
integer
The number of characters preceding SubAtom.
integer
The number of characters of SubAtom.
integer
The number of characters following SubAtom.
atom
The selected part of Atom.
Capable of nondeterminately enumerating all sub-atoms and their all possible placements, e.g.:
| ?- sub_atom(abrakadabra, Before, _, After, ab). After = 9, Before = 0 ? ; After = 2, Before = 7 ? ; no
instantiation_error
Atom is uninstantiated.
type_error
Atom is not an atom. Before, Length, or After, if instantiated, is not an integer. SubAtom, if instantiated, is not an atom.
domain_error
Before, Length, or After, if instantiated, is negative.
atom_length/2
, atom_concat/3
.