root/tags/lgt2210/configs/swi.config

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

Updated release number to 2.21.0.

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