root/tags/lgt291/configs/ic.config

Revision 7, 7.5 KB (checked in by pmoura, 7 years ago)

Corrected compiler bug in the error checking code of directives info/1 and info/2.
Change the "mi" example objects loading order to avoid some "unknown entity" warnings.

  • 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.9.1
5%
6%  configuration file for IC Prolog II 0.96
7%
8%  last updated: August 24, 2000
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
27initialization(Goal) :-
28    call(Goal).
29
30
31% lgt_iso_predicate(?callable).
32
33lgt_iso_predicate(atom_codes(_, _)).
34lgt_iso_predicate(atom_concat(_, _, _)).
35lgt_iso_predicate(catch(_, _, _)).
36lgt_iso_predicate(current_predicate(_)).
37lgt_iso_predicate(number_codes(_, _)).
38lgt_iso_predicate(once(_)).
39lgt_iso_predicate(read_term(_, _, _)).
40lgt_iso_predicate(throw(_)).
41lgt_iso_predicate(write_term(_, _, _)).
42
43
44atom_codes(Atom, Codes) :-
45    name(Atom, Codes).
46
47
48atom_concat(Atom1, Atom2, Atom3) :-
49    concat(Atom1, Atom2, Atom3).
50
51
52catch(Goal, Catcher, Recovery) :-
53    ?????
54
55
56current_predicate(Functor/Arity) :-
57    current_predicate(Functor, Term),
58    functor(Term, Functor, Arity).
59
60
61number_codes(Number, Codes) :-
62    number_chars(Number, Codes).
63
64
65once(Goal) :-
66    one(Goal).
67
68
69read_term(Stream, Term, [singletons([])]) :-
70    !,
71    read(Stream, Term).
72
73read_term(Stream, Term, _) :-
74    read(Stream, Term).
75
76
77throw(Error) :-
78    ?????
79
80
81write_term(Stream, Term, [quoted(true)]) :-
82    !,
83    writeq(Stream, Term).
84
85write_term(Stream, Term, _) :-
86    write(Stream, Term).
87
88
89
90%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
91%
92%  predicate properties
93%
94%  this predicate must return at least static, dynamic and built_in
95%  properties for an existing predicate
96%
97%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
98
99
100% lgt_predicate_property(+callable, ?predicate_property)
101
102lgt_predicate_property(Pred, Prop) :-
103    predicate_property(Pred, Prop).
104
105
106
107%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
108%
109%  metapredicates
110%
111%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112
113
114% lgt_call/2-8
115%
116% if your compiler provides call/1-8 as built-in
117% predicates rewrite these definitions using call(...).
118
119lgt_call(F, A) :-
120    Call =.. [F, A],
121    call(Call).
122
123
124lgt_call(F, A1, A2) :-
125    Call =.. [F, A1, A2],
126    call(Call).
127
128
129lgt_call(F, A1, A2, A3) :-
130    Call =.. [F, A1, A2, A3],
131    call(Call).
132
133
134lgt_call(F, A1, A2, A3, A4) :-
135    Call =.. [F, A1, A2, A3, A4],
136    call(Call).
137
138
139lgt_call(F, A1, A2, A3, A4, A5) :-
140    Call =.. [F, A1, A2, A3, A4, A5],
141    call(Call).
142
143
144lgt_call(F, A1, A2, A3, A4, A5, A6) :-
145    Call =.. [F, A1, A2, A3, A4, A5, A6],
146    call(Call).
147
148
149lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
150    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
151    call(Call).
152
153
154% lgt_once/2-8
155%
156% if your compiler provides call/1-8 as built-in
157% predicates rewrite these definitions using call(...), !.
158
159lgt_once(F, A) :-
160    Call =.. [F, A],
161    once(Call).
162
163
164lgt_once(F, A1, A2) :-
165    Call =.. [F, A1, A2],
166    once(Call).
167
168
169lgt_once(F, A1, A2, A3) :-
170    Call =.. [F, A1, A2, A3],
171    once(Call).
172
173
174lgt_once(F, A1, A2, A3, A4) :-
175    Call =.. [F, A1, A2, A3, A4],
176    once(Call).
177
178
179lgt_once(F, A1, A2, A3, A4, A5) :-
180    Call =.. [F, A1, A2, A3, A4, A5],
181    once(Call).
182
183
184lgt_once(F, A1, A2, A3, A4, A5, A6) :-
185    Call =.. [F, A1, A2, A3, A4, A5, A6],
186    once(Call).
187
188
189lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
190    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
191    once(Call).
192
193
194
195%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196%
197%  file extension predicates
198%
199%  these extensions are used by Logtalk load/compile predicates
200%
201%  you may want to change the extension for Prolog files to match
202%  the one expected by your Prolog compiler
203%
204%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
205
206
207% lgt_file_extension(?atom, ?atom)
208
209lgt_file_extension(logtalk, '.lgt').
210lgt_file_extension(prolog, '.pl').
211lgt_file_extension(xml, '.xml').
212
213
214
215%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216%
217%  default compiler options
218%
219%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
220
221
222% lgt_default_compiler_option(?atom, ?atom)
223%
224% default values for all compiler options
225
226lgt_default_compiler_option(iso_initialization_dir, false).
227
228lgt_default_compiler_option(xml, on).
229lgt_default_compiler_option(xsl, 'lgtxml.xsl').
230
231lgt_default_compiler_option(unknown, warning).
232lgt_default_compiler_option(misspelt, warning).
233lgt_default_compiler_option(singletons, warning).
234lgt_default_compiler_option(lgtredef, warning).
235lgt_default_compiler_option(plredef, silent).
236
237lgt_default_compiler_option(report, on).
238
239
240
241%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
242%
243%  list predicates
244%
245%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246
247
248lgt_append([], List, List).
249lgt_append([Head| Tail], List, [Head| Tail2]) :-
250    lgt_append(Tail, List, Tail2).
251
252
253lgt_member(Head, [Head| _]).
254lgt_member(Head, [_| Tail]) :-
255    lgt_member(Head, Tail).
256
257
258lgt_member_var(V, [H| _]) :-
259    V == H.
260lgt_member_var(V, [_| T]) :-
261    lgt_member_var(V, T).
262
263
264lgt_proper_list([]).
265lgt_proper_list([_| List]) :-
266    lgt_proper_list(List).
267
268
269
270%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271%
272%  file predicates
273%
274%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
275
276
277% lgt_file_exists(+atom)
278%
279% see if a file exist in the current directory
280
281lgt_file_exists(File) :-
282    file_exists(File).
283
284
285% lgt_load_prolog_code(+atom)
286%
287% compile and load a Prolog file
288
289lgt_load_prolog_code(File) :-
290    compile(File).
291
292
293
294%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
295%
296%  sorting predicates
297%
298%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
299
300
301% lgt_keysort(+list, -list)
302
303lgt_keysort(List, Sorted) :-
304    ?????
305
306
307% lgt_sort(+list, -list)
308
309lgt_sort(List, Sorted) :-
310    qsort(List, Sorted, @>).
311
312
313
314%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315%
316%  time and date predicates
317%
318%  if your Prolog compiler does not provide access to the operating system
319%  time and date just write dummy definitions
320%
321%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322
323
324% lgt_current_date(?Year, ?Month, ?Day)
325
326lgt_current_date(Year, Month, Day) :-
327    realtime(Time),
328    ctime(Time, Year, Month, Day, _, _, _).
329   
330
331% lgt_current_time(?Hours, ?Mins, ?Secs)
332
333lgt_current_time(Hours, Mins, Secs) :-
334    realtime(Time),
335    ctime(Time, _, _, _, Hours, Mins, Secs).
336
337
338
339%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340%
341%  timing predicate
342%
343%  if your Prolog compiler does not provide access to a timing predicate
344%  just write dummy definition
345%
346%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347
348
349% lgt_cpu_time(-Seconds)
350
351lgt_cpu_time(Seconds) :-
352    time(Time),
353    Seconds is Time * 60.
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%  end!
373%
374%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.