root/tags/lgt290/configs/ciao_aux17.config

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

Initial revision

  • 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.0
5%
6%  configuration file for CIAO Prolog 1.7p115
7%
8%  last updated: July 21, 2001
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13:- use_package(iso).
14
15:- use_package(runtime_ops).
16
17:- use_module(library(compiler)).
18:- use_module(library(system)).
19:- use_module(library(prolog_sys)).
20:- use_module(library(sort)).
21:- use_module(library(hiord_rt)).
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%  metapredicates
133%
134%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
135
136
137% forall(+callable, +callble)
138
139forall(Generate, Test) :-
140    \+ call((Generate, \+ call(Test))).
141
142
143% retractall(+callable) -- built-in
144
145
146% lgt_call/2-8
147%
148% if your compiler provides call/1-8 as built-in
149% predicates rewrite these definitions using call(...).
150
151lgt_call(F, A) :-
152    call(F, A).
153
154
155lgt_call(F, A1, A2) :-
156    call(F, A1, A2).
157
158
159lgt_call(F, A1, A2, A3) :-
160    call(F, A1, A2, A3).
161
162
163lgt_call(F, A1, A2, A3, A4) :-
164    call(F, A1, A2, A3, A4).
165
166
167lgt_call(F, A1, A2, A3, A4, A5) :-
168    call(F, A1, A2, A3, A4, A5).
169
170
171lgt_call(F, A1, A2, A3, A4, A5, A6) :-
172    call(F, A1, A2, A3, A4, A5, A6).
173
174
175lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
176    call(F, A1, A2, A3, A4, A5, A6, A7).
177
178
179% lgt_once/2-8
180%
181% if your compiler provides call/1-8 as built-in
182% predicates rewrite these definitions using call(...), !.
183
184lgt_once(F, A) :-
185    call(F, A),
186    !.
187
188
189lgt_once(F, A1, A2) :-
190    call(F, A1, A2),
191    !.
192
193
194lgt_once(F, A1, A2, A3) :-
195    call(F, A1, A2, A3),
196    !.
197
198
199lgt_once(F, A1, A2, A3, A4) :-
200    call(F, A1, A2, A3, A4),
201    !.
202
203
204lgt_once(F, A1, A2, A3, A4, A5) :-
205    call(F, A1, A2, A3, A4, A5),
206    !.
207
208
209lgt_once(F, A1, A2, A3, A4, A5, A6) :-
210    call(F, A1, A2, A3, A4, A5, A6),
211    !.
212
213
214lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
215    call(F, A1, A2, A3, A4, A5, A6, A7),
216    !.
217
218
219
220%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
221%
222%  file extension predicates
223%
224%  these extensions are used by Logtalk load/compile predicates
225%
226%  you may want to change the extension for Prolog files to match
227%  the one expected by your Prolog compiler
228%
229%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
230
231
232% lgt_file_extension(?atom, ?atom)
233
234lgt_file_extension(logtalk, '.lgt').
235lgt_file_extension(prolog, '.pl').
236lgt_file_extension(xml, '.xml').
237
238
239
240%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241%
242%  default compiler options
243%
244%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
245
246
247% lgt_default_compiler_option(?atom, ?atom)
248%
249% default values for all compiler options
250
251lgt_default_compiler_option(iso_initialization_dir, true).
252
253lgt_default_compiler_option(xml, on).
254lgt_default_compiler_option(xsl, 'lgtxml.xsl').
255
256lgt_default_compiler_option(unknown, warning).
257lgt_default_compiler_option(misspelt, warning).
258lgt_default_compiler_option(singletons, warning).
259lgt_default_compiler_option(lgtredef, warning).
260lgt_default_compiler_option(plredef, silent).
261
262lgt_default_compiler_option(report, on).
263
264
265
266%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
267%
268%  list predicates
269%
270%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271
272
273lgt_append([], List, List).
274lgt_append([Head| Tail], List, [Head| Tail2]) :-
275    lgt_append(Tail, List, Tail2).
276
277
278lgt_member(Head, [Head| _]).
279lgt_member(Head, [_| Tail]) :-
280    lgt_member(Head, Tail).
281
282
283lgt_member_var(V, [H| _]) :-
284    V == H.
285lgt_member_var(V, [_| T]) :-
286    lgt_member_var(V, T).
287
288
289lgt_proper_list([]).
290lgt_proper_list([_| List]) :-
291    lgt_proper_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.