/
SWI Prolog - Supported Predicates

SWI Prolog - Supported Predicates

// This list follows the structure of built-in predicates as specified at:
// http://eu.swi-prolog.org/pldoc/man?section=builtin
// http://eu.swi-prolog.org/pldoc/man?section=libpl
// All predicates listed below are supported in GOAL; those not listed are not.

// basic operators
true/0
false/0
!/0
fail/0
not/1

// operators used within context of operators that quantify over variables
max/1
min/1
count/1
sum/1
set/1
bag/1

// SWI 4.3 - we do not need Prolog file loading predicates
// SWI 4.4 - we do not need editor interface predicates
// SWI 4.5 - we do not support program listings

// SWI 4.6: Verify Type of a Term
var/1
nonvar/1
integer/1
float/1
rational/1
rational/3
number/1
atom/1
blob/2
string/1
atomic/1
compound/1
callable/1
ground/1
cyclic_term/1
acyclic_term/1

// SWI 4.7: Comparison and Unification of Terms
compare/3
unify_with_occurs_check/2
subsumes_term/2
term_subsumer/3
unifiable/2

// SWI 4.8: Control Predicates
// already defined at the top

// SWI 4.9: Meta-Call Predicates
// call has variable num of args but up to 8 seems supported
call/1
call/2
call/3
call/4
call/5
call/6
call/7
call/8
apply/2
// not/1 is already defined
once/1
ignore/1
call_with_depth_limit/3
call_with_inference_limit/3
setup_call_cleanup/3
setup_call_catcher_cleanup/4
call_cleanup/2
call_cleanup/3

// SWI 4.10 - we do not support coroutines
// SWI 4.11 - we do not support exception handling
// SWI 4.11.4: Printing messages
print_message/2
print_message_lines/3
message_to_string/2
// message hooks use modules so are not supported
// version info is not needed either

// SWI 4.12: we do not support handling signals
// SWI 4.13: DCG Grammar rules
phrase/2
phrase/3
call_dcg/3

// SWI 4.14 - database is purposely restricted (handled by GOAL)
// SWI 4.15 - idem for predicate properties
// (dynamic/1 is the only directive that is supported; handled in SemanticTools)
// SWI 4.16 - program examination does not seem useful

// SWI 4.17: Input and output
open/4
open/3
open_null_stream/1
close/1
close/2
stream_property/2
current_stream/3
is_stream/1
stream_pair/3
set_stream_position/2
stream_position_data/3
seek/4
set_stream/2
set_prolog_IO/3
see/1
tell/1
append/1
seeing/1
telling/1
seen/0
told/0
set_input/1
set_output/1
current_input/1
current_output/1
with_output_to/2
// did not include fast binary I/O

// SWI 4.18: Status of streams
wait_for_input/3
byte_count/2
character_count/2
line_count/2
line_position/2

// SWI 4.19: Primitive character I/O
nl/0
nl/1
put_byte/1
put_byte/2
put_char/1
put_char/2
put_code/1
put_code/2
tab/1
tab/2
flush_output/0
flush_output/1
// ttyflush not supported
get_byte/1
get_byte/2
get_code/1
get_code/2
get_char/1
get_char/2
peek_byte/1
peek_byte/2
peek_code/1
peek_code/2
peek_char/1
peek_char/2
peek_string/3
skip/1
skip/2
get_single_char/1
at_end_of_stream/0
at_end_of_stream/1
set_end_of_stream/1
copy_stream_data/3
copy_stream_data/2
fill_buffer/1
read_pending_codes/3
read_pending_chars/3

// SWI 4.20: Term reading and writing
write_term/2
write_term/3
write_length/3
write_canonical/1
write_canonical/2
write/1
write/2
writeq/1
writeq/2
writeln/1
writeln/2
print/1
print/2
portray/1
read/1
read/2
read_clause/2
read_term/2
read_term/3
read_term_from_atom/3
// read_history and prompts not included (no user input possible)

// SWI 4.21: Analysing and Constructing Terms
functor/3
arg/3
compound_name_arity/3
compound_name_arguments/3
numbervars/3
numbervars/4
var_number/2
term_variables/2
nonground/2
term_variables/3
term_singletons/2
copy_term/2
// non-logical operators not supported

// SWI 4.22: Analysing and Constructing Terms
atom_codes/2
atom_chars/2
char_code/2
number_chars/2
number_codes/2
atom_number/2
name/2
term_to_atom/2
atom_concat/3
atomic_concat/3
atomic_list_concat/2
atomic_list_concat/3
atomic_concat/3
atom_length/2
sub_atom/5
sub_atom_icasechk/3

// SWI 4.23 - localization support not included

// SWI 4.24: character properties
char_type/2
code_type/2
downcase_atom/2
upcase_atom/2
// language-specific predicates not supported

// SWI 4.25 - operators are defined at the top
// SWI 4.26 - character conversion is not supported

// SWI 4.27: Arithmetic
between/3
succ/2
plus/3
divmod/3
nth_integer_root_and_remainder/4
abs/1
sign/1
copysign/2
max/2
min/2
random/1
random_float/0
round/1
integer/1
float/1
rational/1
rationalize/1
float_fractional_part/1
float_integer_part/1
truncate/1
floor/1
ceiling/1
ceil/1
sqrt/1
sin/1
cos/1
tan/1
asin/1
acos/1
atan/1
atan/2
atan2/2
sinh/1
cosh/1
tanh/1
asinh/1
acosh/1
atanh/1
log/1
log10/1
exp/1
powm/3
lgamma/1
erf/1
erfc/1
pi/0
e/0
epsilon/0
inf/0
nan/0
cputime/0
eval/1
msb/1
lsb/1
popcount/1
getbit/2

// SWI 4.28: Misc arithmetic support predicates
set_random/1
random_property/1
current_arithmetic_function/1

// SWI 4.29: Built-in list operations
is_list/1
memberchk/2
length/2
sort/2
sort/4
msort/2
keysort/2
predsort/3

// SWI 4.30 & 4.31: Finding all Solutions to a Goal
findall/3
findall/4
findnsols/4
findnsols/5
bagof/3
setof/3
forall/2

// SWI 4.32: Formatted write
format/1
format/2
format/3
format_predicate/2
current_format_predicate/2

// SWI 4.33 - we do not support global variables
// SWI 4.34 - terminal control is not needed

// SWI 4.35.2: Dealing with time and date (other OS predicates not supported)
get_time/1
stamp_date_time/3
date_time_stamp/2
date_time_value/3
format_time/3
format_time/4
parse_time/2
parse_time/3
day_of_the_week/2

// SWI 4.36: File System Interaction
access_file/2
exists_file/1
file_directory_name/2
file_base_name/2
same_file/2
exists_directory/1
delete_file/1
rename_file/2
size_file/2
time_file/2
absolute_file_name/2
absolute_file_name/3
is_absolute_file_name/1
file_name_extension/3
directory_files/2
expand_file_name/2
prolog_to_os_filename/2
read_link/3
tmp_file_stream/3
make_directory/1
delete_directory/1
working_directory/2
chdir/1

// SWI 4.37 - top-level manipulation not supported
// SWI 4.38 - user interaction protocol not supported
// SWI 4.39 - debugging predicates are not supported
// SWI 4.40 - runtime statistics not supported (at prolog level)
// SWI 4.41 - profiling not supported (at prolog level)
// SWI 4.42 - manual memory management not supported
// SWI 4.43 - Windows DDE interface not supported

// SWI 4.44: Miscellaneous
dwim_match/2
dwim_match/3
wildcard_match/2
// sleep not supported at prolog level

// SWI 5.2.1: Predicates that operate on strings
atom_string/2
number_string/2
term_string/2
term_string/3
string_chars/2
string_codes/2
text_to_string/2
string_length/2
string_code/3
get_string_code/3
string_concat/3
split_string/4
sub_string/5
atomics_to_string/2
atomics_to_string/3
string_upper/2
string_lower/2
read_string/3
read_string/5
open_string/2

// SWI A.1: Aggregation operators
aggregate/3
aggregate/4
aggregate_all/3
aggregate_all/4
foreach/2
free_variables/4

// SWI A.2: Apply predicates on a list
include/3
exclude/3
partition/4
partition/5
maplist/2
maplist/3
maplist/4
maplist/5
convlist/3
foldl/4
foldl/5
foldl/6
foldl/7
scanl/4
scanl/5
scanl/6
scanl/7

// SWI A.3 - Association lists not supported at the moment
// SWI A.4 - Event notifications not supported
// SWI A.5 - Not supported as better native predicates are available
// SWI A.6 - Consistency checking not supported
// SWI A.7/A.8/A.9 - Constraint programming not supported
// SWI A.10 - CSV processing not supported at the moment
// SWI A.11 - Not supported as it is a replacement for the native format/3
// SWI A.12 - "" "" for print_message/2
// SWI A.13 - Generating unique identifiers is not supported
// SWI A.14 - External streams not supported at the moment

// SWI A.15: List Manipulation
member/2
append/3
append/2
prefix/2
select/3
selectchk/3
select/4
selectchk/4
nextto/3
delete/3
nth0/3
nth1/3
nth0/4
nth1/4
last/2
proper_length/2
same_length/2
reverse/2
permutation/2
flatten/2
max_member/2
min_member/2
sum_list/2
max_list/2
min_list/2
numlist/3
is_set/1
list_to_set/2
intersection/3
union/3
subset/2
subtract/3

// SWI A.16 - Script entry points not supported
// SWI A.17 - Non-backtrackable sets not supported
// SWI A.18 - Web-browser interaction not supported
// SWI A.19 - Option lists not supported
// SWI A.20 - Command line parsing not supported

// SWI A.21: Ordered sets
is_ordset/1
ord_empty/1
ord_seteq/2
list_to_ord_set/2
ord_intersect/2
ord_disjoint/2
ord_intersection/2
ord_intersection/3
ord_intersection/4
ord_add_element/3
ord_del_element/3
ord_selectchk/2
ord_memberchk/2
ord_subset/2
ord_subtract/3
ord_union/2
ord_union/3
ord_union/4
ord_symdiff/3

// SWI A.22: Key-value lists
pairs_keys_values/3
pairs_values/2
pairs_keys/2
group_pairs_by_key/2
transpose_pairs/2
map_list_to_pairs/3

// SWI A.23 - Persistency not supported
// SWI A.24 - 'Pure I/O' not supported
// SWI A.25 - Predicate options not supported
// SWI A.26 - Package management not supported
// SWI A.27 - Cross-reference data collection not supported
// SWI A.28 - Quasi quotation not supported

// SWI A.29: Random numbers
random/1
random_between/3
random/3
setrand/1
getrand/1
maybe/0
maybe/1
maybe/2
random_perm2/4
random_member/2
random_select/3
randset/3
randseq/3
random_permutation/2

// SWI A.30 - Readutil not supported at the moment
// SWI A.31 - Named fields not supported
// SWI A.32 - Windows registry manipulation not supported
// SWI A.33 - Linear programming not supported
// SWI A.34 - Modifying solution sequences not supported
// SWI A.35 - Tabled execution not supported
// SWI A.36 - Thread management not supported
// SWI A.37 - Unweighted graphs not supported
// SWI A.38 - URLs not supported
// SWI A.39 - Numbered terms not supported
// SWI A.40 - Lambda expressions not supported

Related content

Tutorials, Documentation and Education
Tutorials, Documentation and Education
More like this
GOAL-Eclipse Quick Start Guide
GOAL-Eclipse Quick Start Guide
Read with this
Embedding KR Languages
Embedding KR Languages
More like this
using OWL
using OWL
Read with this
Planners
Planners
More like this
Projects
Projects
Read with this