root/tags/lgt2143/configs/ifprolog.config

Revision 288, 6.9 KB (checked in by pmoura, 6 years ago)

updated Logtalk release number to 2.14.3.

  • 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.14.3
5%
6%  configuration file for IF/Prolog 5.1
7%
8%  last updated: August 19, 2002
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
29'$lgt_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
46'$lgt_predicate_property'(Pred, Prop) :-
47    predicate_property(Pred, Prop).
48
49
50
51%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52%
53%  metapredicates
54%
55%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56
57
58% forall(+callable, +callble)
59
60forall(Generate, Test) :-
61    \+ call((Generate, \+ call(Test))).
62
63
64% lgt_call/2-8
65%
66% use these definitions only if your compiler does
67% not provide call/1-8 as built-in predicates
68
69'$lgt_call'(F, A) :-
70    Call =.. [F, A],
71    call(Call).
72
73
74'$lgt_call'(F, A1, A2) :-
75    Call =.. [F, A1, A2],
76    call(Call).
77
78
79'$lgt_call'(F, A1, A2, A3) :-
80    Call =.. [F, A1, A2, A3],
81    call(Call).
82
83
84'$lgt_call'(F, A1, A2, A3, A4) :-
85    Call =.. [F, A1, A2, A3, A4],
86    call(Call).
87
88
89'$lgt_call'(F, A1, A2, A3, A4, A5) :-
90    Call =.. [F, A1, A2, A3, A4, A5],
91    call(Call).
92
93
94'$lgt_call'(F, A1, A2, A3, A4, A5, A6) :-
95    Call =.. [F, A1, A2, A3, A4, A5, A6],
96    call(Call).
97
98
99'$lgt_call'(F, A1, A2, A3, A4, A5, A6, A7) :-
100    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
101    call(Call).
102
103
104% lgt_once/2-8
105%
106% if your compiler provides call/1-8 as built-in
107% predicates rewrite these definitions using call(...), !.
108
109'$lgt_once'(F, A) :-
110    Call =.. [F, A],
111    once(Call).
112
113
114'$lgt_once'(F, A1, A2) :-
115    Call =.. [F, A1, A2],
116    once(Call).
117
118
119'$lgt_once'(F, A1, A2, A3) :-
120    Call =.. [F, A1, A2, A3],
121    once(Call).
122
123
124'$lgt_once'(F, A1, A2, A3, A4) :-
125    Call =.. [F, A1, A2, A3, A4],
126    once(Call).
127
128
129'$lgt_once'(F, A1, A2, A3, A4, A5) :-
130    Call =.. [F, A1, A2, A3, A4, A5],
131    once(Call).
132
133
134'$lgt_once'(F, A1, A2, A3, A4, A5, A6) :-
135    Call =.. [F, A1, A2, A3, A4, A5, A6],
136    once(Call).
137
138
139'$lgt_once'(F, A1, A2, A3, A4, A5, A6, A7) :-
140    Call =.. [F, A1, A2, A3, A4, A5, A6, A7],
141    once(Call).
142
143
144
145%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146%
147%  file extension predicates
148%
149%  these extensions are used by Logtalk load/compile predicates
150%
151%  you may want to change the extension for Prolog files to match
152%  the one expected by your Prolog compiler
153%
154%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155
156
157% '$lgt_file_extension'(?atom, ?atom)
158
159'$lgt_file_extension'(logtalk, '.lgt').
160'$lgt_file_extension'(prolog, '.pl').
161'$lgt_file_extension'(xml, '.xml').
162
163
164
165%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
166%
167%  default flag values
168%
169%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170
171
172% '$lgt_default_flag'(?atom, ?atom)
173%
174% default values for all flags
175
176'$lgt_default_flag'(iso_initialization_dir, true).
177
178'$lgt_default_flag'(xml, on).
179'$lgt_default_flag'(xsl, 'lgtxml.xsl').
180'$lgt_default_flag'(doctype, local).
181
182'$lgt_default_flag'(unknown, warning).
183'$lgt_default_flag'(misspelt, warning).
184'$lgt_default_flag'(singletons, warning).
185'$lgt_default_flag'(lgtredef, warning).
186'$lgt_default_flag'(plredef, silent).
187'$lgt_default_flag'(portability, silent).
188
189'$lgt_default_flag'(report, on).
190
191'$lgt_default_flag'(smart_compilation, off).
192
193'$lgt_default_flag'(startup_message, on).
194
195'$lgt_default_flag'(named_anonymous_vars, off).
196
197'$lgt_default_flag'(code_prefix, '').
198
199
200
201%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
202%
203%  list predicates
204%
205%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
206
207
208'$lgt_append'([], List, List).
209'$lgt_append'([Head| Tail], List, [Head| Tail2]) :-
210    '$lgt_append'(Tail, List, Tail2).
211
212
213'$lgt_member'(Head, [Head| _]).
214'$lgt_member'(Head, [_| Tail]) :-
215    '$lgt_member'(Head, Tail).
216
217
218'$lgt_member_var'(V, [H| _]) :-
219    V == H.
220'$lgt_member_var'(V, [_| T]) :-
221    '$lgt_member_var'(V, T).
222
223
224'$lgt_proper_list'([]).
225'$lgt_proper_list'([_| List]) :-
226    '$lgt_proper_list'(List).
227
228
229
230%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231%
232%  file predicates
233%
234%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
235
236
237% '$lgt_file_exists'(+atom)
238%
239% see if a file exist in the current directory
240
241'$lgt_file_exists'(File) :-
242    file_test(File, read).
243
244
245% '$lgt_load_prolog_code'(+atom)
246%
247% compile and load a Prolog file
248
249'$lgt_load_prolog_code'(File) :-
250    reconsult(File).
251
252
253% '$lgt_compare_file_mtimes'(?atom, +atom, +atom)
254%
255% compare file modification times
256
257'$lgt_compare_file_mtimes'(Result, File1, File2) :-
258    get_file_info(File1, mtime, Time1),
259    get_file_info(File2, mtime, Time2),
260    compare(Result, Time1, Time2).
261
262
263
264%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
265%
266%  sorting predicates
267%
268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269
270
271% '$lgt_keysort'(+list, -list)
272
273'$lgt_keysort'(List, Sorted) :-
274    throw(error(not_implemented, keysort/2)).
275
276
277% '$lgt_sort'(+list, -list)
278
279'$lgt_sort'(List, Sorted) :-
280    sort(List, Sorted).
281
282
283
284%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
285%
286%  time and date predicates
287%
288%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
289
290
291% '$lgt_current_date'(?Year, ?Month, ?Day)
292
293'$lgt_current_date'(Year, Month, Day) :-
294    localtime(time, Year, Month, Day, _, _, _, _, _).
295
296
297% '$lgt_current_time'(?Hours, ?Mins, ?Secs)
298
299'$lgt_current_time'(Hours, Mins, Secs) :-
300    localtime(time, _, _, _, _, _, Hours, Min, Secs).
301
302
303
304%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
305%
306%  timing predicate
307%
308%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
309
310
311% '$lgt_cpu_time'(-Seconds)
312
313'$lgt_cpu_time'(Seconds) :-
314    Seconds is cputime.
315
316
317
318%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319%
320%  comparison predicate
321%
322%  the usual compare/3 definition
323%
324%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
325
326
327% compare(?atom, @term, @term) -- built-in
328
329
330
331%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
332%
333%  end!
334%
335%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.