root/tags/lgt2212/configs/b6.config

Revision 1540, 9.1 KB (checked in by pmoura, 4 years ago)

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