Built-in Predicates

The table below summarizes the built-in predicates available in PrologJ. These fall into several categories, with some predicates belonging to more than one category. The table indicates, for each builtin-predicate, what categorie(s) it belongs to. An "X" indicates that a predicate is included in a category. "EXT" indicates that an extended capability of the predicate is included in that category, while the basic capabilities appear in another category. The Grammar Rules category also includes special handling for asserting clauses using -->/2 as a rule specifier, and several categories include additional operators.

By default, all of the built-in predicates listed below are available. However, when the PrologJ interpreter or compiler is started from the command line or a script, the user can specify the category(s) of built-in predicates to use by specifying the -l[ibrary] option on the command line. This option is followed by one or more letters specifying the desired predicate category(s), or by a hyphen (-) to use only the core predicates. If the -l[ibrary] option is not used on the command line or script, or the interpreter is started by running the file prologj.jar, all of the built-in predicates are available.

If the interpreter is run with a console window, the set of available built-in predicates may also be examined or modified through the Library Components menu.

Built-in predicates in PrologJ fall into the following broad categories:

In the table below, the column headed "Documentation" indicates where the reader can find documentation for the built-in predicate.

Predicate Documentation core ISO TRA TIO CIO DEB GRA JAV REL SET FUZ MIS
-l[ibrary] option
specifier
i t Both
i and
t
c
or t
d g j r s f m
abolish/1DEC 1X
abort/0htmlX
arg/3DEC 2 (CM 6.5)X
=:=/2DEC 3 (CM 6.12)X
=\=/2DEC 3 (CM 6.12)X
>/2DEC 3 (CM 6.12)X
>=/2DEC 3 (CM 6.12)X
</2DEC 3 (CM 6.12)X
=</2DEC 3 (CM 6.12)X
asserta/1DEC 4 (CM 6.4);
html; html
XEXTEXT
assertz/1DEC 5 (CM 6.4);
html; html
XEXTEXT
at_end_of_stream/0DEC 6X
at_end_of_stream/1DEC 7X
atom/1DEC 8 (CM 6.3)X
atom_chars/2DEC 9X
atom_codes/2DEC 10X
atom_concat/3DEC 11X
atom_length/2DEC 12X
atomic/1DEC 13 (CM 6.3)X
bagof/3DEC 14X
biginteger/1htmlX
break/0htmlX
built_in/4htmlX
call/1DEC 15 (CM 6.7);
html
XEXT
call_fuzzy/1htmlX
@/2htmlX
catch/3DEC 16; htmlXEXT
char_code/2DEC 17X
char_conversion/2DEC 18X
clause/2DEC 19 (CM 6.4);
html; html
XEXTEXT
close/1DEC 20; htmlXEXT
close/2DEC 21X
compound/1DEC 22X
,/2DEC 23 (CM 6.7);
html
XEXT
consult/1CM 6.1; htmlXX
copy_term/2DEC 24X
current_char_conversion/2DEC 25X
current_input/1DEC 26X
current_op/3DEC 27X
current_output/1DEC 28X
current_predicate/1DEC 29X
current_prolog_flag/2DEC 30X
!/0DEC 31 (CM 6.6)X
debugging/0CM 6.13; htmlX
deny/1htmlX
;/2DEC 32 (CM 6.7);
html
XEXT
display/1CM 6.9; htmlX
display/2htmlX
fail/0DEC 33 (CM 6.2)X
filter_set/4htmlX
findall/3DEC 34X
findset/3htmlX
float/1DEC 35X
flush_output/0DEC 36X
flush_output/1DEC 37X
foreach/2html; htmlEXTX
functor/3DEC 38 (CM 6.5)X
fuzzy_bagof/3htmlX
fuzzy_best/1htmlX
fuzzy_difference/3htmlX
fuzzy_findall/3htmlX
fuzzy_findset/3htmlX
fuzzy_intersection/3htmlX
fuzzy_setof/3htmlX
fuzzy_truth/1htmlX
fuzzy_union/3htmlX
get0/1CM 6.9; htmlX
get0/2htmlX
get/1CM 6.9; htmlX
get/2htmlX
get_byte/1DEC 39X
get_byte/2DEC 40X
get_char/1DEC 41X
get_char/2DEC 42X
get_code/1DEC 43X
get_code/2DEC 44X
halt/0DEC 45X
halt/1DEC 46X
->/2DEC 47; htmlXEXT
-> ;/3DEC 48; htmlXEXT
integer/1DEC 49 (CM 6.3)X
is/2DEC 50 (CM 6.11)X
listing/1CM 6.4; html; htmlXXEXT
listing/2html; htmlXEXT
name/2CM 6.5; see note 1X
nl/0DEC 51 (CM 6.9)X
nl/1DEC 52X
nodebug/0CM 6.13; htmlX
nonvar/1DEC 53 (CM 6.3)X
nospy/1CM 6.13; htmlX
not/1CM 6.7; html; see note 2XEXT
\+/1DEC 54; htmlXEXT
notrace/0CM 6.13; htmlX
notrace/1htmlX
number/1DEC 55X
number_chars/2DEC 56X
number_codes/2DEC 57X
object/1htmlX
once/1DEC 58; htmlXEXT
op/3DEC 59 (CM 6.9)X
open/3DEC 60X
open/4DEC 61; html; htmlXEXT
peek_byte/1DEC 62X
peek_byte/2DEC 63X
peek_char/1DEC 64X
peek_char/2DEC 65X
peek_code/1DEC 66X
peek_code/2DEC 67X
phrase/2CM 9.3X
put/1CM 6.9; htmlX
put/2htmlX
put_byte/1DEC 68X
put_byte/2DEC 69X
put_char/1DEC 70X
put_char/2DEC 71X
put_code/1DEC 72X
put_code/2DEC 73X
read/1DEC 74 (CM 6.9)X
read/2DEC 75X
read_term/2DEC 76X
read_term/3DEC 77X
reconsult/1CM 6.1; htmlXX
repeat/0DEC 78 (CM 6.6)X
retract/1DEC 79 (CM 6.4);
html; html
XEXTEXT
retractall/1html; html htmlEXTEXTX
see/1CM 6.10; htmlX
seeing/1CM 6.10; htmlX
seen/1CM 6.10; htmlX
set_difference/3htmlX
set_input/1DEC 80X
set_intersection/3htmlX
set_output/1DEC 81X
set_prolog_flag/2DEC 82X
set_stream_position/2DEC 83X
set_union/3htmlX
setof/3DEC 84X
skip/1CM 6.9; htmlX
skip/2htmlX
spy/1CM 6.13; htmlX
stream_property/2DEC 85X
sub_atom/5DEC 86X
tab/1CM 6.9; htmlX
tab/2htmlX
tell/1CM 6.10; htmlX
telling/1CM 6.10; htmlX
@>/2DEC 87X
@>=/2DEC 88X
==/2DEC 89 (CM 6.8)X
@</2DEC 90X
@=</2DEC 91X
\==/2DEC 92 (CM 6.8)X
throw/1DEC 93X
throw_error/1htmlX
told/0CM 6.10; htmlX
trace/0CM 6.13; htmlX
trace/1htmlX
true/0DEC 94 (CM 6.2)X
\=/2DEC 95 (CM 6.8)X
=/2DEC 96 (CM 6.8)X
unify_with_occurs_check/2DEC 97X
=../2DEC 98 (CM 6.5)X
var/1DEC 99 (CM 6.3)X
write/1DEC 100 (CM 6.9)X
write/2DEC 101X
write_canonical/1DEC 102X
write_canonical/2DEC 103X
write_error/1htmlX
write_error/2htmlX
write_term/2DEC 104; htmlX
write_term/3DEC 105; htmlX
writeq/1DEC 106X
writeq/2DEC 107X

Notes:

  1. name/2 is implemented identically to atom_codes/2 and has the same error cases
     
  2. not/1 is implemented identically to \+/1 and has the same error cases

Miscellaneous Built-in Predicates

The following built-ins have proven useful in the writing of Prolog code, and so are made available in PrologJ.

Copyright © 2005 - Russell C. Bjork. See the file See file COPYING in the root directory for copyright information.

Valid XHTML 1.0!