root/tags/lgt293/configs/sicstus38.config

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