Go to the first, previous, next, last section, table of contents.


Summary of Built-In Predicates

!
Commits to any choices taken in the current predicate.
(+P,+Q)
P and Q.
(Head --> Body)
Not a built-in predicate; reserved syntax for grammar rules.
(+P -> +Q ; +R)
If P then Q else R, using first solution of P only.
(+P -> +Q)
If P then Q else false, using first solution of P only.
[]
[:File|+Files]
Updates the program with interpreted clauses from File and Files.
(:- Command)
Not a built-in predicate; reserved syntax for commands and declarations.
(?- Query)
Not a built-in predicate; reserved syntax for queries.
(Head :- Body)
Not a built-in predicate; reserved syntax for clauses.
(+P;+Q)
P or Q.
?X = ?Y
The terms X and Y are unified.
+Term =.. ?List
?Term =.. +List
The functor and arguments of the term Term comprise the list List.
+X =:= +Y
X is numerically equal to Y.
?Term1 == ?Term2
The terms Term1 and Term2 are strictly identical.
+X =\= +Y
X is not numerically equal to Y.
+X =< +Y
X is less than or equal to Y.
+X > +Y
X is greater than Y.
+X >= +Y
X is greater than or equal to Y.
?X ^ :P
Executes the procedure call P.
\+ +P
Goal P is not provable.
?Term1 \== ?Term2
The terms Term1 and Term2 are not strictly identical.
+X < +Y
X is less than Y.
?Term1 @=< ?Term2
The term Term1 precedes or is identical to the term Term2 in the standard order.
?Term1 @> ?Term2
The term Term1 follows the term Term2 in the standard order.
?Term1 @>= ?Term2
The term Term1 follows or is identical to the term Term2 in the standard order.
?Term1 @< ?Term2
The term Term1 precedes the term Term2 in the standard order.
?=(?X,?Y)
X and Y are either syntactically identical or syntactically non-unifiable.
abolish(:Preds)
Makes the predicate(s) specified by Preds undefined.
abolish(:Atom,+Arity)
Makes the predicate specified by Atom/Arity undefined.
abort
Aborts execution of the current directive (returns to C in recursive calls to Prolog from C).
absolute_file_name(+RelativeName,?AbsoluteName)
AbsoluteName is the full pathname of RelativeName.
arg(+ArgNo,+Term,?Arg)
The argument ArgNo of the term Term is Arg.
assert(:Clause)
assert(:Clause,-Ref)
Asserts clause Clause with unique identifier Ref.
asserta(:Clause)
asserta(:Clause,-Ref)
Asserts Clause as first clause with unique identifier Ref.
assertz(:Clause)
assertz(:Clause,-Ref)
Asserts Clause as last clause with unique identifier Ref.
at_end_of_line
at_end_of_line(Stream)
The end of stream or end of line has been reached for Stream or from the current input stream.
at_end_of_stream
at_end_of_stream(Stream)
The end of stream has been reached for Stream or from the current input stream.
atom(?X)
X is currently instantiated to an atom.
atom_chars(+Atom,?CharList)
atom_chars(?Atom,+CharList)
The name of the atom Atom is the list of characters CharList.
atomic(?X)
X is currently instantiated to an atom or a number.
bagof(?Template,:Goal,?Bag)
Bag is the bag of instances of Template such that Goal is satisfied (not just provable).
block Specs
Not a built-in predicate; block declaration.
bb_delete(+Key,?Term)
Delete from the blackboard Term stored under Key.
bb_get(+Key,?Term)
Get from the blackboard Term stored under Key.
bb_put(+Key,+Term)
Store the term Term under Key on the blackboard.
bb_update(:Key, ?OldTerm, ?NewTerm)
Replace the term OldTerm by the term NewTerm under Key on the blackboard.
break
Invokes a recursive top-level. (not available in Runtime Systems).
'C'(?S1,?Terminal,?S2)
Grammar rules. S1 is connected by the terminal Terminal to S2.
call(:Term)
(Module::Term)
Executes the procedure call Term in Module.
call_cleanup(:Goal,:Cleanup)
Executes the procedure call Goal. When Goal succeeds deterministically, is cut, fails, or raises an exception, Cleanup is executed.
call_residue(:Goal,?Residue)
Executes the procedure call Goal. Any floundered goals and the variables they are blocked on occur as VarSet-Goal pairs in Residue.
callable(?X)
X is currently instantiated to a compound term or an atom.
character_count(+Stream,?Count)
Count characters have been read from or written to the stream Stream.
clause(:Head,?Body)
clause(:Head,?Body,?Ref)
clause(?Head,?Body,+Ref)
There is an interpreted clause whose head is Head, whose body is Body, and whose unique identifier is Ref.
close(+Stream)
Closes stream Stream.
compare(?Op,?Term1,?Term2)
Op is the result of comparing the terms Term1 and Term2.
compile(:Files)
Compiles in-core the clauses in text file(s) Files.
compound(?X)
X is currently instantiated to a term of arity > 0.
consult(:Files)
Updates the program with interpreted clauses from file(s) Files.
copy_term(?Term,?CopyOfTerm)
CopyOfTerm is an independent copy of Term.
create_mutable(+Datum,-Mutable)
Mutable is a new mutable term with current value Datum.
current_atom(?Atom)
One of the currently defined atoms is Atom.
current_input(?Stream)
Stream is the current input stream.
current_key(?KeyName,?KeyTerm)
There is a recorded item in the internal database whose key is KeyTerm, the name of which is KeyName.
current_module(?Module)
Module is a module currently in the system.
current_module(?Module,?File)
Module is a module currently in the system, loaded from File.
current_op(?Precedence,?Type,?Op)
Atom Op is an operator type Type precedence Precedence.
current_output(?Stream)
Stream is the current output stream.
current_predicate(?Name,:Head)
current_predicate(?Name,-Head)
A user defined or library predicate is named Name, most general goal Head.
current_stream(?AbsFileName,?Mode,?Stream)
There is a stream Stream associated with the file AbsFileName and opened in mode Mode.
debug
Switches on debugging in leap mode (not available in Runtime Systems).
debugging
Displays debugging status information (not available in Runtime Systems).
dif(?X,?Y)
The terms X and Y are different.
display(?Term)
Displays the term Term on the standard output stream.
dynamic Specs
Not a built-in predicate; dynamic declaration.
ensure_loaded(:Files)
Compiles or loads the file(s) Files if need be.
erase(+Ref)
Erases the clause or record whose unique identifier is Ref.
error_exception(+Exception)
user:error_exception(+Exception)
A hook predicate, Exception is an exception that traps to the debugger if it is switched on.
expand_term(+Term1,?Term2)
The term Term1 is a shorthand which expands to the term Term2.
fail
false
False.
fcompile(:Files)
Compiles file-to-file the clauses in text file(s) Files (not available in Runtime Systems).
file_search_path(Alias,?Expansion)
user:file_search_path(Alias,?Expansion)
A hook predicate, telling how to expand Alias(File) file names.
fileerrors
Enables reporting of file errors.
findall(?Template,:Goal,?Bag)
findall(?Template,:Goal,?Bag,?Remainder)
A prefix of Bag is the list of instances of Template such that Goal is provable. The rest of Bag is Remainder or the empty list.
float(?X)
X is currently instantiated to a float.
flush_output
flush_output(+Stream)
Flushes the buffers associated with Stream.
foreign(+CFunctionName,+Predicate)
foreign(+CFunctionName,+Language,+Predicate)
Hook predicates, tell Prolog how to define Predicate to invoke CFunctionName.
foreign_file(+ObjectFile,+Functions)
A hook predicate, tells Prolog that foreign functions Functions are in file ObjectFile. Obsolete, use foreign_resource/2 instead.
foreign_resource(+ResourceName,+Functions)
A hook predicate, tells Prolog that foreign functions Functions are in resource ResourceName.
format(+Format,+Arguments)
format(+Stream,+Format,+Arguments)
Writes Arguments according to Format on the stream Stream or on the current output stream.
freeze(?Var,:Goal)
Blocks Goal until nonvar(Var) holds.
frozen(-Var,?Goal)
The goal Goal is blocked on the variable Var.
functor(+Term,?Name,?Arity)
functor(?Term,+Name,+Arity)
The principal functor of the term Term has name Name and arity Arity.
garbage_collect
Performs a garbage collection of the global stack.
garbage_collect_atoms
Performs a garbage collection of the atoms.
gc
Enables garbage collection of the global stack.
get(?C)
get(+Stream,?C)
The next printing character from the stream Stream or from the current input stream is C.
get0(?C)
get0(+Stream,?C)
The next character from the stream Stream or from the current input stream is C.
get_mutable(?Datum,+Mutable)
The current value of the mutable term Mutable is Datum.
goal_expansion(+Goal,+Module,-NewGoal)
user:goal_expansion(+Goal,+Module,-NewGoal)
A hook predicate. Defines a transformation from Goal in module Module to NewGoal.
ground(?X)
X is currently free of unbound variables.
halt
Halts Prolog. (returns to C in recursive calls to Prolog from C).
halt(Code)
Halts Prolog immediately, returning Code.
help
Hookable, prints a help message (not available in Runtime Systems).
if(+P,+Q,+R)
If P then Q else R, exploring all solutions of P.
incore(+Term)
Executes the procedure call Term.
initialization
Executes a list of user defined goals (not available in Runtime Systems).
initialization(:Goal)
Adds Goal to the list of goals executed by initialization/0 (not available in Runtime Systems).
instance(+Ref,?Term)
Term is a most general instance of the record or clause uniquely identified by Ref.
integer(?X)
X is currently instantiated to an integer.
?Y is +X
Y is the value of the arithmetic expression X.
is_mutable(?X)
X is currently instantiated to a mutable term.
keysort(+List1,?List2)
The list List1 sorted by key yields List2.
leash(+Mode)
Sets leashing mode to Mode (not available in Runtime Systems).
length(?List,?Length)
The length of list List is Length.
library_directory(?Directory)
user:library_directory(?Directory)
A hook predicate, telling how to expand library(File) file names.
line_count(+Stream,?N)
N is the number of lines read/written on stream Stream.
line_position(+Stream,?N)
N is the number of characters read/written on the current line of Stream.
link_foreign_resource(+Resource,+SourceFile,+Option,+CFiles,+ObjectFiles,+Libraries)
Builds a linked foreign resource (not available in Runtime Systems).
listing
listing(:Specs)
Lists the interpreted predicate(s) specified by Specs or all interpreted predicates in the type-in module. Any variables in the listed clauses are internally bound to ground terms before printing. If this causes any blocked goals to be executed, the behavior is undefined.
load(:Files)
Loads object file(s) Files.
load_files(:Files)
load_files(:Files, +Options)
Loads source or object file(s) Files obeying Options.
load_foreign_files(:ObjectFiles,+Libraries)
Hookable, links object files ObjectFiles into Prolog. Obsolete, use link_foreign_resource/6 and load_foreign_resource/1 instead.
load_foreign_resource(:Resource)
Loads foreign resource Resource into Prolog.
unload_foreign_resource(:Resource)
Unloads foreign resource Resource from Prolog.
meta_predicate Specs
Not a built-in predicate; meta-predicate declaration.
method_expansion(+Method1,?Object,?Method2)
user:method_expansion(+Method1,?Object,?Method2)
A hook predicate, defines transformations on Prolog Object methods.
mode Specs
Not a built-in predicate; mode declaration.
module(+Module)
Sets the type-in module to Module; see section Basic Concepts.
module(+Module, +ExportList)
module(+Module, +ExportList, +Options)
Not a built-in predicate; module declaration.
multifile Specs
Not a built-in predicate; multifile declaration.
muse_flag(?FlagName,?Value)
Value is the current value of the Muse flag FlagName.
muse_flag(+FlagName,?OldValue,?NewValue)
OldValue and NewValue are the old and new values of the Muse flag FlagName.
muse_flags
Display all Muse flag settings.
muse_sync
Synchronize for being leftmost in Muse.
muse_trace(:Goal)
muse_trace(:Goal,+FilePrefix)
Generate a Muse trace file for Goal.
name(+Const,?CharList)
name(?Const,+CharList)
The name of atom or number Const is the string CharList.
nl
nl(+Stream)
Outputs a new line on stream Stream or on the current output stream.
nodebug
Switches off debugging (not available in Runtime Systems).
nofileerrors
Disables reporting of file errors.
nogc
Disables garbage collection of the global stack.
nonvar(?X)
X is a non-variable.
nospy :Spec
Removes spy-points from the predicate(s) specified by Spec (not available in Runtime Systems).
nospyall
Removes all spy-points (not available in Runtime Systems).
notrace
nozip
Switches off debugging (not available in Runtime Systems).
number(?X)
X is currently instantiated to a number.
number_chars(+Number,?CharList)
number_chars(?Number,+CharList)
The name of the number Number is the list of characters CharList.
numbervars(?Term,+N,?M)
Number the variables in the term Term from N to M-1.
on_exception(?Pattern,:ProtectedGoal,:Handler)
Executes the procedure call ProtectedGoal. If during the execution raise_exception(Exception) is called, and Exception matches Pattern, the execution of ProtectedGoal abort, Pattern is unified with a copy of Exception and Handler is called.
op(+Precedence,+Type,+Name)
Makes atom(s) Name an operator of type Type precedence Precedence.
open(+FileName,+Mode,-Stream)
open(+FileName,+Mode,-Stream,+Options) [ISO]
Opens file FileName in mode Mode with options Options as stream Stream.
open_null_stream(-Stream)
Opens an output stream to the null device.
otherwise
True.
parallel
parallel Specs
Not a built-in predicate; parallel declaration.
peek_char(?N)
peek_char(+Stream,?N)
N is the character code of the next character peeked at from Stream or from the current input stream.
phrase(:Phrase,?List)
phrase(:Phrase,?List,?Remainder)
Grammar rules. The list List can be parsed as a phrase of type Phrase. The rest of the list is Remainder or empty.
portray(+Term)
user:portray(+Term)
A hook predicate, tells print/1 what to do.
portray_clause(+Clause)
portray_clause(+Stream,+Clause)
Pretty prints Clause on the stream Stream or on the current output stream.
portray_message(+Severity,+Message)
user:portray_message(+Severity,+Message)
A hook predicate, tells print_message/2 what to do.
predicate_property(:Head,?Prop)
predicate_property(-Head,?Prop)
Head is the most general goal of a currently defined predicate that has the property Prop.
print(?Term)
print(+Stream,?Term)
Hookable, portrays or else writes the term Term on the stream Stream or on the current output stream.
print_message(+Severity,+Message)
Hookable, portrays or else writes Message of a given Severity on the standard error stream.
profile_data(:Files,?Selection,?Resolution,-Data)
Data is the profiling data collected from the instrumented predicates defined in the file(s) Files with selection and resolution Selection and Resolution respectively (not available in Runtime Systems nor in Muse).
profile_reset(:Files)
The profiling counters for the instrumented predicates in the file(s) Files are zeroed (not available in Runtime Systems nor in Muse).
prolog_flag(?FlagName,?Value)
Value is the current value of FlagName.
prolog_flag(+FlagName,?OldValue,?NewValue)
OldValue and NewValue are the old and new values of FlagName.
prolog_load_context(?Key,?Value)
Value is the value of the compilation/loading context variable identified by Key.
prompt(?Old,?New)
Changes the prompt from Old to New.
public Specs
Not a built-in predicate; public declaration.
put(+C)
put(+Stream,+C)
The next character sent to the stream Stream or to the current output stream is C.
raise_exception(+Exception)
Causes abortion of a part of the execution tree scoped by the closest enclosing on_exception/3 invocation with its first argument matching Exception.
read(?Term)
read(+Stream,?Term)
Reads the term Term from the stream Stream or from the current input stream.
read_term(?Term,+Options)
read_term(+Stream,?Term,+Options)
Reads the term Term from the stream Stream or from the current input stream with extra Options.
reconsult(:Files)
Updates the program with interpreted clauses from file(s) Files.
recorda(+Key,?Term,-Ref)
Makes the term Term the first record under key Key with unique identifier Ref.
recorded(?Key,?Term,?Ref)
The term Term is currently recorded under key Key with unique identifier Ref.
recordz(+Key,?Term,-Ref)
Makes the term Term the last record under key Key with unique identifier Ref.
reinitialise
Initializes Prolog (returns to C in recursive calls to Prolog from C).
repeat
Succeeds repeatedly.
require(:PredSpecs)
Tries to locate and load library files that export the specified predicates. Creates index files if necessary (not available in Runtime Systems).
restore(+File)
Restores the state saved in file File.
retract(:Clause)
Erases repeatedly the next interpreted clause of form Clause.
retractall(:Head)
Erases all clauses whose head matches Head.
save_program(+File)
save_program(+File, :Goal)
Saves the current state of the Prolog data base in file File. Upon restore, Goal is executed.
see(+File)
Makes file File the current input stream.
seeing(?File)
The current input stream is named File.
seek(+Stream,+Offset,+Method,-NewLocation)
Sets the stream Stream to the byte offset Offset relative to Method, and NewLocation is the new byte offset from the beginning of the file after the operation.
seen
Closes the current input stream.
sequential
sequential Specs
Not a built-in predicate; sequential declaration.
set_input(+Stream)
Sets the current input stream to Stream.
set_output(+Stream)
Sets the current output stream to Stream.
set_stream_position(+Stream,+Position)
Position is a term representing a new position of Stream, which is then set to the new position.
setof(?Template,:Goal,?Set)
Set is the set of instances of Template such that Goal is satisfied (not just provable).
simple(?X)
X is currently uninstantiated or atomic.
skip(+C)
skip(+Stream,+C)
Skips characters from Stream or from the current input stream until after character C.
skip_line
skip_line(+Stream)
Skips characters from Stream or from the current input stream until the next LFD.
sort(+List1,?List2)
The list List1 sorted into order yields List2.
source_file(?File)
source_file(:Pred,?File)
source_file(-Pred,?File)
The predicate Pred is defined in the file File.
spy :Spec
Sets spy-points on the predicate(s) specified by Spec (not available in Runtime Systems).
spypoint_condition(:Goal,?Port,+Test)
Sets conditional spy-point on the predicate for Goal (not available in Runtime Systems).
statistics
Outputs various execution statistics.
statistics(?Key,?Value)
The execution statistics key Key has value Value.
stream_code(+Stream,?StreamCode)
stream_code(?Stream,+StreamCode)
StreamCode is an integer representing a pointer to the internal representation of Stream.
stream_interrupt(?Stream,?OldHandler,?NewHandler)
Sets/reads the interrupt handler connected to the stream Stream (not available in Muse).
stream_position(+Stream,?Position)
Position is a term representing the current position of Stream.
stream_select(+Streams,+TimeOut,-ReadStreams)
Returns a list ReadStreams containing streams with pending characters. Only the streams in the list Streams are checked. TimeOut specifies a timeout on the form off or Sec:MicroSec (not available in Muse).
tab(+N)
tab(+Stream,+N)
Outputs N spaces to the stream Stream or to the current output stream.
tell(+File)
Makes file File the current output stream.
telling(?File)
The current output stream is named File.
term_expansion(+Term1,?TermOrTerms)
term_expansion(+Term1,+Layout1,?TermOrTerms,?Layout2)
user:term_expansion(+Term1,?TermOrTerms)
user:term_expansion(+Term1,+Layout1,?TermOrTerms,?Layout2)
A hook predicate, tells expand_term/2 what to do.
told
Closes the current output stream.
trace
Switches on debugging in creep mode (not available in Runtime Systems).
true
Succeeds.
ttyflush
Flushes the standard output stream buffer.
ttyget(?C)
The next printing character input from the standard input stream is C.
ttyget0(?C)
The next character input from the standard input stream is C.
ttynl
Outputs a new line on the standard output stream.
ttyput(+C)
The next character output to the standard output stream is C.
ttyskip(+C)
Skips characters from the standard input stream until after character C.
ttytab(+N)
Outputs N spaces to the standard output stream.
unknown(?OldState,?NewState)
Changes action on undefined predicates from OldState to NewState (not available in Runtime Systems).
unknown_predicate_handler(+Goal,+Module,-NewGoal)
user:unknown_predicate_handler(+Goal,+Module,-NewGoal)
A hook predicate. Defines an alternative goal to be called in place of a call to an unknown predicate.
update_mutable(+Datum,+Mutable)
Updates the current value of the mutable term Mutable to become Datum.
use_module(:Files)
Loads the module file(s) Files if necessary and import all public predicates.
use_module(:File,+Imports)
Loads the module file File if necessary and imports the predicates in Imports.
use_module(+Module,?File,+Imports)
use_module(?Module,:File,+Imports)
Equivalent to use_module/2 plus unifies Module to the module defined by the file.
user_help
user:user_help
A hook predicate, tells help/0 what to do.
var(?X)
X is currently uninstantiated.
version
Displays introductory and/or system identification messages (not available in Runtime Systems).
version(+Message)
Adds the atom Message to the list of introductory messages (not available in Runtime Systems).
volatile Specs
Not a built-in predicate; volatile declaration.
when(+Condition,:Goal)
Blocks Goal until the Condition is true.
write(+Term)
write(+Stream,+Term)
Writes the term Term on the stream Stream or on the current output stream.
write_canonical(+Term)
write_canonical(+Stream,+Term)
Writes Term on the stream Stream or on the current output stream so that it may be read back.
write_term(+Term,+Options)
write_term(+Stream,+Term,+Options)
Writes the term Term on the stream Stream or on the current output stream with extra Options.
writeq(+Term)
writeq(+Stream,+Term)
Writes the term Term on the stream Stream or on the current output stream, quoting names where necessary.
zip
Switches on debugging in zip mode (not available in Runtime Systems).


Go to the first, previous, next, last section, table of contents.