2001-04-09 20:54:03 +01:00
|
|
|
/*************************************************************************
|
|
|
|
* *
|
|
|
|
* YAP Prolog *
|
|
|
|
* *
|
|
|
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
|
|
|
* *
|
|
|
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
|
|
|
* File: boot.yap *
|
|
|
|
* Last rev: 8/2/88 *
|
|
|
|
* mods: *
|
|
|
|
* comments: error messages for YAP *
|
|
|
|
* *
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
'$Error'(E) :-
|
|
|
|
'$LoopError'(E).
|
|
|
|
|
|
|
|
'$LoopError'(_) :-
|
|
|
|
flush_output(user_output),
|
|
|
|
flush_output(user_error),
|
|
|
|
fail.
|
|
|
|
'$LoopError'(Error) :- !,
|
|
|
|
'$process_error'(Error),
|
|
|
|
fail.
|
|
|
|
'$LoopError'(_) :-
|
|
|
|
flush_output(user_output),
|
|
|
|
flush_output(user_error),
|
|
|
|
fail.
|
|
|
|
|
|
|
|
'$process_error'(abort) :- !,
|
|
|
|
write(user_error,'[ Execution Aborted ]'),
|
|
|
|
nl(user_error).
|
|
|
|
'$process_error'(error(Msg, Where)) :- !,
|
2002-02-04 16:12:54 +00:00
|
|
|
'$set_fpu_exceptions',
|
|
|
|
'$print_message'(error,error(Msg, Where)).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$process_error'(Throw) :-
|
|
|
|
print_message(error,Throw).
|
|
|
|
|
2002-01-22 17:11:36 +00:00
|
|
|
print_message(Level, Mss) :-
|
|
|
|
'$print_message'(Level, Mss).
|
|
|
|
|
|
|
|
'$print_message'(force(_Severity), Msg) :- !,
|
2001-04-09 20:54:03 +01:00
|
|
|
print(user_error,Msg).
|
2002-01-22 17:11:36 +00:00
|
|
|
'$print_message'(Severity, Msg) :-
|
2001-11-15 00:01:43 +00:00
|
|
|
\+ '$undefined'(portray_message(Severity, Msg), user),
|
|
|
|
user:portray_message(Severity, Msg), !.
|
2002-01-22 17:11:36 +00:00
|
|
|
'$print_message'(error,error(Msg,Where)) :-
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(Msg, Where), !.
|
2002-01-22 17:11:36 +00:00
|
|
|
'$print_message'(error,Throw) :-
|
2002-02-12 18:24:21 +00:00
|
|
|
'$format'(user_error,"[ No handler for error ~w ]~n", [Throw]).
|
2002-01-22 17:11:36 +00:00
|
|
|
'$print_message'(informational,M) :-
|
|
|
|
( '$get_value'('$verbose',on) ->
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_informational_message'(M) ;
|
2002-01-22 17:11:36 +00:00
|
|
|
true
|
|
|
|
).
|
|
|
|
'$print_message'(warning,M) :-
|
2002-06-01 02:46:06 +01:00
|
|
|
'$format'(user_error, "[ ", []),
|
|
|
|
'$do_print_message'(M),
|
|
|
|
'$format'(user_error, " ]~n", []).
|
2002-01-22 17:11:36 +00:00
|
|
|
'$print_message'(help,M) :-
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_print_message'(M),
|
|
|
|
'$format'(user_error, "~n", []).
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_informational_message'(loading(_,user)) :- !.
|
|
|
|
'$do_informational_message'(loading(What,AbsoluteFileName)) :- !,
|
2002-01-22 17:11:36 +00:00
|
|
|
'$show_consult_level'(LC),
|
|
|
|
'$format'(user_error, "~*|[ ~a ~a... ]~n", [LC, What, AbsoluteFileName]).
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_informational_message'(loaded(_,user,_,_,_)) :- !.
|
|
|
|
'$do_informational_message'(loaded(What,AbsoluteFileName,Mod,Time,Space)) :- !,
|
2002-01-22 17:11:36 +00:00
|
|
|
'$show_consult_level'(LC0),
|
|
|
|
LC is LC0+1,
|
|
|
|
'$format'(user_error, "~*|[ ~a ~a in module ~a, ~d msec ~d bytes ]~n", [LC, What, AbsoluteFileName,Mod,Time,Space]).
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_informational_message'(M) :-
|
|
|
|
'$format'("[ ", []),
|
|
|
|
'$do_print_message'(M),
|
|
|
|
'$format'(" ]~n", []).
|
|
|
|
|
|
|
|
|
2002-01-22 17:11:36 +00:00
|
|
|
%message(loaded(Past,AbsoluteFileName,user,Msec,Bytes), Prefix, Suffix) :- !,
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_print_message'(debug(debug)) :- !,
|
|
|
|
'$format'(user_error,"Debug mode on.",[]).
|
|
|
|
'$do_print_message'(debug(off)) :- !,
|
|
|
|
'$format'(user_error,"Debug mode off.",[]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$do_print_message'(debug(trace)) :- !,
|
2002-06-01 02:46:06 +01:00
|
|
|
'$format'(user_error,"Trace mode on.",[]).
|
2002-01-07 06:28:04 +00:00
|
|
|
'$do_print_message'('$format'(Msg, Args)) :- !,
|
|
|
|
'$format'(user_error,Msg,Args).
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_print_message'(import(Pred,To,From,private)) :- !,
|
|
|
|
'$format'(user_error,"Importing private predicate ~w:~w to ~w.",
|
2002-01-05 04:37:47 +00:00
|
|
|
[From,Pred,To]).
|
2002-06-01 02:46:06 +01:00
|
|
|
'$do_print_message'(no_match(P)) :- !,
|
|
|
|
'$format'(user_error,"No matching predicate for ~w.",
|
|
|
|
[P]).
|
|
|
|
'$do_print_message'(breakp(bp(debugger,_,_,M:F/N,_),add,already)) :- !,
|
|
|
|
'$format'(user_error,"There is already a spy point on ~w:~w/~w.",
|
|
|
|
[M,F,N]).
|
|
|
|
'$do_print_message'(breakp(bp(debugger,_,_,M:F/N,_),add,ok)) :- !,
|
|
|
|
'$format'(user_error,"Spy point set on ~w:~w/~w.",
|
|
|
|
[M,F,N]).
|
|
|
|
'$do_print_message'(breakp(bp(debugger,_,_,M:F/N,_),remove,last)) :- !,
|
|
|
|
'$format'(user_error,"Spy point on ~w:~w/~w removed.",
|
|
|
|
[M,F,N]).
|
|
|
|
'$do_print_message'(breakp(no,breakpoint_for,M:F/N)) :- !,
|
|
|
|
'$format'(user_error,"There is no spy point on ~w:~w/~w.",
|
|
|
|
[M,F,N]).
|
|
|
|
'$do_print_message'(leash([])) :- !,
|
|
|
|
'$format'(user_error,"No leashing.",
|
|
|
|
[M,F,N]).
|
|
|
|
'$do_print_message'(leash([A|B])) :- !,
|
|
|
|
'$format'(user_error,"Leashing set to ~w.",
|
|
|
|
[[A|B]]).
|
|
|
|
'$do_print_message'(breakpoints([])) :- !,
|
|
|
|
'$format'(user_error,"There are no spy-points set.",
|
|
|
|
[M,F,N]).
|
|
|
|
'$do_print_message'(breakpoints(L)) :- !,
|
|
|
|
'$format'(user_error,"Spy-points set on:", []),
|
|
|
|
'$print_list_of_preds'(L).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$do_print_message'(Messg) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"~q",Messg).
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2002-06-01 02:46:06 +01:00
|
|
|
'$print_list_of_preds'([]).
|
|
|
|
'$print_list_of_preds'([P|L]) :-
|
|
|
|
'$format'(user_error,"~n ~w",[P]),
|
|
|
|
'$print_list_of_preds'(L).
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(context_error(Goal,Who),Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ CONTEXT ERROR- ~w: ~w appeared in ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Goal,Who,Where]).
|
|
|
|
'$output_error_message'(domain_error(array_overflow,Opt), Where) :-
|
2002-03-27 20:53:58 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid index ~w for array ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Opt]).
|
|
|
|
'$output_error_message'(domain_error(array_type,Opt), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid static array type ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Opt]).
|
|
|
|
'$output_error_message'(domain_error(builtin_procedure,P), P) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- non-iso built-in procedure ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[P]).
|
|
|
|
'$output_error_message'(domain_error(character_code_list,Opt), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid list of codes ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Opt]).
|
2001-05-21 21:00:05 +01:00
|
|
|
'$output_error_message'(domain_error(delete_file_option,Opt), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid list of options ~w ]~n",
|
2001-05-21 21:00:05 +01:00
|
|
|
[Where,Opt]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(domain_error(operator_specifier,Op), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid operator specifier ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Op]).
|
|
|
|
'$output_error_message'(domain_error(close_option,Opt), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid close option ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Opt]).
|
|
|
|
'$output_error_message'(domain_error(radix,Opt), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid radix ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Opt]).
|
|
|
|
'$output_error_message'(domain_error(shift_count_overflow,Opt), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: shift count overflow in ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Opt]).
|
|
|
|
'$output_error_message'(domain_error(flag_value,F+V), W) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid value ~w for flag ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[W,V,F]).
|
|
|
|
'$output_error_message'(domain_error(io_mode,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid io mode ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(domain_error(mutable,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: invalid mutable ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
2001-04-19 18:12:18 +01:00
|
|
|
'$output_error_message'(domain_error(module_decl_options,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: expect module declaration options, found ~w ]~n",
|
2001-04-19 18:12:18 +01:00
|
|
|
[Where,N]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(domain_error(not_empty_list,_), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: found empty list ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(domain_error(not_less_than_zero,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: number ~w less than zero ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(domain_error(not_newline,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: number ~w not newline ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(domain_error(not_zero,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: number ~w not zero ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(domain_error(operator_priority,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w invalid operator priority ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(domain_error(operator_specifier,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w invalid operator specifier ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
2002-06-01 02:46:06 +01:00
|
|
|
'$output_error_message'(domain_error(predicate_spec,N), Where) :-
|
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w invalid predicate specifier ]~n",
|
|
|
|
[Where,N]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(domain_error(read_option,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w invalid option to read ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(domain_error(semantics_indicator,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected predicate indicator, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(domain_error(source_sink,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w is not a source sink term ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(domain_error(stream,What), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w not a stream ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,What]).
|
|
|
|
'$output_error_message'(domain_error(stream_or_alias,What), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w not a stream ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,What]).
|
|
|
|
'$output_error_message'(domain_error(stream_option,What), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w not a stream option ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,What]).
|
|
|
|
'$output_error_message'(domain_error(stream_position,What), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w not a stream position ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,What]).
|
|
|
|
'$output_error_message'(domain_error(stream_property,What), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w not a stream property ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,What]).
|
|
|
|
'$output_error_message'(domain_error(syntax_error_handler,What), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w not a syntax error handler ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,What]).
|
|
|
|
'$output_error_message'(domain_error(time_out_spec,What), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w not a valid specification for a time out ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,What]).
|
|
|
|
'$output_error_message'(domain_error(write_option,N), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ DOMAIN ERROR- ~w: ~w invalid option to write ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,N]).
|
|
|
|
'$output_error_message'(existence_error(array,F), W) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ EXISTENCE ERROR- ~w could not open array ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[W,F]).
|
|
|
|
'$output_error_message'(existence_error(procedure,P), _) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ EXISTENCE ERROR- procedure ~w undefined ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[P]).
|
|
|
|
'$output_error_message'(existence_error(source_sink,F), W) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ EXISTENCE ERROR- ~w could not find file ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[W,F]).
|
2001-07-16 16:26:14 +01:00
|
|
|
'$output_error_message'(existence_error(stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ EXISTENCE ERROR- ~w: ~w not an open stream ]~n",
|
2001-07-16 16:26:14 +01:00
|
|
|
[Where,Stream]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(evaluation_error(int_overflow), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ INTEGER OVERFLOW ERROR- ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(evaluation_error(float_overflow), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ FLOATING POINT OVERFLOW ERROR- ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(evaluation_error(undefined), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ UNDEFINED ARITHMETIC RESULT ERROR- ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(evaluation_error(underflow), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ UNDERFLOW ERROR- ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(evaluation_error(float_underflow), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ FLOATING POINT UNDERFLOW ERROR- ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(evaluation_error(zero_divisor), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ ZERO DIVISOR ERROR- ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(instantiation_error, Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ INSTANTIATION ERROR- ~w: expected bound value ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(permission_error(access,private_procedure,P), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot see clauses for ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,P]).
|
|
|
|
'$output_error_message'(permission_error(access,static_procedure,P), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot access static procedure ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,P]).
|
2001-04-16 17:41:04 +01:00
|
|
|
'$output_error_message'(permission_error(alias,new,P), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot create alias ~w ]~n",
|
2001-04-16 17:41:04 +01:00
|
|
|
[Where,P]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(permission_error(create,array,P), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot create array ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,P]).
|
|
|
|
'$output_error_message'(permission_error(create,operator,P), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot create operator ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,P]).
|
|
|
|
'$output_error_message'(permission_error(input,binary_stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot read from binary stream ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(input,closed_stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: trying to read from closed stream ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(input,past_end_of_stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: past end of stream ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(input,stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot read from ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(input,text_stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot read from text stream ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(modify,dynamic_procedure,_), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: modifying a dynamic procedure ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(permission_error(modify,flag,W), _) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- cannot modify flag ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[W]).
|
|
|
|
'$output_error_message'(permission_error(modify,operator,W), _) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- T cannot declare ~w an operator ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[W]).
|
|
|
|
'$output_error_message'(permission_error(modify,static_procedure,_), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: modifying a static procedure ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(permission_error(modify,static_procedure_in_use,_), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: modifying a static procedure in use ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(permission_error(open,source_sink,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot open file ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(output,binary_stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot write to binary stream ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(output,stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot write to ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(output,text_stream,Stream), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot write to text stream ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,Stream]).
|
|
|
|
'$output_error_message'(permission_error(resize,array,P), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ PERMISSION ERROR- ~w: cannot resize array ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,P]).
|
|
|
|
'$output_error_message'(representation_error(character), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ REPRESENTATION ERROR- ~w: expected character ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(representation_error(character_code), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ REPRESENTATION ERROR- ~w: expected character code ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
'$output_error_message'(representation_error(max_arity), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ REPRESENTATION ERROR- ~w: number too big ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
2002-04-11 16:31:58 +01:00
|
|
|
'$output_error_message'(syntax_error(_,Position,_,Term,Pos,Start), Where) :-
|
|
|
|
'$format'(user_error,"[ ~w ",[Where]),
|
|
|
|
'$dump_syntax_error_line'(Start,Position),
|
|
|
|
'$dump_syntax_error_term'(10,Pos, Term),
|
|
|
|
'$format'(user_error,".~n]~n",[]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(system_error, Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ SYSTEM ERROR- ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
2001-05-21 21:00:05 +01:00
|
|
|
'$output_error_message'(system_error(Message), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ SYSTEM ERROR- ~w at ~w]~n",
|
2001-05-21 21:00:05 +01:00
|
|
|
[Message,Where]).
|
2001-10-30 16:42:05 +00:00
|
|
|
'$output_error_message'(type_error(T,_,Err,M), _Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected ~w, got ~w ]~n",
|
2001-05-07 20:56:02 +01:00
|
|
|
[T,Err,M]).
|
2001-04-09 20:54:03 +01:00
|
|
|
'$output_error_message'(type_error(array,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected array, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(atom,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected atom, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(atomic,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected atomic, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(byte,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected byte, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(callable,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected callable goal, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(character,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected character, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(character_code,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected character code, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(compound,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected compound, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(db_reference,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected data base reference, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(db_term,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected data base term, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(evaluable,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected evaluable term, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(float,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected float, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(in_byte,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected byte, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(in_character,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected atom character, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(in_character_code,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected character code, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(integer,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected integer, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(key,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected database key, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(leash_mode,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected modes for leash, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(list,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected list, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(number,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected number, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(pointer,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected pointer, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(predicate_indicator,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected predicate indicator, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(unsigned_byte,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected unsigned byte, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(type_error(variable,W), Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ TYPE ERROR- ~w: expected unbound variable, got ~w ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where,W]).
|
|
|
|
'$output_error_message'(unknown, Where) :-
|
2002-01-07 06:28:04 +00:00
|
|
|
'$format'(user_error,"[ EXISTENCE ERROR- procedure ~w undefined ]~n",
|
2001-04-09 20:54:03 +01:00
|
|
|
[Where]).
|
|
|
|
|
|
|
|
|
2002-04-11 16:31:58 +01:00
|
|
|
'$dump_syntax_error_line'(Pos,_) :-
|
|
|
|
'$format'(user_error,"at line ~d:~n",
|
|
|
|
[Pos]).
|
|
|
|
|
|
|
|
'$dump_syntax_error_term'(0,J,L) :- !,
|
|
|
|
'$format'(user_error,"~n", []),
|
|
|
|
'$dump_syntax_error_term'(10,J,L).
|
|
|
|
'$dump_syntax_error_term'(_,0,L) :- !,
|
|
|
|
'$format'(user_error,"~n<==== HERE ====>~n", []),
|
|
|
|
'$dump_syntax_error_term'(10,-1,L).
|
|
|
|
'$dump_syntax_error_term'(_,_,[]) :- !.
|
|
|
|
'$dump_syntax_error_term'(I,J,[T-P|R]) :-
|
|
|
|
'$dump_error_token'(T),
|
|
|
|
I1 is I-1,
|
|
|
|
J1 is J-1,
|
|
|
|
'$dump_syntax_error_term'(I1,J1,R).
|
|
|
|
|
|
|
|
'$dump_error_token'(atom(A)) :- !,
|
2002-04-13 05:44:20 +01:00
|
|
|
'$format'(user_error," ~a", [A]).
|
2002-04-11 16:31:58 +01:00
|
|
|
'$dump_error_token'(number(N)) :- !,
|
2002-04-13 05:44:20 +01:00
|
|
|
'$format'(user_error," ~w", [N]).
|
2002-04-11 16:31:58 +01:00
|
|
|
'$dump_error_token'(var(_,S,_)) :- !,
|
2002-04-13 05:44:20 +01:00
|
|
|
'$format'(user_error," ~s ", [S]).
|
2002-04-11 16:31:58 +01:00
|
|
|
'$dump_error_token'(string(S)) :- !,
|
2002-04-13 05:44:20 +01:00
|
|
|
'$format'(user_error," ""~s""", [S]).
|
2002-04-11 16:31:58 +01:00
|
|
|
'$dump_error_token'('(') :-
|
|
|
|
'$format'(user_error,"(", []).
|
|
|
|
'$dump_error_token'(')') :-
|
|
|
|
'$format'(user_error," )", []).
|
2002-04-13 05:39:03 +01:00
|
|
|
'$dump_error_token'(',') :-
|
2002-04-13 05:44:20 +01:00
|
|
|
'$format'(user_error," ,", []).
|
2002-04-11 16:31:58 +01:00
|
|
|
'$dump_error_token'(A) :-
|
2002-04-13 05:44:20 +01:00
|
|
|
'$format'(user_error," ~a", [A]).
|
2002-04-11 16:31:58 +01:00
|
|
|
|
|
|
|
|