1% BEGIN LICENSE BLOCK
2% Version: CMPL 1.1
3%
4% The contents of this file are subject to the Cisco-style Mozilla Public
5% License Version 1.1 (the "License"); you may not use this file except
6% in compliance with the License.  You may obtain a copy of the License
7% at www.eclipse-clp.org/license.
8% 
9% Software distributed under the License is distributed on an "AS IS"
10% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11% the License for the specific language governing rights and limitations
12% under the License. 
13% 
14% The Original Code is  The ECLiPSe Constraint Logic Programming System. 
15% The Initial Developer of the Original Code is  Cisco Systems, Inc. 
16% Portions created by the Initial Developer are
17% Copyright (C) 2006 Cisco Systems, Inc.  All Rights Reserved.
18% 
19% Contributor(s): 
20% 
21% END LICENSE BLOCK
22
23:- comment(alias, "Development Environment and Global Settings").
24:- comment(summary, "Built-ins related to the development environment").
25:- comment(categories, ["Built-In Predicates","Development Tools"]).
26
27:- tool(env / 0).
28:- tool(get_flag / 2).
29:- tool(set_flag / 2).
30:- tool(pred / 1).
31
32:- comment(statistics / 2, [
33	summary:"Succeeds if the statistics item Keyword has value Value.
34
35",
36	amode:(statistics(-,-) is multi),
37	amode:(statistics(+,-) is det),
38	desc:html("   Used to retrieve various statistical information about the running
39   ECLiPSe .  To print a list of all the current values, statistics/0 can
40   be used.
41
42<P>
43   The following list details the statistic items:
44
45<DL>
46<DT><STRONG>control_stack_allocated</STRONG><DD>
47
48<P>
49    Unit :  bytes
50
51<P>
52    Description : The amount of control stack currently allocated. The
53        control stack is allocated in chunks, up to a maximum controlled by
54        the -l command line option. The local and control stacks share the
55        same memory area specified by the -l option, which thus gives the
56        maximum combined allocated size of these two stacks.
57
58<DT><STRONG>control_stack_peak</STRONG><DD>
59
60<P>
61    Unit : bytes
62
63<P>
64    Description :   The peak allocated size of the control stack during
65        this session. Chunks of memory can be allocated to, and
66        deallocated from, the control stack as it grows and shrinks.
67
68<DT><STRONG>control_stack_used</STRONG><DD>
69
70<P>
71    Unit :   bytes
72
73<P>
74    Description :   The amount of control stack currently in use.  This
75        stack holds information needed for backtracking.  
76
77<DT><STRONG>dictionary_entries</STRONG><DD>
78
79<P>
80    Unit :   count
81
82<P>
83    Description :   The number of atoms and functors that are currently
84        known to the system.  This is equal to the number of solutions
85        that current_functor/1 would return.
86
87<DT><STRONG>dict_hash_usage</STRONG><DD>
88
89<P>
90    Type :  pair of integers Used/Avail
91
92<P>
93    Description :   Returns two numbers: the number of actually used slots
94	in the dictionary hash table, versus the number of available slots.
95
96<DT><STRONG>dict_hash_collisions</STRONG><DD>
97
98<P>
99    Type :  pair of integers Collisions/Entries
100
101<P>
102    Description :   Returns two numbers: the number of dictionary entries 
103	that collided with existing hash table entries, versus the total
104	number of dictionary hash table entries.
105
106<DT><STRONG>dict_gc_number</STRONG><DD>
107
108<P>
109    Unit :   count
110
111<P>
112    Description :   The number of dictionary garbage collections performed
113        during this session. 
114
115<DT><STRONG>dict_gc_time</STRONG><DD>
116
117<P>
118    Unit :   seconds (float)
119
120<P>
121    Description :   The total cputime spent by all dictionary garbage
122        collections performed during this session.
123
124<DT><STRONG>event_time</STRONG><DD>
125
126<P>
127    Unit :   seconds (float)
128
129<P>
130    Description :   Returns the elapsed real time (session_time) or 
131        the elapsed user time (cputime) since the start of a 
132        (parallel) ECLiPSe session depending on the value of the 
133        after_event_timer flag.  
134
135<DT><STRONG>gc_area</STRONG><DD>
136
137<P>
138    Unit :   bytes
139
140<P>
141    Description :   The average area processed by a garbage collection.
142        This number should be close to the value of gc_interval.  If it
143        is much higher, gc_interval should be increased.
144
145<DT><STRONG>gc_collected</STRONG><DD>
146
147<P>
148    Unit :   bytes (float)
149
150<P>
151    Description :   The total number of bytes collected in the global
152        stack during all the garbage collections in this session.  This
153	value is a float, to avoid overflow.
154
155<DT><STRONG>gc_number</STRONG><DD>
156
157<P>
158    Unit :   count
159
160<P>
161    Description :   The number of global/trail stack garbage
162        collections performed during this session.
163
164<DT><STRONG>gc_ratio</STRONG><DD>
165
166<P>
167    Unit :   percent (float)
168
169<P>
170    Description :   The average percentage of garbage found and
171        collected in the garbage collections performed so far.  If this
172        number is low, gc_interval should be increased.
173
174<DT><STRONG>gc_time</STRONG><DD>
175
176<P>
177    Unit :   seconds (float)
178
179<P>
180    Description :   The total time spent for all garbage collections in
181        this session.
182
183<DT><STRONG>private_heap_allocated</STRONG><DD>
184
185<P>
186    Unit :   bytes
187
188<P>
189    Description :   The amount of memory assigned to the private heap.
190        This area will never shrink.
191
192<DT><STRONG>private_heap_used</STRONG><DD>
193
194<P>
195    Unit :   bytes
196
197<P>
198    Description :   The amount of memory currently used for private
199        data.
200
201<DT><STRONG>global_stack_allocated</STRONG><DD>
202
203<P>
204    Unit :   bytes
205
206<P>
207    Description :   The amount of global stack currently allocated. The
208        global stack is allocated in chunks, up to a maximum controlled
209        by the -g command line option. The global stack and trail share the
210        same memory area specified by the -g option, which thus gives the
211        maximum possible combined allocated size of these two stacks.
212
213<DT><STRONG>global_stack_peak</STRONG><DD>
214
215<P>
216    Unit :   bytes
217
218<P>
219    Description :   The peak allocated size of the global stack during
220        this session. Chunks of memory can be allocated to, and
221        deallocated from, the global stack as it grows and shrinks.
222
223<DT><STRONG>global_stack_used</STRONG><DD>
224
225<P>
226    Unit :   bytes
227
228<P>
229    Description :   The amount of global stack currently in use.  The
230        global stack holds lists and structures and is subject to
231        garbage collection.
232
233<DT><STRONG>hr_time</STRONG><DD>
234
235<P>
236    Unit :   seconds (float)
237
238<P>
239    Description :   Returns the value of a high-resolution timer in seconds.
240	The precise meaning of this value is operating system and hardware
241	dependent, but the resolution should be better than the other time
242	statistics, usually in the microsecond range.  Only differences
243	between two such times are meaningful, the absolute value does not
244	have any specific meaning.  If operating system or hardware do not
245	provide such a timer, the value is the same as session_time.
246
247<DT><STRONG>local_stack_allocated</STRONG><DD>
248
249<P>
250    Unit :   bytes
251
252<P>
253    Description : The amount of local stack currently allocated. The local
254        stack is allocated in chunks, up to a maximum controlled by the -l
255        command line option. The local and control stacks share the same
256        memory area specified by the -l option, which thus gives the
257        maximum combined allocated size of these two stacks.
258
259<DT><STRONG>local_stack_peak</STRONG><DD>
260
261<P>
262    Unit :   bytes
263
264<P>
265    Description :   The peak allocated size of the local stack during
266        this session. Chunks of memory can be allocated to, and
267        deallocated from, the local stack as it grows and shrinks.
268
269<DT><STRONG>local_stack_used</STRONG><DD>
270
271<P>
272    Unit :   bytes
273
274<P>
275    Description :   The amount of local stack currently in use.  This
276        stack holds Prolog variables and return addresses.  
277
278<DT><STRONG>global_stack</STRONG><DD>
279
280<P>
281    Unit :   List of bytes
282
283<P>
284    Description : Returns a list of two numbers for the allocated global
285       stack: the number of bytes currently used, and the number of bytes
286       currently free. It is provided mainly for compatibility.
287
288<DT><STRONG>local_stack</STRONG><DD>
289
290<P>
291    Unit :   List of bytes
292
293<P>
294    Description : Returns a list of two numbers on the current usage of the
295       allocated local and control stacks. In the original WAM, these two
296       stacks are combined into a single stack. This is provided for
297       compatibility purposes only.
298
299<DT><STRONG>trail</STRONG><DD>
300
301<P>
302    Unit :   List of bytes
303
304<P>
305    Description : Returns a list of two numbers for the allocated trail:
306        the number of bytes currently used, and the number of bytes
307        currently free. It is provided mainly for compatibility.
308
309<DT><STRONG>runtime</STRONG><DD>
310
311<P>
312    Unit :   List of milliseconds (integers)
313
314<P>
315    Description :   Returns a list of two times:  user cpu time since
316        the start of the ECLiPSe session, user cpu time since the last
317        call to statistics(runtime, _). As from ECLiPSe 4.2, these times
318	exclude the time spent in garbage collection. This item is provided
319        primarily for compatibility reasons.
320
321<DT><STRONG>session_time</STRONG><DD>
322
323<P>
324    Unit :   seconds (float)
325
326<P>
327    Description :   Returns the real time elapsed since the start of a
328        (parallel) ECLiPSe session.  This is the only timer that can be
329        reliably used in a parallel execution, since it accesses a
330        central clock.  All other timers are local to the worker where
331        they are accessed.
332
333<DT><STRONG>shared_heap_allocated</STRONG><DD>
334
335<P>
336    Unit :   bytes
337
338<P>
339    Description :   The amount of memory assigned to the code heap, i.e.
340        the area used for storing compiled Prolog code, atoms, records,
341        non-logical variables, descriptors, buffers etc.  This area will
342        never shrink.
343
344<DT><STRONG>shared_heap_used</STRONG><DD>
345
346<P>
347    Unit :   bytes
348
349<P>
350    Description :   The amount of memory currently used for compiled
351        Prolog code, atoms, records, non-logical variables, descriptors,
352        buffers etc.
353
354<DT><STRONG>times</STRONG><DD>
355
356<P>
357    Unit :   List of seconds (floats)
358
359<P>
360    Description :   Returns a list of three times:  user cpu time,
361        system cpu time and real time elapsed since the start of the
362        ECLiPSe session.
363
364<DT><STRONG>trail_stack_allocated</STRONG><DD>
365
366<P>
367    Unit :   bytes
368
369<P>
370    Description : The amount of trail stack currently allocated. The trail
371        is allocated in chunks, up to a maximum controlled by the -g
372        command line option. The global stack and trail share the same
373        memory area specified by the -g option, which thus gives the
374        maximum possible combined allocated size of these two stacks.
375
376<DT><STRONG>trail_stack_peak</STRONG><DD>
377
378<P>
379    Unit :   bytes
380
381<P>
382    Description : The peak allocated size of the trail stack during
383        this session. Chunks of memory can be allocated to, and
384        deallocated from, the trail stack as it grows and shrinks.
385
386<DT><STRONG>trail_stack_used</STRONG><DD>
387
388<P>
389    Unit :   bytes
390
391<P>
392    Description :   The amount of trail stack currently in use.  The
393        trail stack records information needed for backtracking and is
394        subject to garbage collection.
395</DL>
396
397NOTE: library(quintus) contains a compatibility version of statistics/2
398which accepts the following different keywords:  runtime, system_time,
399real_time, walltime, memory, program, global_stack,  local_stack, trail,
400choice, stacks, garbage_collection, stack_shifts, atoms,
401atom_garbage_collection, core, heap.
402"),
403	args:["Keyword" : "Atom or Variable.", "Value" : "Prolog term."],
404	exceptions:[5 : "Keyword is neither an atom nor variable."],
405	eg:"
406Success:
407   [eclipse]: statistics(times, [_,_,T]).
408   T = 2848.64
409   yes.
410   [eclipse]: statistics(global_stack_used, G).
411   G = 136
412   yes.
413Fail:
414   statistics(times, [T]).
415Error:
416   statistics(\"time\", T).    (Error 5)
417
418
419
420
421",
422	see_also:[set_flag / 2, env / 0, statistics / 0]]).
423
424
425:- comment(make / 0, [
426	summary:"Recompile all files that have been modified since their last compilation.
427
428",
429	amode:(make is det),
430	desc:html("   This is a simple utility which uses file modification times to determine
431   if a file needs recompilation.  All compiled files in the system are
432   examined and recompiled if they have been modified since the previous
433   compilation.  make/0 can be defined as follows:
434
435<P>
436<PRE>
437make :- current_compiled_file(File, Time, Module),
438        get_file_info(File, mtime) =\\= Time,
439        compile(File, Module),
440        fail.
441make.
442</PRE>
443"),
444	args:[],
445	eg:"
446[eclipse 1]: [file1,file2].
447file1.pl   compiled traceable 40 bytes in 0.00 seconds
448file2.pl   compiled traceable 40 bytes in 0.00 seconds
449
450yes.
451[eclipse 2]: sh(\"touch file1.pl\").
452
453yes.
454[eclipse 3]: make.
455file1.pl   compiled traceable 40 bytes in 0.00 seconds
456
457yes.
458
459
460
461",
462	see_also:['.' / 2, compile / 1, compile / 2, current_compiled_file / 3, ensure_loaded / 1]]).
463
464:- comment(profile / 1, [
465	summary:"Profile the goal and print the times spent in each predicate.
466
467",
468	amode:(profile(+) is det),
469	desc:html("<P>\
470   This predicate invokes the profiler with default options.  Equivalent to:
471   <PRE>
472       profile(Goal, []).
473   </PRE>
474   See profile/2 for details.
475</P>
476"),
477	args:["Goal" : "Atom or a compound term."],
478	exceptions:[6 : "Flags contains an illegal flag."],
479	eg:"
480[eclipse 6]: profile(boyer).
481rewriting...
482proving...
483goal succeeded
484
485                PROFILING STATISTICS
486                --------------------
487
488Goal:             boyer
489Total user time:  10.65s
490
491Predicate             Module         %Time  Time
492-------------------------------------------------
493rewrite           /2  eclipse        52.3%  5.57s
494garbage_collect   /0  sepia_kernel   23.1%  2.46s
495rewrite_args      /2  eclipse        16.6%  1.77s
496equal             /2  eclipse         4.7%  0.50s
497...
498plus              /3  eclipse         0.1%  0.01s
499
500
501
502",
503	see_also:[get_flag / 2, profile / 2]]).
504
505:- comment(profile / 2, [
506	summary:"Profile the goal and print the times spent in each predicate.
507
508",
509	amode:(profile(+,++) is det),
510	desc:html("<P>\
511   This predicate invokes the profiler.  The profiler first executes Goal
512   in profiling mode, which means that during its execution interrupts are
513   generated at regular intervals and the profiler remembers the currently
514   executing predicate.  When the goal succeeds or fails, the profiler
515   prints so, and then it prints the statistics about the time spent in
516   every encountered predicate.  Goal can be any Prolog goal, it does not
517   have to be compiled in a special profiling mode and no Prolog flags have
518   to be set.  The time spent in simple predicates (i.e. those with call_type
519   external, written in C) is counted towards their parent predicate.
520</P><P>
521   In cases where the predicate name is not available, e.g. local goals in
522   a locked module, the information is grouped under a blank predicate
523   name entry for the module.
524</P><P>
525   Flags is a list of option flags:
526   <DL>
527   <DT>simple</DT>
528       <DD>obsolete</DD>
529   <DT>keep_file</DT>
530       <DD>do not remove temporary data file when finished</DD>
531   </DL>
532</P><P>
533   A temporary file &lt;tmp_dir&gt;/eclipse.prof.&lt;pid&gt; is used to collect the
534   profiling information and is removed upon exit (unless keep_file option
535   is given).
536</P>
537"),
538	args:["Goal" : "Atom or a compound term.", "Flags" : "List of atoms."],
539	exceptions:[6 : "Flags contains an illegal flag."],
540	eg:"
541[eclipse 6]: profile(boyer, []).
542rewriting...
543proving...
544goal succeeded
545
546                PROFILING STATISTICS
547                --------------------
548
549Goal:             boyer
550Total user time:  10.55s
551
552Predicate             Module         %Time  Time
553-------------------------------------------------
554=..               /2  sepia_kernel   31.1%  3.28s
555garbage_collect   /0  sepia_kernel   23.5%  2.48s
556rewrite           /2  eclipse        21.6%  2.28s
557rewrite_args      /2  eclipse        17.2%  1.82s
558equal             /2  eclipse         4.1%  0.43s
559remainder         /3  eclipse         0.9%  0.10s
560...
561plus              /3  eclipse         0.1%  0.01s
562
563yes.
564
565
566
567
568",
569	see_also:[get_flag / 2, profile / 1]]).
570
571:- comment(env / 0, [
572	summary:"Prints information about the current ECLiPSe environment on the current
573output.
574
575",
576	amode:(env is det),
577	desc:html("   Prints a list of the current global flag values on the toplevel output
578   stream.  These are the same values that get_flag/2 provides.
579
580<P>
581"),
582	args:[],
583	eg:"
584[eclipse]: env.
585
586after_event_timer:      real            ignore_eof:             off
587bounded:                false           last_errno:             0
588break_level:            0               macro_expansion:        on
589breal_exceptions:       off             max_global_trail:       134217728
590coroutine:              off             max_local_control:      134217728
591cwd_scope:              process         max_predicate_arity:    255
592debug_compile:          on              object_suffix:          \"dll\"
593debugging:              nodebug         output_mode:            \"QPm\"
594eclipse_info_suffix:    \".eci\"          pid:                    2856
595eclipse_object_suffix:  \".eco\"          ppid:                   0
596enable_interrupts:      on              prefer_rationals:       off
597float_precision:        double          print_depth:            20
598gc:                     on              remote_protocol_version:1
599gc_interval:            4194304         toplevel_module:        eclipse
600gc_interval_dict:       960             unix_time:              1326075378
601gc_policy:              adaptive        version:                '6.1'
602goal_expansion:         on              version_as_list:        [6, 1, 99]
603hostarch:               \"i386_linux\"
604
605cwd:                    \"/homes/john/\" 
606default_language:       eclipse_language
607extension:              development occur_check dfid
608tmp_dir:                \"/tmp\"
609hostid:                 \"A#032167137134\"
610hostname:               \"foo.bar.com\"
611installation_directory: \"/usr/local/eclipse\" 
612library_path:           [\"/usr/local/eclipse/lib\",
613                         \"/usr/local/eclipse/lib_public\"]
614loaded_library:         tracer_tty development_support toplevel
615                           eclipse_language suspend
616output_options:         [depth(20), attributes(pretty), quoted(true),
617                         portrayed(true)]
618prolog_suffix:          [\"\", \".ecl\", \".pl\"]
619syntax_option:          nl_in_quotes no_blanks
620variable_names:         check_singletons
621
622",
623	see_also:[get_flag / 2, set_flag / 2]]).
624
625:- comment(trimcore/0, [
626	summary:"Frees currently unused memory.",
627	amode:(trimcore is det),
628	desc: html("\
629
630   Calling this predicate will free some currently deallocated memory, such
631   as memory occupied by retracted and abolished clauses. It also
632   returns deallocated stack space back to the operating system.")
633]).
634
635
636:- comment(garbage_collect / 0, [
637	summary:"Request an immediate garbage collection.
638
639",
640	amode:(garbage_collect is det),
641	desc:html("   Causes an immediate garbage collection of the global and trail stack,
642   provided that the garbage collector is not switched off (cf.
643   set_flag/2).  In any case the predicate succeeds.
644
645<P>
646   Note that the garbage collector is usually triggered automatically,
647   controlled by the user-definable flag gc_interval.  Therefore, the usage
648   of garbage_collect/0 should be restricted to situations where the
649   automatic triggering performs badly.  In this case it should be inserted
650   in a place where it is known for sure that a lot of structures and lists
651   have become useless, eg.  just before a tail-recursive call as shown in
652   the example.
653
654<P>
655"),
656	args:[],
657	eg:"
658cycle(OldState) :-
659    transform(OldState, NewState), /* long computation     */
660    !,
661    garbage_collect,               /* OldState is obsolete */
662    cycle(NewState).
663
664
665
666",
667	see_also:[env / 0, set_flag / 2, get_flag / 2]]).
668
669:- comment(get_flag / 2, [
670	summary:"Succeeds if the flag Flag has the value Value.
671
672",
673	amode:(get_flag(-,-) is nondet),
674	amode:(get_flag(+,-) is nondet),
675	index:[
676	    after_event_timer,
677	    break_level,
678	    coroutine,
679	    cwd,
680	    cwd_scope,
681	    debug_compile,
682	    debugging,
683	    default_language,
684	    eclipse_info_suffix,
685	    eclipse_object_suffix,
686            tmp_dir,
687	    enable_interrupts,
688	    extension,
689	    float_precision,
690	    gc,
691	    gc_interval,
692	    gc_interval_dict,
693	    gc_policy,
694	    goal_expansion,
695	    hostarch,
696	    hostid,
697	    hostname,
698	    ignore_eof,
699	    installation_directory,
700	    last_errno,
701	    library_path,
702	    loaded_library,
703	    macro_expansion,
704            max_integer,
705	    max_global_trail,
706	    max_local_control,
707	    max_predicate_arity,
708	    object_suffix,
709	    occur_check,
710	    output_mode,
711	    output_options,
712	    pid,
713	    ppid,
714	    prefer_rationals,
715	    print_depth,
716	    prolog_suffix,
717	    remote_protocol_version,
718	    syntax_option,
719	    toplevel_module,
720	    unix_time,
721	    variable_names,
722	    version,
723	    version_as_list,
724	    worker,
725	    workers,
726	    workerids,
727	    wm_window,
728	% syntax options
729	    atom_subscripts,
730	    bar_is_no_atom,
731	    bar_is_semicolon,
732	    based_bignums,
733	    blanks_after_sign,
734	    blanks_in_nil,
735	    curly_args_as_list,
736	    doubled_quote_is_quote,
737	    float_needs_point,
738	    general_subscripts,
739	    iso_base_prefix,
740	    iso_escapes,
741	    iso_restrictions,
742	    limit_arg_precedence,
743	    nested_comments,
744	    nl_in_quotes,
745	    no_array_subscripts,
746	    no_attributes,
747	    no_blanks,
748	    no_curly_arguments,
749	    plus_is_no_sign,
750	    read_floats_as_breals,
751	    var_functor_is_apply
752	    ],
753	desc:html("   Used to return or check the environment flag Flag with value Value.  The
754   environment flags which are read/write may be updated using set_flag/2.
755   The current values of the environment flags are returned by env/0.
756<P>
757   The following list details the environment flags:
758<DL>
759<DT><STRONG>after_event_timer</STRONG><DD>
760
761<P>
762    Access mode :   read/write
763
764<P>
765    Type :  Atomic constant <EM>real</EM> or <EM>virtual</EM>
766
767<P>
768    Description : Specifies the timer used for event_after/2 and
769        event_after_every/2.
770
771<P>
772<DT><STRONG>break_level</STRONG><DD>
773
774<P>
775    Access mode :   read/write
776
777<P>
778    Type :   Integer
779
780<P>
781    Description :   Specifies current nesting level of recursive
782        top-level loops.
783
784<P>
785<DT><STRONG>breal_exceptions</STRONG><DD>
786
787<P>
788    Access mode :   read/write
789
790<P>
791    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
792
793<P>
794    Default :   off
795
796<P>
797    Description :   If <EM>on</EM>,  unifying or testing bounded reals
798        for identity raises an 'undecidable comparison of bounded reals'
799        exception in case the comparison is undecidable (i.e. the bounds
800        overlap).  If <EM>off</EM>, bounded reals compare equal when
801        their bounds are equal.  This flag does not affect arithmetic
802        comparisons.
803
804<P>
805<DT><STRONG>coroutine</STRONG><DD>
806
807<P>
808    Access mode :   read/write
809
810<P>
811    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
812
813<P>
814    Default :   configuration dependent
815
816<P>
817    Description :   Specifies whether built-in predicates delay or
818        raise instantiation faults.
819
820<P>
821<DT><STRONG>cwd</STRONG><DD>
822
823<P>
824    Access mode :   read/write
825
826<P>
827    Type :   String
828
829<P>
830    Description :   Specifies the name of the current working directory.
831        May also be set using cd/1 or read using getcwd/1.
832
833<P>
834<DT><STRONG>cwd_scope</STRONG><DD>
835
836<P>
837    Type :   Atomic constant <EM>process</EM> or <EM>separate</EM>
838
839<P>
840    Description :   Specifies whether cd/1, getcwd/1, the cwd flag and
841        relative path names refer the process's current directory ('process'),
842        or to the ECLiPSe system's own idea of current directory ('separate').
843	Note that the effective current directory may change when the cwd_mode
844	is switched, as no synchronisation is done.
845
846<P>
847<DT><STRONG>debug_compile</STRONG><DD>
848
849<P>
850    Access mode :   read/write
851
852<P>
853    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
854
855<P>
856    Default :   on
857
858<P>
859    Description :   Specifies whether clauses are compiled for
860        debugging or not.  May be overwritten on a file by file
861        basis using pragma(debug) or pragma(nodebug).
862
863<P>
864<DT><STRONG>debugging</STRONG><DD>
865
866<P>
867    Access mode : read-only
868
869<P>
870    Type : Atomic constant <EM>nodebug</EM>, <EM>creep</EM>, or <EM>leap</EM>
871
872<P>
873    Default :   nodebug
874
875<P>
876    Description : Specifies whether debugging is disabled (nodebug) or
877    \tenabled.  trace/0 sets the creep mode, debug/0 sets the leap mode.
878
879<P>
880<DT><STRONG>default_language</STRONG><DD>
881
882<P>
883    Access mode : read/write
884
885<P>
886    Type : Atom
887
888<P>
889    Default :   eclipse_language
890
891<P>
892    Description : Specifies the source language dialect for modules which
893    	are created without an explicit language specification (module/1
894        directive or the create_module/1). Other possible settings are
895        for example 'iso' or 'sicstus'.
896
897<P>
898
899<P>
900<DT><STRONG>eclipse_info_suffix</STRONG><DD>
901
902<P>
903    Access mode : read
904
905<P>
906    Type : String
907
908<P>
909    Default : \".eci\"
910
911<P>
912    Description : Specifies the ECLiPSe information file suffix used when a 
913        file is generated by icompile/1. The suffix will be automatically
914        appended to the base file name when the information file is 
915        generated. 
916
917<P>
918<DT><STRONG>eclipse_object_suffix</STRONG><DD>
919
920<P>
921    Access mode : read
922
923<P>
924    Type : String
925
926<P>
927    Default : \".eco\"
928
929<P>
930    Description : Specifies the ECLiPSe object file suffix used when a file
931        is fcompiled. The suffix will be automatically appended to the 
932        file's base name when the object file is generated. When loading a 
933        file (e.g. use_module/1, lib/1), the system will try to find an
934        object file before a source file by appending the given suffix
935        before the source suffix(es).
936
937<P>
938<DT><STRONG>enable_interrupts</STRONG><DD>
939
940<P>
941    Access mode : read/write
942
943<P>
944    Type : Atomic constant <EM>on</EM> or <EM>off</EM>
945
946<P>
947    Default :   on
948
949<P>
950    Description : If on, interrupts are recognised and processed as
951        they occur.  If off, interrupts are entered into a delay queue
952        and processed only when the flag is switched back to on.
953        Interrupts should be disabled only for short periods of time in
954        order to keep the system's interrupt response time short.
955
956<P>
957<DT><STRONG>extension</STRONG><DD>
958
959<P>
960    Access mode : read-only
961
962<P>
963    Type : Atomic constant.
964
965<P>
966    Default :   configuration dependent
967
968<P>
969    Description : Specifies which extensions are available in the
970        system.  This flag may contain multiple values and will return
971        them on backtracking.
972
973<P>
974<DT><STRONG>float_precision</STRONG><DD>
975
976<P>
977    Access mode : read-only
978
979<P>
980    Type : Atomic constant
981
982<P>
983    Default :   double
984
985<P>
986    Description : This flag is obsolete. Its value is always <EM>double</EM>.
987
988<P>
989<DT><STRONG>gc</STRONG><DD>
990
991<P>
992    Access mode :   read/write
993
994<P>
995    Type :   Atomic constant <EM>on</EM>, <EM>verbose</EM> or <EM>off</EM>
996
997<P>
998    Default :   on
999
1000<P>
1001    Description :   Specifies whether garbage collection is enabled
1002        (on), disabled (off) or enabled and reports every collection on
1003        log_output (verbose).
1004
1005<P>
1006<DT><STRONG>gc_policy</STRONG><DD>
1007
1008<P>
1009    Access mode :   read/write
1010
1011<P>
1012    Type :   Atomic constant <EM>adaptive</EM> or <EM>fixed</EM>.
1013
1014<P>
1015    Default :   adaptive
1016
1017<P>
1018    Description :   This option affects the triggering heuristics of
1019        the garbage collector, together with the gc_interval setting.
1020        The <EM>adaptive</EM> policy minimises garbage collection time,
1021        while the <EM>fixed</EM> policy minimises space consumption.
1022
1023<P>
1024<DT><STRONG>gc_interval</STRONG><DD>
1025
1026<P>
1027    Access mode :   read/write
1028
1029<P>
1030    Type :   Integer
1031
1032<P>
1033    Default :   1/32 of global stack size, at least 64KB
1034
1035<P>
1036    Description :   Specify how often the collector is invoked.
1037        Roughly, the argument specifies the minimum number of bytes a
1038        program must have newly allocated before a garbage collection
1039        is triggered.  If the garbage collector runs frequently while
1040        reclaiming little space it may make sense to increase
1041        gc_interval, thus reducing the number of garbage collections. 
1042        This is normally only necessary when the gc_policy is set to
1043        <EM>fixed</EM>.  With gc_policy set to <EM>adaptive</EM>, the
1044        collection intervals will be adjusted automatically.  See also
1045        gc_policy setting.
1046
1047<P>
1048<DT><STRONG>gc_interval_dict</STRONG><DD>
1049
1050<P>
1051    Access mode :   read/write
1052
1053<P>
1054    Type :   Integer
1055
1056<P>
1057    Default :   960
1058
1059<P>
1060    Description :   Specify after how many new dictionary entries the
1061        dictionary garbage collector is invoked.
1062
1063<P>
1064<DT><STRONG>goal_expansion</STRONG><DD>
1065
1066<P>
1067    Access mode :   read/write
1068
1069<P>
1070    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
1071
1072<P>
1073    Default :   on
1074
1075<P>
1076    Description :   Specifies whether goal expansion (inling) is done by
1077        the compiler or other source processing tools.  Can be disabled
1078        for debugging purposes, but usually it is preferable to use a
1079        compiler/source-processor option or a pragma for this purpose.
1080
1081<P>
1082<DT><STRONG>hostarch</STRONG><DD>
1083
1084<P>
1085    Access mode : read-only
1086
1087<P>
1088    Type : String
1089
1090<P>
1091    Description : String identifying the host processor and operating
1092        system.  It is also the name of the machine-dependent
1093        subdirectories in the ECLiPSe installation.
1094
1095<P>
1096<DT><STRONG>hostid</STRONG><DD>
1097
1098<P>
1099    Access mode : read-only
1100
1101<P>
1102    Type : String
1103
1104<P>
1105    Description : The unique identification of the host machine that
1106        the system is running on.
1107
1108<P>
1109<DT><STRONG>hostname</STRONG><DD>
1110
1111<P>
1112    Access mode : read-only
1113
1114<P>
1115    Type : string
1116
1117<P>
1118    Description : The name of the current host machine.
1119
1120<P>
1121<DT><STRONG>ignore_eof</STRONG><DD>
1122
1123<P>
1124    Access mode : read/write
1125
1126<P>
1127    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
1128
1129<P>
1130    Description : Controls whether ECLiPSe can be exited by typing an
1131        end-of-file to the toplevel-prompt or whether this is ignored.
1132        If ignored, ECLiPSe can be exited by calling halt/0.
1133
1134<P>
1135<DT><STRONG>installation_directory</STRONG><DD>
1136
1137<P>
1138    Access mode : read-only
1139
1140<P>
1141    Type : string
1142
1143<P>
1144    Description : The name of the toplevel directory of the running
1145        ECLiPSe installation.  All ECLiPSe library, documentation and
1146        other directories are below this one.
1147
1148<P>
1149<DT><STRONG>last_errno</STRONG><DD>
1150
1151<P>
1152    Access mode : read-only
1153
1154<P>
1155    Type : Integer
1156
1157<P>
1158    Description : The error code that the most recent failed operating
1159        system call returned. This should no longer be used because of
1160        portability problems, use errno_id/1 instead.
1161
1162<P>
1163<DT><STRONG>library_path</STRONG><DD>
1164
1165<P>
1166    Access mode : read/write
1167
1168<P>
1169    Type : List of strings
1170
1171<P>
1172    Default :   the contents of the user's ECLIPSELIBRARYPATH
1173        environment variable, followed by the system library
1174        directories
1175
1176<P>
1177    Description : Specifies the list of pathnames used by the system to
1178        search for library files.  The library path is used by lib/1
1179        for autoloading, and to expand library/1 structures in
1180        pathnames.
1181
1182<P>
1183<DT><STRONG>loaded_library</STRONG><DD>
1184
1185<P>
1186    Access mode :   read/write
1187
1188<P>
1189    Type :   Atom
1190
1191<P>
1192    Description :   Returns the names of the currently loaded
1193        libraries.  This flag may contain multiple values and will
1194        return them on backtracking.
1195
1196<P>
1197<DT><STRONG>macro_expansion</STRONG><DD>
1198
1199<P>
1200    Access mode :   read/write
1201
1202<P>
1203    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
1204
1205<P>
1206    Default :   on
1207
1208<P>
1209    Description :   Specifies whether macro expansion (including clause
1210    	expansion and goal expansion/inlining) is enabled or disabled.
1211        Should be disabled only for very specific debugging purposes.
1212        It is preferrable to disable macro expansion on a per-stream
1213        basis (see set_stream_property/3) or via a source-processor option.
1214
1215<P>
1216<DT><STRONG>max_integer</STRONG><DD>
1217
1218<P>
1219    Access mode : read-only
1220
1221<P>
1222    Type : Integer
1223
1224<P>
1225    Description :   If the range of integer is bounded (i.e. bignums not
1226       supported), returns the maximum representable integer value. Fails 
1227       if the integer range is unbounded. 
1228
1229<P>
1230<DT><STRONG>max_global_trail</STRONG><DD>
1231
1232<P>
1233    Access mode : read-only
1234
1235<P>
1236    Type : Integer
1237
1238<P>
1239    Description : The maximum size in bytes to which the global/trail stack
1240        can grow. See also statistics/2.
1241
1242<P>
1243<DT><STRONG>max_local_control</STRONG><DD>
1244
1245<P>
1246    Access mode : read-only
1247
1248<P>
1249    Type : Integer
1250
1251<P>
1252    Description : The maximum size in bytes to which the global/trail stack
1253        can grow. See also statistics/2.
1254
1255<P>
1256<DT><STRONG>max_predicate_arity</STRONG><DD>
1257
1258<P>
1259    Access mode :   read-only
1260
1261<P>
1262    Type :   Integer
1263
1264<P>
1265    Default :   255
1266
1267<P>
1268    Description :   Returns the maximum number of arguments allowed for
1269        an ECLiPSe predicate.
1270
1271<P>
1272<DT><STRONG>object_suffix</STRONG><DD>
1273
1274<P>
1275    Access mode :   read-only
1276
1277<P>
1278    Type :   String
1279
1280<P>
1281    Description :   Returns the suffix of the external object files
1282        that can be loaded using load/1.  It is usually \"so\" for
1283        systems that support shared libraries and \"o\" for the others.
1284
1285<P>
1286<DT><STRONG>occur_check</STRONG><DD>
1287
1288<P>
1289    Access mode : read/write
1290
1291<P>
1292    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
1293
1294<P>
1295    Default :   off
1296
1297<P>
1298    Description : If the flag is on, occur check is performed on
1299        uncompiled unifications and the compiler generates code for
1300        unifications that will perform the occur check when necessary.
1301        Note that as ECLiPSe built-ins are compiled with this flag off,
1302        so the occur check is never performed with built-ins.
1303
1304<P>
1305<DT><STRONG>output_mode</STRONG><DD>
1306
1307<P>
1308    Access mode : read/write
1309
1310<P>
1311    Type : String
1312
1313<P>
1314    Default :   \"QPm\"
1315
1316<P>
1317    Description : The value is a control string that is recognised by
1318        the %w format of printf/3.  This format is used to output
1319        results on the toplevel loop and to print debugger trace lines.
1320        See also the output_options flag.
1321
1322<P>
1323<DT><STRONG>output_options</STRONG><DD>
1324
1325<P>
1326    Access mode : read/write
1327
1328<P>
1329    Type : List of structures
1330
1331<P>
1332    Default :   [depth(20), attributes(pretty), ...]
1333
1334<P>
1335    Description : The value is an output options list as understood by
1336    	write_term/2,3.   This format is used to output results on the
1337        toplevel loop and to print debugger trace lines.  This flag is
1338        an alternative, more readable representation of the values of the
1339        print_depth and output_mode flag.  It reflects the values of those
1340        flags and will change their values whenever it is changed itself.
1341
1342<P>
1343<DT><STRONG>pid</STRONG><DD>
1344
1345<P>
1346    Access mode :   read-only
1347
1348<P>
1349    Type :   Integer
1350
1351<P>
1352    Description :   Returns the process identifier of the current
1353        ECLiPSe .
1354
1355<P>
1356<DT><STRONG>ppid</STRONG><DD>
1357
1358<P>
1359    Access mode :   read-only
1360
1361<P>
1362    Type :   Integer
1363
1364<P>
1365    Description :   Returns the process identifier of the current
1366        ECLiPSe 's parent process.
1367
1368<P>
1369<DT><STRONG>prefer_rationals</STRONG><DD>
1370
1371<P>
1372    Access mode :   read/write
1373
1374<P>
1375    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
1376
1377<P>
1378    Default :   off
1379
1380<P>
1381    Description :   Specifies if the result of a /-division of two
1382        integers gives a rational or a floating point result.  Similar
1383        for the result of raising an integer to a negative integral
1384        power.
1385
1386<P>
1387<DT><STRONG>print_depth</STRONG><DD>
1388
1389<P>
1390    Access mode :   read/write
1391
1392<P>
1393    Type :   Integer
1394
1395<P>
1396    Default :   20
1397
1398<P>
1399    Description :   Specifies the print depth bound for printing
1400        compound terms.  It is not taken into account by the output
1401        predicates that produce machine-readable output (write_canonical,
1402        writeq, etc), but other I/O built-ins obey this flag.
1403        Identical to the depth(N) component of the output_options flag.
1404
1405<P>
1406<DT><STRONG>prolog_suffix</STRONG><DD>
1407
1408<P>
1409    Access mode :   read/write
1410
1411<P>
1412    Type :   List of strings
1413
1414<P>
1415    Default :   [\"\", \".ecl\", \".pl\"]
1416
1417<P>
1418    Description :   Specifies the Prolog source file suffix(es) used
1419        when compiling files or loading libraries.  The system tries to
1420        find the file by appending the given suffixes in the order
1421        provided.
1422
1423<P>
1424<DT><STRONG>remote_protocol_version</STRONG><DD>
1425
1426<P>
1427    Access mode :   read only
1428
1429<P>
1430    Type :   Integer
1431
1432<P>
1433    Description :   Specifies the version of the protocol which this
1434    	Eclipse uses to communicate with remotely attached peers.  See
1435        Embedding and Interfacing Manual: The Remote Interface Protocol.
1436
1437<P>
1438<DT><STRONG>syntax_option</STRONG><DD>
1439
1440<P>
1441    Access mode :   read/write
1442
1443<P>
1444    Type :   Atom
1445
1446<P>
1447    Description :   Returns the names of the currently enabled syntax
1448        options.  This flag may contain multiple values and will return
1449        them on backtracking.  A syntax option is reset using
1450        set_flag(syntax_option, not(Flag)).  Most compatibility
1451        packages affect these flags as well.  The following options are
1452        available:
1453
1454    <DL>
1455    <DT><EM>atom_subscripts</EM><DD>
1456	  allow atoms to be followed by subscripts, and parse as subscript/2.
1457	  Useful for parsing other languages, e.g. FlatZinc.
1458
1459    <DT><EM>bar_is_no_atom</EM><DD>
1460	disallow the use of an unquoted vertical bar as atom or functor,
1461	except when it occurs in infix-position.
1462
1463    <DT><EM>bar_is_semicolon</EM><DD>
1464	translate occurrences of unquoted infix vertical bars into terms
1465	with functor ;/2, e.g. (a|b) = (a;b).
1466
1467    <DT><EM>based_bignums</EM><DD>
1468	  Allow base notation even for integers longer than the
1469	  wordsize (i.e.  they are always positive).
1470
1471    <DT><EM>blanks_after_sign</EM><DD>
1472	ignore blank space between a sign and a number (by default,
1473	this space is significant and will lead to the sign being
1474	taken as prefix operator rather than the number's sign).
1475	Also allow signs of numbers to be quoted.
1476
1477    <DT><EM>blanks_in_nil</EM><DD>
1478          has no effect (obsolete).
1479
1480    <DT><EM>curly_args_as_list</EM><DD>
1481	  Parse terms written as {a,b,c} as {}([a,b,c]) instead of
1482	  the default {}((a,b,c)).
1483
1484    <DT><EM>doubled_quote_is_quote</EM><DD>
1485	  parse a pair of quotes within a quoted item as one
1486	  occurrence of the quote within the item.  If this option is
1487	  off (the default), consecutive string-quoted and list-quoted
1488	  items are parsed as a single (concatenated) item, while
1489	  consecutive quoted atoms are parsed as consecutive atoms.
1490 
1491    <DT><EM>float_needs_point</EM><DD>
1492    	require floating point numbers to be written with a decimal point,
1493	e.g. 1.0e-3 instead of 1e-3.
1494
1495    <DT><EM>general_subscripts</EM><DD>
1496	  allow atoms, parenthesized subterms and subscripted subterms
1497	  to be followed by subscripts, and parse as subscript/2.
1498	  Useful for parsing other languages, e.g. Zinc.
1499
1500    <DT><EM>iso_base_prefix</EM><DD>
1501	  allow binary, octal or hexadecimal numbers to be written
1502	  with 0b, 0o or 0x prefix respectively, and disallow the
1503	  <CODE>base'number</CODE> notation.
1504
1505    <DT><EM>iso_escapes</EM><DD>
1506	  ISO-Prolog compatible escape sequences within strings and atoms.
1507
1508    <DT><EM>iso_restrictions</EM><DD>
1509	  enable all ISO-Prolog syntax restrictions that are not controlled
1510	  by individual settings. This includes: disallowing operators as
1511	  operands of operators; disallowing an atom to be declared as both
1512	  an infix and a postfix operator; restrictions on changing operator
1513	  properties for comma, vertical bar, and the empty-bracket atoms.
1514
1515    <DT><EM>limit_arg_precedence</EM><DD>
1516	  do not allow terms with a precedence higher than 999 as
1517	  structure arguments, unless parenthesised.
1518
1519    <DT><EM>nested_comments</EM><DD>
1520          allow bracketed comments to be nested.
1521
1522    <DT><EM>nl_in_quotes</EM><DD>
1523          allow newlines to occur inside quotes (default).
1524
1525    <DT><EM>no_array_subscripts</EM><DD>
1526	  do not allow array subscript syntax for subscript/2.
1527
1528    <DT><EM>no_attributes</EM><DD>
1529	disallow the Eclipse specific syntax for variable attributes
1530	in curly braces.
1531
1532    <DT><EM>no_blanks</EM><DD>
1533	  do not allow blanks between functor and opening parenthesis (default).
1534
1535    <DT><EM>no_curly_arguments</EM><DD>
1536	disallow the Eclipse specific syntax for structures with
1537	named arguments in curly braces.
1538
1539    <DT><EM>plus_is_no_sign</EM><DD>
1540	do not interpret a plus sign preceding a number as the
1541	number's sign (effectively ignoring it), but treat it as
1542	a possible prefix operator +/1.
1543
1544    <DT><EM>read_floats_as_breals</EM><DD>
1545    	read all floating point numbers as bounded reals rather than as
1546	floats. The resulting breal is a small interval enclosing the
1547	true value of the number in decimal notation.
1548
1549    <DT><EM>var_functor_is_apply</EM><DD>
1550	allow variables as functors, and parse a term like X(A,B,C)
1551	as apply(X,[A,B,C]).
1552
1553     </DL>
1554
1555<P>
1556<DT><STRONG>tmp_dir</STRONG><DD>
1557
1558<P>
1559    Access mode : read/write
1560
1561<P>
1562    Type : String
1563
1564<P>
1565    Default : configuration dependent (see Description below)
1566
1567<P>
1568    Description : Specifies the temporary directory that ECLiPSe may use
1569        for storing temporary data files. <TT>Value</TT> should be an
1570        existing directory (in ECLiPSe's file name syntax) that the user
1571        can write to (set_flag/2 will fail otherwise). It is also
1572        recommended that the directory should reside on a local disk where
1573        the I/O operations are as fast as possible.  <P> By default, this
1574        directory is taken from the environment variable ECLIPSETMP if it
1575        exist. Otherwise, it is \"/tmp\" for Unix systems; \"//C/Temp\" for
1576        Windows. If none of these exist, it is set to the current
1577        working directory at start up.
1578
1579<P>
1580<DT><STRONG>toplevel_module</STRONG><DD>
1581
1582<P>
1583    Access mode :   read/write
1584
1585<P>
1586    Type :   Atom
1587
1588<P>
1589    Default :   eclipse
1590
1591<P>
1592    Description :   The name of the current top-level module.  This is
1593        the caller module for all queries entered in the top-level
1594        loop.  By default, this is also shown in the top-level prompt.
1595
1596<P>
1597<DT><STRONG>unix_time</STRONG><DD>
1598
1599<P>
1600    Access mode :   read-only
1601
1602<P>
1603    Type :   Integer
1604
1605<P>
1606    Description :   Return the time as given by the UNIX time(3)
1607        function, ie.  seconds since 00:00:00 GMT, Jan 1 1970.
1608
1609<P>
1610<DT><STRONG>variable_names</STRONG><DD>
1611
1612<P>
1613    Access mode :   read/write
1614
1615<P>
1616    Type :   Atomic constant <EM>on</EM>, <EM>off</EM> or <EM>check_singletons</EM>
1617
1618<P>
1619    Default :   check_singletons
1620
1621<P>
1622    Description :   Controls the ability to retain the source name of
1623        variables.  This flag affects the reading process only, i.e.
1624        when a variable is read (or compiled) with the flag set to on,
1625        it will keep its name even when the flag is switched off later.
1626        check_singletons is like on but additionally the compiler emits
1627        warnings about source variables which occur only once in a
1628        clause and whose name does not start with an underscore.  The
1629        source variable names are being created during the term input
1630        if this flag is not off, and then they are kept independently
1631        of the value of this flag.
1632
1633<P>
1634<DT><STRONG>version</STRONG><DD>
1635
1636<P>
1637    Access mode :   read-only
1638
1639<P>
1640    Type :   Atom
1641
1642<P>
1643    Description :   Returns the current version number of ECLiPSe .
1644
1645<P>
1646<DT><STRONG>version_as_list</STRONG><DD>
1647
1648<P>
1649    Access mode :   read-only
1650
1651<P>
1652    Type :   List of integers
1653
1654<P>
1655    Description :   Returns a list of integers, starting with your ECLiPSe
1656    	system's major version number, and ending with its build number.
1657	Note that this list can be used for lexicographic comparison, e.g.
1658	[5,3,17] @>= [5,3] or [5,3,17] @>= [5,1,24].
1659
1660<P>
1661<DT><STRONG>worker</STRONG><DD>
1662
1663<P>
1664    Access mode :   read-only
1665
1666<P>
1667    Type :   Integer
1668
1669<P>
1670    Description :   In a parallel session it returns a positive number,
1671        identifying the worker on which the flag inquiry was executed.
1672        In a sequential session 0 is returned.
1673
1674<P>
1675<DT><STRONG>workers</STRONG><DD>
1676
1677<P>
1678    Access mode :   read/write
1679
1680<P>
1681    Type :   A structure Host:N, where Host is an atom and N integer
1682
1683<P>
1684    Description :   In a parallel session it returns a positive number
1685        for N, which is the number of active workers on a given host
1686        Host.  If Host is a variable, it is bound to the host name
1687        where this predicate is executed.
1688
1689<P>
1690<DT><STRONG>workerids</STRONG><DD>
1691
1692<P>
1693    Access mode :   read-only
1694
1695<P>
1696    Type :   A structure Host:ActiveList+AsleepList, where Host is an
1697        atom and ActiveList and AsleepList are integer lists
1698
1699<P>
1700    Description :   In a parallel session it returns the workerid lists
1701        of of both active and asleep workers on a given host Host.  If
1702        Host is a variable, it is bound to the host name where this
1703        predicate is executed.
1704
1705<P>
1706<DT><STRONG>wm_window</STRONG><DD>
1707
1708<P>
1709    Access mode :   read/write
1710
1711<P>
1712    Type :   Atomic constant <EM>on</EM> or <EM>off</EM>
1713
1714<P>
1715    Description :   In a parallel session this flag tells if the window
1716        interface for the worker manager is on or off.
1717</DL>
1718<P>
1719"),
1720	args:["Flag" : "Atom or Variable.", "Value" : "Prolog term."],
1721	exceptions:[5 : "Flag is neither an atom nor variable."],
1722	eg:"
1723Success:
1724   [eclipse]: get_flag(gc, X).
1725   X = on
1726
1727   yes.
1728   [eclipse]: get_flag(loaded_library, L).
1729
1730   L = lists     More? (;)
1731
1732   L = development_support     More? (;)
1733   yes.
1734
1735Error:
1736   get_flag(1,X).           (Error 5)
1737
1738
1739
1740",
1741	see_also:[set_flag / 2, env / 0, errno_id / 1]]).
1742
1743:- comment((help) / 1, [
1744	summary:"Prints help information on the specified predicate in PredSpec on the
1745current output.
1746
1747",
1748	amode:(help(+) is semidet),
1749	desc:html("\
1750   Prints help information about the specified predicates to the current
1751   output.  The information displayed is a text version of the reference
1752   manual.  If only Name is specified, the system looks for all predicates
1753   that have this atom in their name.  If there are more than one predicate
1754   matching, a short description for each one is printed, rather than the
1755   whole page.  For instance, help var prints the short description of
1756   get_var_info/3, nonvar/1, readvar/3, var/1 and variant/2, whereas help
1757   dv prints the whole reference manual page for readvar/3.
1758
1759<P>
1760   Help information is available for both built-ins (those predicates
1761   defined in eclipse_language) and library predicates. If a particular
1762   predicate is available in more than one library, the user can specify
1763   Module:Name/Arity for PredSpec where Module is the name of the library 
1764   to select a specific predicate description. If a predicate is available
1765   both as a built-in and library predicate(s), then the built-in will be
1766   printed in full, while short descriptions are given for the library
1767   predicates.
1768<P>
1769   In addition, if information on library is available, help
1770   lib(LibraryName) can be used to obtain this information.
1771
1772"),
1773	args:["PredSpec" : "Predicate/Library specification in form Name/Arity or Module:Name/Arity, lib(Name), or an atom Name"],
1774	fail_if:"Fails if no help is available for PredSpec",
1775	eg:"
1776Success:
1777      help(nl/0).         % Displays reference page on nl/0
1778
1779      help(write/X).      % Displays short description of
1780  % write/1 and write/2
1781
1782      help(fd:(::)/2).    % Displays the reference page for fd's ::/2.
1783
1784      help((=:=)/2).      % Displays reference page for the built-in =:=/2,
1785  % and short description of the other instances of =:=/2.
1786
1787      help(lib(eplex)).   % Displays the reference page for the library eplex.
1788      help(X).            % Displays short description of
1789  % all built-ins
1790
1791Fail:
1792      help(nobip/1).
1793
1794
1795
1796
1797",
1798	see_also:[current_built_in / 1]]).
1799
1800:- comment(pred / 1, [
1801	summary:"The flags of the predicate described by PredSpec are printed out on the
1802current output.
1803
1804",
1805	amode:(pred(++) is semidet),
1806	desc:html("   Used to print on the current output the flags of the visible predicate
1807   described by PredSpec.  For the description of the flags see get_flag/3.
1808
1809<P>
1810"),
1811	args:["PredSpec" : "Predicate name in the form Atom/Integer"],
1812	fail_if:"Fails if PredSpec does not exist",
1813	exceptions:[4 : "PredSpec is not instantiated", 5 : "PredSpec is not in the format Atom/Integer"],
1814	eg:"
1815    ?- pred(pred/1).
1816    mode                pred(?)
1817    visibility          imported
1818    definition_module   sepia_kernel
1819    declared            on
1820    defined             on
1821    autoload            off
1822    auxiliary           off
1823    call_type           prolog
1824    demon               off
1825    deprecated          off
1826    parallel            off
1827    priority            2
1828    run_priority        2
1829    stability           static
1830    tool                on
1831    type                built_in
1832    debugged            on
1833    leash               notrace
1834    skip                on
1835    spy                 off
1836    start_tracing       off
1837    port_calls          []
1838    port_lines          []
1839    break_lines         []
1840    code_size           10
1841    Yes (0.01s cpu)
1842
1843    ?- pred(nopred/1).
1844    No (0.00s cpu)
1845",
1846	see_also:[get_flag / 3, set_flag/3, current_built_in / 1]]).
1847
1848:- comment(set_flag / 2, [
1849	summary:"Succeeds if the flag Flag is successfully set to the value Value.
1850
1851",
1852	amode:(set_flag(+,++) is det),
1853	desc:html("   Used to set the environment flag Flag to the value Value.  The current
1854   value of a flag may be returned using get_flag/2.  Refer to the
1855   specification of get_flag/2 for details about each of the environment
1856   flags.
1857
1858<P>
1859"),
1860	args:["Flag" : "Atom.", "Value" : "Atomic or compound term."],
1861	exceptions:[4 : "Flag and/or Value are not instantiated.", 5 : "Flag is neither an atom nor a variable.", 5 : "Value is not of the expected type.", 6 : "Flag and/or Value are out of range.", 30 : "Flag is a read-only flag."],
1862	eg:"
1863Success:
1864   set_flag(gc,verbose).
1865   set_flag(syntax_option, no_blanks).
1866   set_flag(syntax_option, not nl_in_quotes).
1867
1868
1869   % The following example will set a new library path
1870
1871   [eclipse]: get_flag(library_path,Path),
1872      set_flag(library_path, [\"/home/myuser/mylibs\" | Path]).
1873
1874   Path = [\"/usr/local/ECLIPSE/lib\"]
1875   yes.
1876
1877Fail:
1878   set_flag(statistics, some).
1879
1880Error:
1881   set_flag(X,a).                (Error  4)
1882   set_flag(\"a\",x).              (Error  5)
1883   set_flag(blah, a).            (Error  6)
1884   set_flag(gc,fred).            (Error  6)
1885   set_flag(version,1).          (Error 30)
1886
1887
1888
1889",
1890	see_also:[get_flag / 2, env / 0, cd / 1, compile / 1, compile / 2, (dynamic) / 1, pragma / 1, lib / 1]]).
1891
1892:- comment(statistics / 0, [
1893	summary:"Prints information about resource usage and garbage collection.
1894
1895",
1896	amode:(statistics is det),
1897	desc:html("   Prints information about resource usage and garbage collection on the
1898   log_output stream.  This information is also provided by
1899   statistics/2.  Please refer to statistics/2 for a description of the
1900   statistic items.  Times are displayed in seconds, memory sizes in bytes.
1901
1902<P>
1903"),
1904	args:[],
1905	eg:"
1906?- statistics.
1907times:                   [25.53, 30.64, 31548.76] seconds
1908session_time:            31548.765625 seconds
1909event_time:              31548.765625 seconds
1910hr_time:                 567247.01280051 seconds
1911global_stack_used:       2632 bytes
1912global_stack_allocated:  4259840 bytes
1913global_stack_peak:       134152192 bytes
1914trail_stack_used:        200 bytes
1915trail_stack_allocated:   327680 bytes
1916trail_stack_peak:        4259840 bytes
1917control_stack_used:      600 bytes
1918control_stack_allocated: 65536 bytes
1919control_stack_peak:      65536 bytes
1920local_stack_used:        364 bytes
1921local_stack_allocated:   65536 bytes
1922local_stack_peak:        65536 bytes
1923shared_heap_allocated:   2985984 bytes
1924shared_heap_used:        2900104 bytes
1925private_heap_allocated:  139264 bytes
1926private_heap_used:       132048 bytes
1927gc_number:               46 
1928gc_collected:            6509080.0 bytes
1929gc_area:                 46688728 bytes
1930gc_ratio:                0.303074122993982 %
1931gc_time:                 14.046 seconds
1932dictionary_entries:      6699 
1933dict_hash_usage:         3847 / 8192 
1934dict_hash_collisions:    1327 / 3847 
1935dict_gc_number:          23 
1936dict_gc_time:            0.0 seconds
1937",
1938	see_also:[statistics / 2]]).
1939
1940