Expand description
Atom/number-string builtins: atom_length/2, atom_concat/3,
atom_chars/2, number_chars/2, number_codes/2.
Ported byte-for-byte from patch-prolog v1 (solver.rs arms). Modes
verified against the oracle:
atom_concat/3supports ONLY the deterministic both-atoms-bound mode; an unbound prefix/suffix raisestype_error(atom, _)(v1 is not nondeterministic here).atom_chars/2works both directions (atom→one-char atoms, list→atom).number_chars/2andnumber_codes/2work both directions; garbage input on the reverse direction raises a baresyntax_errorformal.- float→chars/codes uses v1’s
format_float(“3.0”, not “3”).
Functions§
- plg_
rt_ b_ atom_ chars_ 2 atom_chars/2: both directions (atom ↔ list of one-char atoms).- plg_
rt_ b_ atom_ concat_ 3 atom_concat/3: concatenate two bound atoms. Only this mode is supported (v1 raises a type error otherwise).- plg_
rt_ b_ atom_ length_ 2 atom_length/2: length (in chars) of an atom. 1 = success.- plg_
rt_ b_ number_ chars_ 2 number_chars/2: both directions (number ↔ list of one-char atoms).- plg_
rt_ b_ number_ codes_ 2 number_codes/2: both directions (number ↔ list of char codes).