root/tags/lgt293/configs/qu.configold

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