root/tags/lgt293/configs/swi.config

Revision 78, 6.2 KB (checked in by pmoura, 7 years ago)

Renamed config file for SWI-Prolog 3.3.x and later versions.

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