root/tags/lgt293/configs/trinc.config

Revision 70, 9.3 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 Trinc Prolog R3
7%
8%  last updated: December 30, 2001
9%
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12
13abort :-
14    throw(error(execution_aborted)).
15
16
17
18%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19%
20%  ISO Prolog Standard predicates that we must define because they are
21%  not built-in
22%
23%  add a clause for lgt_iso_predicate/1 declaring each ISO predicate that
24%  we must define; there must be at least one clause for this predicate
25%  whose call should fail if we don't define any ISO predicates
26%
27%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28
29
30% lgt_iso_predicate(?callable).
31
32lgt_iso_predicate(_) :-
33    fail.
34
35
36
37%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38%
39%  predicate properties
40%
41%  this predicate must return at least static, dynamic and built_in
42%  properties for an existing predicate
43%
44%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
46
47% lgt_predicate_property(+callable, ?predicate_property)
48
49lgt_predicate_property(Pred, built_in) :-
50    iso_bip(Pred).
51
52lgt_predicate_property(Pred, dynamic) :-
53    functor(Pred, Functor, Arity),
54    functor(Clause, Functor, Arity),
55    catch((asserta(Clause), retract(Clause), !), _, fail).
56
57
58
59%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60%
61%  metapredicates
62%
63%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64
65
66% forall(+callable, +callble)
67
68forall(Generate, Test) :-
69    \+ call((Generate, \+ call(Test))).
70
71
72% retractall(+callable)
73
74retractall(Head) :-
75    retract((Head :- _)),
76    fail.
77
78retractall(_).
79
80
81% lgt_call/2-8
82%
83% if your compiler provides call/1-8 as built-in
84% predicates rewrite these definitions using call(...).
85
86lgt_call(F, A) :-
87    Call =.. [F, A],
88    call(Call).
89
90
91lgt_call(F, A1, A2) :-
92    Call =.. [F, A1, A2],
93    call(Call).
94
95
96lgt_call(F, A1, A2, A3) :-
97    Call =.. [F, A1, A2, A3],
98    call(Call).
99
100
101lgt_call(F, A1, A2, A3, A4) :-
102    Call =.. [F, A1, A2, A3, A4],
103    call(Call).
104
105
106lgt_call(F, A1, A2, A3, A4, A5) :-
107    Call =.. [F, A1, A2, A3, A4, A5],
108    call(Call).
109
110
111lgt_call(F, A1, A2, A3, A4, A5, A6) :-
112    Call =.. [F, A1, A2, A3, A4, A5, A6],
113    call(Call).
114
115
116lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
117    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
118    call(Call).
119
120
121% lgt_once/2-8
122%
123% if your compiler provides call/1-8 as built-in
124% predicates rewrite these definitions using call(...), !.
125
126lgt_once(F, A) :-
127    Call =.. [F, A],
128    once(Call).
129
130
131lgt_once(F, A1, A2) :-
132    Call =.. [F, A1, A2],
133    once(Call).
134
135
136lgt_once(F, A1, A2, A3) :-
137    Call =.. [F, A1, A2, A3],
138    once(Call).
139
140
141lgt_once(F, A1, A2, A3, A4) :-
142    Call =.. [F, A1, A2, A3, A4],
143    once(Call).
144
145
146lgt_once(F, A1, A2, A3, A4, A5) :-
147    Call =.. [F, A1, A2, A3, A4, A5],
148    once(Call).
149
150
151lgt_once(F, A1, A2, A3, A4, A5, A6) :-
152    Call =.. [F, A1, A2, A3, A4, A5, A6],
153    once(Call).
154
155
156lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
157    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
158    once(Call).
159
160
161
162%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163%
164%  file extension predicates
165%
166%  these extensions are used by Logtalk load/compile predicates
167%
168%  you may want to change the extension for Prolog files to match
169%  the one expected by your Prolog compiler
170%
171%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
172
173
174% lgt_file_extension(?atom, ?atom)
175
176lgt_file_extension(logtalk, '.lgt').
177lgt_file_extension(prolog, '.pl').
178lgt_file_extension(xml, '.xml').
179
180
181
182%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183%
184%  default flag values
185%
186%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
187
188
189% lgt_default_flag(?atom, ?atom)
190%
191% default values for all flags
192
193lgt_default_flag(iso_initialization_dir, true).
194
195lgt_default_flag(xml, on).
196lgt_default_flag(xsl, 'lgtxml.xsl').
197
198lgt_default_flag(unknown, warning).
199lgt_default_flag(misspelt, warning).
200lgt_default_flag(singletons, warning).
201lgt_default_flag(lgtredef, warning).
202lgt_default_flag(plredef, silent).
203lgt_default_flag(portability, silent).
204
205lgt_default_flag(report, on).
206
207
208
209%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210%
211%  list predicates
212%
213%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214
215
216lgt_append([], List, List).
217lgt_append([Head| Tail], List, [Head| Tail2]) :-
218    lgt_append(Tail, List, Tail2).
219
220
221lgt_member(Head, [Head| _]).
222lgt_member(Head, [_| Tail]) :-
223    lgt_member(Head, Tail).
224
225
226lgt_member_var(V, [H| _]) :-
227    V == H.
228lgt_member_var(V, [_| T]) :-
229    lgt_member_var(V, T).
230
231
232lgt_proper_list([]).
233lgt_proper_list([_| List]) :-
234    lgt_proper_list(List).
235
236
237
238%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
239%
240%  file predicates
241%
242%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
243
244
245% lgt_file_exists(+atom)
246%
247% see if a file exist in the current directory
248
249lgt_file_exists(File) :-
250    catch(open(File, read, Stream), _, fail),
251    close(Stream).
252
253
254% lgt_load_prolog_code(+atom)
255%
256% compile and load a Prolog file
257
258lgt_load_prolog_code(File) :-
259    consult(File).
260
261
262
263%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
264%
265%  sorting predicate
266%
267%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
268
269
270% lgt_keysort(+list, -list)
271
272lgt_keysort(List, Sorted) :-
273    throw(error(not_yet_implemented, keysort/2)).
274
275
276% lgt_sort(+list, -list)
277
278lgt_sort(List, Sorted) :-
279    throw(error(not_yet_implemented, sort/2)).
280
281
282
283%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
284%
285%  time and date predicates
286%
287%  if your Prolog compiler does not provide access to the operating system
288%  time and date just write dummy definitions
289%
290%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
291
292
293% lgt_current_date(?Year, ?Month, ?Day)
294
295lgt_current_date(1999, 12, 3).
296
297
298% lgt_current_time(?Hours, ?Mins, ?Secs)
299
300lgt_current_time(0, 0, 0).
301
302
303
304%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305%
306%  timing predicate
307%
308%  if your Prolog compiler does not provide access to a timing predicate
309%  just write dummy definition
310%
311%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312
313
314% lgt_cpu_time(-Seconds)
315
316lgt_cpu_time(Seconds) :-
317    throw(error(not_yet_implemented, cpu_time/1)).
318
319
320
321%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
322%
323%  comparison predicate
324%
325%  the usual compare/3 definition
326%
327%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
328
329
330% compare(?atom, @term, @term)
331
332compare(<, X, Y) :-
333    X @< Y, !.
334
335compare(=, X, Y) :-
336    X == Y, !.
337   
338compare(>, X, Y) :-
339    X @> Y.
340
341
342
343%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
344%
345%  end!
346%
347%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
348
349
350
351iso_bip(_ = _).
352iso_bip(_ \= _).
353iso_bip(unify_with_occurs_check(_, _)).
354
355iso_bip(var(_)).
356iso_bip(atom(_)).
357iso_bip(integer(_)).
358iso_bip(float(_)).
359iso_bip(atomic(_)).
360iso_bip(compound(_)).
361iso_bip(nonvar(_)).
362iso_bip(number(_)).
363
364iso_bip(_ @=< _).
365iso_bip(_ @< _).
366iso_bip(_ @>= _).
367iso_bip(_ @> _).
368iso_bip(_ == _).
369iso_bip(_ \== _).
370
371iso_bip(functor(_, _, _)).
372iso_bip(arg(_, _, _)).
373iso_bip(copy_term(_, _)).
374iso_bip(_ =.. _).
375
376iso_bip(_ is _).
377
378iso_bip(_ =:= _).
379iso_bip(_ =\= _).
380iso_bip(_ < _).
381iso_bip(_ =< _).
382iso_bip(_ > _).
383iso_bip(_ >= _).
384
385iso_bip(clause(_, _)).
386iso_bip(current_predicate(_)).
387
388iso_bip(abolish(_)).
389iso_bip(asserta(_)).
390iso_bip(assertz(_)).
391iso_bip(retract(_)).
392
393iso_bip(bagof(_, _, _)).
394iso_bip(findall(_, _, _)).
395iso_bip(setof(_, _, _)).
396
397iso_bip(current_input(_)).
398iso_bip(current_output(_)).
399iso_bip(set_input(_)).
400iso_bip(set_output(_)).
401iso_bip(open(_, _, _)).
402iso_bip(open(_, _, _, _)).
403iso_bip(close(_)).
404iso_bip(close(_, _)).
405iso_bip(flush_output).
406iso_bip(flush_output(_)).
407iso_bip(stream_property(_, _)).
408iso_bip(set_stream_position(_, _)).
409iso_bip(at_end_of_stream).
410iso_bip(at_end_of_stream(_)).
411
412iso_bip(get_char(_)).
413iso_bip(get_char(_, _)).
414iso_bip(get_code(_)).
415iso_bip(get_code(_, _)).
416iso_bip(peek_char(_)).
417iso_bip(peek_char(_, _)).
418iso_bip(peek_code(_)).
419iso_bip(peek_code(_, _)).
420iso_bip(put_char(_)).
421iso_bip(put_char(_, _)).
422iso_bip(put_code(_)).
423iso_bip(put_code(_, _)).
424iso_bip(nl).
425iso_bip(nl(_)).
426
427iso_bip(get_byte(_)).
428iso_bip(get_byte(_, _)).
429iso_bip(peek_byte(_)).
430iso_bip(peek_byte(_, _)).
431iso_bip(put_byte(_)).
432iso_bip(put_byte(_, _)).
433
434iso_bip(read_term(_, _)).
435iso_bip(read_term(_, _, _)).
436iso_bip(read(_)).
437iso_bip(read(_, _)).
438iso_bip(write_term(_, _)).
439iso_bip(write_term(_, _, _)).
440iso_bip(write(_)).
441iso_bip(write(_, _)).
442iso_bip(writeq(_)).
443iso_bip(writeq(_, _)).
444iso_bip(write_canonical(_)).
445iso_bip(write_canonical(_, _)).
446iso_bip(op(_, _, _)).
447iso_bip(current_op(_, _, _)).
448iso_bip(char_conversion(_, _)).
449iso_bip(current_char_conversion(_, _)).
450
451iso_bip(\+ _).
452iso_bip(once(_)).
453iso_bip(repeat).
454
455iso_bip(atom_length(_, _)).
456iso_bip(atom_concat(_, _, _)).
457iso_bip(sub_atom(_, _, _, _, _)).
458iso_bip(atom_chars(_, _)).
459iso_bip(atom_codes(_, _)).
460iso_bip(char_code(_, _)).
461iso_bip(number_chars(_, _)).
462iso_bip(number_codes(_, _)).
463
464iso_bip(current_prolog_flag(_, _)).
465iso_bip(set_prolog_flag(_, _)).
466iso_bip(halt).
467iso_bip(halt(_)).
468
469iso_bip(true).
470iso_bip(fail).
471iso_bip(call(_)).
472iso_bip(!).
473iso_bip(catch(_,_,_)).
474iso_bip(throw(_)).
Note: See TracBrowser for help on using the browser.