Information about the State of the Program ========================================== `listing' Lists onto the current output stream all the clauses in the current interpreted program (in the type-in module, type `f' to see *note Module Spec::.). Clauses listed onto a file can be consulted back. `listing(:SPEC)' Lists all interpreted predicates covered by SPEC, which is described under `spy/1' (type `f' to see *note Spy-Point::.), but which may also contain variables. For example: | ?- listing([concatenate/3, reverse, m:go/(2-3), bar:_]). `current_atom(?ATOM)' ATOM is an atom known to SICStus Prolog. Can be used to enumerate (through backtracking) all currently known atoms, and return each one as ATOM. `current_predicate(?NAME,:HEAD) "[ISO]"' `current_predicate(?NAME,-HEAD) "[ISO]"' NAME is the name of a user defined predicate, and HEAD is the most general goal for that predicate, possibly prefixed by a module name. This predicate can be used to enumerate all user defined predicates through backtracking. `predicate_property(:HEAD,?PROPERTY)' `predicate_property(-HEAD,?PROPERTY)' HEAD is the most general goal for an existing predicate, possibly prefixed by a module name, and PROPERTY is a property of that predicate, where the possible properties are * one of the atoms `built_in' (for built-in predicates) or `compiled' or `interpreted' (for user defined predicates), * zero or more of the atoms `dynamic' and `multifile', for predicates that have been declared to have these properties (type `f' to see *note Declarations::.), * one or more terms `(block TERM)' for predicates that have block declarations (type `f' to see *note Declarations::.), * the atom `exported' or terms `imported_from(MODULEFROM)' for predicates exported or imported from modules (type `f' to see *note Module Intro::.), * the term `(meta_predicate TERM)' for predicates that have meta-predicate declarations (type `f' to see *note Meta Decl::.). * in Muse only, the atom `sync' for predicates that perform side effects that must be synchronized to preserve standard semantics. * in Muse only, the atom `parallel' for predicates that may be executed in parallel. This predicate can be used to enumerate all existing predicates and their properties through backtracking. `current_module(?MODULE)' MODULE is a module in the system. It can be used to backtrack through all modules present in the system. `current_module(?MODULE, ?FILE)' MODULE is the module defined in FILE. (This predicate is not available in Runtime Systems.) `module(+MODULE)' The type-in module is set to MODULE. (This predicate is not available in Runtime Systems.) `prolog_flag(+FLAGNAME,?OLDVALUE,?NEWVALUE)' OLDVALUE is the value of the Prolog flag FLAGNAME, and the new value of FLAGNAME is set to NEWVALUE. The possible Prolog flag names and values are: `argv' A read-only flag. The value is a list of atoms of the program arguments supplied when the current SICStus Prolog process was started. For example, if SICStus Prolog were invoked with: % sicstus -a hello world 2001 then the value will be `[hello,world,'2001']'. `compiling' Governs the mode in which `compile/1' and `fcompile/1' operate (type `f' to see *note Load Intro::.). `compactcode' Compilation produces byte-coded abstract instructions (the default). `fastcode' Compilation produces native machine instructions. Currently only available for 680x0, Sparc, and MIPS platforms. `profiledcode' Compilation produces byte-coded abstract instructions instrumented to produce execution profiling data. `debugcode' Compiling is replaced by consulting. `debugging' Corresponds to the predicates `debug/0', `nodebug/0', `trace/0', `notrace/0' (type `f' to see *note Debug Pred::.). `trace' Turns on trace mode. `debug' Turns on the debugger. `off' Turns off trace mode and the debugger (the default). (This flag is not available in Runtime Systems.) `character_escapes' `on' or `off'. If this flag is `on', a backslash occurring inside integers in `0'' notation or inside quoted atoms or strings has special meaning, and indicates the start of an escape sequence (type `f' to see *note Escape Sequences::.). This flag is relevant when reading as well as when writing terms, and is initially `on'. `fileerrors' `on' or `off'. Turns raising of exception on file errors on or off. Equivalent to `fileerrors/0' and `nofileerrors/0', respectively (type `f' to see *note Stream Pred::.). Initially `on'. `gc' `on' or `off'. Turns garbage collection on or off. Initially `on'. `gc_margin' MARGIN: Number of kilobytes. If less than MARGIN kilobytes are reclaimed in a garbage collection then the size of the garbage collected area should be increased. Also, no garbage collection is attempted unless the garbage collected area has at least MARGIN kilobytes. Initially 500. `gc_trace' Governs garbage collection trace messages. `verbose' Turn on verbose tracing of garbage collection. `terse' Turn on terse tracing of garbage collection. `off' Turn off tracing of garbage collection (the default). `redefine_warnings' `on' or `off'. Enable or disable warning messages when a predicate is being * redefined from a different file than its previous definition. * imported to the `user' module and it was previously locally defined. * redefined locally and it was previously imported. * imported to the `user' module from another module than it was previously imported from. Initially `on'. (This warning is always disabled in Runtime Systems.) `single_var_warnings' `on' or `off'. Enable or disable warning messages when a clause containing non-anonymous variables occurring once only is compiled or consulted. Initially `on'. `unknown' Corresponds to the predicate `unknown/2' (type `f' to see *note Debug Pred::.). `trace' Causes calls to undefined predicates to be reported and the debugger to be entered at the earliest opportunity. (This setting is not possible in Runtime Systems.) `fail' Causes calls to such predicates to fail. `error' Causes calls to such predicates to raise an exception (the default). Type `f' to see *Note Exception::. `syntax_errors' Controls what action is taken upon syntax errors in `read/(1-2)'. `dec10' The syntax error is reported and the read is repeated. `error' An exception is raised. Type `f' to see *Note Exception:: (the default). `fail' The syntax error is reported and the read fails. `quiet' The read quietly fails. `system_type' A read-only flag. The value is `development' in Development Systems and `runtime' in Runtime Systems. `typein_module' Permitted values are atoms. Controls the current type-in module (type `f' to see *note Module Spec::.). Corresponds to the predicate `module/1'. `user_input' Permitted values are any stream opened for reading. Controls which stream is referenced by `user_input' and `SP_stdin'. It is initially set to a stream connected to UNIX `stdin'. `user_output' Permitted values are any stream opened for writing. Controls which stream is referenced by `user_output' and `SP_stdout'. It is initially set to a stream connected to UNIX `stdout'. `user_error' Permitted values are any stream opened for writing. Controls which stream is referenced by `user_error' and `SP_stderr'. It is initially set to a stream connected to UNIX `stderr'. `version' A read-only flag. The value is an atom containing the banner text displayed on startup and reinitialization, such as `'SICStus 3 #0: Wed Mar 15 12:29:29 MET 1995''. `prolog_flag(?FLAGNAME,?VALUE)' VALUE is the current value of the Prolog flag FLAGNAME. Can be used to enumerate all Prolog flags and their values by backtracking. `prolog_load_context(?KEY,?VALUE)' This predicate gives access to context variables during compilation and loading of Prolog files. It unifies VALUE with the value of the variable identified by KEY. Possible keys are: `file' The absolute path name of the file being compiled. During loading of a ql-file, the corresponding source file name is returned. `directory' The absolute path name of the directory of the file being compiled/loaded. `module' The source module (type `f' to see *note Meta Exp::.). This is useful for example if you are defining clauses for `user:term_expansion/2' and need to access the source module at compile time. `stream' The stream being compiled or loaded from. `term_position' A term representing the position of the last clause read (type `f' to see *note Stream Pred::.). `statistics' Displays on the terminal statistics relating to memory usage, run time, garbage collection of the global stack and stack shifts. `statistics(?KEY,?VALUE)' This allows a program to gather various execution statistics. For each of the possible keys KEY, VALUE is unified with a list of values, as follows: `global_stack' `[SIZE USED,FREE]' This refers to the global stack, where compound terms are stored. The values are gathered before the list holding the answers is allocated. `local_stack' `[SIZE USED,FREE]' This refers to the local stack, where recursive predicate environments are stored. `trail' `[SIZE USED,FREE]' This refers to the trail stack, where conditional variable bindings are recorded. `choice' `[SIZE USED,FREE]' This refers to the choicepoint stack, where partial states are stored for backtracking purposes. `core' `memory' `[SIZE USED,0]' These refer to the amount of memory actually allocated by the UNIX process. `heap' `program' `[SIZE USED,0]' These refer to the amount of memory allocated for compiled and interpreted clauses, symbol tables, and the like. `runtime' `[SINCE START OF PROLOG,SINCE PREVIOUS STATISTICS]' These refer to CPU time used while executing, excluding time spend garbage collecting, stack shifting, or in system calls. In Muse, these numbers refer to the worker that happens to be executing the call to `statistics/2', and so normally are not meaningful. `walltime' `[SINCE START OF PROLOG,SINCE PREVIOUS STATISTICS]' These refer to absolute time elapsed. `garbage_collection' `[NO. OF GCS,BYTES FREED,TIME SPENT]' `stack_shifts' `[NO. OF LOCAL SHIFTS,NO. OF TRAIL SHIFTS,TIME SPENT]' Times are in milliseconds, sizes of areas in bytes.