root/tags/lgt2311/configs/sicstus4.config

Revision 3986, 12.2 KB (checked in by pmoura, 13 months ago)

Updated the release number to 2.31.1.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3%  Logtalk - Open source object-oriented logic programming language
4%  Release 2.31.1
5%
6%  configuration file for SICStus Prolog 4.0 and later versions
7%
8%  last updated: November 3, 2007
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13:- use_module(library(file_systems)).
14
15
16
17%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18%
19%  ISO Prolog Standard predicates that we must define because they are
20%  not built-in
21%
22%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
23%  we must define; there must be at least one clause for this predicate
24%  whose call should fail if we don't define any ISO predicates
25%
26%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27
28
29% '$lgt_iso_predicate'(?callable).
30
31'$lgt_iso_predicate'(_) :-
32    fail.
33
34
35
36%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37%
38%  predicate properties
39%
40%  this predicate must return at least static, dynamic, and built_in
41%  properties for an existing predicate
42%
43%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44
45
46% '$lgt_predicate_property'(+callable, ?predicate_property)
47
48'$lgt_predicate_property'(Pred, Prop) :-
49    predicate_property(Pred, Prop).
50
51
52
53%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54%
55%  meta-predicates
56%
57%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58
59
60% call_cleanup(+callable, +callble) -- built-in
61
62
63% forall(+callable, +callble) -- built-in
64
65forall(Generate, Test) :-
66    \+ (call(Generate), \+ call(Test)).
67
68
69% retractall(+callable) -- built-in
70
71
72% call_with_args/2-9
73%
74% use these definitions only if your compiler does
75% not provide call_with_args/2-9 as built-in predicates
76
77call_with_args(F, A) :-
78    call(F, A).
79
80call_with_args(F, A1, A2) :-
81    call(F, A1, A2).
82
83call_with_args(F, A1, A2, A3) :-
84    call(F, A1, A2, A3).
85
86call_with_args(F, A1, A2, A3, A4) :-
87    call(F, A1, A2, A3, A4).
88
89call_with_args(F, A1, A2, A3, A4, A5) :-
90    call(F, A1, A2, A3, A4, A5).
91
92call_with_args(F, A1, A2, A3, A4, A5, A6) :-
93    call(F, A1, A2, A3, A4, A5, A6).
94
95call_with_args(F, A1, A2, A3, A4, A5, A6, A7) :-
96    call(F, A1, A2, A3, A4, A5, A6, A7).
97
98call_with_args(F, A1, A2, A3, A4, A5, A6, A7, A8) :-
99    call(F, A1, A2, A3, A4, A5, A6, A7, A8).
100
101
102
103%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
104%
105%  Prolog built-in meta-predicates
106%
107%  (excluding ISO Prolog Standard meta-predicates)
108%
109%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
110
111
112% '$lgt_pl_meta_predicate'(?callable).
113
114'$lgt_pl_meta_predicate'(call_cleanup(::, ::)).
115'$lgt_pl_meta_predicate'(call_residue_vars(::, *)).
116'$lgt_pl_meta_predicate'(findall(*, ::, *, *)).
117'$lgt_pl_meta_predicate'(freeze(*, ::)).
118'$lgt_pl_meta_predicate'(if(::, ::, ::)).
119'$lgt_pl_meta_predicate'(on_exception(*, ::, ::)).
120'$lgt_pl_meta_predicate'(undo(::)).
121'$lgt_pl_meta_predicate'(when(*, ::)).
122
123
124
125%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126%
127%  file extension predicates
128%
129%  these extensions are used by Logtalk load/compile predicates
130%
131%  you may want to change the extension for Prolog files to match
132%  the one expected by your Prolog compiler
133%
134%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
135
136
137% '$lgt_file_extension'(?atom, ?atom)
138
139'$lgt_file_extension'(logtalk, '.lgt').
140'$lgt_file_extension'(prolog, '.pl').
141'$lgt_file_extension'(xml, '.xml').
142
143
144
145%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146%
147%  default flag values
148%
149%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150
151
152% '$lgt_default_flag'(?atom, ?atom)
153%
154% default values for all flags
155
156'$lgt_default_flag'(xmldocs, on).
157'$lgt_default_flag'(xslfile, 'lgtxml.xsl').
158'$lgt_default_flag'(xmlspec, dtd).
159'$lgt_default_flag'(xmlsref, local).
160
161'$lgt_default_flag'(unknown, warning).
162'$lgt_default_flag'(misspelt, warning).
163'$lgt_default_flag'(singletons, warning).
164'$lgt_default_flag'(lgtredef, warning).
165'$lgt_default_flag'(plredef, silent).
166'$lgt_default_flag'(portability, silent).
167
168'$lgt_default_flag'(report, on).
169
170'$lgt_default_flag'(smart_compilation, off).
171'$lgt_default_flag'(reload, always).
172
173'$lgt_default_flag'(startup_message, flags(verbose)).
174
175'$lgt_default_flag'(underscore_variables, singletons).
176
177'$lgt_default_flag'(code_prefix, '').
178
179'$lgt_default_flag'(debug, off).
180'$lgt_default_flag'(break_predicate, true).
181
182'$lgt_default_flag'(events, off).
183
184'$lgt_default_flag'(altdirs, off).
185'$lgt_default_flag'(tmpdir, 'lgt_tmp/').
186'$lgt_default_flag'(xmldir, 'xml_docs/').
187
188'$lgt_default_flag'(encoding_directive, source).
189'$lgt_default_flag'(threads, unsupported).
190
191'$lgt_default_flag'(context_switching_calls, allow).
192
193
194
195%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196%
197%  list predicates
198%
199%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
200
201
202'$lgt_append'(List1, List2, List3) :-
203    append(List1, List2, List3).
204
205
206'$lgt_member'(Element, List) :-
207    member(Element, List).
208
209
210'$lgt_member_var'(Var, [Head| _]) :-
211    Var == Head.
212'$lgt_member_var'(Var, [_| Tail]) :-
213    '$lgt_member_var'(Var, Tail).
214
215
216'$lgt_is_list'([]) :-
217    !.
218'$lgt_is_list'([_| Tail]) :-
219    '$lgt_is_list'(Tail).
220
221
222'$lgt_is_proper_list'(List) :-
223    List == [], !.
224'$lgt_is_proper_list'([_| Tail]) :-
225    nonvar(Tail),
226    '$lgt_is_proper_list'(Tail).
227
228
229
230%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231%
232%  file predicates
233%
234%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
235
236
237% '$lgt_file_exists'(+atom)
238%
239% checks if a file exist in the current directory
240
241'$lgt_file_exists'(File) :-
242    absolute_file_name(File, Path),
243    file_exists(Path).
244
245
246% '$lgt_directory_exists'(+atom)
247%
248% checks if a directory exists
249
250'$lgt_directory_exists'(Directory) :-
251    absolute_file_name(Directory, Path),
252    directory_exists(Path).
253
254
255% '$lgt_current_directory'(-atom)
256%
257% gets current working directory
258
259'$lgt_current_directory'(Directory) :-
260    current_directory(Directory).
261
262
263% '$lgt_change_directory'(+atom)
264%
265% changes current working directory
266
267'$lgt_change_directory'(Directory) :-
268    current_directory(_, Directory).
269
270
271% '$lgt_make_directory'(+atom)
272%
273% makes a new directory; succeeds if the directory already exists
274
275'$lgt_make_directory'(Directory) :-
276    absolute_file_name(Directory, Path),
277    (   directory_exists(Path) ->
278        true
279    ;   make_directory(Path)
280    ).
281
282
283% '$lgt_load_prolog_code'(+atom, +atom)
284%
285% compile and load a Prolog file
286
287'$lgt_load_prolog_code'(File, _) :-
288    compile(File).
289
290
291% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
292%
293% compare file modification times
294
295'$lgt_compare_file_mtimes'(Result, File1, File2) :-
296    file_property(File1, modify_time, Time1),
297    file_property(File2, modify_time, Time2),
298    compare(Result, Time1, Time2).
299
300
301
302%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303%
304%  sorting predicates
305%
306%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
307
308
309% '$lgt_keysort'(+list, -list)
310
311'$lgt_keysort'(List, Sorted) :-
312    keysort(List, Sorted).
313
314
315% '$lgt_sort'(+list, -list)
316
317'$lgt_sort'(List, Sorted) :-
318    sort(List, Sorted).
319
320
321
322%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323%
324%  time and date predicates
325%
326%  if your Prolog compiler does not provide access to the operating system
327%  time and date just write dummy definitions
328%
329%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
330
331
332% '$lgt_current_date'(?Year, ?Month, ?Day)
333
334'$lgt_current_date'(Year, Month, Day) :-
335    datime(datime(Year, Month, Day, _, _, _)).
336
337
338% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
339
340'$lgt_current_time'(Hours, Mins, Secs) :-
341    datime(datime(_, _, _, Hours, Mins, Secs)).
342
343
344
345%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
346%
347%  timing predicate
348%
349%  if your Prolog compiler does not provide access to a timing predicate
350%  just write dummy definition
351%
352%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
353
354
355% '$lgt_cpu_time'(-Seconds)
356
357'$lgt_cpu_time'(Seconds) :-
358    statistics(runtime, [Miliseconds| _]),
359    Seconds is Miliseconds / 1000.
360
361
362
363%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
364%
365%  comparison predicate
366%
367%  the usual compare/3 definition
368%
369%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
370
371
372% compare(?atom, @term, @term) -- built-in
373
374
375
376%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
377%
378%  callable predicate
379%
380%  the usual callable/1 definition
381%
382%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
383
384
385% callable(@term) -- built-in
386
387
388
389%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390%
391%  read character predicate
392%
393%  read a single character echoing it and writing a newline after
394%
395%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
396
397
398'$lgt_read_single_char'(Char) :-
399    get_char(Char),
400    (   peek_code(10) ->    % hack to workaround the lack of built-in
401        get_code(_)         % support for unbuffered character input
402    ;   true
403    ).
404
405
406
407%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
408%
409%  pretty print a term by naming its free variables
410%  (avoid instantiating variables in term by using double negation if necessary)
411%
412%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
413
414
415'$lgt_pretty_print_vars'(Stream, Term) :-
416    \+ \+ (
417        numbervars(Term, 0, _),
418        write_term(Stream, Term, [numbervars(true)])).
419
420
421'$lgt_pretty_print_vars_quoted'(Stream, Term) :-
422    \+ \+ (
423        numbervars(Term, 0, _),
424        write_term(Stream, Term, [numbervars(true), quoted(true)])).
425
426
427
428%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429%
430%  getting stream current line number
431%  (needed for improved compiler error messages)
432%
433%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
434
435
436% '$lgt_stream_current_line_number'(@stream, -integer)
437
438'$lgt_stream_current_line_number'(Stream, Line) :-
439    stream_property(Stream, position(Position)),
440    stream_position_data(line_count, Position, Line).
441
442
443
444%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
445%
446%  handling of Prolog-proprietary directives on Logtalk source files
447%
448%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
449
450
451% '$lgt_ignore_pl_directive'(@callable)
452
453'$lgt_ignore_pl_directive'(mode(_)).
454
455
456% '$lgt_rewrite_and_copy_pl_directive'(@callable, -callable)
457
458'$lgt_rewrite_and_copy_pl_directive'(volatile(PIs), volatile(CPIs)) :-
459    '$lgt_rewrite_and_copy_pl_directive_pis'(PIs, CPIs).
460
461
462'$lgt_rewrite_and_copy_pl_directive_pis'(PIs, _) :-
463    var(PIs),
464    throw(instantiation_error).
465'$lgt_rewrite_and_copy_pl_directive_pis'([], []) :-
466    !.
467'$lgt_rewrite_and_copy_pl_directive_pis'([PI| PIs], [CPI| CPIs]) :-
468    !,
469    '$lgt_rewrite_and_copy_pl_directive_pis'(PI, CPI),
470    '$lgt_rewrite_and_copy_pl_directive_pis'(PIs, CPIs).
471'$lgt_rewrite_and_copy_pl_directive_pis'((PI, PIs), (CPI, CPIs)) :-
472    !,
473    '$lgt_rewrite_and_copy_pl_directive_pis'(PI, CPI),
474    '$lgt_rewrite_and_copy_pl_directive_pis'(PIs, CPIs).
475'$lgt_rewrite_and_copy_pl_directive_pis'(Functor/Arity, TFunctor/TArity) :-
476    '$lgt_pp_object_'(_, Prefix, _, _, _, _, _, _, _, _, _),
477    '$lgt_construct_predicate_functor'(Prefix, Functor, Arity, TFunctor),
478    functor(Meta, Functor, Arity),
479    (   '$lgt_pp_meta_predicate_'(Meta) ->
480        TArity is Arity + 4
481    ;   TArity is Arity + 3
482    ).
483
484
485% '$lgt_rewrite_and_recompile_pl_directive'(@callable, -callable)
486
487'$lgt_rewrite_and_recompile_pl_directive'(module(Module, Exports, _), module(Module, Exports)).
488
489
490
491%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
492%
493%  Shortcut to the Logtalk built-in predicate logtalk_load/1
494%
495%  defined in the config files in order to be able to comment it out in case
496%  of conflict with some Prolog native feature; it implies conformance with
497%  the ISO Prolog standard regarding the definition of the {}/1 syntax
498%
499%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
500
501{File, Files} :-
502    !,
503    logtalk_load(File),
504    {Files}.
505{File} :-
506    logtalk_load(File).
507
508
509
510%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
511%
512%  end!
513%
514%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.