root/tags/lgt293/configs/ic.config

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

Changed comments about Logtalk flags.

  • 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.3
5%
6%  configuration file for IC Prolog II 0.96
7%
8%  last updated: December 30, 2001
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 flag values
218%
219%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
220
221
222% lgt_default_flag(?atom, ?atom)
223%
224% default values for all flags
225
226lgt_default_flag(iso_initialization_dir, false).
227
228lgt_default_flag(xml, on).
229lgt_default_flag(xsl, 'lgtxml.xsl').
230
231lgt_default_flag(unknown, warning).
232lgt_default_flag(misspelt, warning).
233lgt_default_flag(singletons, warning).
234lgt_default_flag(lgtredef, warning).
235lgt_default_flag(plredef, silent).
236lgt_default_flag(portability, silent).
237
238lgt_default_flag(report, on).
239
240
241
242%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
243%
244%  list predicates
245%
246%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247
248
249lgt_append([], List, List).
250lgt_append([Head| Tail], List, [Head| Tail2]) :-
251    lgt_append(Tail, List, Tail2).
252
253
254lgt_member(Head, [Head| _]).
255lgt_member(Head, [_| Tail]) :-
256    lgt_member(Head, Tail).
257
258
259lgt_member_var(V, [H| _]) :-
260    V == H.
261lgt_member_var(V, [_| T]) :-
262    lgt_member_var(V, T).
263
264
265lgt_proper_list([]).
266lgt_proper_list([_| List]) :-
267    lgt_proper_list(List).
268
269
270
271%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
272%
273%  file predicates
274%
275%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
276
277
278% lgt_file_exists(+atom)
279%
280% see if a file exist in the current directory
281
282lgt_file_exists(File) :-
283    file_exists(File).
284
285
286% lgt_load_prolog_code(+atom)
287%
288% compile and load a Prolog file
289
290lgt_load_prolog_code(File) :-
291    compile(File).
292
293
294
295%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
296%
297%  sorting predicates
298%
299%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
300
301
302% lgt_keysort(+list, -list)
303
304lgt_keysort(List, Sorted) :-
305    ?????
306
307
308% lgt_sort(+list, -list)
309
310lgt_sort(List, Sorted) :-
311    qsort(List, Sorted, @>).
312
313
314
315%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316%
317%  time and date predicates
318%
319%  if your Prolog compiler does not provide access to the operating system
320%  time and date just write dummy definitions
321%
322%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323
324
325% lgt_current_date(?Year, ?Month, ?Day)
326
327lgt_current_date(Year, Month, Day) :-
328    realtime(Time),
329    ctime(Time, Year, Month, Day, _, _, _).
330   
331
332% lgt_current_time(?Hours, ?Mins, ?Secs)
333
334lgt_current_time(Hours, Mins, Secs) :-
335    realtime(Time),
336    ctime(Time, _, _, _, Hours, Mins, Secs).
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
352lgt_cpu_time(Seconds) :-
353    time(Time),
354    Seconds is Time * 60.
355
356
357
358%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
359%
360%  comparison predicate
361%
362%  the usual compare/3 definition
363%
364%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
365
366
367% compare(?atom, @term, @term) -- built-in
368
369
370
371%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
372%
373%  end!
374%
375%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.