root/tags/lgt2311/configs/qu.config

Revision 3986, 11.2 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 Qu-Prolog 8.1
7%
8%  last updated: October 24, 2007
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
28% '$lgt_iso_predicate'(?callable).
29
30'$lgt_iso_predicate'(_) :-
31    fail.
32
33
34
35%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36%
37%  predicate properties
38%
39%  this predicate must return at least static, dynamic, and built_in
40%  properties for an existing predicate
41%
42%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
44
45% '$lgt_predicate_property'(+callable, ?predicate_property)
46
47'$lgt_predicate_property'(Pred, Prop) :-
48    predicate_property(Pred, Prop).
49
50
51
52%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53%
54%  meta-predicates
55%
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
58
59% call_cleanup(+callable, +callble) -- built-in
60
61
62% forall(+callable, +callble) -- built-in
63
64
65% retractall(+callable) -- built-in
66
67
68% call_with_args/2-9
69%
70% use these definitions only if your compiler does
71% not provide call_with_args/2-9 as built-in predicates
72
73call_with_args(F, A) :-
74    call_predicate(F(A)).
75
76call_with_args(F, A1, A2) :-
77    call_predicate(F(A1, A2)).
78
79call_with_args(F, A1, A2, A3) :-
80    call_predicate(F(A1, A2, A3)).
81
82call_with_args(F, A1, A2, A3, A4) :-
83    call_predicate(F(A1, A2, A3, A4)).
84
85call_with_args(F, A1, A2, A3, A4, A5) :-
86    call_predicate(F(A1, A2, A3, A4, A5)).
87
88call_with_args(F, A1, A2, A3, A4, A5, A6) :-
89    call_predicate(F(A1, A2, A3, A4, A5, A6)).
90
91call_with_args(F, A1, A2, A3, A4, A5, A6, A7) :-
92    call_predicate(F(A1, A2, A3, A4, A5, A6, A7)).
93
94call_with_args(F, A1, A2, A3, A4, A5, A6, A7, A8) :-
95    call_predicate(F(A1, A2, A3, A4, A5, A6, A7, A8)).
96
97
98
99%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100%
101%  Prolog built-in meta-predicates
102%
103%  (excluding ISO Prolog Standard meta-predicates)
104%
105%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
106
107
108% '$lgt_pl_meta_predicate'(?callable).
109
110'$lgt_pl_meta_predicate'(call_cleanup(::, ::)).
111'$lgt_pl_meta_predicate'(delay(*, ::)).
112'$lgt_pl_meta_predicate'(delay_until(*, ::)).
113'$lgt_pl_meta_predicate'(message_choice(::)).
114'$lgt_pl_meta_predicate'(retry_woken_delays(::)).
115'$lgt_pl_meta_predicate'(thread_fork(*, ::)).
116'$lgt_pl_meta_predicate'(thread_fork(*, ::, *)).
117'$lgt_pl_meta_predicate'(thread_push_goal(*, ::)).
118'$lgt_pl_meta_predicate'(thread_atomic_goal(::)).
119'$lgt_pl_meta_predicate'(unwind_protect(::, ::)).
120'$lgt_pl_meta_predicate'(thread_wait_on_goal(::)).
121'$lgt_pl_meta_predicate'(thread_wait_on_goal(::, *)).
122'$lgt_pl_meta_predicate'('??'(*, ::)).
123
124
125
126%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
127%
128%  file extension predicates
129%
130%  these extensions are used by Logtalk load/compile predicates
131%
132%  you may want to change the extension for Prolog files to match
133%  the one expected by your Prolog compiler
134%
135%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136
137
138% '$lgt_file_extension'(?atom, ?atom)
139
140'$lgt_file_extension'(logtalk, '.lgt').
141'$lgt_file_extension'(prolog, '.ql').
142'$lgt_file_extension'(xml, '.xml').
143
144
145
146%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
147%
148%  default flag values
149%
150%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
151
152
153% '$lgt_default_flag'(?atom, ?atom)
154%
155% default values for all flags
156
157'$lgt_default_flag'(xmldocs, on).
158'$lgt_default_flag'(xslfile, 'lgtxml.xsl').
159'$lgt_default_flag'(xmlspec, dtd).
160'$lgt_default_flag'(xmlsref, local).
161
162'$lgt_default_flag'(unknown, warning).
163'$lgt_default_flag'(misspelt, warning).
164'$lgt_default_flag'(singletons, warning).
165'$lgt_default_flag'(lgtredef, warning).
166'$lgt_default_flag'(plredef, silent).
167'$lgt_default_flag'(portability, silent).
168
169'$lgt_default_flag'(report, on).
170
171'$lgt_default_flag'(smart_compilation, off).
172'$lgt_default_flag'(reload, always).
173
174'$lgt_default_flag'(startup_message, flags(verbose)).
175
176'$lgt_default_flag'(underscore_variables, singletons).
177
178'$lgt_default_flag'(code_prefix, '').
179
180'$lgt_default_flag'(debug, off).
181'$lgt_default_flag'(break_predicate, true).
182
183'$lgt_default_flag'(events, off).
184
185'$lgt_default_flag'(altdirs, off).
186'$lgt_default_flag'(tmpdir, 'lgt_tmp/').
187'$lgt_default_flag'(xmldir, 'xml_docs/').
188
189'$lgt_default_flag'(encoding_directive, unsupported).
190'$lgt_default_flag'(threads, unsupported).
191
192'$lgt_default_flag'(context_switching_calls, allow).
193
194
195
196%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
197%
198%  list predicates
199%
200%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201
202
203'$lgt_append'(List1, List2, List3) :-
204    append(List1, List2, List3).
205
206
207'$lgt_member'(Term, List) :-
208    member(Term, List).
209
210
211'$lgt_member_var'(Term, List) :-
212    member_eq(Term, List).
213
214
215'$lgt_is_list'([]) :-
216    !.
217'$lgt_is_list'([_| Tail]) :-
218    '$lgt_is_list'(Tail).
219
220
221'$lgt_is_proper_list'(List) :-
222    List == [], !.
223'$lgt_is_proper_list'([_| Tail]) :-
224    nonvar(Tail),
225    '$lgt_is_proper_list'(Tail).
226
227
228
229%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
230%
231%  file predicates
232%
233%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234
235
236% '$lgt_file_exists'(+atom)
237%
238% see if a file exist in the current directory
239
240'$lgt_file_exists'(File) :-
241    access(File, 4, 0).
242
243
244% '$lgt_directory_exists'(+atom)
245%
246% checks if a directory exists
247
248'$lgt_directory_exists'(Directory) :-
249    access(Directory, 4, 0).
250
251
252% '$lgt_current_directory'(-atom)
253%
254% gets current working directory
255
256'$lgt_current_directory'(Directory) :-
257    getcwd(Directory).
258
259
260% '$lgt_change_directory'(+atom)
261%
262% changes current working directory
263
264'$lgt_change_directory'(Directory) :-
265    chdir(Directory).
266
267
268% '$lgt_make_directory'(+atom)
269%
270% makes a new directory; succeeds if the directory already exists
271
272'$lgt_make_directory'(Directory) :-
273    (   access(Directory, 4, 0) ->
274        true
275    ;   atom_concat('mkdir ', Directory, Command),
276        os(system(Command))
277    ).
278
279
280% '$lgt_load_prolog_code'(+atom, +atom)
281%
282% compile and load a Prolog file
283
284'$lgt_load_prolog_code'(File, _) :-
285    '$lgt_file_extension'(prolog, Extension),
286    atom_concat(Name, Extension, File),
287    fcompile(File, [assemble_only(true)]),
288    load(Name).
289
290
291% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
292%
293% compare file modification times
294
295'$lgt_compare_file_mtimes'(_, _, _) :-
296    fail.
297
298
299
300%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
301%
302%  sorting predicates
303%
304%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305
306
307% '$lgt_keysort'(+list, -list)
308
309'$lgt_keysort'(_, _) :-
310    throw(error(not_implemented, keysort/2)).
311
312
313% '$lgt_sort'(+list, -list)
314
315'$lgt_sort'(List, Sorted) :-
316    sort(List, Sorted).
317
318
319
320%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
321%
322%  time and date predicates
323%
324%  if your Prolog compiler does not provide access to the operating system
325%  time and date just write dummy definitions
326%
327%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328
329
330% '$lgt_current_date'(?Year, ?Month, ?Day)
331
332'$lgt_current_date'(Year, Month, Day) :-
333    realtime(Time),
334    gmtime(Time, gmt_time(Year2, Month2, Day, _, _, _)),
335    Year is 1900 + Year2,
336    Month is Month2 + 1.
337
338
339% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
340
341'$lgt_current_time'(Hours, Mins, Secs) :-
342    realtime(Time),
343    gmtime(Time, gmt_time(_, _, _, Hours, Mins, Secs)).
344
345
346
347%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
348%
349%  timing predicate
350%
351%  if your Prolog compiler does not provide access to a timing predicate
352%  just write dummy definition
353%
354%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355
356
357% '$lgt_cpu_time'(-Seconds)
358
359'$lgt_cpu_time'(Seconds) :-
360    statistics(runtime, [Start,_]),
361    Seconds is Start/1000.
362
363
364
365%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
366%
367%  comparison predicate
368%
369%  the usual compare/3 definition
370%
371%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
372
373
374% compare(?atom, @term, @term) -- built-in
375
376
377
378%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
379%
380%  callable predicate
381%
382%  the usual callable/1 definition
383%
384%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
385
386
387% callable(@term) -- built-in
388
389
390
391%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
392%
393%  read character predicate
394%
395%  read a single character echoing it and writing a newline after
396%
397%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398
399
400'$lgt_read_single_char'(Char) :-
401    flush_output, get_char(Char), skip(10).
402
403
404
405%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
406%
407%  pretty print a term by naming its free variables
408%  (avoid instantiating variables in term by using double negation if necessary)
409%
410%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
411
412
413'$lgt_pretty_print_vars'(Stream, Term) :-
414    write_term(Stream, Term, [numbervars(true)]).
415
416
417'$lgt_pretty_print_vars_quoted'(Stream, Term) :-
418    write_term(Stream, Term, [numbervars(true), quoted(true)]).
419
420
421
422%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
423%
424%  getting stream current line number
425%  (needed for improved compiler error messages)
426%
427%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
428
429
430% '$lgt_stream_current_line_number'(@stream, -integer)
431
432'$lgt_stream_current_line_number'(Stream, Line) :-
433    stream_property(Stream, line_number(Line)).
434
435
436
437%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438%
439%  handling of Prolog-proprietary directives on Logtalk source files
440%
441%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
442
443
444% '$lgt_ignore_pl_directive'(@callable)
445
446'$lgt_ignore_pl_directive'(_) :-
447    fail.
448
449
450% '$lgt_rewrite_and_copy_pl_directive'(@callable, -callable)
451
452'$lgt_rewrite_and_copy_pl_directive'(_, _) :-
453    fail.
454
455
456% '$lgt_rewrite_and_recompile_pl_directive'(@callable, -callable)
457
458'$lgt_rewrite_and_recompile_pl_directive'(_, _) :-
459    fail.
460
461
462
463%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
464%
465%  Shortcut to the Logtalk built-in predicate logtalk_load/1
466%
467%  defined in the config files in order to be able to comment it out in case
468%  of conflict with some Prolog native feature; it implies conformance with
469%  the ISO Prolog standard regarding the definition of the {}/1 syntax
470%
471%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
472
473{File, Files} :-
474    !,
475    logtalk_load(File),
476    {Files}.
477{File} :-
478    logtalk_load(File).
479
480
481
482%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
483%
484%  end!
485%
486%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.