root/tags/lgt2143/configs/lpawin36.config

Revision 288, 9.0 KB (checked in by pmoura, 6 years ago)

updated Logtalk release number to 2.14.3.

  • 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.14.3
5%
6%  configuration file for LPA WinProlog 3.61
7%
8%  last updated: August 19, 2002
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13:- prolog_flag(syntax_errors, _, error).
14
15
16
17%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18%
19%  ISO Prolog Standard predicates that we must define because they are
20%  not built-in
21%
22%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
23%  we must define; there must be at least one clause for this predicate
24%  whose call should fail if we don't define any ISO predicates
25%
26%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27
28
29:- dynamic(lgt_exception_/1).
30
31
32% '$lgt_iso_predicate'(?callable).
33
34'$lgt_iso_predicate'(atom_codes(_, _)).
35'$lgt_iso_predicate'(atom_concat(_, _, _)).
36'$lgt_iso_predicate'(catch(_, _, _)).
37'$lgt_iso_predicate'(close(_)).
38'$lgt_iso_predicate'(nl(_)).
39'$lgt_iso_predicate'(number_codes(_, _)).
40'$lgt_iso_predicate'(once(_)).
41'$lgt_iso_predicate'(open(_, _, _)).
42'$lgt_iso_predicate'(read_term(_, _, _)).
43'$lgt_iso_predicate'(throw(_)).
44'$lgt_iso_predicate'(write_canonical(_, _)).
45'$lgt_iso_predicate'(write_term(_, _, _)).
46
47
48atom_codes(Atom, Codes) :-
49    atom_chars(Atom, Codes).
50
51
52atom_concat(Atom1, Atom2, Atom3) :-
53    nonvar(Atom1), nonvar(Atom2),
54    !,
55    name(Atom1, Codes1),
56    name(Atom2, Codes2),
57    '$lgt_append'(Codes1, Codes2, Codes3),
58    name(Atom3, Codes3).
59
60atom_concat(Atom1, Atom2, Atom3) :-
61    nonvar(Atom3),
62    !,
63    name(Atom3, Codes3),
64    '$lgt_append'(Codes1, Codes2, Codes3),
65    name(Atom1, Codes1),
66    name(Atom2, Codes2).
67
68
69lpa_catch(Error, Goal) :-
70    catch(Error, Goal).
71
72
73:- hide(catch).
74
75
76catch(Error, Goal) :-
77    lpa_catch(Error, Goal).
78
79
80catch(Goal, Catcher, Recovery) :-
81    lpa_catch(Error, Goal),
82    (Error = 0 ->
83        true
84        ;
85        (Error = -1 ->
86            !, fail
87            ;
88            (Error = 999 ->
89                retract(lgt_exception_(Ball)),
90                !,
91                (Catcher = Ball ->
92                    call(Recovery)
93                    ;
94                    throw(Ball))
95                ;
96                error_message(Error, Message),
97                (Catcher = Message ->
98                    call(Recovery)
99                    ;
100                    write(Message), nl, abort)))).
101
102
103:- hide(close).
104
105
106close(Stream) :-
107    fclose(Stream).
108
109
110nl(Stream) :-
111    output(Current),
112    output(Stream),
113    nl,
114    output(Current).
115
116
117number_codes(Number, Codes) :-
118    number_chars(Number, Codes).
119
120
121once(Goal) :-
122    one(Goal).
123
124
125open(File, read, File) :-
126    fopen(File, File, 0).
127
128open(File, write, File) :-
129    fcreate(File, File, 0).
130
131
132read_term(Stream, Term, [singletons([])]) :-
133    !,
134    input(Current),
135    input(Stream),
136    read(Term),
137    input(Current).
138
139read_term(Stream, Term, _) :-
140    input(Current),
141    input(Stream),
142    read(Term),
143    input(Current).
144
145
146throw(Error) :-
147    asserta(lgt_exception_(Error)),
148    throw(999, Error).
149
150
151write_canonical(Stream, Term) :-
152    output(Current),
153    output(Stream),
154    writeq(Term),
155    output(Current).
156
157
158write_term(Stream, Term, [quoted(true)]) :-
159    !,
160    output(Current),
161    output(Stream),
162    writeq(Term),
163    output(Current).
164
165write_term(Stream, Term, _) :-
166    output(Current),
167    output(Stream),
168    write(Term),
169    output(Current).
170
171
172
173%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
174%
175%  predicate properties
176%
177%  this predicate must return at least static, dynamic, and built_in
178%  properties for an existing predicate
179%
180%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181
182
183% '$lgt_predicate_property'(+callable, ?predicate_property)
184
185'$lgt_predicate_property'(Pred, Prop) :-
186    predicate_property(Pred, Prop).
187
188
189
190%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
191%
192%  metapredicates
193%
194%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195
196
197% lgt_call/2-8
198%
199% use these definitions only if your compiler does
200% not provide call/1-8 as built-in predicates
201
202'$lgt_call'(F, A) :-
203    F(A).
204
205
206'$lgt_call'(F, A1, A2) :-
207    F(A1, A2).
208
209
210'$lgt_call'(F, A1, A2, A3) :-
211    F(A1, A2, A3).
212
213
214'$lgt_call'(F, A1, A2, A3, A4) :-
215    F(A1, A2, A3, A4).
216
217
218'$lgt_call'(F, A1, A2, A3, A4, A5) :-
219    F(A1, A2, A3, A4, A5).
220
221
222'$lgt_call'(F, A1, A2, A3, A4, A5, A6) :-
223    F(A1, A2, A3, A4, A5, A6).
224
225
226'$lgt_call'(F, A1, A2, A3, A4, A5, A6, A7) :-
227    F(A1, A2, A3, A4, A5, A6, A7).
228
229
230% lgt_once/2-8
231%
232% if your compiler provides call/1-8 as built-in
233% predicates rewrite these definitions using call(...), !.
234
235'$lgt_once'(F, A) :-
236    one(F(A)).
237
238
239'$lgt_once'(F, A1, A2) :-
240    one(F(A1, A2)).
241
242
243'$lgt_once'(F, A1, A2, A3) :-
244    one(F(A1, A2, A3)).
245
246
247'$lgt_once'(F, A1, A2, A3, A4) :-
248    one(F(A1, A2, A3, A4)).
249
250
251'$lgt_once'(F, A1, A2, A3, A4, A5) :-
252    one(F(A1, A2, A3, A4, A5)).
253
254
255'$lgt_once'(F, A1, A2, A3, A4, A5, A6) :-
256    one(F(A1, A2, A3, A4, A5, A6)).
257
258
259'$lgt_once'(F, A1, A2, A3, A4, A5, A6, A7) :-
260    one(F(A1, A2, A3, A4, A5, A6, A7)).
261
262
263
264%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265%
266%  file extension predicates
267%
268%  these extensions are used by Logtalk load/compile predicates
269%
270%  you may want to change the extension for Prolog files to match
271%  the one expected by your Prolog compiler
272%
273%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
274
275
276% '$lgt_file_extension'(?atom, ?atom)
277
278'$lgt_file_extension'(logtalk, '.lgt').
279'$lgt_file_extension'(prolog, '.pl').
280'$lgt_file_extension'(xml, '.xml').
281
282
283
284%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
285%
286%  default flag values
287%
288%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
289
290
291% '$lgt_default_flag'(?atom, ?atom)
292%
293% default values for all flags
294
295'$lgt_default_flag'(iso_initialization_dir, true).
296
297'$lgt_default_flag'(xml, on).
298'$lgt_default_flag'(xsl, 'lgtxml.xsl').
299'$lgt_default_flag'(doctype, local).
300
301'$lgt_default_flag'(unknown, warning).
302'$lgt_default_flag'(misspelt, warning).
303'$lgt_default_flag'(singletons, warning).
304'$lgt_default_flag'(lgtredef, warning).
305'$lgt_default_flag'(plredef, silent).
306'$lgt_default_flag'(portability, silent).
307
308'$lgt_default_flag'(report, on).
309
310'$lgt_default_flag'(smart_compilation, off).
311
312'$lgt_default_flag'(startup_message, on).
313
314'$lgt_default_flag'(named_anonymous_vars, off).
315
316'$lgt_default_flag'(code_prefix, '').
317
318
319
320%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
321%
322%  list predicates
323%
324%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325
326
327'$lgt_append'([], List, List).
328'$lgt_append'([Head| Tail], List, [Head| Tail2]) :-
329    '$lgt_append'(Tail, List, Tail2).
330
331
332'$lgt_member'(Head, [Head| _]).
333'$lgt_member'(Head, [_| Tail]) :-
334    '$lgt_member'(Head, Tail).
335
336
337'$lgt_member_var'(V, [H| _]) :-
338    V == H.
339'$lgt_member_var'(V, [_| T]) :-
340    '$lgt_member_var'(V, T).
341
342
343'$lgt_proper_list'([]).
344'$lgt_proper_list'([_| List]) :-
345    '$lgt_proper_list'(List).
346
347
348
349%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350%
351%  file predicates
352%
353%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
354
355
356% '$lgt_file_exists'(+atom)
357%
358% see if a file exist in the current directory
359
360'$lgt_file_exists'(File) :-
361    catch(absolute_file_name(File, [access(exist)], _), _, fail).
362
363
364% '$lgt_load_prolog_code'(+atom)
365%
366% compile and load a Prolog file
367
368'$lgt_load_prolog_code'(File) :-
369    reconsult(File).
370
371
372% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
373%
374% compare file modification times
375
376'$lgt_compare_file_mtimes'(Result, File1, File2) :-
377    file(File1, 3, Time1),
378    file(File2, 3, Time2),
379    compare(Result, Time1, Time2).
380
381
382
383%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
384%
385%  sorting predicates
386%
387%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388
389
390% '$lgt_keysort'(+list, -list)
391
392'$lgt_keysort'(List, Sorted) :-
393    keysort(List, Sorted).
394
395
396% '$lgt_sort'(+list, -list)
397
398'$lgt_sort'(List, Sorted) :-
399    sort(List, Sorted).
400
401
402
403%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404%
405%  time and date predicates
406%
407%  if your Prolog compiler does not provide access to the operating system
408%  time and date just write dummy definitions
409%
410%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
411
412
413% '$lgt_current_date'(?Year, ?Month, ?Day)
414
415'$lgt_current_date'(Year, Month, Day) :-
416    date(Day, Month, Year).
417
418
419% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
420
421'$lgt_current_time'(Hours, Mins, Secs) :-
422    time(Hours, Mins, Secs, _).
423
424
425
426%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
427%
428%  timing predicate
429%
430%  if your Prolog compiler does not provide access to a timing predicate
431%  just write dummy definition
432%
433%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
434
435
436% '$lgt_cpu_time'(-Seconds)
437
438'$lgt_cpu_time'(Seconds) :-
439    ticks(Ticks),
440    AbsTicks is Ticks mod 2^32,
441    Seconds is AbsTicks / 4660.
442
443
444
445%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
446%
447%  comparison predicate
448%
449%  the usual compare/3 definition
450%
451%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
452
453
454% compare(?atom, @term, @term) -- built-in
455
456
457
458%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
459%
460%  end!
461%
462%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.