root/tags/lgt291/configs/xsb.config

Revision 7, 7.2 KB (checked in by pmoura, 7 years ago)

Corrected compiler bug in the error checking code of directives info/1 and info/2.
Change the "mi" example objects loading order to avoid some "unknown entity" warnings.

  • 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.9.1
5%
6%  configuration file for XSB 2.3
7%
8%  last updated: February 24, 2001
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13
14
15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
16%
17%  ISO Prolog Standard predicates that we must define because they are
18%  not built-in
19%
20%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
21%  we must define; there must be at least one clause for this predicate
22%  whose call should fail if we don't define any ISO predicates
23%
24%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
26
27initialization(Goal) :-
28    call(Goal).
29
30
31% lgt_iso_predicate(?callable).
32
33lgt_iso_predicate(atom_concat(_, _, _)).
34lgt_iso_predicate(read_term(_, _, _)).
35lgt_iso_predicate(write_term(_, _, _)).
36
37
38atom_concat(Atom1, Atom2, Atom3) :-
39    nonvar(Atom1), nonvar(Atom2),
40    !,
41    atom_codes(Atom1, Codes1),
42    atom_codes(Atom2, Codes2),
43    lgt_append(Codes1, Codes2, Codes3),
44    atom_codes(Atom3, Codes3).
45
46atom_concat(Atom1, Atom2, Atom3) :-
47    nonvar(Atom3),
48    !,
49    atom_codes(Atom3, Codes3),
50    lgt_append(Codes1, Codes2, Codes3),
51    atom_codes(Atom1, Codes1),
52    atom_codes(Atom2, Codes2).
53
54
55read_term(Stream, Term, [singletons([])]) :-
56    !,
57    read(Stream, Term).
58
59read_term(Stream, Term, _) :-
60    read(Stream, Term).
61
62
63write_term(Stream, Term, [quoted(true)]) :-
64    !,
65    writeq(Stream, Term).
66
67write_term(Stream, Term, _) :-
68    write(Stream, Term).
69
70
71
72%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73%
74%  predicate properties
75%
76%  this predicate must return at least static, dynamic and built_in
77%  properties for an existing predicate
78%
79%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
80
81
82% lgt_predicate_property(+callable, ?predicate_property)
83
84lgt_predicate_property(Pred, Prop) :-
85    predicate_property(Pred, Prop).
86
87
88
89%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
90%
91%  Logtalk specific predicates
92%
93%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94
95
96% forall(+Generate, +Test)
97
98forall(Generate, Test) :-
99    \+ call((Generate, \+ call(Test))).
100
101
102% lgt_call/2-8
103%
104% use these definitions only if your compiler does
105% not provide call/1-8 as built-in predicates
106
107lgt_call(F, A) :-
108    Call =.. [F, A],
109    call(Call).
110
111
112lgt_call(F, A1, A2) :-
113    Call =.. [F, A1, A2],
114    call(Call).
115
116
117lgt_call(F, A1, A2, A3) :-
118    Call =.. [F, A1, A2, A3],
119    call(Call).
120
121
122lgt_call(F, A1, A2, A3, A4) :-
123    Call =.. [F, A1, A2, A3, A4],
124    call(Call).
125
126
127lgt_call(F, A1, A2, A3, A4, A5) :-
128    Call =.. [F, A1, A2, A3, A4, A5],
129    call(Call).
130
131
132lgt_call(F, A1, A2, A3, A4, A5, A6) :-
133    Call =.. [F, A1, A2, A3, A4, A5, A6],
134    call(Call).
135
136
137lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
138    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
139    call(Call).
140
141
142% lgt_once/2-8
143%
144% if your compiler provides call/1-8 as built-in
145% predicates rewrite these definitions using call(...), !.
146
147lgt_once(F, A) :-
148    Call =.. [F, A],
149    once(Call).
150
151
152lgt_once(F, A1, A2) :-
153    Call =.. [F, A1, A2],
154    once(Call).
155
156
157lgt_once(F, A1, A2, A3) :-
158    Call =.. [F, A1, A2, A3],
159    once(Call).
160
161
162lgt_once(F, A1, A2, A3, A4) :-
163    Call =.. [F, A1, A2, A3, A4],
164    once(Call).
165
166
167lgt_once(F, A1, A2, A3, A4, A5) :-
168    Call =.. [F, A1, A2, A3, A4, A5],
169    once(Call).
170
171
172lgt_once(F, A1, A2, A3, A4, A5, A6) :-
173    Call =.. [F, A1, A2, A3, A4, A5, A6],
174    once(Call).
175
176
177lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
178    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
179    once(Call).
180
181
182
183%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
184%
185%  file extension predicates
186%
187%  these extensions are used by Logtalk load/compile predicates
188%
189%  you may want to change the extension for Prolog files to match
190%  the one expected by your Prolog compiler
191%
192%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193
194
195% lgt_file_extension(?atom, ?atom)
196
197lgt_file_extension(logtalk, '.lgt').
198lgt_file_extension(prolog, '.P').
199lgt_file_extension(xml, '.xml').
200
201
202
203%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
204%
205%  default compiler options
206%
207%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208
209
210% lgt_default_compiler_option(?atom, ?atom)
211%
212% default values for all compiler options
213
214lgt_default_compiler_option(iso_initialization_dir, false).
215
216lgt_default_compiler_option(xml, on).
217lgt_default_compiler_option(xsl, 'lgtxml.xsl').
218
219lgt_default_compiler_option(unknown, warning).
220lgt_default_compiler_option(misspelt, warning).
221lgt_default_compiler_option(singletons, warning).
222lgt_default_compiler_option(lgtredef, warning).
223lgt_default_compiler_option(plredef, silent).
224
225lgt_default_compiler_option(report, on).
226
227
228
229%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
230%
231%  list predicates
232%
233%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234
235
236lgt_append([], List, List).
237lgt_append([Head| Tail], List, [Head| Tail2]) :-
238    lgt_append(Tail, List, Tail2).
239
240
241lgt_member(Head, [Head| _]).
242lgt_member(Head, [_| Tail]) :-
243    lgt_member(Head, Tail).
244
245
246lgt_member_var(V, [H| _]) :-
247    V == H.
248lgt_member_var(V, [_| T]) :-
249    lgt_member_var(V, T).
250
251
252lgt_proper_list([]).
253lgt_proper_list([_| List]) :-
254    lgt_proper_list(List).
255
256
257
258%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
259%
260%  file predicates
261%
262%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263
264
265% lgt_file_exists(+atom)
266%
267% see if a file exist in the current directory
268
269lgt_file_exists(File) :-
270    file_exists(File).
271
272
273% lgt_load_prolog_code(+atom)
274%
275% compile and load a Prolog file
276
277lgt_load_prolog_code(File) :-
278    reconsult(File).
279
280
281
282%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283%
284%  sorting predicates
285%
286%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
287
288
289% lgt_keysort(+list, -list)
290
291lgt_keysort(List, Sorted) :-
292    keysort(List, Sorted).
293
294
295% lgt_sort(+list, -list)
296
297lgt_sort(List, Sorted) :-
298    sort(List, Sorted).
299
300
301
302%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
303%
304%  time and date predicates
305%
306%  if your Prolog compiler does not provide access to the operating system
307%  time and date just write dummy definitions
308%
309%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
310
311
312% lgt_current_date(?Year, ?Month, ?Day)
313
314lgt_current_date(2001, 2, 24).
315
316
317% lgt_current_time(?Hours, ?Mins, ?Secs)
318
319lgt_current_time(0, 0, 0).
320
321
322
323%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
324%
325%  timing predicate
326%
327%  if your Prolog compiler does not provide access to a timing predicate
328%  just write dummy definition
329%
330%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
331
332
333% lgt_cpu_time(-Seconds)
334
335lgt_cpu_time(Seconds) :-
336    cputime(Seconds).
337
338
339
340%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341%
342%  comparison predicate
343%
344%  the usual compare/3 definition
345%
346%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347
348
349% compare(?atom, @term, @term) -- built-in
350
351
352
353%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354%
355%  end!
356%
357%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.