root/tags/lgt2202/configs/amzi.config

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

Updated Logtalk release number to 2.20.2.

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