root/tags/lgt290/configs/sicstus38.config

Revision 2, 6.7 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 SICStus Prolog 3.8
7%
8%  last updated: August 24, 2000
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 compiler options
172%
173%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
174
175
176% lgt_default_compiler_option(?atom, ?atom)
177%
178% default values for all compiler options
179
180lgt_default_compiler_option(iso_initialization_dir, true).
181
182lgt_default_compiler_option(xml, on).
183lgt_default_compiler_option(xsl, 'lgtxml.xsl').
184
185lgt_default_compiler_option(unknown, warning).
186lgt_default_compiler_option(misspelt, warning).
187lgt_default_compiler_option(singletons, warning).
188lgt_default_compiler_option(lgtredef, warning).
189lgt_default_compiler_option(plredef, silent).
190
191lgt_default_compiler_option(report, on).
192
193
194
195%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
196%
197%  list predicates
198%
199%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
200
201
202lgt_append([], List, List).
203lgt_append([Head| Tail], List, [Head| Tail2]) :-
204    lgt_append(Tail, List, Tail2).
205
206
207lgt_member(Head, [Head| _]).
208lgt_member(Head, [_| Tail]) :-
209    lgt_member(Head, Tail).
210
211
212lgt_member_var(V, [H| _]) :-
213    V == H.
214lgt_member_var(V, [_| T]) :-
215    lgt_member_var(V, T).
216
217
218lgt_proper_list([]).
219lgt_proper_list([_| List]) :-
220    lgt_proper_list(List).
221
222
223
224%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225%
226%  file predicates
227%
228%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
229
230
231% lgt_file_exists(+atom)
232%
233% see if a file exist in the current directory
234
235lgt_file_exists(File) :-
236    file_exists(File).
237
238
239% lgt_load_prolog_code(+atom)
240%
241% compile and load a Prolog file
242
243lgt_load_prolog_code(File) :-
244    compile(File).
245
246
247
248%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
249%
250%  sorting predicates
251%
252%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253
254
255% lgt_keysort(+list, -list)
256
257lgt_keysort(List, Sorted) :-
258    keysort(List, Sorted).
259
260
261% lgt_sort(+list, -list)
262
263lgt_sort(List, Sorted) :-
264    sort(List, Sorted).
265
266
267
268%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
269%
270%  time and date predicates
271%
272%  if your Prolog compiler does not provide access to the operating system
273%  time and date just write dummy definitions
274%
275%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
276
277
278% lgt_current_date(?Year, ?Month, ?Day)
279
280lgt_current_date(Year, Month, Day) :-
281    datime(datime(Year, Month, Day, _, _, _)).
282
283
284% lgt_current_time(?Hours, ?Mins, ?Secs)
285
286lgt_current_time(Hours, Mins, Secs) :-
287    datime(datime(_, _, _, Hours, Mins, Secs)).
288
289
290
291%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
292%
293%  timing predicate
294%
295%  if your Prolog compiler does not provide access to a timing predicate
296%  just write dummy definition
297%
298%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
299
300
301% lgt_cpu_time(-Seconds)
302
303lgt_cpu_time(Seconds) :-
304    statistics(runtime, [Miliseconds| _]),
305    Seconds is Miliseconds / 1000.
306
307
308
309%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
310%
311%  comparison predicate
312%
313%  the usual compare/3 definition
314%
315%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316
317
318% compare(?atom, @term, @term) -- built-in
319
320
321
322%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
323%
324%  end!
325%
326%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracBrowser for help on using the browser.