root/tags/lgt2210/configs/k.config

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