root/tags/lgt2212/configs/sicstus.config

Revision 1540, 9.3 KB (checked in by pmoura, 4 years ago)

Updated release number to 2.21.2.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3%  Logtalk - Object oriented extension to Prolog
4%  Release 2.21.2
5%
6%  configuration file for SICStus Prolog 3.8 and later versions
7%
8%  last updated: July 17, 2004
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13:- use_module(library(system)).
14
15:- set_prolog_flag(language, iso). % recomended, but optional
16
17
18
19%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20%
21%  ISO Prolog Standard predicates that we must define because they are
22%  not built-in
23%
24%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
25%  we must define; there must be at least one clause for this predicate
26%  whose call should fail if we don't define any ISO predicates
27%
28%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29
30
31% '$lgt_iso_predicate'(?callable).
32
33'$lgt_iso_predicate'(_) :-
34    fail.
35
36
37
38%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39%
40%  predicate properties
41%
42%  this predicate must return at least static, dynamic, and built_in
43%  properties for an existing predicate
44%
45%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46
47
48% '$lgt_predicate_property'(+callable, ?predicate_property)
49
50'$lgt_predicate_property'(Pred, Prop) :-
51    predicate_property(Pred, Prop).
52
53
54
55%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56%
57%  metapredicates
58%
59%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60
61
62% forall(+callable, +callble)
63
64forall(Generate, Test) :-
65    \+ call((Generate, \+ call(Test))).
66
67
68% lgt_call/2-8
69%
70% use these definitions only if your compiler does
71% not provide call/1-8 as built-in predicates
72
73'$lgt_call'(F, A) :-
74    Call =.. [F, A],
75    call(Call).
76
77
78'$lgt_call'(F, A1, A2) :-
79    Call =.. [F, A1, A2],
80    call(Call).
81
82
83'$lgt_call'(F, A1, A2, A3) :-
84    Call =.. [F, A1, A2, A3],
85    call(Call).
86
87
88'$lgt_call'(F, A1, A2, A3, A4) :-
89    Call =.. [F, A1, A2, A3, A4],
90    call(Call).
91
92
93'$lgt_call'(F, A1, A2, A3, A4, A5) :-
94    Call =.. [F, A1, A2, A3, A4, A5],
95    call(Call).
96
97
98'$lgt_call'(F, A1, A2, A3, A4, A5, A6) :-
99    Call =.. [F, A1, A2, A3, A4, A5, A6],
100    call(Call).
101
102
103'$lgt_call'(F, A1, A2, A3, A4, A5, A6, A7) :-
104    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
105    call(Call).
106
107
108% lgt_once/2-8
109%
110% if your compiler provides call/1-8 as built-in
111% predicates rewrite these definitions using call(...), !.
112
113'$lgt_once'(F, A) :-
114    Call =.. [F, A],
115    once(Call).
116
117
118'$lgt_once'(F, A1, A2) :-
119    Call =.. [F, A1, A2],
120    once(Call).
121
122
123'$lgt_once'(F, A1, A2, A3) :-
124    Call =.. [F, A1, A2, A3],
125    once(Call).
126
127
128'$lgt_once'(F, A1, A2, A3, A4) :-
129    Call =.. [F, A1, A2, A3, A4],
130    once(Call).
131
132
133'$lgt_once'(F, A1, A2, A3, A4, A5) :-
134    Call =.. [F, A1, A2, A3, A4, A5],
135    once(Call).
136
137
138'$lgt_once'(F, A1, A2, A3, A4, A5, A6) :-
139    Call =.. [F, A1, A2, A3, A4, A5, A6],
140    once(Call).
141
142
143'$lgt_once'(F, A1, A2, A3, A4, A5, A6, A7) :-
144    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
145    once(Call).
146
147
148
149%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150%
151%  Prolog built-in metapredicates
152%
153%  (excluding ISO Prolog Standard metapredicates)
154%
155%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156
157
158% '$lgt_pl_metapredicate'(?callable).
159
160'$lgt_pl_metapredicate'(call_cleanup(::, ::)).
161'$lgt_pl_metapredicate'(findall(*, ::, *, *)).
162'$lgt_pl_metapredicate'(freeze(*, ::)).
163'$lgt_pl_metapredicate'(on_exception(*, ::, ::)).
164'$lgt_pl_metapredicate'(undo(::)).
165'$lgt_pl_metapredicate'(when(*, ::)).
166
167
168
169%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170%
171%  file extension predicates
172%
173%  these extensions are used by Logtalk load/compile predicates
174%
175%  you may want to change the extension for Prolog files to match
176%  the one expected by your Prolog compiler
177%
178%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179
180
181% '$lgt_file_extension'(?atom, ?atom)
182
183'$lgt_file_extension'(metafile, '.mlgt').
184'$lgt_file_extension'(logtalk, '.lgt').
185'$lgt_file_extension'(prolog, '.pl').
186'$lgt_file_extension'(xml, '.xml').
187
188
189
190%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
191%
192%  default flag values
193%
194%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195
196
197% '$lgt_default_flag'(?atom, ?atom)
198%
199% default values for all flags
200
201'$lgt_default_flag'(iso_initialization_dir, true).
202
203'$lgt_default_flag'(xml, on).
204'$lgt_default_flag'(xsl, 'lgtxml.xsl').
205'$lgt_default_flag'(xmlspec, dtd).
206'$lgt_default_flag'(doctype, local).
207
208'$lgt_default_flag'(unknown, warning).
209'$lgt_default_flag'(misspelt, warning).
210'$lgt_default_flag'(singletons, warning).
211'$lgt_default_flag'(lgtredef, warning).
212'$lgt_default_flag'(plredef, silent).
213'$lgt_default_flag'(portability, silent).
214
215'$lgt_default_flag'(report, on).
216
217'$lgt_default_flag'(smart_compilation, off).
218
219'$lgt_default_flag'(startup_message, flags).
220
221'$lgt_default_flag'(underscore_vars, singletons).
222
223'$lgt_default_flag'(code_prefix, '').
224
225'$lgt_default_flag'(debug, off).
226'$lgt_default_flag'(supports_break_predicate, true).
227
228
229
230%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231%
232%  list predicates
233%
234%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
235
236
237'$lgt_append'([], List, List).
238'$lgt_append'([Head| Tail], List, [Head| Tail2]) :-
239    '$lgt_append'(Tail, List, Tail2).
240
241
242'$lgt_member'(Head, [Head| _]).
243'$lgt_member'(Head, [_| Tail]) :-
244    '$lgt_member'(Head, Tail).
245
246
247'$lgt_member_var'(V, [H| _]) :-
248    V == H.
249'$lgt_member_var'(V, [_| T]) :-
250    '$lgt_member_var'(V, T).
251
252
253'$lgt_proper_list'([]).
254'$lgt_proper_list'([_| List]) :-
255    '$lgt_proper_list'(List).
256
257
258'$lgt_reverse'(List, Reversed) :-
259    '$lgt_reverse'(List, [], Reversed, Reversed).
260
261'$lgt_reverse'([], Reversed, Reversed, []).
262'$lgt_reverse'([Head| Tail], List, Reversed, [_| Bound]) :-
263    '$lgt_reverse'(Tail, [Head| List], Reversed, Bound).
264
265
266
267%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268%
269%  file predicates
270%
271%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
272
273
274% '$lgt_file_exists'(+atom)
275%
276% see if a file exist in the current directory
277
278'$lgt_file_exists'(File) :-
279    file_exists(File).
280
281
282% '$lgt_load_prolog_code'(+atom)
283%
284% compile and load a Prolog file
285
286'$lgt_load_prolog_code'(File) :-
287    compile(File).
288
289
290% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
291%
292% compare file modification times
293
294'$lgt_compare_file_mtimes'(Result, File1, File2) :-
295    file_property(File1, mod_time(Time1)),
296    file_property(File2, mod_time(Time2)),
297    compare(Result, Time1, Time2).
298
299
300
301%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
302%
303%  sorting predicates
304%
305%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
306
307
308% '$lgt_keysort'(+list, -list)
309
310'$lgt_keysort'(List, Sorted) :-
311    keysort(List, Sorted).
312
313
314% '$lgt_sort'(+list, -list)
315
316'$lgt_sort'(List, Sorted) :-
317    sort(List, Sorted).
318
319
320
321%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322%
323%  time and date predicates
324%
325%  if your Prolog compiler does not provide access to the operating system
326%  time and date just write dummy definitions
327%
328%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
329
330
331% '$lgt_current_date'(?Year, ?Month, ?Day)
332
333'$lgt_current_date'(Year, Month, Day) :-
334    datime(datime(Year, Month, Day, _, _, _)).
335
336
337% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
338
339'$lgt_current_time'(Hours, Mins, Secs) :-
340    datime(datime(_, _, _, Hours, Mins, Secs)).
341
342
343
344%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345%
346%  timing predicate
347%
348%  if your Prolog compiler does not provide access to a timing predicate
349%  just write dummy definition
350%
351%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
352
353
354% '$lgt_cpu_time'(-Seconds)
355
356'$lgt_cpu_time'(Seconds) :-
357    statistics(runtime, [Miliseconds| _]),
358    Seconds is Miliseconds / 1000.
359
360
361
362%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
363%
364%  comparison predicate
365%
366%  the usual compare/3 definition
367%
368%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
369
370
371% compare(?atom, @term, @term) -- built-in
372
373
374
375%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
376%
377%  callable predicate
378%
379%  the usual callable/1 definition
380%
381%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
382
383
384% callable(@term) -- built-in
385
386
387
388%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
389%
390%  read character predicate
391%
392%  read a single character echoing it and writing a newline after
393%
394%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
395
396
397'$lgt_read_single_char'(Char) :-
398    get_char(Char).
399
400
401
402%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403%
404%  pretty print a term by naming its free variables
405%  (avoid instantiating variables in term by using double negation if necessary)
406%
407%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
408
409
410'$lgt_pretty_print_vars'(Stream, Term) :-
411    \+ \+ (
412        numbervars(Term, 0, _),
413        write_term(Stream, Term, [numbervars(true)])).
414
415
416'$lgt_pretty_print_vars_quoted'(Stream, Term) :-
417    \+ \+ (
418        numbervars(Term, 0, _),
419        write_term(Stream, Term, [numbervars(true), quoted(true)])).
420
421
422
423%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
424%
425%  end!
426%
427%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.