root/tags/lgt2311/configs/minerva.config

Revision 3986, 10.6 KB (checked in by pmoura, 13 months ago)

Updated the release number to 2.31.1.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3%  Logtalk - Open source object-oriented logic programming language
4%  Release 2.31.1
5%
6%  configuration file for Minerva 2.4
7%
8%  last updated: October 24, 2007
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%  meta-predicates
58%
59%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60
61
62% call_cleanup(+callable, +callble)
63
64call_cleanup(_, _) :-
65    throw(not_supported(call_cleanup/2)).
66
67
68% forall(+callable, +callble) -- built-in
69
70forall(Generate, Test) :-
71    \+ (call(Generate), \+ call(Test)).
72
73
74% retractall(+callable) -- built-in
75
76
77% call_with_args/2-9
78%
79% use these definitions only if your compiler does
80% not provide call_with_args/2-9 as built-in predicates
81
82call_with_args(F, A) :-
83    Call =.. [F, A],
84    call(Call).
85
86call_with_args(F, A1, A2) :-
87    Call =.. [F, A1, A2],
88    call(Call).
89
90call_with_args(F, A1, A2, A3) :-
91    Call =.. [F, A1, A2, A3],
92    call(Call).
93
94call_with_args(F, A1, A2, A3, A4) :-
95    Call =.. [F, A1, A2, A3, A4],
96    call(Call).
97
98call_with_args(F, A1, A2, A3, A4, A5) :-
99    Call =.. [F, A1, A2, A3, A4, A5],
100    call(Call).
101
102call_with_args(F, A1, A2, A3, A4, A5, A6) :-
103    Call =.. [F, A1, A2, A3, A4, A5, A6],
104    call(Call).
105
106call_with_args(F, A1, A2, A3, A4, A5, A6, A7) :-
107    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
108    call(Call).
109
110call_with_args(F, A1, A2, A3, A4, A5, A6, A7, A8) :-
111    Call =.. [F, A1, A2, A3, A4, A5, A6, A7, A8],
112    call(Call).
113
114
115
116%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117%
118%  Prolog built-in meta-predicates
119%
120%  (excluding ISO Prolog Standard meta-predicates)
121%
122%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
123
124
125% '$lgt_pl_meta_predicate'(?callable).
126
127'$lgt_pl_meta_predicate'(_) :-
128    fail.
129
130
131
132%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
133%
134%  file extension predicates
135%
136%  these extensions are used by Logtalk load/compile predicates
137%
138%  you may want to change the extension for Prolog files to match
139%  the one expected by your Prolog compiler
140%
141%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
142
143
144% '$lgt_file_extension'(?atom, ?atom)
145
146'$lgt_file_extension'(logtalk, '.lgt').
147'$lgt_file_extension'(prolog, '.min').
148'$lgt_file_extension'(xml, '.xml').
149
150
151
152%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
153%
154%  default flag values
155%
156%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
157
158
159% '$lgt_default_flag'(?atom, ?atom)
160%
161% default values for all flags
162
163'$lgt_default_flag'(xmldocs, on).
164'$lgt_default_flag'(xslfile, 'lgtxml.xsl').
165'$lgt_default_flag'(xmlspec, dtd).
166'$lgt_default_flag'(xmlsref, local).
167
168'$lgt_default_flag'(unknown, warning).
169'$lgt_default_flag'(misspelt, warning).
170'$lgt_default_flag'(singletons, warning).
171'$lgt_default_flag'(lgtredef, warning).
172'$lgt_default_flag'(plredef, silent).
173'$lgt_default_flag'(portability, silent).
174
175'$lgt_default_flag'(report, on).
176
177'$lgt_default_flag'(smart_compilation, off).
178'$lgt_default_flag'(reload, always).
179
180'$lgt_default_flag'(startup_message, flags(verbose)).
181
182'$lgt_default_flag'(underscore_variables, singletons).
183
184'$lgt_default_flag'(code_prefix, '').
185
186'$lgt_default_flag'(debug, off).
187'$lgt_default_flag'(break_predicate, true).
188
189'$lgt_default_flag'(events, off).
190
191'$lgt_default_flag'(altdirs, off).
192'$lgt_default_flag'(tmpdir, 'lgt_tmp/').
193'$lgt_default_flag'(xmldir, 'xml_docs/').
194
195'$lgt_default_flag'(encoding_directive, unsupported).
196'$lgt_default_flag'(threads, unsupported).
197
198'$lgt_default_flag'(context_switching_calls, allow).
199
200
201
202%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
203%
204%  list predicates
205%
206%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
207
208
209'$lgt_append'(List1, List2, List3) :-
210    append(List1, List2, List3).
211
212
213'$lgt_member'(Term, List) :-
214    member(Term, List).
215
216
217'$lgt_member_var'(V, [H| _]) :-
218    V == H.
219'$lgt_member_var'(V, [_| T]) :-
220    '$lgt_member_var'(V, T).
221
222
223'$lgt_is_list'([]) :-
224    !.
225'$lgt_is_list'([_| Tail]) :-
226    '$lgt_is_list'(Tail).
227
228
229'$lgt_is_proper_list'(List) :-
230    List == [], !.
231'$lgt_is_proper_list'([_| Tail]) :-
232    nonvar(Tail),
233    '$lgt_is_proper_list'(Tail).
234
235
236
237%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238%
239%  file predicates
240%
241%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
242
243
244% '$lgt_file_exists'(+atom)
245%
246% see if a file exist in the current directory
247
248:- java_predicates('java.io.File',
249    [fileCreate = 'File'(string),
250     fileCanRead = canRead,
251     fileLastModified = lastModified]).
252
253'$lgt_file_exists'(Path) :-
254    fileCreate(Path, File),
255    fileCanRead(File).
256
257
258% '$lgt_directory_exists'(+atom)
259%
260% checks if a directory exists
261
262'$lgt_directory_exists'(Directory) :-
263    ?????
264
265
266% '$lgt_change_directory'(+atom)
267%
268% changes current working directory
269
270'$lgt_change_directory'(Directory) :-
271    ?????
272
273
274% '$lgt_make_directory'(+atom)
275%
276% makes a new directory; succeeds if the directory already exists
277
278'$lgt_make_directory'(_) :-
279    throw(not_supported('$lgt_make_directory'/1)).
280
281
282% '$lgt_load_prolog_code'(+atom, +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    nonvar(Term),
391    functor(Term, Functor, _),
392    atom(Functor).
393
394
395
396%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
397%
398%  read character predicate
399%
400%  read a single character echoing it and writing a newline after
401%
402%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403
404
405'$lgt_read_single_char'(Char) :-
406    get_char(Char),
407    (   peek_code(10) ->    % hack to workaround the lack of built-in
408        get_code(_)         % support for unbuffered character input
409    ;   true
410    ).
411
412
413
414%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
415%
416%  pretty print a term by naming its free variables
417%  (avoid instantiating variables in term by using double negation if necessary)
418%
419%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
420
421
422'$lgt_pretty_print_vars'(Stream, Term) :-
423    write_term(Stream, Term, [numbervars(true)]).
424
425
426'$lgt_pretty_print_vars_quoted'(Stream, Term) :-
427    write_term(Stream, Term, [numbervars(true), quoted(true)]).
428
429
430
431%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
432%
433%  getting stream current line number
434%  (needed for improved compiler error messages)
435%
436%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
437
438
439% '$lgt_stream_current_line_number'(@stream, -integer)
440
441'$lgt_stream_current_line_number'(_, _) :-
442    fail.
443
444
445
446%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
447%
448%  handling of Prolog-proprietary directives on Logtalk source files
449%
450%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
451
452
453% '$lgt_ignore_pl_directive'(@callable)
454
455'$lgt_ignore_pl_directive'(_) :-
456    fail.
457
458
459% '$lgt_rewrite_and_copy_pl_directive'(@callable, -callable)
460
461'$lgt_rewrite_and_copy_pl_directive'(_, _) :-
462    fail.
463
464
465% '$lgt_rewrite_and_recompile_pl_directive'(@callable, -callable)
466
467'$lgt_rewrite_and_recompile_pl_directive'(_, _) :-
468    fail.
469
470
471
472%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
473%
474%  Shortcut to the Logtalk built-in predicate logtalk_load/1
475%
476%  defined in the config files in order to be able to comment it out in case
477%  of conflict with some Prolog native feature; it implies conformance with
478%  the ISO Prolog standard regarding the definition of the {}/1 syntax
479%
480%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
481
482{File, Files} :-
483    !,
484    logtalk_load(File),
485    {Files}.
486{File} :-
487    logtalk_load(File).
488
489
490
491%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
492%
493%  end!
494%
495%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.