root/tags/lgt2210/configs/eclipseiso.config

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