root/tags/lgt293/configs/b6.config

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