root/tags/lgt293/configs/gnu.config

Revision 70, 6.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 GNU Prolog 1.1.2 (and later versions)
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
27% lgt_iso_predicate(?callable).
28
29lgt_iso_predicate(_) :-
30    fail.
31
32
33
34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35%
36%  predicate properties
37%
38%  this predicate must return at least static, dynamic and built_in
39%  properties for an existing predicate
40%
41%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
43
44% lgt_predicate_property(+callable, ?predicate_property)
45
46lgt_predicate_property(Pred, Prop) :-
47    functor(Pred, Functor, Arity),
48    predicate_property(Functor/Arity, Prop).
49
50
51
52%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53%
54%  metapredicates
55%
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
58
59% forall(+callable, +callble)
60
61forall(Generate, Test) :-
62    \+ call((Generate, \+ call(Test))).
63
64
65% lgt_call/2-8
66%
67% use these definitions only if your compiler does
68% not provide call/1-8 as built-in predicates
69
70lgt_call(F, A) :-
71    call_with_args(F, A).
72
73
74lgt_call(F, A1, A2) :-
75    call_with_args(F, A1, A2).
76
77
78lgt_call(F, A1, A2, A3) :-
79    call_with_args(F, A1, A2, A3).
80
81
82lgt_call(F, A1, A2, A3, A4) :-
83    call_with_args(F, A1, A2, A3, A4).
84
85
86lgt_call(F, A1, A2, A3, A4, A5) :-
87    call_with_args(F, A1, A2, A3, A4, A5).
88
89
90lgt_call(F, A1, A2, A3, A4, A5, A6) :-
91    call_with_args(F, A1, A2, A3, A4, A5, A6).
92
93
94lgt_call(F, A1, A2, A3, A4, A5, A6, A7) :-
95    call_with_args(F, A1, A2, A3, A4, A5, A6, A7).
96
97
98% lgt_once/2-8
99%
100% if your compiler provides call/1-8 as built-in
101% predicates rewrite these definitions using call(...), !.
102
103lgt_once(F, A) :-
104    call_with_args(F, A),
105    !.
106
107
108lgt_once(F, A1, A2) :-
109    call_with_args(F, A1, A2),
110    !.
111
112
113lgt_once(F, A1, A2, A3) :-
114    call_with_args(F, A1, A2, A3),
115    !.
116
117
118lgt_once(F, A1, A2, A3, A4) :-
119    call_with_args(F, A1, A2, A3, A4),
120    !.
121
122
123lgt_once(F, A1, A2, A3, A4, A5) :-
124    call_with_args(F, A1, A2, A3, A4, A5),
125    !.
126
127
128lgt_once(F, A1, A2, A3, A4, A5, A6) :-
129    call_with_args(F, A1, A2, A3, A4, A5, A6),
130    !.
131
132
133lgt_once(F, A1, A2, A3, A4, A5, A6, A7) :-
134    call_with_args(F, A1, A2, A3, A4, A5, A6, A7),
135    !.
136
137
138
139%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140%
141%  file extension predicates
142%
143%  these extensions are used by Logtalk load/compile predicates
144%
145%  you may want to change the extension for Prolog files to match
146%  the one expected by your Prolog compiler
147%
148%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149
150
151% lgt_file_extension(?atom, ?atom)
152
153lgt_file_extension(logtalk, '.lgt').
154lgt_file_extension(prolog, '.pl').
155lgt_file_extension(xml, '.xml').
156
157
158
159%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160%
161%  default flag values
162%
163%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164
165
166% lgt_default_flag(?atom, ?atom)
167%
168% default values for all flags
169
170lgt_default_flag(iso_initialization_dir, true).
171
172lgt_default_flag(xml, on).
173lgt_default_flag(xsl, 'lgtxml.xsl').
174
175lgt_default_flag(unknown, warning).
176lgt_default_flag(misspelt, warning).
177lgt_default_flag(singletons, warning).
178lgt_default_flag(lgtredef, warning).
179lgt_default_flag(plredef, silent).
180lgt_default_flag(portability, silent).
181
182lgt_default_flag(report, on).
183
184
185
186%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
187%
188%  list predicates
189%
190%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
191
192
193lgt_append(List1, List2, List3) :-
194    append(List1, List2, List3).
195
196
197lgt_member(Element, List) :-
198    member(Element, List).
199
200
201lgt_member_var(V, [H| _]) :-
202    V == H.
203lgt_member_var(V, [_| T]) :-
204    lgt_member_var(V, T).
205
206
207lgt_proper_list(List) :-
208    list(List).
209
210
211
212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213%
214%  file predicates
215%
216%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
218
219% lgt_file_exists(+atom)
220%
221% see if a file exist in the current directory
222
223lgt_file_exists(File) :-
224    file_exists(File).
225
226
227% lgt_load_prolog_code(+atom)
228%
229% compile and load a Prolog file
230
231lgt_load_prolog_code(File) :-
232    consult(File).
233
234
235
236%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
237%
238%  sorting predicates
239%
240%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241
242
243% lgt_keysort(+list, -list)
244
245lgt_keysort(List, Sorted) :-
246    keysort(List, Sorted).
247
248
249% lgt_sort(+list, -list)
250
251lgt_sort(List, Sorted) :-
252    sort(List, Sorted).
253
254
255
256%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
257%
258%  time and date predicates
259%
260%  if your Prolog compiler does not provide access to the operating system
261%  time and date just write dummy definitions
262%
263%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
264
265
266% lgt_current_date(?Year, ?Month, ?Day)
267
268lgt_current_date(Year, Month, Day) :-
269    date_time(dt(Year, Month, Day, _, _, _)).
270
271
272% lgt_current_time(?Hours, ?Mins, ?Secs)
273
274lgt_current_time(Hours, Mins, Secs) :-
275    date_time(dt(_, _, _, Hours, Mins, Secs)).
276
277
278
279%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
280%
281%  timing predicate
282%
283%  if your Prolog compiler does not provide access to a timing predicate
284%  just write dummy definition
285%
286%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
287
288
289% lgt_cpu_time(-Seconds)
290
291lgt_cpu_time(Seconds) :-
292    cpu_time(Miliseconds),
293    Seconds is Miliseconds / 1000.
294
295
296
297%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
298%
299%  comparison predicate
300%
301%  the usual compare/3 definition
302%
303%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
304
305
306% compare(?atom, @term, @term) -- built-in
307
308
309
310%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
311%
312%  end!
313%
314%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.