root/tags/lgt2212/configs/minerva.config

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