root/tags/lgt293/configs/amzi6.config

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

Changed comments about Logtalk flags.

  • 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.3
5%
6%  configuration file for Amzi! Prolog 6.1.21
7%
8%  last updated: December 30, 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 flag values
192%
193%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194
195
196% lgt_default_flag(?atom, ?atom)
197%
198% default values for all flags
199
200lgt_default_flag(iso_initialization_dir, false).
201
202lgt_default_flag(xml, on).
203lgt_default_flag(xsl, 'lgtxml.xsl').
204
205lgt_default_flag(unknown, warning).
206lgt_default_flag(misspelt, warning).
207lgt_default_flag(singletons, warning).
208lgt_default_flag(lgtredef, warning).
209lgt_default_flag(plredef, silent).
210lgt_default_flag(portability, silent).
211
212lgt_default_flag(report, on).
213
214
215
216%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217%
218%  list predicates
219%
220%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
221
222
223lgt_append([], List, List).
224lgt_append([Head| Tail], List, [Head| Tail2]) :-
225    lgt_append(Tail, List, Tail2).
226
227
228lgt_member(Head, [Head| _]).
229lgt_member(Head, [_| Tail]) :-
230    lgt_member(Head, Tail).
231
232
233lgt_member_var(V, [H| _]) :-
234    V == H.
235lgt_member_var(V, [_| T]) :-
236    lgt_member_var(V, T).
237
238
239lgt_proper_list([]).
240lgt_proper_list([_| List]) :-
241    lgt_proper_list(List).
242
243
244
245%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246%
247%  file predicates
248%
249%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
250
251
252% lgt_file_exists(+atom)
253%
254% see if a file exist in the current directory
255
256lgt_file_exists(File) :-
257    file_exists(File).
258
259
260% lgt_load_prolog_code(+atom)
261%
262% compile and load a Prolog file
263
264lgt_load_prolog_code(File) :-
265    reconsult(File).
266
267
268
269%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270%
271%  sorting predicates
272%
273%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274
275
276% lgt_keysort(+list, -list)
277
278lgt_keysort(List, Sorted) :-
279    keysort(List, Sorted).
280
281
282% lgt_sort(+list, -list)
283
284lgt_sort(List, Sorted) :-
285    sort(List, Sorted).
286
287
288
289%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290%
291%  time and date predicates
292%
293%  if your Prolog compiler does not provide access to the operating system
294%  time and date just write dummy definitions
295%
296%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
297
298
299% lgt_current_date(?Year, ?Month, ?Day)
300
301lgt_current_date(Year, Month, Day) :-
302    date(Month, Day, Year).
303
304
305% lgt_current_time(?Hours, ?Mins, ?Secs)
306
307lgt_current_time(Hours, Mins, Secs) :-
308    time(Hours, Mins, Secs).
309
310
311
312%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
313%
314%  timing predicate
315%
316%  if your Prolog compiler does not provide access to a timing predicate
317%  just write dummy definition
318%
319%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
320
321
322% lgt_cpu_time(-Seconds)
323
324
325lgt_cpu_time(Seconds) :-
326    Seconds is cputime.
327
328
329
330%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
331%
332%  comparison predicate
333%
334%  the usual compare/3 definition
335%
336%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
337
338
339% compare(Order, Term1, Term2) -- built-in
340
341
342
343%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
344%
345%  end!
346%
347%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.