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.
The number of characters preceding SubAtom.
The number of characters of SubAtom.
The number of characters following SubAtom.
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
Atom is uninstantiated.
Atom is not an atom. Before, Length, or After, if instantiated, is not an integer. SubAtom, if instantiated, is not an atom.
Before, Length, or After, if instantiated, is negative.