root/tags/lgt291/configs/amzi6.config

Revision 7, 6.9 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 Amzi! Prolog 6.1.21
7%
8%  last updated: March 3, 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
32% lgt_iso_predicate(?callable).
33
34lgt_iso_predicate(copy_term(_, _)).
35lgt_iso_predicate(read_term(_, _, _)).
36
37
38copy_term(Term, Copy) :-
39    asserta(lgt_copy_term_(Term)),
40    retract(lgt_copy_term_(Copy)).
41
42
43read_term(Stream, Term, [singletons([])]) :-
44    !,
45    read(Stream, Term).
46
47read_term(Stream, Term, _) :-
48    read(Stream, Term).
49
50
51
52%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53%
54%  predicate properties
55%
56%  this predicate must return at least static, dynamic and built_in
57%  properties for an existing predicate
58%
59%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60
61
62% lgt_predicate_property(+callable, ?predicate_property)
63
64lgt_predicate_property(Predicate, Property) :-
65    functor(Predicate, Functor, Arity),
66    predicate_property(Functor/Arity, Property).
67
68
69
70%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
71%
72%  metapredicates
73%
74%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75
76
77abort :-
78    abort(0).
79
80
81% forall(+callable, +callble)
82
83forall(Generate, Test) :-
84    \+ call((Generate, \+ call(Test))).
85
86
87% lgt_call/2-8
88%
89% use these definitions only if your compiler does
90% not provide call/1-8 as built-in predicates
91
92lgt_call(F, A) :-
93    Call =.. [F, A],
94    call(Call).
95
96
97lgt_call(F, A1, A2) :-
98    Call =.. [F, A1, A2],
99    call(Call).
100
101
102lgt_call(F, A1, A2, A3) :-
103    Call =.. [F, A1, A2, A3],
104    call(Call).
105
106
107lgt_call(F, A1, A2, A3, A4) :-
108    Call =.. [F, A1, A2, A3, A4],
109    call(Call).
110
111
112lgt_call(F, A1, A2, A3, A4, A5) :-
113    Call =.. [F, A1, A2, A3, A4, A5],
114    call(Call).
115
116
117lgt_call(F, A1, A2, A3, A4, A5, A6) :-
118    Call =.. [F, A1, A2, A3, A4, A5, A6],
119    call(Call).
120
121
122lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
123    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
124
125    call(Call).
126
127
128% lgt_once/2-8
129%
130% if your compiler provides call/1-8 as built-in
131% predicates rewrite these definitions using call(...), !.
132
133lgt_once(F, A) :-
134    Call =.. [F, A],
135    once(Call).
136
137
138lgt_once(F, A1, A2) :-
139    Call =.. [F, A1, A2],
140    once(Call).
141
142
143lgt_once(F, A1, A2, A3) :-
144    Call =.. [F, A1, A2, A3],
145    once(Call).
146
147
148lgt_once(F, A1, A2, A3, A4) :-
149    Call =.. [F, A1, A2, A3, A4],
150    once(Call).
151
152
153lgt_once(F, A1, A2, A3, A4, A5) :-
154    Call =.. [F, A1, A2, A3, A4, A5],
155    once(Call).
156
157
158lgt_once(F, A1, A2, A3, A4, A5, A6) :-
159    Call =.. [F, A1, A2, A3, A4, A5, A6],
160    once(Call).
161
162
163lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
164    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
165    once(Call).
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
183lgt_file_extension(logtalk, '.lgt').
184lgt_file_extension(prolog, '.pro').
185lgt_file_extension(xml, '.xml').
186
187
188
189%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190%
191%  default compiler options
192%
193%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194
195
196% lgt_default_compiler_option(?atom, ?atom)
197%
198% default values for all compiler options
199
200lgt_default_compiler_option(iso_initialization_dir, false).
201
202lgt_default_compiler_option(xml, on).
203lgt_default_compiler_option(xsl, 'lgtxml.xsl').
204
205lgt_default_compiler_option(unknown, warning).
206lgt_default_compiler_option(misspelt, warning).
207lgt_default_compiler_option(singletons, warning).
208lgt_default_compiler_option(lgtredef, warning).
209lgt_default_compiler_option(plredef, silent).
210
211lgt_default_compiler_option(report, on).
212
213
214
215%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216%
217%  list predicates
218%
219%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
220
221
222lgt_append([], List, List).
223lgt_append([Head| Tail], List, [Head| Tail2]) :-
224    lgt_append(Tail, List, Tail2).
225
226
227lgt_member(Head, [Head| _]).
228lgt_member(Head, [_| Tail]) :-
229    lgt_member(Head, Tail).
230
231
232lgt_member_var(V, [H| _]) :-
233    V == H.
234lgt_member_var(V, [_| T]) :-
235    lgt_member_var(V, T).
236
237
238lgt_proper_list([]).
239lgt_proper_list([_| List]) :-
240    lgt_proper_list(List).
241
242
243
244%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
245%
246%  file predicates
247%
248%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
249
250
251% lgt_file_exists(+atom)
252%
253% see if a file exist in the current directory
254
255lgt_file_exists(File) :-
256    file_exists(File).
257
258
259% lgt_load_prolog_code(+atom)
260%
261% compile and load a Prolog file
262
263lgt_load_prolog_code(File) :-
264    reconsult(File).
265
266
267
268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269%
270%  sorting predicates
271%
272%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
273
274
275% lgt_keysort(+list, -list)
276
277lgt_keysort(List, Sorted) :-
278    keysort(List, Sorted).
279
280
281% lgt_sort(+list, -list)
282
283lgt_sort(List, Sorted) :-
284    sort(List, Sorted).
285
286
287
288%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
289%
290%  time and date predicates
291%
292%  if your Prolog compiler does not provide access to the operating system
293%  time and date just write dummy definitions
294%
295%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
296
297
298% lgt_current_date(?Year, ?Month, ?Day)
299
300lgt_current_date(Year, Month, Day) :-
301    date(Month, Day, Year).
302
303
304% lgt_current_time(?Hours, ?Mins, ?Secs)
305
306lgt_current_time(Hours, Mins, Secs) :-
307    time(Hours, Mins, Secs).
308
309
310
311%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312%
313%  timing predicate
314%
315%  if your Prolog compiler does not provide access to a timing predicate
316%  just write dummy definition
317%
318%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319
320
321% lgt_cpu_time(-Seconds)
322
323
324lgt_cpu_time(Seconds) :-
325    Seconds is cputime.
326
327
328
329%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
330%
331%  comparison predicate
332%
333%  the usual compare/3 definition
334%
335%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
336
337
338% compare(Order, Term1, Term2) -- built-in
339
340
341
342%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343%
344%  end!
345%
346%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.