Reference Manual

Core Prolog

Control

!/0 (cut) removes choicepoints
$exported_proc/3 checks whether the given procedure is exported
$findterm/5 locates the given term on the heap
$nextproc/3 retrieves the next procedure in the name table
$procinfo/5 retrieves information about the given procedure
$resolve_module/4 finds the module which exports the given procedure
,/2 conjunction of two goals
->/2 if-then, and if-then-else
:/2 calls a goal in the specified module
;/2 disjunction of two goals
</2 The left expression is less than the right expression
=:=/2 The left and right expressions are equal
=</2 The left expression is less than or equal to the right
=\=/2 The left and right expressions are not equal
>/2 The left expression is greater than the right expression
>=/2 The left expression is greater than or equal to the right
\+/1 tests whether a goal fails
abolish/[1,2,3] remove a procedure from the database; remove a procedure from the database; remove a procedure from the database
abort/0 return execution immediately to the Prolog shell
all_ntbl_entries/4 retrieves all name table entries
all_procedures/4 retrieves all Prolog- or C-defined procedures
als_system/1 Provides system environmental information.
b_findall/4 bound list of solutions for a goal, not sorted
bagof/3 all solutions for a goal, not sorted
call/1 calls a goal
callWithDelayedInterrupt/[1,2] call goal, setting delayed interrupt
canon_path/2 canonicalizes a path name
catch/3 execute a goal, specifying an exception handler
change_cwd/1 change the current working directory
command_line/1 provides access to the prolog system start-up command line
compiletime/0 Runs goals only at compile time
curmod/1 get the current module
current_op/3 retrieve current operator definitions
current_prolog_flag/2 retrieve value(s) of prolog flag(s)
exists_file/1 tests whether a file exists
fail/0 always fails
filename_equal/2 OS portable check for equality of file names
findall/3 all solutions for a goal, not sorted
forcePrologInterrupt/0 force interrupt on next call
free_gv/1 release store associated with a named global variable
gc/0 invokes the garbage compactor
getDirEntries/3 returns the file in a directory which matches a pattern
getPrologInterrupt/1 determine the type of a Prolog interrupt
get_cwd/1 returns the current working directory
getenv/2 gets the value of the given os environment variable
halt/0 exit ALS Prolog
is/2 evaluates an arithmetic expression
leash/1 set which ports are leashed for the debugger
make_det_gv/1 create named global variable and access methods which preserve instantiations of structures
make_gv/1 create named global variable and access methods
modules/2 get the use list of a module
must_exist_file/1 raises a system_error if exists_file fails
nospy/[0,1] removes all spy points; removes a spy point
not/1 tests whether a goal fails
notrace/0 turn off tracing
op/3 define operator associativity and precedence
procedures/4 retrieves all Prolog-defined procedures
remove_file/1 removes a file from the current working directory
repeat/0 always succeed upon backtracking
rexec/2 Execute an operating system command remotely, or possibly locally.
save_image/2 package an application
setPrologInterrupt/1 establish the type of a Prolog interrupt
set_prolog_flag/2 set value of a Prolog flag
setof/3 all unique solutions for a goal, sorted
spy/[0,1] enable spy points; sets a spy point
statistics/0 display memory allocation information
statistics/2 display runtime statistics
sys_env/3 Provides brief system environmental information.
system/1 Executes the specified OS shell command
throw/1 give control to an exception handler
trace/[0,1] turn on tracing; trace the execution of a goal
true/0 always succeeds

Input Output

$access/2 determine accessibility of a file
at_end_of_stream/[0,1] test for end of the curent input stream; test for end of a specific input stream
bufread/[2,3] runs the Prolog parser on a string of text; similar to bufread/2, allowing read options
bufwrite/2 formatted write to strings
bufwriteq/2 formatted write to strings with quoting
chdir/1 changes the current directory to the specified directory
close/[1,2] close an open stream; close an open stream with options
consult/[1,2] load a Prolog file; load a Prolog file, with options
consultq/1 load a Prolog file, without messages
curl/[1,2,3] Access to the internet via the curl package with URL, Options, Target in one list; Access to the internet via the curl package with separate URL arg, combined Options, Target in one list; Access to the internet via the curl package with separate URL, Options, Target args
current_input/1 retrieve current input stream
current_output/1 retrieve current output stream
date/1 gets the local date
date_less/2 compares two dates
date_pattern/4 describes the pattern term for date display
datetime/2 gets the local system date and time
datetime_less/2 compares two datetimes
display/1 write term to current output stream in canonical form
flush_input/1 discard buffer contents of stream
flush_output/[0,1] flush current output stream; flush specific output stream
get/1 read the next printable character
get0/1 read the next character
get_char/[1,2] read a character from current input stream; read character from a specific stream
get_code/[1,2] read a character code from current input stream; read character code from a specific stream
gm_datetime/2 gets the Greenwich mean time(UTC)
http/3 REST-inspired user-level interface for curl
nl/[0,1] output a newline to the current output stream; output a newline to a specified output stream
old_bufread/2 similar to bufread/2, giving additional information on variables
open/[3,4] open a stream; open a stream with options
peek_char/[1,2] obtain char from stream
peek_code/[1,2] obtain char code from stream; obtain char from stream
poll/2 Determine whether I/O is possible
printf/[1,2,3,4] print out a string to the current output; print out a string with arguments; print out a string with a format and arguments; print out string with format, arguments, options
printf_opt/3 print out string with format, arguments, options
put/1 write out a character
put_atom/[1,2] output an atom to the current output stream; output an atom to a specific output stream
put_char/[1,2] output a character to the current output stream; output a character to a specific output stream
put_code/[1,2] output a character code to the current output stream; output a character code to a specific output stream
put_string/[1,2] output a string to the current output stream; output a string to a specific output stream
read/[1,2] read a term from the current input stream; read a term from specified stream
read_term/[2,3] read term from current input with options; read term from specified stream with options
reconsult/1 load a Prolog file, updating the prolog database
see/1 sets the current input stream
seeing/1 returns the name of the current input stream
seen/0 closes the current input stream
set_date_pattern/1 changes the pattern term for date display
set_depth_computation/2 set method of computing term depth
set_input/1 set current input stream
set_line_length/2 set length of line for output stream
set_max_depth/2 set maximum depth that terms will be written to
set_output/1 set current output stream
set_stream_position/2 seek to a new position in a stream
skip/1 discard all input characters until specified character
sprintf/3 formatted write to atoms and strings
stream_position/[2,3] reposition a stream
stream_property/2 retrieve streams and their properties
tab/1 prints out a specified number of spaces
tell/1 sets the standard output stream
telling/1 returns the name of the standard output stream
time/1 gets the local system time
time_less/2 compares two times
told/0 closes the standard output stream
ttyflush/0 forces all buffered output to the screen
valid_date/[1,3] determines if a date pattern represents a valid date
write/[1,2] write term to current output stream; write term to specified stream
write_canonical/[1,2] write term to current output stream in canonical form(no operators); write term to specified stream in canonical form
write_term/[2,3] write term to current output stream with options; write term to specified output stream with options
writeq/[1,2] write term to current output stream so that it may be read back in; write term to specified stream so that it may be read back in

Prolog Database

assert/[1,2] adds a clause to a procedure; adds a clause to a procedure, returning a DB Ref
asserta/[1,2] adds a clause to the beginning of a procedure; adds a clause to the beginning of a procedure, returning a DB Ref
assertz/[1,2] adds a clause to the end of a procedure; adds a clause to the end of a procedure, returning a DB Ref
clause/[2,3] retrieve a clause; retrieve a clause with a database reference
dynamic/1 declare a procedure to be dynamic
erase/1 removes a clause from the database
instance/2 retrieve a clause from the database reference
listing/[0,1] Prints all clauses; Prints clauses matching the specified template
module_closure/[2,3] creates a module closure; creates a module closure for the specified procedure
retract/[1,2] removes a clause from the database; removes a clause specified by a database reference

Terms

=../2 composes/decomposes structures from/to components
=/2 unify two terms
==/2 terms are identical
@</2 The left argument is before the right argument
@=</2 The left argument is not after the right argument
@>/2 The left argument is after the right argument
@>=/2 The left argument is not before the right argument
\=/2 test if two items are non-unifiable
\==/2 terms are not identical
append/3 append two lists
arg/3 access the arguments of a structured term
atom/1 the term is an atom
atom_chars/2 convert between atoms and the list of characters representing the atom
atom_codes/2 convert between atoms and the list of character codes representing the atom
atomic/1 the term is an atom or a number
char_code/2 convert between characters and codes
compare/3 compares two terms in the standard order
copy_term/2 make copy of a term
dappend/3 append two lists
dmember/2 list membership
dreverse/2 determinate list reversal
float/1 the term is a floating point number
functor/3 builds structures and retrieves information about them
gensym/2 generates families of unique symbols
integer/1 the term is an integer
keysort/2 sorts a list of Key-Data pairs
length/2 count the number of elements in a list
make_hash_table/1 create a hash table and access predicates
mangle/3 destructively modify a structure
member/2 list membership
name/2 converts strings to atoms and atoms to strings
nonvar/1 the variable is instantiated
nth/3 returns the nth element of a list
number/1 the term is an integer or a floating point
number_chars/2 convert between a number and the list of characters which represent the number
number_codes/2 convert between a number and the list of character codes which represent the number
recorda/3 records item in internal term database
recorded/3 retrieves item from internal term database
recordz/3 records item in internal term database
reverse/2 list reversal
sort/2 sorts a list of terms
sub_atom/5 dissect an atom
term_chars/2 convert between a term and the list of characters which represent the term
term_codes/2 convert between a term and the list of character codes which represent the term
var/1 the variable is unbound

UIAs

$uia_alloc/2 allocates a UIA of specified length
$uia_clip/2 clip the given UIA
$uia_peek/4 returns the specified region of a UIA
$uia_peekb/3 returns the specified byte of a UIA
$uia_peekd/3 returns the specified double of a UIA
$uia_peekl/3 returns the specified long word of a UIA
$uia_peeks/3 returns the specified substring of a UIA
$uia_peeks/4 returns the specified substring of a UIA
$uia_peekw/3 returns the specified word of a UIA
$uia_poke/4 modifies the specified region of a UIA
$uia_pokeb/3 modifies the specified byte of a UIA
$uia_poked/3 modifies the specified double of a UIA
$uia_pokel/3 modifies the specified long word of a UIA
$uia_pokes/3 modifies the specified substring of a UIA
$uia_pokew/3 modifies the specified word of a UIA
$uia_size/2 obtains the actual size of a UIA

ALS Library

Arithmetic

max/3 Returns the maximum of results of evaluating two arithmetic Exprs
max_vector/3 Returns the result of iteratively taking the max of Left,Right
maximum/2 Returns the maximum of the evaluations of the expressions on ExprList
min/3 Returns the minimum of results of evaluating two arithmetic Exprs
min_vector/3 Returns the result of iteratively taking the min of Left,Right
minimum/2 Returns the minimum of the evaluations of the expressions on ExprList
prodlist/2 Returns the product of the evaluations of the numbers on ExprList
sum_square_diffs/3 Returns the sum of squares of differences of XList,YList
sum_squares/2 Returns the sum of the squares of the evaluations of the numbers on ExprList
sumlist/2 Returns the sum of the evaluations of the numbers on ExprList

Atoms

cat_together_seplines/2 convert list of atoms to single atom with eoln separating atom entries
cat_together_spaced/2 convert list of atoms to single atom with space separating atom entries
catenate/[2,3] catenates a list of atoms; catenates two atoms, or an atom and number, to produce a third atom
prefix_dir/3 prefix Dir to each (atomic) item on List
prefix_to/3 catenate Atom to the front of each element on a List of atoms
strip_prefix/3 strip a fixed-length prefix from a list of atoms
trim_atoms/3 truncates a list of atoms

Formatting

columns/[1,2,3] Output ListOfRows as a minimal columnar array of terms; Like columns/1, outputting to a given stream; Output ListOfRows as a columnized rectangular array of terms

Lists

append/2 appends a list of lists together
at_most_n/3 returns initial segment of list of length =< N
change_nth/3 destructively changes the Nth element of a list
check_default/4 looks up an equation on a list, with a default
check_default_del/5 looks up a tagged equation on a List, and deletes it
deleteNth/3 deletes the Nth element of a list
delete_1st/3 deletes the left-most entry of Item in List
encode_list/3 encodes the elements of a list with provided codes
flatten/2 flattens a nested list
get_list_tail/3 returns the tail of a list determined by an element
init_seg_list/2 determines if one list is an initial segment of another
insert_item_in_list/3 interleaves an arbitrary term between elements of a list
insert_spaces/2 interleaves a quoted blank between elements of a list
int_diff/4 returns the intersection and one difference of two lists
intersect/[2,3] returns the intersection of a list of lists; returns the intersection of two lists
is_length/2 invertible length predicate
last/2 returns last element of a list
list_diff/3 returns the ordered difference of two lists
list_diffs/4 returns both ordered differences of two lists
mangle_change_tagged/3 destructively changes the value of a tagged eqn
merge_in_list/3 merges two list together
merge_plists/3 recursively merges two tagged equation lists
merge_tagged_lists/3 recursively merges two tagged equation lists
n_of/3 creates a list of N copies of an item
nobind_member/2 tests list membership without binding any variables
nonmember/2 tests for the failure of membership
nth_tail/4 returns the nth head and tail of a list
number_list/[2,3] creates a numbered list from a source list; numbers the elements of a list
remove_tagged/3 removes tagged equations from a list
sorted_merge/[2,3] returns the sorted union of a list of lists; returns the sorted union of two lists
split_ll_at_start/5 splits a list of atoms according to an initial sub-atom
split_ll_by_blank/3 splits a list of atoms by the first null atom
struct_lookup_subst/4 performs substs for structs package constructors
sublist/4 extracts a sublist from a list
subset/2 determines if one list is a subset of another
subst_nth/4 non-destructively changes the Nth element of a list
subst_tagged/4 NON-destructively changes the value of a tagged eqn
symmetric_diff/3 returns the symmetric difference of two lists
union/3 returns the ordered union of two lists

Strings

asplit/4 divides an atom as determined by a character
asplit00/4 divides a list of character codes as det. by a list of char codes
atomic_to_uia/2 create a UIA corresponding to an atomic item
change_case_sym/2 converts the case of characters in a symbol, based on the first
char_in/3 Locates the position of a character in an atom.
cnvrt_to_UIA/2 create a UIA corresponding to an arbitrary term
convert_to_uc/2 converts all items in a list of terms to uppercase
head/4 splits an list into segments determined by a character code
head0/4 splits a character code list into segments determined by a code
make_lc/2 converts a Prolog string to all lowercase character (codes)
make_lc_sym/2 converts an atom or UIA to all lowercase characters
make_uc/2 converts a Prolog string to all uppercase character (codes)
make_uc_sym/2 converts an atom or UIA to all uppercase characters
read_to/5 splits a string according to one of several possible chars
read_to_blank/3 splits a string around the leftmost occurrence of blank
replace_char_atom/4 Replace occurrences of a char in an atom by another char
replace_char_string/4 Replace occurrences of a char in a string by another char
same_uc/2 Term1,Term2 unify after converting all characters to upper case
string_to_sized_uia/3 creates a UIA containing chars corresponding to a string
string_to_uia/[2,3] creates a UIA corresponding to an arbitrary string; insert list of char (codes) into a UIA
strip_both_white/2 strips leading and trailing white space chars from a string
strip_both_white_atom/2 strips leading and trailing white space chars from a prolog atom
strip_tail_white/2 strips trailing white space from a string
strip_white/2 strips leading white space from a string
truncate/3 creates a UIA truncating the input expression

Web

grab_html_tokens/2 extracts all Tokens from the File
grab_pxml/2 reads the pxml term found in file Path
grab_pxml_with_paths/5 read PXML term in FilePath, tagged component tags and paths
grab_pxml_with_tagged/3 read PXML term in FilePath, including tagged components
parse_html_toks_to_pxml/5 parse a list of HTML-tokens
parse_html_toks_to_pxml_vals/3 parse a list of HTML-tokens
read_pxml_comment/3 read an HTML comment into PXML
read_pxml_term/7 - read a PXML term out of Tokens
read_tokens/2 extracts all Tokens from a stream
tokenize_file/2 extracts all Tokens from the File
unary_tag/1 specifies syntactic roles tags

C Interface

C Data

$c_examine/2 Examines the contents of a C data area or a UIA
$c_free/1 Frees a C data area
$c_malloc/2 Allocates a C data area using the system malloc call
$c_set/2 Modifies the contents of a C data area or a UIA
c_alloc/2 allocate a UIA that can hold C data
c_alloc_abs/2 allocate a C-malloced data area
c_allocn/3 allocate a UIA to hold Num items
c_allocn_abs/3 allocated a C-malloced area to hold Num items
c_call/3 calls a C function
c_const/2 get the value of a C defined constant
c_create/3 equivalent to c_alloc/2 plus c_set/3
c_create_abs/3 equivalent to c_alloc_abs/2 plus c_set/3
c_create_arglist/[2,3] create an initialized ARGLIST structure for X Toolkit
c_createn/4 allocate and initialize an array of data values in a UIA
c_createn_abs/4 allocate and initialize an array of data values in a C area
c_examine/3 examine a UIA or C data area
c_examine/3 multiply examine a UIA or C data area
c_examine_raw/4 extract raw chars from a UIA or C data area
c_examine_str/4 extract chars from a UIA or C data area
c_examinen/4 examine a component of an array
c_examinen/4 multiply examine a component of an array
c_free/1 applied to UIA does nothing (freeing handled by gc)
c_free_abs/1 mfree the C area pointed by Ptr.
c_free_arglist/1 perform c_free_abs on each item of PtrList
c_rconst/2 get the value of a C defined runtime constant
c_set/3 modify a UIA or C data area
c_set/3 multiply modify a UIA or C data area
c_set_raw/4 writes chars from a UIA into a UIA or C data area
c_set_str/4 insert C string in a UIA or C data area
c_setn/4 perform c_set/3 on a component of an array
c_setn/4 multiply perform c_set/3 on a component of an array

ALSDev

Development Env.

Edit Menu Select actions while editing a file
File Menu Select a file for editing
Find Dialog Search and replace in edit windows
Listener Window Primary interaction window
Preferences Dialog Set various IDE preferences
Prolog Menu Manage prolog projects and settings
Prolog Projects Menu Manage prolog projects and settings
Tools Menu Invoke various useful tools

Gui Library

add_to_main_menu_entry/2 add an item to a menu entry
atomic_input_dialog/[2,3,4] input atoms and numbers
create_image/[2,3] create an image from a GIF file
display_image/[1,3] display an image
extend_cascade/3 extend a menu cascade
extend_main_menubar/2 add entries to the main menubar
file_select_dialog/ [1,2,3] select a file
info_dialog/ [1,2,3] present an information dialog
init_tk_alslib/[0,1,2] initialize GUI library, creating Tcl interpreter
menu_entries_list/[2,3] obtain menu entries
path_to_menu_entry/[2,3,4] obtain path to a menu entry
popup_select_items/ [2,3,4] present popup selection list
yes_no_dialog/[2,3,4,6] present a yes/no dialog

Prolog Objects

accessObjStruct/3 access the value of a slot in an object
create_object/2 create an object
defStruct/2 specify an abstract data type
defineClass/1 specify an ObjectPro class
send/2 send a message to an object
setObjStruct/3 set the value of a slot in an object

TclTk Interface

prolog call a prolog term from Tcl
tcl_call/3 execute Tcl script
tcl_coerce_atom/3 convert Tcl entity to Prolog atom
tcl_coerce_list/3 convert Tcl entity to Prolog list
tcl_coerce_number/3 convert Tcl entity to Prolog number
tcl_delete/1 delete a Tcl interpreter
tcl_delete_all/0 delete all Tcl interpreters
tcl_eval/3 evaluate Tcl script
tcl_new/1 create a Tcl interpreter
tk_new/1 create a Tcl interpreter initialized for Tk