root/tags/lgt2210/configs/qu.config

Revision 1460, 9.2 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 Qu-Prolog 6.4
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
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%  metapredicates
55%
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
58
59% forall(+callable, +callble)
60
61forall(Generate, Test) :-
62    \+ call((Generate, \+ call(Test))).
63
64
65% lgt_call/2-8
66%
67% use these definitions only if your compiler does
68% not provide call/1-8 as built-in predicates
69
70'$lgt_call'(F, A) :-
71    call_predicate(F, A).
72
73
74'$lgt_call'(F, A1, A2) :-
75    call_predicate(F, A1, A2).
76
77
78'$lgt_call'(F, A1, A2, A3) :-
79    call_predicate(F, A1, A2, A3).
80
81
82'$lgt_call'(F, A1, A2, A3, A4) :-
83    call_predicate(F, A1, A2, A3, A4).
84
85
86'$lgt_call'(F, A1, A2, A3, A4, A5) :-
87    Call =.. [F, A1, A2, A3, A4, A5],
88    call(Call).
89
90
91'$lgt_call'(F, A1, A2, A3, A4, A5, A6) :-
92    Call =.. [F, A1, A2, A3, A4, A5, A6],
93    call(Call).
94
95
96'$lgt_call'(F, A1, A2, A3, A4, A5, A6, A7) :-
97    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
98    call(Call).
99
100
101% lgt_once/2-8
102%
103% if your compiler provides call/1-8 as built-in
104% predicates rewrite these definitions using call(...), !.
105
106'$lgt_once'(F, A) :-
107    once(call_predicate(F, A)).
108
109
110'$lgt_once'(F, A1, A2) :-
111    once(call_predicate(F, A1, A2)).
112
113
114'$lgt_once'(F, A1, A2, A3) :-
115    once(call_predicate(F, A1, A2, A3)).
116
117
118'$lgt_once'(F, A1, A2, A3, A4) :-
119    once(call_predicate(F, A1, A2, A3, A4)).
120
121
122'$lgt_once'(F, A1, A2, A3, A4, A5) :-
123    Call =.. [F, A1, A2, A3, A4, A5],
124    once(Call).
125
126
127'$lgt_once'(F, A1, A2, A3, A4, A5, A6) :-
128    Call =.. [F, A1, A2, A3, A4, A5, A6],
129    once(Call).
130
131
132'$lgt_once'(F, A1, A2, A3, A4, A5, A6, A7) :-
133    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
134    once(Call).
135
136
137
138%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
139%
140%  Prolog built-in metapredicates
141%
142%  (excluding ISO Prolog Standard metapredicates)
143%
144%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145
146
147% '$lgt_pl_metapredicate'(?callable).
148
149'$lgt_pl_metapredicate'(message_choice(::)).
150'$lgt_pl_metapredicate'(thread_fork(*, ::)).
151'$lgt_pl_metapredicate'(thread_fork(*, ::, *)).
152'$lgt_pl_metapredicate'(thread_push_goal(*, ::)).
153'$lgt_pl_metapredicate'(thread_atomic_goal(::)).
154'$lgt_pl_metapredicate'(unwind_protect(::, ::)).
155'$lgt_pl_metapredicate'(thread_wait_on_goal(::)).
156'$lgt_pl_metapredicate'('??'(*, ::)).
157
158
159
160%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161%
162%  file extension predicates
163%
164%  these extensions are used by Logtalk load/compile predicates
165%
166%  you may want to change the extension for Prolog files to match
167%  the one expected by your Prolog compiler
168%
169%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170
171
172% '$lgt_file_extension'(?atom, ?atom)
173
174'$lgt_file_extension'(metafile, '.mlgt').
175'$lgt_file_extension'(logtalk, '.lgt').
176'$lgt_file_extension'(prolog, '.ql').
177'$lgt_file_extension'(xml, '.xml').
178
179
180
181%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
182%
183%  default flag values
184%
185%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186
187
188% '$lgt_default_flag'(?atom, ?atom)
189%
190% default values for all flags
191
192'$lgt_default_flag'(iso_initialization_dir, false).
193
194'$lgt_default_flag'(xml, on).
195'$lgt_default_flag'(xsl, 'lgtxml.xsl').
196'$lgt_default_flag'(xmlspec, dtd).
197'$lgt_default_flag'(doctype, local).
198
199'$lgt_default_flag'(unknown, warning).
200'$lgt_default_flag'(misspelt, warning).
201'$lgt_default_flag'(singletons, warning).
202'$lgt_default_flag'(lgtredef, warning).
203'$lgt_default_flag'(plredef, silent).
204'$lgt_default_flag'(portability, silent).
205
206'$lgt_default_flag'(report, on).
207
208'$lgt_default_flag'(smart_compilation, off).
209
210'$lgt_default_flag'(startup_message, flags).
211
212'$lgt_default_flag'(underscore_vars, singletons).
213
214'$lgt_default_flag'(code_prefix, '').
215
216'$lgt_default_flag'(debug, off).
217'$lgt_default_flag'(supports_break_predicate, true).
218
219
220
221%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
222%
223%  list predicates
224%
225%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
226
227
228'$lgt_append'(List1, List2, List3) :-
229    append(List1, List2, List3).
230
231
232'$lgt_member'(Term, List) :-
233    member(Term, List).
234
235
236'$lgt_member_var'(Term, List) :-
237    member_eq(Term, List).
238
239
240'$lgt_proper_list'([]).
241'$lgt_proper_list'([_| List]) :-
242    '$lgt_proper_list'(List).
243
244
245'$lgt_reverse'(List, Reversed) :-
246    '$lgt_reverse'(List, [], Reversed, Reversed).
247
248'$lgt_reverse'([], Reversed, Reversed, []).
249'$lgt_reverse'([Head| Tail], List, Reversed, [_| Bound]) :-
250    '$lgt_reverse'(Tail, [Head| List], Reversed, Bound).
251
252
253
254%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
255%
256%  file predicates
257%
258%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
259
260
261% '$lgt_file_exists'(+atom)
262%
263% see if a file exist in the current directory
264
265'$lgt_file_exists'(File) :-
266    access(File, 4, 0).
267
268
269% '$lgt_load_prolog_code'(+atom)
270%
271% compile and load a Prolog file
272
273'$lgt_load_prolog_code'(File) :-
274    '$lgt_file_extension'(prolog, Extension),
275    atom_concat(Name, Extension, File),
276    fcompile(File, [assemble_only(true)]),
277    load(Name).
278
279
280% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
281%
282% compare file modification times
283
284'$lgt_compare_file_mtimes'(_, _, _) :-
285    fail.
286
287
288
289%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290%
291%  sorting predicates
292%
293%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
294
295
296% '$lgt_keysort'(+list, -list)
297
298'$lgt_keysort'(List, Sorted) :-
299    throw(error(not_implemented, keysort/2)).
300
301
302% '$lgt_sort'(+list, -list)
303
304'$lgt_sort'(List, Sorted) :-
305    sort(List, Sorted).
306
307
308
309%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
310%
311%  time and date predicates
312%
313%  if your Prolog compiler does not provide access to the operating system
314%  time and date just write dummy definitions
315%
316%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317
318
319% '$lgt_current_date'(?Year, ?Month, ?Day)
320
321'$lgt_current_date'(Year, Month, Day) :-
322    realtime(Time),
323    gmtime(Time, gmt_time(Year2, Month2, Day, _, _, _)),
324    Year is 1900 + Year2,
325    Month is Month2 + 1.
326
327
328% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
329
330'$lgt_current_time'(Hours, Mins, Secs) :-
331    realtime(Time),
332    gmtime(Time, gmt_time(_, _, _, Hours, Mins, Secs)).
333
334
335
336%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
337%
338%  timing predicate
339%
340%  if your Prolog compiler does not provide access to a timing predicate
341%  just write dummy definition
342%
343%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
344
345
346% '$lgt_cpu_time'(-Seconds)
347
348'$lgt_cpu_time'(Seconds) :-
349    statistics(runtime, [Start,_]),
350    Seconds is Start/1000.
351
352
353
354%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355%
356%  comparison predicate
357%
358%  the usual compare/3 definition
359%
360%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
361
362
363% compare(?atom, @term, @term) -- built-in
364
365
366
367%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
368%
369%  callable predicate
370%
371%  the usual callable/1 definition
372%
373%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
374
375
376% callable(@term)
377
378callable(Term) :-
379    once((atom(Term); compound(Term))).
380
381
382
383%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
384%
385%  read character predicate
386%
387%  read a single character echoing it and writing a newline after
388%
389%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390
391
392'$lgt_read_single_char'(Char) :-
393    flush_output, get_char(Char), skip(10).
394
395
396
397%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398%
399%  pretty print a term by naming its free variables
400%  (avoid instantiating variables in term by using double negation if necessary)
401%
402%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
403
404
405'$lgt_pretty_print_vars'(Stream, Term) :-
406    write_term(Stream, Term, [numbervars(true)]).
407
408
409'$lgt_pretty_print_vars_quoted'(Stream, Term) :-
410    write_term(Stream, Term, [numbervars(true), quoted(true)]).
411
412
413
414%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
415%
416%  end!
417%
418%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.