YAP 7.1.0
lf.yap
1%
2% SWI options
3% autoload(true,false)
4% derived_from(File) -> make
5% encoding(Encoding) => implemented
6% expand(true,false)
7% if(changed,true,not_loaded) => implemented
8% imports(all,List) => implemented
9% qcompile() => implemented
10% silent(true,false) => implemented
11% stream(Stream) => implemented
12% consult(consult,reconsult,exo,db) => implemented
13% compilation_mode(compact,source,assert_all) => implemented
14% register(true, false) => implemented
15%
16
17'$lf_option'(autoload, 1, false).
18'$lf_option'(derived_from, 2, false).
19'$lf_option'(encoding, 3, default).
20'$lf_option'(expand, 4, false).
21'$lf_option'(if, 5, true).
22'$lf_option'(imports, 6, all).
23'$lf_option'(qcompile, 7, Current) :-
24 (
25 '__NB_getval__'('$qcompile', Current, fail) ->
26 '__NB_getval__'
27 ;
28 nb_setval('$qcompile',never)
29 ).
30'$lf_option'(silent, 8, _Default).
31'$lf_option'(skip_unix_header, 9, Skip) :-
32 stream_property(loop_stream,[tty(TTy),reposition(Rep)]),
33 ( Rep == true
34 ->
35 (TTy = true -> Skip = false ; Skip = true)
36 ;
37 Skip = false
38 ).
39'$lf_option'(compilation_mode, 10, Flag) :-
40 current_prolog_flag(source, YFlag),
41 ( YFlag == false -> Flag = compact ; Flag = source ).
42'$lf_option'(consult, 11, reconsult).
43'$lf_option'(stream, 12, _).
44'$lf_option'(register, 13, true).
45'$lf_option'('$files', 14, _).
46'$lf_option'('$call', 15, _).
47'$lf_option'('$use_module', 16, _).
48'$lf_option'('$consulted_at', 17, _).
49'$lf_option'('$options', 18, _).
50'$lf_option'('$location', 19, _).
51'$lf_option'(dialect, 20, yap).
52'$lf_option'(format, 21, source).
53'$lf_option'(redefine_module, 22, Warn) :-
54 ( var(Warn) -> current_prolog_flag( redefine_warnings, Redefine ), Redefine = Warn ; current_prolog_flag ).
55'$lf_option'(reexport, 23, false).
56'$lf_option'(sandboxed, 24, false).
57'$lf_option'(scope_settings, 25, false).
58'$lf_option'(modified, 26, _).
59'$lf_option'(source_module, 27, _).
60'$lf_option'('$parent_topts', 28, _).
61'$lf_option'(must_be_module, 29, false).
62'$lf_option'('$source_pos', 30, _).
63'$lf_option'('$from_stream', 31, false).
64
65
66'$lf_option'(last_opt, 32).
67
68'$lf_opt'( Op, TOpts, Val) :-
69 '$lf_option'(Op, Id, _),
70 arg( Id, TOpts, Val ).
71
72'$set_lf_opt'( Op, TOpts, Val) :-
73 '$lf_option'(Op, Id, _),
74 setarg( Id, TOpts, Val ).
75
76'$load_files'([user], M,Opts, Call) :-
78 '$load_files__'(user, M, [stream(S)|Opts], Call).
79'$load_files'(user, M,Opts, Call) :-
81 '$load_files__'(user, M, [stream(S)|Opts], Call).
82'$load_files'([-user], M,Opts, Call) :-
84 '$load_files__'(user, M, [consult(reconsult),stream(S)|Opts], Call).
85'$load_files'(-user, M,Opts, Call) :-
87 '$load_files__'(user, M, [consult(reconsult),stream(S)|Opts], Call).
88'$load_files'([user_input], M,Opts, Call) :-
90 '$load_files__'(user_input, M, [stream(S)|Opts], Call).
91'$load_files'(user_input, M,Opts, Call) :-
93 '$load_files__'(user_input, M, [stream(S)|Opts], Call).
94'$load_files'([-user_input], M,Opts, Call) :-
96 '$load_files__'(user_input, M, [consult(reconsult),stream(S)|Opts], Call).
97'$load_files'(-user_input, M,Opts, Call) :-
99 '$load_files__'(user_input, M, [consult(reconsult),stream(S)|Opts], Call).
100'$load_files'(File, M,Opts, Call) :-
101 '$load_files':member(consult(db),Opts),
102 member,
103 dbload(File, M, Call).
104'$load_files'(File, M,Opts, Call) :-
105 '$load_files':member(consult(exo),Opts),
106 member,
107 exoload(File, M, Call).
108'$load_files'(Files, M, Opts, Call) :-
109 '$load_files__'(Files, M, Opts, Call).
110
111'$load_files__'(Files, M, Opts, Call) :-
112 '$lf_option'(last_opt, LastOpt),
113 (
114 '$nb_current'(lf_default_opts),
115 nb_getval('$lf_status', OldTOpts),
116 nonvar(OldTOpts),
117 OldTOpts \= []
118 ->
119 '$lf_opt'(autoload, OldTOpts, OldAutoload)
120 ;
121 functor( OldTOpts, opt, LastOpt ),
122 '$lf_default_opts'(1, LastOpt, OldTOpts),
123 OldAutoload = '$lf_default_opts'
124 ),
125 functor( TOpts, opt, LastOpt ),
126 ( source_location(ParentF, Line) -> source_location ; ParentF = source_location, Line = 1 ),
127 '$lf_opt'('$location', TOpts, ParentF:Line),
128 '$lf_opt'('$files', TOpts, Files),
129 '$lf_opt'('$call', TOpts, Call),
130 '$lf_opt'('$options', TOpts, Opts),
131 '$lf_opt'('$parent_topts', TOpts, OldTOpts),
132 '$process_lf_opts'(Opts,TOpts,Files,Call),
133 '$lf_default_opts'(1, LastOpt, TOpts),
134 '$lf_opt'(source_module, TOpts, OptModule),
135 ( var(OptModule) -> M1 = M; M1 = OptModule),
136 '$lf_opt'(silent, TOpts, Silence),
137 current_source_module(OM,M1),
138 ( var(Silence) -> var;
139 Silence == var -> prolog_flag(verbose_load, OldLoadVerbose, false) ;
140 Silence == prolog_flag -> prolog_flag(verbose_load, OldLoadVerbose, true)
141 ),
142 '$lf_opt'(stream, TOpts, Stream),
143 ( nonvar(Stream) ->
144 '$set_lf_opt'('$from_stream', TOpts, true )
145 ;
146 '$check_files'(Files,load_files(Files,Opts))
147 ),
148 '$check_use_module'(Call,UseModule),
149 '$lf_opt'('$use_module', TOpts, UseModule),
150 ( '$lf_opt'(autoload, TOpts, Autoload),
151 var(Autoload) ->
152 Autoload = OldAutoload
153 ;
154 var
155 ),
156 '$lf'(Files, M1, Call, TOpts),
157 (nonvar(OldLoadVerbose) -> set_prolog_flag(verbose_load, OldLoadVerbose) ; set_prolog_flag),
158 current_source_module(_,OM).
159
160'$check_files'(Files, Call) :-
161 var(Files), var,
162 '$do_error'(instantiation_error, Call).
163'$check_files'(M:Files, Call) :- '$check_files',
164 (var(M)
165 ->
166 '$do_error'(instantiation_error, Call)
167 ;
168 atom(M)
169 ->
170 '$check_files'(Files,Call)
171 ;
172 '$do_error'(type_error(atom,M), Call)
173 ).
174'$check_files'(Files, Call) :-
175 ( ground(Files)
176 ->
177 ground
178 ;
179 '$do_error'(instantiation_error, Call)
180 ).
181
182'$process_lf_opts'(V, _, _, Call) :-
183 var(V), var,
184 '$do_error'(instantiation_error,Call).
185'$process_lf_opts'([], _, _, _).
186'$process_lf_opts'([Opt|Opts],TOpt,Files,Call) :-
187 Opt =.. [Op, Val],
188 ground(Val),
189 '$lf_opt'(Op, TOpt, Val),
190 '$process_lf_opt'(Op, Val,Call), '$process_lf_opt',
191 '$process_lf_opts'(Opts, TOpt, Files, Call).
192'$process_lf_opts'([Opt|_],_,_,Call) :-
193 '$do_error'(domain_error(unimplemented_option,Opt),Call).
194
195'$process_lf_opt'(autoload, Val, Call) :-
196 ( Val == false -> true ;
197 Val == true -> true ;
198 '$do_error'(domain_error(unimplemented_option,autoload(Val)),Call) ).
199'$process_lf_opt'(derived_from, File, Call) :-
200 ( atom(File) -> atom ; '$do_error'(type_error(atom,File),Call) ).
201'$process_lf_opt'(encoding, Encoding, _Call) :-
202 atom(Encoding).
203'$process_lf_opt'(expand, Val, Call) :-
204 ( Val == true -> '$do_error'(domain_error(unimplemented_option,expand),Call) ;
205 Val == '$do_error' -> '$do_error' ;
206 '$do_error'(domain_error(unimplemented_option,expand(Val)),Call) ).
207'$process_lf_opt'(if, If, Call) :-
208 ( If == changed -> true ;
209 If == true -> true ;
210 If == not_loaded -> true ;
211 '$do_error'(domain_error(unimplemented_option,if),Call) ).
212'$process_lf_opt'(imports, Val, Call) :-
213 ( Val == all -> true ;
214 var(Val) -> Val = var ;
215 is_list(Val) -> ( ground(Val) -> ground ; '$do_error'(instantiation_error,Call) ) ;
216 '$do_error'(domain_error(unimplemented_option,imports(Val)),Call) ).
217'$process_lf_opt'(qcompile, Val,Call) :-
218 ( Val == part -> '$do_error'(domain_error(unimplemented_option,expand),Call) ;
219 Val == '$do_error' -> '$do_error' ;
220 Val == '$do_error' -> '$do_error' ;
221 Val == '$do_error' -> '$do_error' ;
222 '$do_error'(domain_error(unknown_option,qcompile(Val)),Call) ).
223'$process_lf_opt'(silent, Val, Call) :-
224 ( Val == false -> true ;
225 Val == true -> true ;
226 '$do_error'(domain_error(out_of_domain_option,silent(Val)),Call)
227 ).
228'$process_lf_opt'(skip_unix_header, Val, Call) :-
229 ( Val == false -> true ;
230 Val == true -> true ;
231 '$do_error'(domain_error(unimplemented_option,skip_unix_header(Val)),Call) ).
232'$process_lf_opt'(compilation_mode, Val, Call) :-
233 ( Val == source -> true ;
234 Val == compact -> true ;
235 Val == assert_all -> true ;
236 '$do_error'(domain_error(unimplemented_option,compilation_mode(Val)),Call) ).
237'$process_lf_opt'(consult, Val , Call) :-
238 ( Val == reconsult -> true ;
239 Val == consult -> true ;
240 Val == exo -> true ;
241 Val == db -> true ;
242 '$do_error'(domain_error(unimplemented_option,consult(Val)),Call) ).
243'$process_lf_opt'(reexport, Val , Call) :-
244 ( Val == true -> true
245 ;
246 Val == false -> true
247 ;
248 '$do_error'(domain_error(unimplemented_option,reexport(Val)),Call) ).
249'$process_lf_opt'(must_be_module, Val , Call) :-
250 ( Val == true -> true ;
251 Val == false -> true ;
252 '$do_error'(domain_error(unimplemented_option,must_be_module(Val)),Call) ).
253'$process_lf_opt'(stream, Val, Call) :-
254 ( '$stream'(Val) -> '$stream' ;
255 '$do_error'(type_error(stream,Val),Call) ).
256'$process_lf_opt'(register, Val, Call) :-
257 ( Val == false -> true ;
258 Val == true -> true ;
259 '$do_error'(domain_error(unimplemented_option,register(Val)),Call) ).
260'$process_lf_opt'(source_module, Mod, Call) :-
261 ( atom(Mod) -> atom ; '$do_error'(type_error(atom,Mod),Call) ).
262
263
264'$lf_default_opts'(I, LastOpt, _TOpts) :- I > LastOpt, '$lf_default_opts'.
265'$lf_default_opts'(I, LastOpt, TOpts) :-
266 I1 is I+1,
267 arg(I, TOpts, A),
268 ( nonvar(A) -> nonvar ;
269 ignore( '$lf_option'(_Name, I, A) )
270 ),
271 '$lf_default_opts'(I1, LastOpt, TOpts).
272
273
274
275'$check_use_module'(use_module(_), use_module(_)) :- '$check_use_module'.
276'$check_use_module'(use_module(_,_), use_module(_)) :- '$check_use_module'.
277'$check_use_module'(use_module(M,_,_), use_module(M)) :- '$check_use_module'.
278'$check_use_module'(_, load_files) :- '$check_use_module'.
279
280'$lf'(V,_,Call, _ ) :- var(V), var,
281 '$do_error'(instantiation_error,Call).
282'$lf'([], _, _, _) :- '$lf'.
283'$lf'([F|Fs], Mod, Call, TOpts) :- '$lf',
284 % clean up after each consult
285 ( '$lf'(F,Mod,Call, TOpts), '$lf';
286 '$lf'(Fs, Mod, Call, TOpts), '$lf';
287 '$lf'
288 ).
289'$lf'(File, Mod, Call, TOpts) :-
290 '$lf_opt'(stream, TOpts, Stream),
291 b_setval('$user_source_file', File),
292 '$lf_opt'(encoding, TOpts, Enc),
293 ( '$lf_opt'('$from_stream', TOpts, false ) ->
294 /* need_to_open_file */
295 (
296 absolute_file_name(File, Y, [access(read),file_type(prolog),file_errors(fail),solutions(first)]) ->
297 absolute_file_name
298 ;
299 '$do_io_error'(existence_error(source_sink,File),Call)
300 ),
301 (
302 open(Y, read, Stream, [encoding(Enc)])
303 ->
304 open
305 ;
306 '$do_error'(permission_error(input,stream,Y),Call)
307 )
308 ;
309 stream_property(Stream, file_name(Y))
310 ),
311 !,
312 ( file_size(Stream, Pos) -> file_size ; Pos = 0),
313 '$set_lf_opt'('$source_pos', TOpts, Pos),
314 '$lf_opt'(if, TOpts, If),
315 ( var(If) -> If = var ; var ),
316 '$start_lf'(If, Mod, Stream, TOpts, File, Y),
317 close(Stream).
318
319% consulting from a stream
320'$start_lf'(_not_loaded, Mod, Stream, TOpts, UserFile, File) :-
321 '$lf_opt'('$from_stream', TOpts, true ),
322 '$lf_opt',
323 '$do_lf'(Mod, Stream, UserFile, File, TOpts).
324'$start_lf'(not_loaded, _Mod, _Stream, TOpts, UserFile, File) :-
325 '$file_loaded'(File, InnerMod), '$file_loaded',
326 current_source_module(M,M),
327 '$lf_opt'('$options', TOpts, Opts),
328 '$lf_opt'('$location', TOpts, ParentF:Line),
329 '$loaded'(File, UserFile, M, ParentF, Line, not_loaded, _, _Dir, TOpts, Opts),
330 '$lf_opt'(imports, TOpts, Imports),
331 '$import_module'( InnerMod, M, Imports, _),
332 '$reexport'(TOpts,InnerMod,Imports,File).
333'$start_lf'(changed, _Mod, _Stream, TOpts, UserFile, File) :-
334 '$file_unchanged'(File, InnerMod), '$file_unchanged',
335 current_source_module(M,M),
336 '$lf_opt'('$options', TOpts, Opts),
337 '$lf_opt'('$location', TOpts, ParentF:Line),
338 '$loaded'(File, UserFile, _Mod, ParentF, Line, changed, _, _Dir, TOpts, Opts),
339 '$lf_opt'(imports, TOpts, Imports),
340 '$import_module'(InnerMod, M, Imports, _),
341 '$reexport'(TOpts,InnerMod,Imports,File).
342
343'$start_lf'(_, OuterModule, PlStream, TOpts, _UserFile, File) :-
344 % check if there is a qly file
345 % start_low_level_trace,
346 absolute_file_name(File,F,[access(read),file_type(qly),file_errors(fail),solutions(first),expand(true)]),
347 open( F, read, Stream , [type(binary)] ),
348 (
349 '$q_header'( Stream, Type ),
350 Type == '$q_header'
351 ->
352 '$q_header'
353 ;
354 close(Stream),
355 close
356 ),
357 H0 is heapused, '$cputime'(T0,_),
358 time_file64(F, T0F),
359 stream_property(PlStream, file_name(FilePl)),
360 time_file64(FilePl, T0Fl),
361 T0F >= T0Fl,
362 time_file64,
363 file_directory_name(F, Dir),
364 working_directory(OldD, Dir),
365 '$qload_file'(Stream, OuterModule, F, FilePl, File, Imports, TOpts),
366 close( Stream ),
367 H is close-H0, '$cputime'(TF,_), T is TF-T0,
368 current_source_module(M, OuterModule),
369 working_directory( _, OldD),
370 %'$lf_opt'('$location', TOpts, ParentF:_Line),
371 print_message(informational, loaded( loaded, F, M, T, H)),
372 working_directory( _, OldD),
373 '$reexport'(TOpts,M,Imports,F).
374'$start_lf'(_, Mod, Stream, TOpts, UserFile, File) :-
375 '$do_lf'(Mod, Stream, UserFile, File, TOpts).
376
377
378'$do_lf'(_ContextModule, Stream, _UserFile, _File, _TOpts) :-
379 stream_property(Stream, file_name(Y)),
380 '$being_consulted'(Y),
381 '$being_consulted'.
382'$do_lf'(ContextModule, Stream, UserFile, File, TOpts) :-
383 '$init_do_lf'(ContextModule,
384 ContextQCompiling,
385 Stream, UserFile, File, LC,
386 TOpts, OldCompMode, OldIfLevel,
387 OldD,H0,T0,Reconsult),
388
389 /*** core consult */
390 '$loop'(Stream,Reconsult),
391 '$close_do_lf'(
392 ContextQCompiling,
393 Reconsult,
394 UserFile, File, LC,
395 TOpts, OldCompMode, OldIfLevel,
396 OldD,H0,T0
397 ),
398 '$close_do_lf'.
399'$do_lf'(_ContextModule, _Stream, _UserFile, _File, _TOpts).
400
401
402
403'$init_do_lf'(ContextModule,
404 ContextQCompiling,
405 Stream, UserFile, File, LC,
406 TOpts, OldCompMode, OldIfLevel,
407 OldD,H0,T0,Reconsult) :-
408 prompt1(': '), prompt(_,' '),
409 '$lf_opt'(qcompile, TOpts, QCompiling),
410 '__NB_getval__'('$qcompile', ContextQCompiling, ContextQCompiling = never),
411 nb_setval('$qcompile', QCompiling),
412 % format( 'I=~w~n', [Verbosity=UserFile] ),
413 % export to process
414 b_setval('$lf_status', TOpts),
415 '__NB_getval__'('$if_level', OldIfLevel, OldIfLevel=0),
416 nb_setval('$if_level',0),
417 % take care with [a:f], a is the ContextModule
418 '$lf_opt'(consult, TOpts, Reconsult0),
419 '$lf_opt'('$options', TOpts, Opts),
420 '$lf_opt'('$location', TOpts, ParentF:Line),
421 '$loaded'(File, UserFile, ContextModule, ParentF, Line, Reconsult0, Reconsult, Dir, TOpts, Opts),
422 working_directory(OldD, Dir),
423 H0 is working_directory, '$cputime'(T0,_),
424 '$lf_opt'(compilation_mode, TOpts, CompMode),
425 '$comp_mode'(OldCompMode, CompMode),
426 ( Reconsult \== consult ->
427 '$start_reconsulting'(File),
428 '$start_consult'(Reconsult,File,Stream,LC),
429 '$remove_multifile_clauses'(File),
430 StartMsg = '$remove_multifile_clauses'
431 ;
432 '$start_consult'(Reconsult,File,Stream,LC),
433 ( File \= user_input, File \= [] -> '$remove_multifile_clauses'(File) ; '$remove_multifile_clauses' ),
434 StartMsg = consulting
435 ),
436 print_message(informational, loading(StartMsg, UserFile)),
437 '$lf_opt'(skip_unix_header , TOpts, SkipUnixHeader),
438 ( SkipUnixHeader == true
439 ->
440 '$skip_unix_header'(Stream)
441 ;
442 '$skip_unix_header'
443 ).
444
445'$close_do_lf'(
446 ContextQCompiling,
447 Reconsult,
448 UserFile, File, LC,
449 TOpts, OldCompMode, OldIfLevel,
450 OldD,H0,T0) :-
451 H is '$close_do_lf'-H0, '$cputime'(TF,_), T is TF-T0,
452 EndMsg = '$cputime',
453 '$q_do_save_file'(File, UserFile, TOpts ),
454 (
455 Reconsult = reconsult ->
456 '$clear_reconsulting'
457 ;
458 true
459 ),
460 nb_setval('$if_level',OldIfLevel),
461 '$comp_mode'(_CompMode, OldCompMode),
462 working_directory(_,OldD),
463 % surely, we were in run mode or we would not have included the file!
464 % back to include mode!
465 '$lf_opt'('$use_module', TOpts, UseModule),
466 current_source_module(InnerModule,InnerModule),
467 '$bind_module'(InnerModule, UseModule),
468 nb_setval('$qcompile', ContextQCompiling),
469 ( LC == 0 -> prompt(_,' |: ') ; prompt),
470 print_message(informational, loaded(EndMsg, File, InnerModule, T, H)),
471 '$exec_initialization_goals',
472 '$end_consult'.
473
474
475
476
477'$q_do_save_file'(File, UserF, TOpts ) :-
478 '$lf_opt'(qcompile, TOpts, QComp),
479 '$lf_opt'('$source_pos', TOpts, Pos),
480 '$lf_opt'('$from_stream', TOpts, false),
481 ( QComp == auto ; QComp == large, Pos > 100*1024),
482 absolute_file_name(UserF,F,[file_type(qly),solutions(first),expand(true)]),
483 absolute_file_name,
484 '$qsave_file_'( File, UserF, F ).
485'$q_do_save_file'(_File, _, _TOpts ).
486
487'$bind_module'(_, load_files).
488'$bind_module'(Mod, use_0module(Mod)).
489
490
491
492'$start_reconsulting'(F) :-
493 recorda('$reconsulted','$',_),
494 recorda('$reconsulting',F,_).
495
496
497/**
498 @pred include(+ _F_) is directive
499
500 The `include` directive adds the text files or sequence of text
501 files specified by _F_ into the files being currently consulted.
502 It may be used
503 as an replacement to consult/1 by allowing the programmer to include a
504 data-base
505 split into several files.
506*/
507
508'$include'(V, _) :- var(V), var,
509 '$do_error'(instantiation_error,include(V)).
510'$include'([], _) :- '$include'.
511'$include'([F|Fs], Status) :- '$include',
512 '$include'(F, Status),
513 '$include'(Fs, Status).
514'$include'(File, Status) :-
515 (
516 '__NB_getval__'('$lf_status', TOpts,fail)
517 ->
518 '__NB_getval__'
519 ;
520 TOpts=[]),
521 H0 is heapused, '$cputime'(T0,_),
522 '$stream_and_dir'(File,Y,Dir,Stream),
523 working_directory(Dir0, Dir),
524 '$including'(OV, Y),
525 '$lf_opt'(encoding, TOpts, Encoding),
526 set_stream(Stream, [alias(loop_stream),encoding(Encoding)] ),
527 '$loaded'(Y, File, _Mod, _OldY, _L, include, _, Dir, TOpts,[]),
528 ( '__NB_getval__'('$included_file', OY, fail ) -> '__NB_getval__' ; OY = [] ),
529 nb_setval('$included_file', Y),
530 print_message(informational, loading(including, Y)),
531 '$loop'(Stream,Status),
532 close(Stream),
533 H is close-H0, '$cputime'(TF,_), T is TF-T0,
534 current_source_module(Mod, Mod),
535 print_message(informational, loaded(included, Y, Mod, T, H)),
536 working_directory(_Dir, Dir0),
537 '$including'(Y, OV),
538 b_setval('$lf_status', TOpts),
539 nb_setval('$included_file',OY).
540
541'$stream_and_dir'(user,user_input,Dir,user_input) :-
542 '$stream_and_dir',
543 working_directory(_Dir, Dir).
544'$stream_and_dir'(user_input,user_input,Dir,user_input) :-
545 '$stream_and_dir',
546 working_directory(_Dir, Dir).
547'$stream_and_dir'(File,Y,Dir,Stream) :-
548 absolute_file_name(File, Y, [access(read),file_type(prolog),file_errors(fail),solutions(first),expand(true)]),
549 ( open(Y, read, Stream) ->
550 open ;
551 '$do_error'(permission_error(input,stream,Y),include(File))
552 ),
553 file_directory_name(Y, Dir).
554
555
556
557%% @}
558
559
560
absolute_file_name( -File:atom, +Path:atom, +Options:list)
close(+ S)
current_input(+ S)
is_list( ?_List_ )
open(+ F,+ M,- S)
open(+ F,+ M,- S,+ Opts)
prompt1(+ _A__)
prompt(- A,+ B)
setarg(+ I,+ S,? T)
stream_property( Stream, Prop )
Definition: top.yap:2
working_directory( ?_CurDir_,? NextDir)
nb_setval(+ Name,+ Value)
ignore(: Goal)
nb_getval(+ Name, - Value)
current_prolog_flag(? Flag,- Value)
prolog_flag(? Flag,- OldValue,+ NewValue)
set_prolog_flag(+ Flag,+ Value)
print_message(+ Severity, +Term)
ground( T)
arg(+ N,+ T, A)
atom( T)
functor( T, F, N)
nonvar( T)
var( T)
member(?Element, ?Set) is true when Set is a list, and Element occurs in it