7
Prolog built-in predicates
Type testing
var/1
,
nonvar/1
,
atom/1
,
integer/1
,
float/1
,
number/1
,
atomic/1
,
compound/1
,
callable/1
,
list/1
,
partial_list/1
,
list_or_partial_list/1
Term unification
(=)/2
- Prolog unification
unify_with_occurs_check/2
(\=)/2
- not Prolog unifiable
Term comparison
Standard total ordering of terms
(==)/2
- term identical,
(\==)/2
- term not identical,
(@<)/2
- term less than,
(@=<)/2
- term less than or equal to,
(@>)/2
- term greater than,
(@>=)/2
- term greater than or equal to
compare/3
Term processing
functor/3
arg/3
(=..)/2
- univ
copy_term/2
setarg/4
,
setarg/3
Variable naming/numbering
name_singleton_vars/1
name_query_vars/2
bind_variables/2
,
numbervars/3
,
numbervars/1
term_ref/2
Arithmetic
Evaluation of an arithmetic expression
(is)/2
- evaluate expression
(=:=)/2
- arithmetic equal,
(=\=)/2
- arithmetic not equal,
(<)/2
- arithmetic less than,
(=<)/2
- arithmetic less than or equal to,
(>)/2
- arithmetic greater than,
(>=)/2
- arithmetic greater than or equal to
Dynamic clause management
Introduction
asserta/1
,
assertz/1
retract/1
retractall/1
clause/2
abolish/1
Predicate information
current_predicate/1
predicate_property/2
All solutions
Introduction
findall/3
bagof/3
,
setof/3
Streams
Introduction
current_input/1
current_output/1
set_input/1
set_output/1
open/4
,
open/3
close/2
,
close/1
flush_output/1
,
flush_output/0
current_stream/1
stream_property/2
at_end_of_stream/1
,
at_end_of_stream/0
stream_position/2
set_stream_position/2
seek/4
character_count/2
line_count/2
line_position/2
stream_line_column/3
set_stream_line_column/3
add_stream_alias/2
current_alias/2
add_stream_mirror/2
remove_stream_mirror/2
current_mirror/2
set_stream_type/2
set_stream_eof_action/2
set_stream_buffering/2
Constant term streams
Introduction
open_input_atom_stream/2
,
open_input_chars_stream/2
,
open_input_codes_stream/2
close_input_atom_stream/1
,
close_input_chars_stream/1
,
close_input_codes_stream/1
open_output_atom_stream/1
,
open_output_chars_stream/1
,
open_output_codes_stream/1
close_output_atom_stream/2
,
close_output_chars_stream/2
,
close_output_codes_stream/2
Character input/output
get_char/2
,
get_char/1
,
get_code/1
,
get_code/2
get_key/2
,
get_key/1
get_key_no_echo/2
,
get_key_no_echo/1
peek_char/2
,
peek_char/1
,
peek_code/1
,
peek_code/2
unget_char/2
,
unget_char/1
,
unget_code/2
,
unget_code/1
put_char/2
,
put_char/1
,
put_code/1
,
put_code/2
,
nl/1
,
nl/0
Byte input/output
get_byte/2
,
get_byte/1
peek_byte/2
,
peek_byte/1
unget_byte/2
,
unget_byte/1
put_byte/2
,
put_byte/1
Term input/output
read_term/3
,
read_term/2
,
read/2
,
read/1
read_atom/2
,
read_atom/1
,
read_integer/2
,
read_integer/1
,
read_number/2
,
read_number/1
read_token/2
,
read_token/1
syntax_error_info/4
last_read_start_line_column/2
write_term/3
,
write_term/2
,
write/2
,
write/1
,
writeq/2
,
writeq/1
,
write_canonical/2
,
write_canonical/1
,
display/2
,
display/1
,
print/2
,
print/1
format/3
,
format/2
portray_clause/2
,
portray_clause/1
get_print_stream/1
op/3
current_op/3
char_conversion/2
current_char_conversion/2
Input/output from/to constant terms
read_term_from_atom/3
,
read_from_atom/2
,
read_token_from_atom/2
read_term_from_chars/3
,
read_from_chars/2
,
read_token_from_chars/2
read_term_from_codes/3
,
read_from_codes/2
,
read_token_from_codes/2
write_term_to_atom/3
,
write_to_atom/2
,
writeq_to_atom/2
,
write_canonical_to_atom/2
,
display_to_atom/2
,
print_to_atom/2
,
format_to_atom/3
write_term_to_chars/3
,
write_to_chars/2
,
writeq_to_chars/2
,
write_canonical_to_chars/2
,
display_to_chars/2
,
print_to_chars/2
,
format_to_chars/3
write_term_to_codes/3
,
write_to_codes/2
,
writeq_to_codes/2
,
write_canonical_to_codes/2
,
display_to_codes/2
,
print_to_codes/2
,
format_to_codes/3
DEC-10 compatibility input/output
Introduction
see/1
,
tell/1
,
append/1
seeing/1
,
telling/1
seen/0
,
told/0
get0/1
,
get/1
,
skip/1
put/1
,
tab/1
Term expansion
Definite clause grammars
expand_term/2
,
term_expansion/2
phrase/3
,
phrase/2
Logic, control and exceptions
abort/0
,
stop/0
,
top_level/0
,
break/0
,
halt/1
,
halt/0
once/1
,
(\+)/1
- not provable,
call_with_args/1-11
,
call/2
repeat/0
for/3
Atomic term processing
atom_length/2
atom_concat/3
sub_atom/5
char_code/2
lower_upper/2
atom_chars/2
,
atom_codes/2
number_atom/2
,
number_chars/2
,
number_codes/2
name/2
atom_hash/2
new_atom/3
,
new_atom/2
,
new_atom/1
current_atom/1
atom_property/2
List processing
append/3
member/2
,
memberchk/2
reverse/2
delete/3
,
select/3
permutation/2
prefix/2
,
suffix/2
sublist/2
last/2
length/2
nth/3
max_list/2
,
min_list/2
,
sum_list/2
sort/2
,
sort0/2
,
keysort/2
sort/1
,
sort0/1
,
keysort/1
Global variables
Introduction
g_assign/2
,
g_assignb/2
,
g_link/2
g_read/2
g_array_size/2
g_inc/3
,
g_inc/2
,
g_inco/2
,
g_inc/1
,
g_dec/3
,
g_dec/2
,
g_deco/2
,
g_dec/1
g_set_bit/2
,
g_reset_bit/2
,
g_test_set_bit/2
,
g_test_reset_bit/2
Examples
Prolog state
set_prolog_flag/2
current_prolog_flag/2
set_bip_name/2
current_bip_name/2
write_pl_state_file/1
,
read_pl_state_file/1
Program state
consult/1
,
'.'/2
- program consult
load/1
listing/1
,
listing/0
System statistics
statistics/0
,
statistics/2
user_time/1
,
system_time/1
,
cpu_time/1
,
real_time/1
Random number generator
set_seed/1
,
randomize/0
get_seed/1
random/1
random/3
File name processing
absolute_file_name/2
decompose_file_name/4
prolog_file_name/2
Operating system interface
argument_counter/1
argument_value/2
argument_list/1
environ/2
make_directory/1
,
delete_directory/1
,
change_directory/1
working_directory/1
directory_files/2
rename_file/2
delete_file/1
,
unlink/1
file_permission/2
,
file_exists/1
file_property/2
temporary_name/2
temporary_file/3
date_time/1
host_name/1
os_version/1
architecture/1
shell/2
,
shell/1
,
shell/0
system/2
,
system/1
spawn/3
,
spawn/2
popen/3
exec/5
,
exec/4
fork_prolog/1
create_pipe/2
wait/2
prolog_pid/1
send_signal/2
sleep/1
select/5
Sockets input/output
Introduction
socket/2
socket_close/1
socket_bind/2
socket_connect/4
socket_listen/2
socket_accept/4
,
socket_accept/3
hostname_address/2
Linedit management
get_linedit_prompt/1
set_linedit_prompt/1
add_linedit_completion/1
find_linedit_completion/2
Source reader facility
Introduction
sr_open/3
sr_change_options/2
sr_close/1
sr_read_term/4
sr_current_descriptor/1
sr_get_stream/2
sr_get_module/3
sr_get_file_name/2
sr_get_position/3
sr_get_include_list/2
sr_get_include_stream_list/2
sr_get_size_counters/3
sr_get_error_counters/3
sr_set_error_counters/3
sr_error_from_exception/2
sr_write_message/8
,
sr_write_message/6
,
sr_write_message/4
sr_write_error/6
,
sr_write_error/4
,
sr_write_error/2
Copyright (C) 1999-2002 Daniel Diaz.
Chapters 9 and 10 : Copyright (C) 2002-2003 INRIA, Rémy Haemmerlé.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
More about the copyright