29:- module(system(
'$messages',[]),
101:-
dynamic prolog:message//1.
102:-
multifile prolog:message//1.
106:-
multifile user:portray_message/2.
108:-
dynamic user:portray_message/2.
128translate_message(
Term )
-->
129 message(
Term),
message.
130translate_message(answer(
Vs,
GVs,
LGs,
Extras))
-->
132 write_query_answer(
Vs,
GVs ,
LGs,
Extras).
133translate_message( absolute_file_path(
File))
-->
135 [
'~N~n absolute_file of ~w' - [
File] ].
136translate_message( absolute_file_path(
Msg,
Args))
-->
141translate_message( absolute_file_path_component(
Msg,
Args))
-->
144 [
'$messages':seq(
Args) ].
145translate_message( arguments([]))
-->
147translate_message( arguments([
A|As]))
-->
151 translate_message( arguments(
As)).
152translate_message( ancestors([]))
-->
154 [
'There are no ancestors.' ].
155translate_message( breakp(bp(debugger,
_,
_,
M:F/N,
_),add,already))
-->
157 [
'There is already a spy point on ~w:~w/~w.' - [
M,
F,
N] ].
158translate_message( breakp(bp(debugger,
_,
_,
M:F/N,
_),add,ok))
-->
160 [
'Spy point set on ~w:~w/~w.' - [
M,
F,
N] ].
161translate_message( breakp(bp(debugger,
_,
_,
M:F/N,
_),remove,last))
-->
163 [
'Spy point on ~w:~w/~w removed.' - [
M,
F,
N] ].
164translate_message( breakp(no,breakpoint_for,
M:F/N))
-->
166 [
'There is no spy point on ~w:~w/~w.' - [
M,
F,
N] ].
167translate_message( breakpoints([]))
-->
169 [
'There are no spy-points set.' ].
170translate_message( breakpoints(
L))
-->
172 [
'Spy-points set on:' ],
174translate_message( clauses_not_together(
P))
-->
176 [
'Discontiguous definition of ~q.' - [
P] ].
177translate_message( debug(debug))
-->
179 [
'Debug mode on.' - [] ].
180translate_message( debug(off))
-->
182 [
'Debug mode off.'- [] ].
183translate_message( debug(trace))
-->
185 [
'Trace mode on.'- [] ].
186translate_message( declaration(
Args,
Action))
-->
188 [
'declaration ~w ~w.' - [
Args,
Action] ].
189translate_message( defined_elsewhere(
P,
F))
-->
191 [
'predicate ~q previously defined in file ~w' - [
P,
F] ].
192translate_message( functionality(
Library))
-->
194 [
'~q not available' - [
Library] ].
195translate_message( import(
Pred,
To,
From,private))
-->
197 [
'Importing private predicate ~w:~w to ~w.' - [
From,
Pred,
To] ].
198translate_message( redefine_imported(
M,
M0,
PI))
-->
200 {
source_location(
ParentF,
Line) },
201 [
'~N~w:~w:~w Module ~w redefines imported predicate ~w:~w.' - [
ParentF,
Line,
0,
M,
M0,
PI] ].
202translate_message( leash([]))
-->
205translate_message( leash([
A|B]))
-->
207 [
'Leashing set to ~w.' - [[
A|B]] ].
208translate_message(yes)
-->
213translate_message(false)
-->
216translate_message( no)
-->
219translate_message( no_match(
P))
-->
221 [
'No matching predicate for ~w.' - [
P] ].
222translate_message( leash([
A|B]))
-->
224 [
'Leashing set to ~w.' - [[
A|B]] ].
225translate_message( halt)
-->
227 [
'YAP execution halted.'-[] ].
228translate_message(
'$abort')
--> translate_message,
229 [
'YAP execution aborted'-[] ].
230translate_message( abort(user))
--> translate_message,
231 [
'YAP execution aborted' - [] ].
232translate_message( loading(
_,
F))
--> {
F == user },
.
233translate_message( loading(
What,
FileName))
--> translate_message,
234 {
'$show_consult_level'(
LC) },
235 [
'~N~*|~a ~w...' - [
LC,
What,
FileName] ].
236translate_message( loaded(
_,user,
_,
_,
_))
--> translate_message.
237translate_message( loaded(
What,
AbsFileName,
Mod,
Time,
Space))
--> translate_message,
238 {
'$show_consult_level'(
LC) },
239 [
'~N~*|~a ~a in module ~a, ~d msec ~d bytes' - [
LC,
AbsFileName,
What,
Mod,
Time,
Space] ].
240translate_message(signal(
SIG,
_))
-->
242 [
'UNEXPECTED SIGNAL: ~a' - [
SIG] ].
243translate_message(trace_command(
C))
-->
245 [
'~a is not a valid debugger command.' - [
C] ].
246translate_message(trace_help)
-->
248 [
' Please enter a valid debugger command (h for help).' ].
249translate_message(version(yap(
Mj,
Mi,
Patch,
_),
VersionGit,
AT,
Saved))
-->
251 {
sub_atom(
VersionGit,
0,
8,
_,
VERSIONGIT ) },
252 [
'YAP ~d.~d.~d-~a (compiled ~a)~n' - [
Mj,
Mi,
Patch,
VERSIONGIT,
AT],
253 'database loaded from ~a~n' - [
Saved] ].
254translate_message(myddas_version(
Version))
-->
256 [
'MYDDAS version ~a' - [
Version] ].
257translate_message(throw(
BALL))
-->
259 [
'WARNING: throw of ~W had no catch' - [
BALL,[]] ].
260translate_message(error(syntax_error(
E),
Exc))
-->
263 error_descriptor(
Exc,
Desc),
264 '$show_consult_level'(
LC)
266 location(
Desc, error, short,
LC),
267 main_message(error(syntax_error(
E),
Exc), error,
LC ).
268translate_message(error(style_check(
What,
File,
Line,
Clause),
Exc))
-->
270 {
error_descriptor(
Exc,
Desc),
271 '$show_consult_level'(
LC) },
272 location(
Desc, error, short,
LC),
273 main_message(error(style_check(
What,
File,
Line,
Clause),
Exc), warning,
LC ).
274translate_message(error(
E,
Info))
-->
276 '$show_consult_level'(
LC),
277 error_descriptor(
Info,
Desc),
278 Level = error_descriptor
281 location(
Desc,
Level,full ,
LC),
282 main_message(error(
E,
Info) ,
Level,
LC ),
283 c_goal(
Desc,
Level,
LC ),
284 extra_info(
Desc,
Level,
LC ),
285 stack_info(
Desc,
Level,
LC ),
289translate_message(error(user_defined_error(
Error),
Info))
-->
291 {
'$show_consult_level'(
LC),
292 error_descriptor(
Info,
Desc) },
293 location(
Desc, error, short,
LC),
294 translate_message(
Error).
295translate_message(error(
Exc,
Info))
-->
297 '$show_consult_level'(
LC),
298 error_descriptor(
Info,
Desc),
303 c_goal(
Desc, error,
LC ).
304translate_message(error(
Descriptor,exception(
Error)))
-->
306 [
'ERROR NOT RECOGNISED - ~w unsupported both by YAP system code and by user hooks:' - [
Descriptor] , nl],
307 [
'~@' - [
'print_exception'(
Error)] ,nl].
308translate_message(
Throw)
-->
322location(
Desc,
Level,
More,
LC )
-->
324 query_exception(prologConsulting,
Desc, true),
326 query_exception(parserLine,
Desc,
LN),
328 query_exception(parserFile,
Desc,
FileName),
330 query_exception(parserPos,
Desc,
Pos),
331 (
var(
Pos)
-> Pos=1;var)
333 [
'~N~s:~d:~d ~a:'-[
FileName,
LN,
Pos,
Level], nl ],
337 prolog_caller(
Desc,
Level,
LC)
341location(
Desc,
Level,
_,
LC )
-->
342 prolog_caller(
Desc,
Level,
LC).
345prolog_caller(
Desc,
Level,
LC )
-->
347 query_exception(prologPredFile,
Desc,
FileName),
348 query_exception(prologPredLine,
Desc,
LN),
349 query_exception(prologPredName,
Desc,
Name),
350 query_exception(prologPredArity,
Desc,
Arity),
351 query_exception(prologPredModule,
Desc,
Module)
354 [
'~N~s:~d:0 ~a executing ~s:~s/~d:'-[
FileName,
LN,
Level,
Module,
Name,
Arity] ],
356 c_caller(
Desc,
Level,
LC).
358prolog_caller(
Desc,
Level,
LC )
-->
359 [
'~Nuser:~d:0 ~a in top-level goal.'-[
0,
Level]],
361 c_caller(
Desc,
Level,
LC).
363c_caller(
Desc,
Level,
_LC )
-->
365 query_exception(errorFile,
Desc,
FileName),
366 query_exception(errorLine,
Desc,
LN),
367 query_exception(errorFunction,
Desc,
F)
370 [
'~N~s:~d:0: ~a in ~s():'-[
FileName,
LN,
Level,
F] ].
371c_caller(
_Desc,
_Level,
_LC )
--> [].
373event(redo,
_Desc)
--> {fail}.
374event(fail,
_Desc)
--> {fail}.
375event(abort,
Desc)
--> {
throw(event(abort,
Desc)) }.
377simplify_pred(user
:F,
F)
:- simplify_pred.
378simplify_pred(prolog
:F,
F)
:- simplify_pred.
383main_message(error(
Msg,
In),
_,
_)
--> {
var(
Msg)}, !,
384 [
'Uninstantiated message ~w~n.' - [
error(
Msg,
In)], nl ].
385main_message(error(style_check(singleton(
SVs),
_Pos,
_File,
P),
_Exc),
_Level,
LC)
-->
388 clause_to_indicator(
P,
I),
390 (
SVs = [
_]
-> NVs = 0 ; NVs = 1 )
394 '~*|singleton variable~*c ~s in ~q.' -
395 [
LC,
NVs,
0's, SVsL, I] % '
397main_message(error(style_check(
discontiguous(
N,
A,
Mod),
_Pos,
_File,
_P),
_Exc),
_Level,
LC)
-->
399 [
'~*|discontiguous definition for ~p.' - [
LC,
Mod:N/A] ].
400main_message(error(style_check(multiple(
N,
A,
Mod,
F0),
L,
F,
_P ),
_Info),
Level,
LC)
-->
402 [
'~N~*|~a:~d:0: ~a: ~q previously defined in ~a!!'-[
LC,
F,
L,
Level ,
Mod:N/A,
F0], nl, nl ].
403main_message( error(syntax_error(
_Msg),
Info),
_Level,
_LC )
-->
405 error_descriptor(
Info,
Desc),
406 query_exception(parserTextA,
Desc,
J),
409 query_exception(parserTextB,
Desc,
K),
414 sub_text(
J,
0,
K,
_,
Jb),
415 atomic_concat(
Jb,
Je,
J)
420 '~s <<SYNTAX ERROR>> ~s' - [
Jb,
Je],
425main_message(error(
ErrorInfo,
_),
_Level,
LC)
-->
427 main_error_message(
ErrorInfo,
LC ).
430main_error_message(consistency_error(
Who),
LC)
-->
431 [
'~*|%%% argument ~a not consistent with type.'-[
LC,
Who] ].
432main_error_message(domain_error(
Who ,
Type),
LC)
-->
433 [
'~*|%%% ~a: ~q does not belong to domain.' - [
LC,
Type,
Who] ].
434main_error_message(evaluation_error(
What),
LC)
-->
435 [
'~*|%%% found ~w during evaluation of arithmetic expression.' - [
LC,
What] ].
436main_error_message(evaluation_error(
What,
Who),
LC)
-->
437 [
'~*|%%% ~w caused ~a during evaluation of arithmetic expressions.' - [
LC,
Who,
What]].
438main_error_message(existence_error(
Type ,
Who),
LC)
-->
439 [
'~*|%%% ~q ~q does not exist.' - [
LC,
Type,
Who] ].
440main_error_message(permission_error(
Op,
Type,
Id),
LC)
-->
441 [
'~*|%%% value ~q is not allowed in ~a ~q.' - [
LC,
Op,
Type,
Id] ].
442main_error_message(instantiation_error,
LC)
-->
443 [
'~*|%%% unbound variable.' - [
LC] ].
444main_error_message(representation_error(
Type),
LC)
-->
445 [
'~*|%%% YAP cannot represent ~w.' - [
LC,
Type] ].
446main_error_message(resource_error(
Who),
LC)
-->
447 [
'~*|%%% ~q.' - [
LC,
Who]].
448main_error_message(syntax_error(
Who),
LC)
-->
449 [
'~*|%%% ~w while parsing.' - [
LC,
Who]].
450main_error_message(type_error(
Type,
Who),
LC)
-->
451 [
'~*|%%% ~q should be of type ~a.' - [
LC,
Who,
Type]].
452main_error_message(system_error(
Who,
In),
LC)
-->
453 [
'~*|%%% ~q ~q.' - [
LC,
Who,
In]].
454mainw_error_message(uninstantiation_error(
T),
LC)
-->
455 [
'~*|%%% found ~q, expected unbound variable.' - [
LC,
T]].
457display_consulting(
_F,
Level,
Info,
LC)
-->
459 error_descriptor(
Info,
Desc),
460 query_exception(prologParserFile,
Desc,
F0),
461 query_exception(prologParserLine,
Desc,
L),
465 [
'~a:~d:0: ~a raised!!:'-[
F0,
Level],
].
467display_consulting(
_F,
_,
_,
_LC)
-->
470c_goal(
Desc,
_,
LC)
-->
472 query_exception(errorGoal,
Desc,
G) },
474 [
'~*|call was: ~w' - [
LC,
G]].
478extra_info(
Desc,
_,
LC )
-->
480 query_exception(errorMsg,
Desc,
Msg),
489 [
'~*|% info: ~s' - [
LC,
Msg]],
491extra_info(
_,
_,
_ )
-->
494stack_info(
_,
_,
_ )
--> stack_info.
495stack_info(
Desc,
_,
LC)
-->
497 query_exception(prologStack,
Desc,
Stack),
502 [
'~*|Prolog execution stack is:' - [
LC]],
505stack_info(
_,
_ )
-->
513system_message(error(
Msg,
In))
-->
514 ( {
var(
Msg) }
; {
var(
In)} ), !,
515 [
'bad error ~w' - [
error(
Msg,
In)]].
516system_message(error(consistency_error(
Who),
Where))
-->
517 [
'CONSISTENCY ERROR (arguments not compatible with format)- ~w ~w' - [
Who,
Where] ].
518system_message(error(context_error(
Goal,
Who),
Where))
-->
519 [
'CONTEXT ERROR- ~w: ~w appeared in ~w' - [
Goal,
Who,
Where] ].
520system_message(error(domain_error(
DomainType,
Opt),
Where))
-->
521 [
'DOMAIN ERROR- ~w: ' - Where],
522 domain_error(
DomainType,
Opt).
523system_message(error(format_argument_type(
Type,
Arg),
Where))
-->
524 [
'FORMAT ARGUMENT ERROR- ~~~a called with ~w in ~w: ' - [
Type,
Arg,
Where]].
525system_message(error(existence_error(directory,
Key),
Where))
-->
526 [
'EXISTENCE ERROR- ~w: ~w not an existing directory' - [
Where,
Key] ].
527system_message(error(existence_error(key,
Key),
Where))
-->
528 [
'EXISTENCE ERROR- ~w: ~w not an existing key' - [
Where,
Key] ].
529system_message(error(existence_error(mutex,
Key),
Where))
-->
530 [
'EXISTENCE ERROR- ~w: ~w is an erased mutex' - [
Where,
Key] ].
531system_message(existence_error(prolog_flag,
F))
-->
532 [
'Prolog Flag ~w: new Prolog flags must be created using create_prolog_flag/3.' - [
F] ].
533system_message(error(existence_error(prolog_flag,
P),
Where))
--> system_message,
534 [
'EXISTENCE ERROR- ~w: prolog flag ~w is undefined' - [
Where,
P] ].
535system_message(error(existence_error(procedure,
P), context(
Call,
Parent)))
--> system_message, [
'EXISTENCE ERROR- procedure ~w is undefined, called fromcontext ~w~n Goal was ~w' - [
P,
Parent,
Call] ].
536system_message(error(existence_error(stream,
Stream),
Where))
-->
537 [
'EXISTENCE ERROR- ~w: ~w not an open stream' - [
Where,
Stream] ].
538system_message(error(existence_error(thread,
Thread),
Where))
-->
539 [
'EXISTENCE ERROR- ~w: ~w not a running thread' - [
Where,
Thread] ].
540system_message(error(existence_error(variable,
Var),
Where))
-->
541 [
'EXISTENCE ERROR- ~w: variable ~w does not exist' - [
Where,
Var] ].
542system_message(error(existence_error(
Name,
F),
W))
-->
543 {
object_name(
Name,
ObjName) },
544 [
'EXISTENCE ERROR- ~w could not open ~a ~w' - [
W,
ObjName,
F] ].
545system_message(error(evaluation_error(int_overflow),
Where))
-->
546 [
'INTEGER OVERFLOW ERROR- ~w' - [
Where] ].
547system_message(error(evaluation_error(float_overflow),
Where))
-->
548 [
'FLOATING POINT OVERFLOW ERROR- ~w' - [
Where] ].
549system_message(error(evaluation_error(undefined),
Where))
-->
550 [
'UNDEFINED ARITHMETIC RESULT ERROR- ~w' - [
Where] ].
551system_message(error(evaluation_error(underflow),
Where))
-->
552 [
'UNDERFLOW ERROR- ~w' - [
Where] ].
553system_message(error(evaluation_error(float_underflow),
Where))
-->
554 [
'FLOATING POINT UNDERFLOW ERROR- ~w' - [
Where] ].
555system_message(error(evaluation_error(zero_divisor),
Where))
-->
556 [
'ZERO DIVISOR ERROR- ~w' - [
Where] ].
557system_message(error(not_implemented(
Type,
What),
Where))
-->
558 [
'~w: ~w not implemented- ~w' - [
Where,
Type,
What] ].
559system_message(error(operating_SYSTEM_ERROR_INTERNAL,
Where))
-->
560 [
'OPERATING SYSTEM ERROR- ~w' - [
Where] ].
561system_message(error(out_of_heap_error,
Where))
-->
562 [
'OUT OF DATABASE SPACE ERROR- ~w' - [
Where] ].
563system_message(error(out_of_stack_error,
Where))
-->
564 [
'OUT OF STACK SPACE ERROR- ~w' - [
Where] ].
565system_message(error(out_of_trail_error,
Where))
-->
566 [
'OUT OF TRAIL SPACE ERROR- ~w' - [
Where] ].
567system_message(error(out_of_attvars_error,
Where))
-->
568 [
'OUT OF STACK SPACE ERROR- ~w' - [
Where] ].
569system_message(error(out_of_auxspace_error,
Where))
-->
570 [
'OUT OF AUXILIARY STACK SPACE ERROR- ~w' - [
Where] ].
571system_message(error(permission_error(access,private_procedure,
P),
Where))
-->
572 [
'PERMISSION ERROR- ~w: cannot see clauses for ~w' - [
Where,
P] ].
573system_message(error(permission_error(access,static_procedure,
P),
Where))
-->
574 [
'PERMISSION ERROR- ~w: cannot access static procedure ~w' - [
Where,
P] ].
575system_message(error(permission_error(alias,new,
P),
Where))
-->
576 [
'PERMISSION ERROR- ~w: cannot create alias ~w' - [
Where,
P] ].
577system_message(error(permission_error(create,
Name,
P),
Where))
-->
578 [
'PERMISSION ERROR- ~w: cannot create ~a ~w' - [
Where,
Name,
P] ].
579system_message(error(permission_error(import,
M1:I,redefined,
SecondMod),
Where))
-->
580 [
'PERMISSION ERROR- loading ~w: modules ~w and ~w both define ~w' - [
Where,
M1,
SecondMod,
I] ].
581system_message(error(permission_error(input,binary_stream,
Stream),
Where))
-->
582 [
'PERMISSION ERROR- ~w: cannot read from binary stream ~w' - [
Where,
Stream] ].
583system_message(error(permission_error(input,closed_stream,
Stream),
Where))
-->
584 [
'PERMISSION ERROR- ~w: trying to read from closed stream ~w' - [
Where,
Stream] ].
585system_message(error(permission_error(input,past_end_of_stream,
Stream),
Where))
-->
586 [
'PERMISSION ERROR- ~w: past end of stream ~w' - [
Where,
Stream] ].
587system_message(error(permission_error(input,stream,
Stream),
Where))
-->
588 [
'PERMISSION ERROR- ~w: cannot read from ~w' - [
Where,
Stream] ].
589system_message(error(permission_error(input,text_stream,
Stream),
Where))
-->
590 [
'PERMISSION ERROR- ~w: cannot read from text stream ~w' - [
Where,
Stream] ].
591system_message(error(permission_error(modify,dynamic_procedure,
_),
Where))
-->
592 [
'PERMISSION ERROR- ~w: modifying a dynamic procedure' - [
Where] ].
593system_message(error(permission_error(modify,flag,
W),
_))
-->
594 [
'PERMISSION ERROR- cannot modify flag ~w' - [
W] ].
595system_message(error(permission_error(modify,operator,
W),
Q))
-->
596 [
'PERMISSION ERROR- ~w: cannot modify operator ~q' - [
Q,
W] ].
597system_message(error(permission_error(modify,dynamic_procedure,
F),
Where))
-->
598 [
'PERMISSION ERROR- ~w: modifying dynamic procedure ~w' - [
Where,
F] ].
599system_message(error(permission_error(modify,static_procedure,
F),
Where))
-->
600 [
'PERMISSION ERROR- ~w: modifying static procedure ~w' - [
Where,
F] ].
601system_message(error(permission_error(modify,static_procedure_in_use,
_),
Where))
-->
602 [
'PERMISSION ERROR- ~w: modifying a static procedure in use' - [
Where] ].
603system_message(error(permission_error(modify,
table,
P),
_))
-->
604 [
'PERMISSION ERROR- cannot table procedure ~w' - [
P] ].
605system_message(error(permission_error(module,redefined,
Mod),
Who))
-->
606 [
'PERMISSION ERROR ~w- redefining module ~a in a different file' - [
Who,
Mod] ].
607system_message(error(permission_error(open,source_sink,
Stream),
Where))
-->
608 [
'PERMISSION ERROR- ~w: cannot open file ~w' - [
Where,
Stream] ].
609system_message(error(permission_error(output,binary_stream,
Stream),
Where))
-->
610 [
'PERMISSION ERROR- ~w: cannot write to binary stream ~w' - [
Where,
Stream] ].
611system_message(error(permission_error(output,stream,
Stream),
Where))
-->
612 [
'PERMISSION ERROR- ~w: cannot write to ~w' - [
Where,
Stream] ].
613system_message(error(permission_erroro(utput,text_stream,
Stream),
Where))
-->
614 [
'PERMISSION ERROR- ~w: cannot write to text stream ~w' - [
Where,
Stream] ].
615system_message(error(permission_error(resize,array,
P),
Where))
-->
616 [
'PERMISSION ERROR- ~w: cannot resize array ~w' - [
Where,
P] ].
617system_message(error(permission_error(unlock,mutex,
P),
Where))
-->
618 [
'PERMISSION ERROR- ~w: cannot unlock mutex ~w' - [
Where,
P] ].
619system_message(error(representation_error(character),
Where))
-->
620 [
'REPRESENTATION ERROR- ~w: expected character' - [
Where] ].
621system_message(error(representation_error(character_code),
Where))
-->
622 [
'REPRESENTATION ERROR- ~w: expected character code' - [
Where] ].
623system_message(error(representation_error(max_arity),
Where))
-->
624 [
'REPRESENTATION ERROR- ~w: number too big' - [
Where] ].
625system_message(error(representation_error(variable),
Where))
-->
626 [
'REPRESENTATION ERROR- ~w: should be a variable' - [
Where] ].
627system_message(error(resource_error(code_space),
Where))
-->
628 [
'RESOURCE ERROR- not enough code space' - [
Where] ].
629system_message(error(resource_error(huge_int),
Where))
-->
630 [
'RESOURCE ERROR- too large an integer in absolute value' - [
Where] ].
631system_message(error(resource_error(memory),
Where))
-->
633 [
'RESOURCE ERROR- not enough virtual memory' - [
Where] ].
634system_message(error(resource_error(stack),
Where))
-->
635 [
'RESOURCE ERROR- not enough stack' - [
Where] ].
636system_message(error(resource_error(streams),
Where))
-->
637 [
'RESOURCE ERROR- could not find a free stream' - [
Where] ].
638system_message(error(resource_error(threads),
Where))
-->
639 [
'RESOURCE ERROR- too many open threads' - [
Where] ].
640system_message(error(resource_error(trail),
Where))
-->
641 [
'RESOURCE ERROR- not enough trail space' - [
Where] ].
642system_message(error(signal(
SIG,
_),
_))
-->
643 [
'UNEXPECTED SIGNAL: ~a' - [
SIG] ].
645system_message(error(
_,exception(
Error)))
-->
646 [
'UNHANDLED ERROR - unsupported by YAP engine or hooks: ~@' - [
print_exception(
Error)] ].
647system_message(error(unhandled_exception,
Throw))
-->
648 [
'UNHANDLED EXCEPTION - message ~w unknown' - [
Throw] ].
649system_message(error(uninstantiation_error(
TE),
_Where))
-->
650 [
'UNINSTANTIATION ERROR - expected unbound term, got ~q' - [
TE] ].
651system_message(
Messg)
-->
655domain_error(array_overflow,
Opt)
--> domain_error,
656 [
'invalid static index ~w for array' - Opt ].
657domain_error(array_type,
Opt)
--> domain_error,
658 [
'invalid static array type ~w' - Opt ].
659domain_error(builtin_procedure,
_)
--> domain_error,
660 [
'non-iso built-in procedure' - [] ].
661domain_error(character_code_list,
Opt)
--> domain_error,
662 [
'invalid list of codes ~w' - [
Opt] ].
663domain_error(close_option,
Opt)
--> domain_error,
664 [
'invalid close option ~w' - [
Opt] ].
665domain_error(delete_file_option,
Opt)
--> domain_error,
666 [
'invalid list of options ~w' - [
Opt] ].
667domain_error(encoding,
Opt)
--> domain_error,
668 [
'invalid encoding ~w' - [
Opt] ].
669domain_error(flag_value, [
Opt,
Flag])
--> domain_error,
670 [
'invalid value ~w for flag ~w' - [
Opt,
Flag] ].
671domain_error(flag_value,
Opt)
--> domain_error,
672 [
'invalid value ~w for flag' - [
Opt] ].
673domain_error(io_mode,
Opt)
--> domain_error,
674 [
'invalid io mode ~w' - [
Opt] ].
675domain_error(mutable,
Opt)
--> domain_error,
676 [
'invalid id mutable ~w' - [
Opt] ].
677domain_error(module_decl_options,
Opt)
--> domain_error,
678 [
'expect module declaration options, found ~w' - [
Opt] ].
679domain_error(non_empty_list,
Opt)
--> domain_error,
680 [
'found empty list' - [
Opt] ].
681domain_error(not_less_than_zero,
Opt)
--> domain_error,
682 [
'number ~w less than zero' - [
Opt] ].
683domain_error(not_newline,
Opt)
--> domain_error,
684 [
'number ~w not newline' - [
Opt] ].
685domain_error(not_zero,
Opt)
--> domain_error,
686 [
'~w is not allowed in the domain' - [
Opt] ].
687domain_error(operator_priority,
Opt)
--> domain_error,
688 [
'~w invalid operator priority' - [
Opt] ].
689domain_error(operator_specifier,
Opt)
--> domain_error,
690 [
'invalid operator specifier ~w' - [
Opt] ].
691domain_error(out_of_range,
Opt)
--> domain_error,
692 [
'expression ~w is out of range' - [
Opt] ].
693domain_error(predicate_spec,
Opt)
--> domain_error,
694 [
'~w invalid predicate specifier' - [
Opt] ].
695domain_error(radix,
Opt)
--> domain_error,
696 [
'invalid radix ~w' - [
Opt] ].
697domain_error(read_option,
Opt)
--> domain_error,
698 [
'~w invalid option to read_term' - [
Opt] ].
699domain_error(semantics_indicator,
Opt)
--> domain_error,
700 [
'predicate indicator, got ~w' - [
Opt] ].
701domain_error(shift_count_overflow,
Opt)
--> domain_error,
702 [
'shift count overflow in ~w' - [
Opt] ].
703domain_error(source_sink,
Opt)
--> domain_error,
704 [
'~w is not a source sink term' - [
Opt] ].
705domain_error(stream,
Opt)
--> domain_error,
706 [
'~w is not a stream' - [
Opt] ].
707domain_error(stream_or_alias,
Opt)
--> domain_error,
708 [
'~w is not a stream (or alias)' - [
Opt] ].
709domain_error(stream_encoding,
Opt)
--> domain_error,
710 [
'~w is not a supported stream encoding' - [
Opt] ].
711domain_error(stream_position,
Opt)
--> domain_error,
712 [
'~w is not a stream position' - [
Opt] ].
713domain_error(stream_property,
Opt)
--> domain_error,
714 [
'~w is not a stream property' - [
Opt] ].
715domain_error(syntax_error_handler,
Opt)
--> domain_error,
716 [
'~w is not a syntax error handler' - [
Opt] ].
717domain_error(
table,
Opt)
--> domain_error,
718 [
'non-tabled procedure ~w' - [
Opt] ].
719domain_error(thread_create_option,
Opt)
--> domain_error,
720 [
'~w is not a thread_create option' - [
Opt] ].
721domain_error(time_out_spec,
Opt)
--> domain_error,
722 [
'~w is not valid specificatin for time_out' - [
Opt] ].
723domain_error(unimplemented_option,
Opt)
--> domain_error,
724 [
'~w is not yet implemented' - [
Opt] ].
725domain_error(write_option,
Opt)
--> domain_error,
726 [
'~w invalid write option' - [
Opt] ].
727domain_error(
Domain,
Opt)
-->
728 [
'~w does not belong to domain ~w' - [
Opt,
Domain] ].
730object_name(array, array).
731object_name(atom, atom).
732object_name(atomic, atomic).
733object_name(byte, byte).
734object_name(callable,
'callable goal').
735object_name(char, char).
736object_name(character_code,
'character code').
737object_name(compound,
'compound term').
738object_name(db_reference,
'data base reference').
739object_name(evaluable,
'evaluable term').
740object_name(file, file).
741object_name(float, float).
742object_name(in_byte, byte).
743object_name(in_character, character).
744object_name(integer, integer).
746object_name(key,
'database key').
747object_name(leash_mode,
'leash mode').
748object_name(library, library).
749object_name(list, list).
750object_name(message_queue,
'message queue').
751object_name(mutex, mutex).
752object_name(number, number).
753object_name(operator, operator).
754object_name(pointer, pointer).
755object_name(predicate_indicator,
'predicate indicator').
756object_name(source_sink, file).
757object_name(unsigned_byte,
'unsigned byte').
758object_name(unsigned_char,
'unsigned char').
759object_name(variable,
'unbound variable').
761svs([
A=_VA],
S)
:- svs,
763svs([
A=_VA,
B=_VB],
SN)
:- svs,
766 string_concat([
SA,` and `,
SB],
SN).
770 string_concat([
S,
`, `,
S1],
SN).
772list_of_preds([])
--> [].
773list_of_preds([
P|L])
-->
777syntax_error_term(between(
_I,
J,
_L),[
S|T],
_LC)
-->
781 [
' <<<< at line ~d >>>> ~s' - [
J,
T],
].
782syntax_error_term(between(
_I,
J,
_L),
LTaL,
LC)
-->
783 syntax_error_tokens(
LTaL,
J,
LC).
785syntax_error_tokens([],
_,
_LC)
--> [].
786syntax_error_tokens([
T|L],
J,
LC)
-->
787 syntax_error_token(
T,
J,
LC),
788 syntax_error_tokens(
L,
J,
LC).
790syntax_error_token(atom(
A),
_,
_LC)
--> syntax_error_token,
792syntax_error_token(number(
N),
_,
_LC)
--> syntax_error_token,
794syntax_error_token(var(
_,
S),
_,
_LC)
--> syntax_error_token,
796syntax_error_token(string(
S),
_,
_LC)
--> syntax_error_token,
798syntax_error_token(error,
L,
_LC)
--> syntax_error_token,
799 [
' <<<< at line ~d >>>> ' - [
L] ].
800syntax_error_token(
'EOT',
_,
_LC)
--> syntax_error_token,
802syntax_error_token(
'(',
_,
_LC)
--> syntax_error_token,
804syntax_error_token(
'{',
_,
_LC)
--> syntax_error_token,
806syntax_error_token(
'[',
_,
_LC)
--> syntax_error_token,
808syntax_error_token(
')',
_,
_LC)
--> syntax_error_token,
810syntax_error_token(
']',
_,
_LC)
--> syntax_error_token,
812syntax_error_token(
'}',
_,
_LC)
--> syntax_error_token,
814syntax_error_token(
',',
_,
_LC)
--> syntax_error_token,
816syntax_error_token(
'.',
_,
_LC)
--> syntax_error_token,
818syntax_error_token(
';',
_,
_LC)
--> syntax_error_token,
820syntax_error_token(
':',
_,
_LC)
--> syntax_error_token,
822syntax_error_token(
'|',
_,
_LC)
--> syntax_error_token,
824syntax_error_token(
'l',
_,
_LC)
--> syntax_error_token,
826syntax_error_token(nl,
_,
LC)
--> syntax_error_token,
827 [
'~*| ' -[
LC], nl ].
828syntax_error_token(
B,
_,
_LC)
--> syntax_error_token,
829 [ nl,
'bad_token: ~q' - [
B], nl ].
840write_query_answer( [], [] , [],
_ )
-->
845write_query_answer(
_,
Vs0,
GVs0,
Extras )
-->
850 name_vars(
Vs,
Gs,
VGs, []),
851 '$singleton_vs_numbervars'(
VGs,
0,
_)
855name_vars([
A='$VAR'(
A)
|Vs],
Gs)
-->
858name_vars([
_A='$VAR'(
-1)
|Vs],
Gs)
-->
861name_vars([
A='$VAR'(
B)
|Vs],
Gs)
-->
865name_vars([
A=V|Vs],
Gs)
-->
869name_vars([], [
G|Gs])
-->
873name_vars([],[])
--> [].
875vars( [var(
A,
B)
|VGs],
Extra)
-->
876 [
'~a = '-[
A],
'~q'-[
B]],
878 extra_vars(
VGs,
Extra).
879vars([nonvar(
A,
V)
|VGs],
Extra)
-->
880 [
'~a = '-[
A],
'~W'-[
V,[
priority(
699)
|Opts]]],
883 yap_flag(toplevel_print_options,
Opts)
885 extra_vars(
VGs,
Extra).
886vars( [goal(
G)
|Gs],
Extra)
-->
889 yap_flag(toplevel_print_options,
Opts)
891 [
'~W'-[
G,[
priority(
699)
|Opts]]],
892 extra_vars(
Gs,
Extra).
893vars([],
_Extra)
--> [].
895extra_vars([],
Extra)
-->
898extra_vars(
VGs,
Extra)
-->
902write_goal_output(var([
V|VL]),
First, next)
-->
905 write_output_vars(
VL).
906write_goal_output(nonvar([
V|VL],
B),
First, next)
-->
910 write_output_vars(
VL),
913write_goal_output(nl,
First,
First)
-->
916write_goal_output(
Format-G,
First,
Next)
-->
921 {
format(codes(
String),
Format,
G) },
931write_goal_output(
_-G,
First, next)
-->
933 write_goal_output(
G,
First, next).
934write_goal_output(
MG,
First, next)
-->
937 strip_module(
MG,
M,
G0),
943name_vars_in_goals(
G,
VL0,
G)
:-
944 name_well_known_vars(
VL0),
946 name_vars_in_goals1(
GVL,
0,
_).
948name_well_known_vars([]).
949name_well_known_vars([
Name=V|NVL0])
:-
952 name_well_known_vars(
NVL0).
953name_well_known_vars([
_|NVL0])
:-
954 name_well_known_vars(
NVL0).
956name_vars_in_goals1([],
I,
I).
957name_vars_in_goals1([
V|NGVL],
I0,
IF)
:-
959 gen_name_string(
I0,[],
SName),
gen_name_string,
962 name_vars_in_goals1(
NGVL,
I,
IF).
963name_vars_in_goals1([
NV|NGVL],
I0,
IF)
:-
965 name_vars_in_goals1(
NGVL,
I0,
IF).
968print_lines(
S,
A,
Key)
-->
971 print_lines_(
Tok,
S,
A,
Key).
972print_lines(
_S,
_A,
_Key)
-->
975print_lines_( at_same_line,
S,
Prefix_,
Key)
-->
977 print_lines(
S,
Prefix_,
Key).
978print_lines_(begin(
Severity,
OtherKey),
S,
Prefix_es,
Key)
-->
980 {
prefix_(
Severity,
P ) },
982 print_lines(
S,
Prefix_es,
Key ).
983print_lines_( flush,
S,
_,
Key)
-->
988print_lines_( end(
Key0),
S,
_,
Key)
-->
992print_lines_( end(
_OtherKey),
S,
Prefix_es,
Key)
-->
994 print_lines(
S,
Prefix_es,
Key ).
995print_lines_(flush,
S,
Prefix_es,
Key)
-->
998 print_lines(
S,
Prefix_es,
Key ).
999print_lines_(format(
Fmt,
Args),
S,
Prefix_es,
Key)
-->
1001 {
format(
S,
Fmt,
Args) },
1002 print_lines(
S,
Prefix_es,
Key ).
1003print_lines_( nl,
S,
_,
Key)
-->
1009print_lines_(nl,
S,
Prefix_es,
Key)
-->
1012 Prefix_es = [
Prefix_S - Cmds|More],
1013 format(
S,
Prefix_S,
Cmds)
1018 NPrefix_es = Prefix_es
1022 print_lines(
S,
NPrefix_es,
Key).
1024print_lines_(prefix_(
Fmt-Args),
S,
Prefix_es,
Key)
-->
1026 print_lines(
S, [
Fmt-Args|Prefix_es],
Key ).
1027print_lines_(prefix_(
Fmt),
S,
Prefix_es,
Key)
-->
1028 {
atom(
Fmt )
; string(
Fmt ) },
1030 print_lines(
S, [
Fmt-[]
|Prefix_es],
Key ).
1031print_lines_(
Fmt-Args,
S,
Prefix_es,
Key)
-->
1033 {
format(
S,
Fmt,
Args) },
1034 print_lines(
S,
Prefix_es,
Key ).
1036print_lines_(
Fmt,
S,
Prefix_es,
Key)
-->
1037 {
atom(
Fmt)
; string(
Fmt ) },
1039 {
format(
S,
Fmt, []) },
1040 print_lines(
S,
Prefix_es,
Key).
1041print_lines_(
Msg,
S,
_Prefix_es,
_Key)
-->
1042 {
format(
S,
'Illegal message Component: ~q !!!.~n', [
Msg]) }.
1044prefix_(help,
'~N'-[]).
1045prefix_(query,
'~N'-[]).
1046prefix_(debug,
'~N'-[]).
1047prefix_(warning,
'~N'-[]).
1048prefix_(error,
'~N'-[]).
1049prefix_(banner,
'~N'-[]).
1050prefix_(informational,
'~N~*|% '-[
LC])
:-
1051 '$show_consult_level'(
LC),
1053 '$show_consult_level'.
1054prefix_(informational,
'~N'-[]).
1055prefix_(debug(
_),
'~N'-[]).
1086clause_to_indicator(
T,
MNameArity)
:-
1087 strip_module(
T,
M0,
T1),
1088 pred_arity(
T1,
M0,
MNameArity ).
1090call/1pred_arity(
V,
M,
M:)
:- var(
V),
var.
1091pred_arity((
:- _Path),
_M, prolog
:(
:-)
/1 )
:- pred_arity.
1092pred_arity((
?- _Path),
_M, prolog
:(?)
/1 )
:- pred_arity.
1093pred_arity((
H:-_),
M,
MNameArity)
:-
1096 strip_module(
M:H,
M1,
H1),
1097 pred_arity(
H1,
M1,
MNameArity).
1098pred_arity((
H-->_),
M,
M2:Name//Arity)
:-
1101 strip_module(
M:H,
M1,
H1),
1102 pred_arity(
H1,
M1,
M2:Name/Arity).
1104pred_arity((
H,
_),
M,
MNameArity)
:-
1107 strip_module(
M:H,
M1,
H1),
1108 pred_arity(
H1,
M1,
MNameArity).
1109pred_arity(
Name/Arity,
M,
M:Name/Arity)
:-
1111pred_arity(
Name//Arity,
M,
M:Name//Arity)
:-
1113pred_arity(
H,
M,
M:Name/Arity)
:-
1148 Lines = [
begin(
_,
Key)
|Msg],
1152 Prefix_ = Prefix_0-[]
1156 Prefix_ = Prefix_0-[]
1160 (
Msg = [at_same_line
|Msg1]
1162 print_lines(
S, [
Prefix_],
Key,
Msg1, [])
1164 print_lines(
S, [
Prefix_],
Key, [
Prefix_|Msg], [])
1206set_prolog_flag
:yap_error_descriptor(
A,
B)
:-
1207 error_descriptor(
A,
B).
1209error_descriptor(
V, [] )
:-
1212error_descriptor( exception(
Info),
List )
:-
1214 '$read_exception'(
Info,
List).
1215error_descriptor( (
Info),
Info ).
1218query_exception(
K0,[
H|L],
V)
:-
1219 (
atom(
K0)
-> K=K0 ; atom_to_string(
K,
K0) ),
1221 lists
:member(
K0=V,[
H|L]).
1222query_exception(
M,
K,
V)
:-
1223 '$query_exception'(
M,
K,
V).
1233 format(user_error,
'malformed message ~q: message level is unbound~n', [
Msg])
1238 format(user_error,
'uninstantiated message~n', [])
1244 prolog_flag(compiling, true),
1245 prolog_flag(verbose_load, false),
1246 Level \= prolog_flag,
1247 Level \= prolog_flag,
1250 prolog_flag(verbose, silent),
1251 Level \= prolog_flag,
1252 Level \= prolog_flag,
1255 print_message
:portray_message(
Severity,
Msg),
1259 '__NB_getval__'(
'$if_skip_mode',skip,fail),
1261'__NB_getval__'
:print_message(force(
_Severity),
Msg)
:- print_message,
1262 print(user_error,
Msg).
1265 '$pred_exists'(message(
Term,
Lines0, [ end(
Id)]),
'$messages'),
1266 message(
Term,
Lines0, [ end(
Id)]),
1267 Lines = [
begin(
Severity,
Id)
| Lines0],
1273 ignore((prefix_(
Severity,
Prefix_ ),
1274 print_message_lines(user_error,
Prefix_,
Lines)))
1279 Lines = [
begin(
Severity,
Id)
| Lines0],
1281 user
:message_hook(
Term,
Severity,
Lines)
1285 prefix_(
Severity,
Prefix_ ),
1286 print_message_lines(user_error,
Prefix_,
Lines)
1291 format(user_error,
'failed to print ~w: ~w~n' ,[
_Severity,
_Term]).
1300
yap_flag( ?Param, ?Value)
current_module( ? Mod:atom)
atom_codes(?Atom, ?Codes)
sub_atom(+ A,? Bef, ? Size, ? After, ? At_out)
message_hook(+ Term, + Kind, + Lines)
current_prolog_flag(? Flag,- Value)
set_prolog_flag(+ Flag,+ Value)
message_to_string(+ Term, - String)
print_message(+ Severity, +Term)
print_message_lines(+ Stream, + Prefix__, + _Lines)
translate_message(+Term, +Lines, -Lines0)
variables_in_term( +_t, +_SetOfVariables_, +_ExtendedSetOfVariables_ )
member(?Element, ?Set) is true when Set is a list, and Element occurs in it