root/tags/lgt2210/configs/b5.config

Revision 1460, 9.0 KB (checked in by pmoura, 4 years ago)

Updated release number to 2.21.0.

  • 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.21.0
5%
6%  configuration file for B-Prolog 4.0, 5.0
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
27% '$lgt_iso_predicate'(?callable).
28
29'$lgt_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
46'$lgt_predicate_property'(Pred, dynamic) :-
47    predicate_property(Pred, interpreted).
48
49'$lgt_predicate_property'(Pred, static) :-
50    predicate_property(Pred, compiled).
51
52'$lgt_predicate_property'(Pred, built_in) :-
53    predicate_property(Pred, _),
54    functor(Pred, Functor, Arity),
55    predefined(Functor, Arity).
56
57'$lgt_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
80'$lgt_call'(F, A) :-
81    Call =.. [F, A],
82    call(Call).
83
84
85'$lgt_call'(F, A1, A2) :-
86    Call =.. [F, A1, A2],
87    call(Call).
88
89
90'$lgt_call'(F, A1, A2, A3) :-
91    Call =.. [F, A1, A2, A3],
92    call(Call).
93
94
95'$lgt_call'(F, A1, A2, A3, A4) :-
96    Call =.. [F, A1, A2, A3, A4],
97    call(Call).
98
99
100'$lgt_call'(F, A1, A2, A3, A4, A5) :-
101    Call =.. [F, A1, A2, A3, A4, A5],
102    call(Call).
103
104
105'$lgt_call'(F, A1, A2, A3, A4, A5, A6) :-
106    Call =.. [F, A1, A2, A3, A4, A5, A6],
107    call(Call).
108
109
110'$lgt_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
120'$lgt_once'(F, A) :-
121    Call =.. [F, A],
122    once(Call).
123
124
125'$lgt_once'(F, A1, A2) :-
126    Call =.. [F, A1, A2],
127    once(Call).
128
129
130'$lgt_once'(F, A1, A2, A3) :-
131    Call =.. [F, A1, A2, A3],
132    once(Call).
133
134
135'$lgt_once'(F, A1, A2, A3, A4) :-
136    Call =.. [F, A1, A2, A3, A4],
137    once(Call).
138
139
140'$lgt_once'(F, A1, A2, A3, A4, A5) :-
141    Call =.. [F, A1, A2, A3, A4, A5],
142    once(Call).
143
144
145'$lgt_once'(F, A1, A2, A3, A4, A5, A6) :-
146    Call =.. [F, A1, A2, A3, A4, A5, A6],
147    once(Call).
148
149
150'$lgt_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%  Prolog built-in metapredicates
159%
160%  (excluding ISO Prolog Standard metapredicates)
161%
162%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163
164
165% '$lgt_pl_metapredicate'(?callable).
166
167'$lgt_pl_metapredicate'(_) :-
168    fail.
169
170
171
172%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
173%
174%  file extension predicates
175%
176%  these extensions are used by Logtalk load/compile predicates
177%
178%  you may want to change the extension for Prolog files to match
179%  the one expected by your Prolog compiler
180%
181%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182
183
184% '$lgt_file_extension'(?atom, ?atom)
185
186'$lgt_file_extension'(metafile, '.mlgt').
187'$lgt_file_extension'(logtalk, '.lgt').
188'$lgt_file_extension'(prolog, '.pl').
189'$lgt_file_extension'(xml, '.xml').
190
191
192
193%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194%
195%  default flag values
196%
197%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
198
199
200% '$lgt_default_flag'(?atom, ?atom)
201%
202% default values for all flags
203
204'$lgt_default_flag'(iso_initialization_dir, true).
205
206'$lgt_default_flag'(xml, on).
207'$lgt_default_flag'(xsl, 'lgtxml.xsl').
208'$lgt_default_flag'(xmlspec, dtd).
209'$lgt_default_flag'(doctype, local).
210
211'$lgt_default_flag'(unknown, warning).
212'$lgt_default_flag'(misspelt, warning).
213'$lgt_default_flag'(singletons, warning).
214'$lgt_default_flag'(lgtredef, warning).
215'$lgt_default_flag'(plredef, silent).
216'$lgt_default_flag'(portability, silent).
217
218'$lgt_default_flag'(report, on).
219
220'$lgt_default_flag'(smart_compilation, off).
221
222'$lgt_default_flag'(startup_message, flags).
223
224'$lgt_default_flag'(underscore_vars, singletons).
225
226'$lgt_default_flag'(code_prefix, '').
227
228'$lgt_default_flag'(debug, off).
229'$lgt_default_flag'(supports_break_predicate, false).
230
231
232
233%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234%
235%  list predicates
236%
237%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238
239
240'$lgt_append'(List1, List2, List3) :-
241    append(List1, List2, List3).
242
243
244'$lgt_member'(Element, List) :-
245    member(Element, List).
246
247
248'$lgt_member_var'(V, [H| _]) :-
249    V == H.
250'$lgt_member_var'(V, [_| T]) :-
251    '$lgt_member_var'(V, T).
252
253
254'$lgt_proper_list'([]).
255'$lgt_proper_list'([_| List]) :-
256    '$lgt_proper_list'(List).
257
258
259'$lgt_reverse'(List, Reversed) :-
260    '$lgt_reverse'(List, [], Reversed, Reversed).
261
262'$lgt_reverse'([], Reversed, Reversed, []).
263'$lgt_reverse'([Head| Tail], List, Reversed, [_| Bound]) :-
264    '$lgt_reverse'(Tail, [Head| List], Reversed, Bound).
265
266
267
268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269%
270%  file predicates
271%
272%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
273
274
275% '$lgt_file_exists'(+atom)
276%
277% see if a file exist in the current directory
278
279'$lgt_file_exists'(File) :-
280    exists(File).
281
282
283% '$lgt_load_prolog_code'(+atom)
284%
285% compile and load a Prolog file
286
287'$lgt_load_prolog_code'(File) :-
288    compile(File),
289    load(File).
290
291
292% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
293%
294% compare file modification times
295
296'$lgt_compare_file_mtimes'(_, _, _) :-
297    fail.
298
299
300
301%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
302%
303%  sorting predicates
304%
305%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
306
307
308% '$lgt_keysort'(+list, -list)
309
310'$lgt_keysort'(List, Sorted) :-
311    keysort(List, Sorted).
312
313
314% '$lgt_sort'(+list, -list)
315
316'$lgt_sort'(List, Sorted) :-
317    sort(List, Sorted).
318
319
320
321%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322%
323%  time and date predicates
324%
325%  if your Prolog compiler does not provide access to the operating system
326%  time and date just write dummy definitions
327%
328%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
329
330
331% '$lgt_current_date'(?Year, ?Month, ?Day)
332
333'$lgt_current_date'(22, 11, 99).
334
335
336% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
337
338'$lgt_current_time'(0, 0, 0).
339
340
341
342%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343%
344%  timing predicate
345%
346%  if your Prolog compiler does not provide access to a timing predicate
347%  just write dummy definition
348%
349%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350
351
352% '$lgt_cpu_time'(-Seconds)
353
354'$lgt_cpu_time'(Seconds) :-
355    cputime(Miliseconds),
356    Seconds is Miliseconds / 1000 .
357
358
359
360%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
361%
362%  comparison predicate
363%
364%  the usual compare/3 definition
365%
366%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367
368
369% compare(?atom, @term, @term) -- built-in
370
371
372
373%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
374%
375%  callable predicate
376%
377%  the usual callable/1 definition
378%
379%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
380
381
382% callable(@term)
383
384callable(Term) :-
385    once((atom(Term); compound(Term))).
386
387
388
389%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390%
391%  read character predicate
392%
393%  read a single character echoing it and writing a newline after
394%
395%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
396
397
398'$lgt_read_single_char'(Char) :-
399    get_char(Char).
400
401
402
403%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404%
405%  pretty print a term by naming its free variables
406%  (avoid instantiating variables in term by using double negation if necessary)
407%
408%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
409
410
411'$lgt_pretty_print_vars'(Stream, Term) :-
412    \+ \+ (numbervars(Term, 0, _), write(Stream, Term)).
413
414
415'$lgt_pretty_print_vars_quoted'(Stream, Term) :-
416    \+ \+ (numbervars(Term, 0, _), writeq(Stream, Term)).
417
418
419
420%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
421%
422%  end!
423%
424%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.