root/tags/lgt290/configs/trinc.config

Revision 2, 9.4 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 Trinc Prolog R3
7%
8%  last updated: August 24, 2000
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 compiler options
185%
186%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
187
188
189% lgt_default_compiler_option(?atom, ?atom)
190%
191% default values for all compiler options
192
193lgt_default_compiler_option(iso_initialization_dir, true).
194
195lgt_default_compiler_option(xml, on).
196lgt_default_compiler_option(xsl, 'lgtxml.xsl').
197
198lgt_default_compiler_option(unknown, warning).
199lgt_default_compiler_option(misspelt, warning).
200lgt_default_compiler_option(singletons, warning).
201lgt_default_compiler_option(lgtredef, warning).
202lgt_default_compiler_option(plredef, silent).
203
204lgt_default_compiler_option(report, on).
205
206
207
208%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
209%
210%  list predicates
211%
212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213
214
215lgt_append([], List, List).
216lgt_append([Head| Tail], List, [Head| Tail2]) :-
217    lgt_append(Tail, List, Tail2).
218
219
220lgt_member(Head, [Head| _]).
221lgt_member(Head, [_| Tail]) :-
222    lgt_member(Head, Tail).
223
224
225lgt_member_var(V, [H| _]) :-
226    V == H.
227lgt_member_var(V, [_| T]) :-
228    lgt_member_var(V, T).
229
230
231lgt_proper_list([]).
232lgt_proper_list([_| List]) :-
233    lgt_proper_list(List).
234
235
236
237%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
238%
239%  file predicates
240%
241%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
242
243
244% lgt_file_exists(+atom)
245%
246% see if a file exist in the current directory
247
248lgt_file_exists(File) :-
249    catch(open(File, read, Stream), _, fail),
250    close(Stream).
251
252
253% lgt_load_prolog_code(+atom)
254%
255% compile and load a Prolog file
256
257lgt_load_prolog_code(File) :-
258    consult(File).
259
260
261
262%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263%
264%  sorting predicate
265%
266%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
267
268
269% lgt_keysort(+list, -list)
270
271lgt_keysort(List, Sorted) :-
272    throw(error(not_yet_implemented, keysort/2)).
273
274
275% lgt_sort(+list, -list)
276
277lgt_sort(List, Sorted) :-
278    throw(error(not_yet_implemented, sort/2)).
279
280
281
282%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
283%
284%  time and date predicates
285%
286%  if your Prolog compiler does not provide access to the operating system
287%  time and date just write dummy definitions
288%
289%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
290
291
292% lgt_current_date(?Year, ?Month, ?Day)
293
294lgt_current_date(1999, 12, 3).
295
296
297% lgt_current_time(?Hours, ?Mins, ?Secs)
298
299lgt_current_time(0, 0, 0).
300
301
302
303%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
304%
305%  timing predicate
306%
307%  if your Prolog compiler does not provide access to a timing predicate
308%  just write dummy definition
309%
310%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
311
312
313% lgt_cpu_time(-Seconds)
314
315lgt_cpu_time(Seconds) :-
316    throw(error(not_yet_implemented, cpu_time/1)).
317
318
319
320%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
321%
322%  comparison predicate
323%
324%  the usual compare/3 definition
325%
326%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
327
328
329% compare(?atom, @term, @term)
330
331compare(<, X, Y) :-
332    X @< Y, !.
333
334compare(=, X, Y) :-
335    X == Y, !.
336   
337compare(>, X, Y) :-
338    X @> Y.
339
340
341
342%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
343%
344%  end!
345%
346%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
347
348
349
350iso_bip(_ = _).
351iso_bip(_ \= _).
352iso_bip(unify_with_occurs_check(_, _)).
353
354iso_bip(var(_)).
355iso_bip(atom(_)).
356iso_bip(integer(_)).
357iso_bip(float(_)).
358iso_bip(atomic(_)).
359iso_bip(compound(_)).
360iso_bip(nonvar(_)).
361iso_bip(number(_)).
362
363iso_bip(_ @=< _).
364iso_bip(_ @< _).
365iso_bip(_ @>= _).
366iso_bip(_ @> _).
367iso_bip(_ == _).
368iso_bip(_ \== _).
369
370iso_bip(functor(_, _, _)).
371iso_bip(arg(_, _, _)).
372iso_bip(copy_term(_, _)).
373iso_bip(_ =.. _).
374
375iso_bip(_ is _).
376
377iso_bip(_ =:= _).
378iso_bip(_ =\= _).
379iso_bip(_ < _).
380iso_bip(_ =< _).
381iso_bip(_ > _).
382iso_bip(_ >= _).
383
384iso_bip(clause(_, _)).
385iso_bip(current_predicate(_)).
386
387iso_bip(abolish(_)).
388iso_bip(asserta(_)).
389iso_bip(assertz(_)).
390iso_bip(retract(_)).
391
392iso_bip(bagof(_, _, _)).
393iso_bip(findall(_, _, _)).
394iso_bip(setof(_, _, _)).
395
396iso_bip(current_input(_)).
397iso_bip(current_output(_)).
398iso_bip(set_input(_)).
399iso_bip(set_output(_)).
400iso_bip(open(_, _, _)).
401iso_bip(open(_, _, _, _)).
402iso_bip(close(_)).
403iso_bip(close(_, _)).
404iso_bip(flush_output).
405iso_bip(flush_output(_)).
406iso_bip(stream_property(_, _)).
407iso_bip(set_stream_position(_, _)).
408iso_bip(at_end_of_stream).
409iso_bip(at_end_of_stream(_)).
410
411iso_bip(get_char(_)).
412iso_bip(get_char(_, _)).
413iso_bip(get_code(_)).
414iso_bip(get_code(_, _)).
415iso_bip(peek_char(_)).
416iso_bip(peek_char(_, _)).
417iso_bip(peek_code(_)).
418iso_bip(peek_code(_, _)).
419iso_bip(put_char(_)).
420iso_bip(put_char(_, _)).
421iso_bip(put_code(_)).
422iso_bip(put_code(_, _)).
423iso_bip(nl).
424iso_bip(nl(_)).
425
426iso_bip(get_byte(_)).
427iso_bip(get_byte(_, _)).
428iso_bip(peek_byte(_)).
429iso_bip(peek_byte(_, _)).
430iso_bip(put_byte(_)).
431iso_bip(put_byte(_, _)).
432
433iso_bip(read_term(_, _)).
434iso_bip(read_term(_, _, _)).
435iso_bip(read(_)).
436iso_bip(read(_, _)).
437iso_bip(write_term(_, _)).
438iso_bip(write_term(_, _, _)).
439iso_bip(write(_)).
440iso_bip(write(_, _)).
441iso_bip(writeq(_)).
442iso_bip(writeq(_, _)).
443iso_bip(write_canonical(_)).
444iso_bip(write_canonical(_, _)).
445iso_bip(op(_, _, _)).
446iso_bip(current_op(_, _, _)).
447iso_bip(char_conversion(_, _)).
448iso_bip(current_char_conversion(_, _)).
449
450iso_bip(\+ _).
451iso_bip(once(_)).
452iso_bip(repeat).
453
454iso_bip(atom_length(_, _)).
455iso_bip(atom_concat(_, _, _)).
456iso_bip(sub_atom(_, _, _, _, _)).
457iso_bip(atom_chars(_, _)).
458iso_bip(atom_codes(_, _)).
459iso_bip(char_code(_, _)).
460iso_bip(number_chars(_, _)).
461iso_bip(number_codes(_, _)).
462
463iso_bip(current_prolog_flag(_, _)).
464iso_bip(set_prolog_flag(_, _)).
465iso_bip(halt).
466iso_bip(halt(_)).
467
468iso_bip(true).
469iso_bip(fail).
470iso_bip(call(_)).
471iso_bip(!).
472iso_bip(catch(_,_,_)).
473iso_bip(throw(_)).
Note: See TracBrowser for help on using the browser.