root/tags/lgt2210/configs/xsb.config

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