The following (user-level) builtins are supported, with semantics (intended to be) close to SICSTUS and QUINTUS Prolog.
fail/0 nl/0 var/1 nonvar/1 integer/1 atomic/1 +/3 % arithmetic offers also the usual is/2 interface -/3 * /3 // /3 mod/3 << /3 >> /3 /\ /3 \/ /3 # /3 % bitwise XOR \ /3 % bitwise NOT random/1 % returns an integer, not a float get0/1 put/1 < /2 > /2 =< /2 >= /2 =:= /2 =\= /2 compare/3 seeing/1 seen/0 telling/1 told/0 copy_term/2 functor/3 arg/3 name/2 abort/0 is_compiled/1 % checks if a predicate is compiled
true/0, =/2, .. -> .. ; .. ;/1 call/1 \+/1 repeat/0 findall/3 findall/4 for/3 numbervars/4 see/1 tell/1 system/1 statistics/0 statistics/2 atom/1 compound/1 =../2 length/2 tab/1 get/1 == /2 \== /2 A @< B A @> B A @=< B A @>= B compile/1 - see co.pl for the compiler read/1 - see the file: read.pl write/1 - see the file: write.pl halt/0, halt(ReturnCode), listing/0, % only for interpreted code listing(Pred,Arity), assert/1, asserta/1, assertz/1, retract/1, retractall/1 erase/1, dynamic/1, instance/2, clause/2, clause/3, consult/1, % usable for debugging or dynamic code reconsult/1, % they override compiled definitions !!! setof/3, bagof/3, sort/3, keysort/3, setarg/3, % backtrackable update of arg I of term T with new term X is_builtin/1 % lists the system-level builtins (written in C): current_predicate/1 % lists/checks existence of a predicate/arity predicate_property/2 % lists/checks if a property (arg 2) is associated with a head (arg 1)
:-op/3, current_op/3.
Including files are supported. For compile/1 use
:-compile(file).
or
:-[file]. % this calls the compiler too !!!
For consulting included interpreted code within an embedding reconsult/1 use:
:-consult(file).