root/tags/lgt293/configs/ciao_aux17.config

Revision 70, 8.6 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 CIAO Prolog 1.7p162
7%
8%  last updated: December 30, 2001
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13:- use_package(iso).
14
15:- use_package(runtime_ops).
16:- use_package(hiord).
17
18:- use_module(library(compiler)).
19:- use_module(library(system)).
20:- use_module(library(prolog_sys)).
21:- use_module(library(sort)).
22
23:- include(engine(builtin_exports)).
24
25:- set_prolog_flag(multi_arity_warnings, off).
26
27
28
29%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30%
31%  ISO Prolog Standard predicates that we must define because they are
32%  not built-in
33%
34%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
35%  we must define; there must be at least one clause for this predicate
36%  whose call should fail if we don't define any ISO predicates
37%
38%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39
40
41% lgt_iso_predicate(?callable).
42
43lgt_iso_predicate(_) :-
44    fail.
45
46
47
48%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49%
50%  predicate properties
51%
52%  this predicate must return at least static, dynamic and built_in
53%  properties for an existing predicate
54%
55%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56
57
58% lgt_predicate_property(+callable, ?predicate_property)
59
60lgt_predicate_property(Pred, built_in) :-
61    functor(Pred, Functor, Arity),
62    builtin_export(_, Functor, Arity, _).
63
64lgt_predicate_property(Pred, built_in) :-
65    lgt_ciao_iso_builtin(Pred).
66
67lgt_predicate_property(Pred, static) :-
68    predicate_property(Pred, compiled).
69
70lgt_predicate_property(Pred, static) :-
71    functor(Pred, Functor, Arity),
72    atom_concat('user:', Functor, Functor2),
73    functor(Pred2, Functor2, Arity),
74    predicate_property(Pred2, compiled).
75
76lgt_predicate_property(Pred, Prop) :-
77    predicate_property(Pred, Prop).
78
79lgt_predicate_property(Pred, Prop) :-
80    functor(Pred, Functor, Arity),
81    atom_concat('user:', Functor, Functor2),
82    functor(Pred2, Functor2, Arity),
83    predicate_property(Pred2, Prop).
84
85
86lgt_ciao_iso_builtin(write(_)).
87lgt_ciao_iso_builtin(write(_, _)).
88lgt_ciao_iso_builtin(writeq(_)).
89lgt_ciao_iso_builtin(writeq(_, _)).
90lgt_ciao_iso_builtin(write_canonical(_)).
91lgt_ciao_iso_builtin(write_canonical(_, _)).
92lgt_ciao_iso_builtin(write_term(_, _)).
93lgt_ciao_iso_builtin(write_term(_, _, _)).
94
95lgt_ciao_iso_builtin(read(_)).
96lgt_ciao_iso_builtin(read(_, _)).
97lgt_ciao_iso_builtin(read_term(_, _)).
98lgt_ciao_iso_builtin(read_term(_, _, _)).
99
100lgt_ciao_iso_builtin(open(_, _, _, _)).
101lgt_ciao_iso_builtin(close(_, _)).
102lgt_ciao_iso_builtin(stream_property(_, _)).
103
104lgt_ciao_iso_builtin(op(_, _, _)).
105lgt_ciao_iso_builtin(current_op(_, _, _)).
106
107lgt_ciao_iso_builtin(_ \= _).
108lgt_ciao_iso_builtin(once(_)).
109lgt_ciao_iso_builtin(compound(_)).
110lgt_ciao_iso_builtin(sub_atom(_, _, _, _, _)).
111lgt_ciao_iso_builtin(unify_with_occurs_check(_, _)).
112
113lgt_ciao_iso_builtin(char_code(_, _)).
114lgt_ciao_iso_builtin(atom_chars(_, _)).
115lgt_ciao_iso_builtin(number_chars(_, _)).
116lgt_ciao_iso_builtin(get_byte(_)).
117lgt_ciao_iso_builtin(get_byte(_, _)).
118lgt_ciao_iso_builtin(peek_byte(_)).
119lgt_ciao_iso_builtin(peek_byte(_, _)).
120lgt_ciao_iso_builtin(put_byte(_)).
121lgt_ciao_iso_builtin(put_byte(_, _)).
122lgt_ciao_iso_builtin(get_char(_)).
123lgt_ciao_iso_builtin(get_char(_, _)).
124lgt_ciao_iso_builtin(peek_char(_)).
125lgt_ciao_iso_builtin(peek_char(_, _)).
126lgt_ciao_iso_builtin(put_char(_)).
127lgt_ciao_iso_builtin(put_char(_, _)).
128
129
130
131%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132%
133%  metapredicates
134%
135%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136
137
138% forall(+callable, +callble)
139
140forall(Generate, Test) :-
141    \+ call((Generate, \+ call(Test))).
142
143
144% retractall(+callable) -- built-in
145
146
147% lgt_call/2-8
148%
149% if your compiler provides call/1-8 as built-in
150% predicates rewrite these definitions using call(...).
151
152lgt_call(F, A) :-
153    call(F, A).
154
155
156lgt_call(F, A1, A2) :-
157    call(F, A1, A2).
158
159
160lgt_call(F, A1, A2, A3) :-
161    call(F, A1, A2, A3).
162
163
164lgt_call(F, A1, A2, A3, A4) :-
165    call(F, A1, A2, A3, A4).
166
167
168lgt_call(F, A1, A2, A3, A4, A5) :-
169    call(F, A1, A2, A3, A4, A5).
170
171
172lgt_call(F, A1, A2, A3, A4, A5, A6) :-
173    call(F, A1, A2, A3, A4, A5, A6).
174
175
176lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
177    call(F, A1, A2, A3, A4, A5, A6, A7).
178
179
180% lgt_once/2-8
181%
182% if your compiler provides call/1-8 as built-in
183% predicates rewrite these definitions using call(...), !.
184
185lgt_once(F, A) :-
186    call(F, A),
187    !.
188
189
190lgt_once(F, A1, A2) :-
191    call(F, A1, A2),
192    !.
193
194
195lgt_once(F, A1, A2, A3) :-
196    call(F, A1, A2, A3),
197    !.
198
199
200lgt_once(F, A1, A2, A3, A4) :-
201    call(F, A1, A2, A3, A4),
202    !.
203
204
205lgt_once(F, A1, A2, A3, A4, A5) :-
206    call(F, A1, A2, A3, A4, A5),
207    !.
208
209
210lgt_once(F, A1, A2, A3, A4, A5, A6) :-
211    call(F, A1, A2, A3, A4, A5, A6),
212    !.
213
214
215lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
216    call(F, A1, A2, A3, A4, A5, A6, A7),
217    !.
218
219
220
221%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
222%
223%  file extension predicates
224%
225%  these extensions are used by Logtalk load/compile predicates
226%
227%  you may want to change the extension for Prolog files to match
228%  the one expected by your Prolog compiler
229%
230%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231
232
233% lgt_file_extension(?atom, ?atom)
234
235lgt_file_extension(logtalk, '.lgt').
236lgt_file_extension(prolog, '.pl').
237lgt_file_extension(xml, '.xml').
238
239
240
241%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
242%
243%  default flag values
244%
245%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246
247
248% lgt_default_flag(?atom, ?atom)
249%
250% default values for all flags
251
252lgt_default_flag(iso_initialization_dir, true).
253
254lgt_default_flag(xml, on).
255lgt_default_flag(xsl, 'lgtxml.xsl').
256
257lgt_default_flag(unknown, warning).
258lgt_default_flag(misspelt, warning).
259lgt_default_flag(singletons, warning).
260lgt_default_flag(lgtredef, warning).
261lgt_default_flag(plredef, silent).
262lgt_default_flag(portability, silent).
263
264lgt_default_flag(report, on).
265
266
267
268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269%
270%  list predicates
271%
272%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
273
274
275lgt_append([], List, List).
276lgt_append([Head| Tail], List, [Head| Tail2]) :-
277    lgt_append(Tail, List, Tail2).
278
279
280lgt_member(Head, List) :-
281    member(Head, List).
282
283
284lgt_member_var(V, [H| _]) :-
285    V == H.
286lgt_member_var(V, [_| T]) :-
287    lgt_member_var(V, T).
288
289
290lgt_proper_list(List) :-
291    list(List).
292
293
294
295%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
296%
297%  file predicates
298%
299%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
300
301
302% lgt_file_exists(+atom)
303%
304% see if a file exist in the current directory
305
306lgt_file_exists(File) :-
307    file_exists(File).
308
309
310% lgt_load_prolog_code(+atom)
311%
312% compile and load a Prolog file
313
314lgt_load_prolog_code(File) :-
315    set_prolog_flag(multi_arity_warnings, off),
316    ensure_loaded(File).
317
318
319
320%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
321%
322%  sorting predicate
323%
324%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325
326
327% lgt_keysort(+list, -list)
328
329lgt_keysort(List, Sorted) :-
330    keysort(List, Sorted).
331
332
333% lgt_sort(+list, -list)
334
335lgt_sort(List, Sorted) :-
336    sort(List, Sorted).
337
338
339
340%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
341%
342%  time and date predicates
343%
344%  if your Prolog compiler does not provide access to the operating system
345%  time and date just write dummy definitions
346%
347%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
348
349
350% lgt_current_date(?Year, ?Month, ?Day)
351
352lgt_current_date(Year, Month, Day) :-
353    datime(_, Year, Month, Day, _, _, _, _, _).
354
355
356% lgt_current_time(?Hours, ?Mins, ?Secs)
357
358lgt_current_time(Hours, Mins, Secs) :-
359    datime(_, _, _, _, Hours, Mins, Secs, _, _).
360
361
362
363%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
364%
365%  timing predicate
366%
367%  if your Prolog compiler does not provide access to a timing predicate
368%  just write dummy definition
369%
370%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
371
372
373% lgt_cpu_time(-Seconds)
374
375lgt_cpu_time(Seconds) :-
376    statistics(runtime, [Miliseconds| _]),
377    Seconds is Miliseconds / 1000.
378
379
380
381%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
382%
383%  comparison predicate
384%
385%  the usual compare/3 definition
386%
387%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
388
389
390% compare(?atom, @term, @term) -- built-in
391
392
393
394%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
395%
396%  end!
397%
398%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.