root/tags/lgt2212/configs/ji.config

Revision 1599, 9.3 KB (checked in by pmoura, 4 years ago)

Added note on problem with JIProlog when running on MacOS X.

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