root/tags/lgt291/configs/als.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 ALS Prolog 3.1
7%
8%  last updated: August 24, 2000
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(abolish(_)).
34lgt_iso_predicate(current_predicate(_)).
35lgt_iso_predicate(once(_)).
36
37
38abolish(Functor/Arity) :-
39    abolish(Functor, Arity).
40
41
42current_predicate(Functor/Arity) :-
43    procedures(_, Functor, Arity, _).   
44
45
46once(Goal) :-
47    call(Goal),
48    !.
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(Pred, built_in) :-
65    functor(Pred, Functor, Arity),
66    all_procedures(Module, Functor, Arity, _),
67    once((Module = builtins; Module = sio)).
68
69lgt_predicate_property(Pred, dynamic) :-
70    procedures(_, Functor, Arity, _).   
71
72
73lgt_predicate_property(Pred, static) :-
74    lgt_predicate_property(Pred, built_in).
75
76
77
78%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79%
80%  metapredicates
81%
82%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
83
84
85% forall(+callable, +callble)
86
87forall(Generate, Test) :-
88    \+ call((Generate, \+ call(Test))).
89
90
91% retractall(+callable).
92
93retractall(Head) :-
94    retract((Head:-_)),
95    fail.
96
97retractall(Head) :-
98    retract(Head),
99    fail.
100
101retractall(_).
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
109lgt_call(F, A) :-
110    Call =.. [F, A],
111    call(Call).
112
113
114lgt_call(F, A1, A2) :-
115    Call =.. [F, A1, A2],
116    call(Call).
117
118
119lgt_call(F, A1, A2, A3) :-
120    Call =.. [F, A1, A2, A3],
121    call(Call).
122
123
124lgt_call(F, A1, A2, A3, A4) :-
125    Call =.. [F, A1, A2, A3, A4],
126    call(Call).
127
128
129lgt_call(F, A1, A2, A3, A4, A5) :-
130    Call =.. [F, A1, A2, A3, A4, A5],
131    call(Call).
132
133
134lgt_call(F, A1, A2, A3, A4, A5, A6) :-
135    Call =.. [F, A1, A2, A3, A4, A5, A6],
136    call(Call).
137
138
139lgt_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
149lgt_once(F, A) :-
150    Call =.. [F, A],
151    once(Call).
152
153
154lgt_once(F, A1, A2) :-
155    Call =.. [F, A1, A2],
156    once(Call).
157
158
159lgt_once(F, A1, A2, A3) :-
160    Call =.. [F, A1, A2, A3],
161    once(Call).
162
163
164lgt_once(F, A1, A2, A3, A4) :-
165    Call =.. [F, A1, A2, A3, A4],
166    once(Call).
167
168
169lgt_once(F, A1, A2, A3, A4, A5) :-
170    Call =.. [F, A1, A2, A3, A4, A5],
171    once(Call).
172
173
174lgt_once(F, A1, A2, A3, A4, A5, A6) :-
175    Call =.. [F, A1, A2, A3, A4, A5, A6],
176    once(Call).
177
178
179lgt_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%  file extension predicate
188%
189%  these extensions are used by Logtalk load/compile predicates
190%
191%  you may want to change the extension for Prolog files to match
192%  the one expected by your Prolog compiler
193%
194%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195
196
197% lgt_file_extension(?atom, ?atom)
198
199lgt_file_extension(logtalk, '.lgt').
200lgt_file_extension(prolog, '.pro').
201lgt_file_extension(xml, '.xml').
202
203
204
205%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
206%
207%  default compiler options
208%
209%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210
211
212% lgt_default_compiler_option(?atom, ?atom)
213%
214% default values for all compiler options
215
216lgt_default_compiler_option(iso_initialization_dir, false).
217
218lgt_default_compiler_option(xml, on).
219lgt_default_compiler_option(xsl, 'lgtxml.xsl').
220
221lgt_default_compiler_option(unknown, warning).
222lgt_default_compiler_option(misspelt, warning).
223lgt_default_compiler_option(singletons, warning).
224lgt_default_compiler_option(lgtredef, warning).
225lgt_default_compiler_option(plredef, silent).
226
227lgt_default_compiler_option(report, on).
228
229
230
231%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
232%
233%  list predicates
234%
235%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236
237
238lgt_append([], List, List).
239lgt_append([Head| Tail], List, [Head| Tail2]) :-
240    lgt_append(Tail, List, Tail2).
241
242
243lgt_member(Head, [Head| _]).
244lgt_member(Head, [_| Tail]) :-
245    lgt_member(Head, Tail).
246
247
248lgt_member_var(V, [H| _]) :-
249    V == H.
250lgt_member_var(V, [_| T]) :-
251    lgt_member_var(V, T).
252
253
254lgt_proper_list([]).
255lgt_proper_list([_| List]) :-
256    lgt_proper_list(List).
257
258
259
260%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261%
262%  file predicates
263%
264%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265
266
267% lgt_file_exists(+atom)
268%
269% see if a file exist in the current directory
270
271lgt_file_exists(File) :-
272    exists_file(File).
273
274
275% lgt_load_prolog_code(+atom)
276%
277% compile and load a Prolog file
278
279lgt_load_prolog_code(File) :-
280    reconsult(File).
281
282
283
284%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
285%
286%  sorting predicates
287%
288%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
289
290
291% lgt_keysort(+list, -list)
292
293lgt_keysort(List, Sorted) :-
294    keysort(List, Sorted).
295
296
297% lgt_sort( +List, -Sorted )
298
299lgt_sort(List, Sorted) :-
300    sort(List, Sorted).
301
302
303
304%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305%
306%  time and date predicates
307%
308%  if your Prolog compiler does not provide access to the operating system
309%  time and date just write dummy definitions
310%
311%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312
313
314% lgt_current_date(?Year, ?Month, ?Day)
315
316lgt_current_date(Year, Month, Day) :-
317    date(Year/Month/Day).
318
319
320% lgt_current_time(?Hours, ?Mins, ?Secs)
321
322lgt_current_time(Hours, Mins, Secs) :-
323    time(Hours:Mins:Secs).
324
325
326
327%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328%
329%  timing predicate
330%
331%  if your Prolog compiler does not provide access to a timing predicate
332%  just write dummy definition
333%
334%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
335
336
337% lgt_cpu_time(-Seconds)
338
339lgt_cpu_time(Seconds) :-
340    Seconds is cputime.
341
342
343
344%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345%
346%  comparison predicate
347%
348%  the usual compare/3 definition
349%
350%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351
352
353% compare(?atom, @term, @term) -- built-in
354
355
356
357%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
358%
359%  end!
360%
361%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.