This section contains predicates for:
The following predicates turn on and off the modes that control the behavior of the Prolog runtime system. The modes are described in detail in the section on arun.
get_mode/2 retrieves the current setting of Mode, unifying Value the atoms 'on' and 'off' as appropriate.
set_mode/2 sets the named Mode to the Value, either 'on' and 'off.'
Various predicates are provided for getting information about the operation of the Prolog engine and the computer environment.
abort does the following based on the value of Severity:
current_prolog_flag returns various system limits. Currently flags are: max_atoms, max_integer, min_integer.
date returns the Month, Day and Year if unbound. If bound, then it unifies with them. For example:
?- date(12, 16, 1999). % Succeeds if today is 16 December 1999.
highwater predicate returns the highwater marks used by these four control structures. These values can then be used when initializing the Logic Server, to minimize the amount of resources taken.
pro_heap/2 returns the size, Top, and current position, Pos, of the heap.
pro_control/2 returns the size, Top, and current position, Pos, of the control stack.
pro_local/2 returns the size, Top, and current position, Pos, of the local stack.
pro_trail/2 returns the size, Top, and current position, Pos, of the trail stack.
pro_db/2 returns the amount of dynamic database storage allocated by the Prolog engine at this point in time, and the amount of that storage actually used. This predicate is for information only, as the Logic Server allocates dynamic memory blocks as it needs them.
stack_sizes returns the number of cells in use on each of the respective stacks.
system/1 executes an operating system command or program.
CmdA must be instantiated to an atom representing a command or program that can be executed by the operating system. The call to system/1 succeeds if the command "succeeded". For example:
?- system('dir c:\').
time/3 succeeds by unifying Hour, Min, and Sec to the current time-of-day (hours, minutes, and seconds respectively). If any of these are given as integers, then time/3 can be used as an alarm clock, failing until the conditions are met.
timer/1 succeeds if Ticks can be instantiated to floating point seconds since some implementation dependent time.
It is intended primarily for timing executions
?- timer(X), do_something, timer(Y), Z is Y - X, write(Z).
Note that timings can also be done using the built-in atom, cputime. The value of cputime is the current elapsed time in floating point seconds. It can be used in arithmetic expressions.
version/1 returns a string with the current Amzi! version.
These predicates, except pp and user_pp can be entered only at the ?- prompt in the listener.
Allows you to add clauses to the dynamic database. This is equivalent to consult.
Consults all the files and libraries in a project file. Note that if a project is already the current project, consult automatically does a reconsult.
Enters the Debugger. See the Debugger section for more information.
pp first tries to prove user_pp(Term). If this fails then it will pretty print Term at the user terminal (labeling variables using numbervars/3 and printing separate goals on separate lines).
Exits the current listener.
Reconsults a project file.
Allows you to replace clauses in the dynamic database. This is equivalent to reconsult.
replace expects a sequence of clauses, followed by [ctrl-z] or 'quit.' rather than a single clause.
Copyright ©1987-2000 Amzi! inc. All Rights Reserved.