small changes
This commit is contained in:
parent
f41a8c19ef
commit
880a9989c3
2
C/args.c
2
C/args.c
@ -63,7 +63,7 @@ Yap_ArgListToVector (Term listl, const param_t *def, int n)
|
|||||||
arity_t arity = ArityOfFunctor( f );
|
arity_t arity = ArityOfFunctor( f );
|
||||||
if (arity != 1) {
|
if (arity != 1) {
|
||||||
LOCAL_Error_TYPE = DOMAIN_ERROR_OUT_OF_RANGE;
|
LOCAL_Error_TYPE = DOMAIN_ERROR_OUT_OF_RANGE;
|
||||||
LOCAL_Error_Term = hd;
|
LOCAL_Error_Term = hd;
|
||||||
free( a );
|
free( a );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _YAP_NOT_INSTALLED_
|
|||||||
#add_definitions( -Wall -Wstrict-prototypes -Wmissing-prototypes)
|
#add_definitions( -Wall -Wstrict-prototypes -Wmissing-prototypes)
|
||||||
|
|
||||||
# Model Specific
|
# Model Specific
|
||||||
#set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG=1;LOW_LEVEL_TRACER=1> )
|
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG=1;LOW_LEVEL_TRACER=1> )
|
||||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS DEBUG=1;LOW_LEVEL_TRACER=1 )
|
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS DEBUG=1;LOW_LEVEL_TRACER=1 )
|
||||||
|
|
||||||
#ensure cells are properly aligned in code
|
#ensure cells are properly aligned in code
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#if defined(YAPOR) || defined(TABLING)
|
#if defined(YAPOR) || defined(TABLING)
|
||||||
#include "Yatom.h"
|
#include "Yatom.h"
|
||||||
#include "YapHeap.h"
|
#include "YapHeap.h"
|
||||||
#include "SWI-Prolog.h"
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
#if HAVE_STRING_H
|
#if HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -249,8 +249,6 @@ int PL_get_wchars(term_t l, size_t *lengthp, wchar_t **s, unsigned flags)
|
|||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
seq_tv_t inp, out;
|
seq_tv_t inp, out;
|
||||||
size_t leng;
|
size_t leng;
|
||||||
encoding_t enc;
|
|
||||||
int minimal;
|
|
||||||
void *buf = NULL;
|
void *buf = NULL;
|
||||||
inp.val.t = Yap_GetFromSlot( l );
|
inp.val.t = Yap_GetFromSlot( l );
|
||||||
inp.type = cvtFlags( flags );
|
inp.type = cvtFlags( flags );
|
||||||
@ -721,6 +719,8 @@ X_API int PL_get_functor(term_t ts, functor_t *f)
|
|||||||
Term t = Yap_GetFromSlot(ts);
|
Term t = Yap_GetFromSlot(ts);
|
||||||
if ( IsAtomTerm(t)) {
|
if ( IsAtomTerm(t)) {
|
||||||
*f = t;
|
*f = t;
|
||||||
|
} else if ( IsPairTerm(t)) {
|
||||||
|
*f = FunctorToSWIFunctor(FunctorDot);
|
||||||
} else {
|
} else {
|
||||||
*f = FunctorToSWIFunctor(FunctorOfTerm(t));
|
*f = FunctorToSWIFunctor(FunctorOfTerm(t));
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,16 @@
|
|||||||
/* Define if you have libreadline */
|
/* Define if you have libreadline */
|
||||||
#ifndef HAVE_LIBREADLINE
|
#ifndef HAVE_LIBREADLINE
|
||||||
#define HAVE_LIBREADLINE YES
|
#define HAVE_LIBREADLINE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <readline/history.h> header file. */
|
||||||
|
#ifndef HAVE_READLINE_HISTORY_H
|
||||||
|
#define HAVE_READLINE_HISTORY_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <readline/readline.h> header file. */
|
||||||
|
#ifndef HAVE_READLINE_READLINE_H
|
||||||
|
#define HAVE_READLINE_READLINE_H 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define to 1 if you have the declaration of `rl_catch_signals ', and to 0 if
|
/* Define to 1 if you have the declaration of `rl_catch_signals ', and to 0 if
|
||||||
@ -96,4 +106,3 @@ you don't. */
|
|||||||
#ifndef HAVE_RL_SET_PROMPT
|
#ifndef HAVE_RL_SET_PROMPT
|
||||||
#define HAVE_RL_SET_PROMPT 1
|
#define HAVE_RL_SET_PROMPT 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -491,8 +491,9 @@ doformat(volatile Term otail, volatile Term oargs, int sno USES_REGS)
|
|||||||
ptr[1] = '\0';
|
ptr[1] = '\0';
|
||||||
{
|
{
|
||||||
char *tmp2;
|
char *tmp2;
|
||||||
if (!(tmp2 = Yap_AllocCodeSpace(repeats+10)))
|
if (!(tmp2 = Yap_AllocCodeSpace(repeats+10))) {
|
||||||
goto do_type_int_error;
|
goto do_type_int_error;
|
||||||
|
}
|
||||||
#if HAVE_SNPRINTF
|
#if HAVE_SNPRINTF
|
||||||
snprintf (tmp2, repeats+10, tmp1, fl);
|
snprintf (tmp2, repeats+10, tmp1, fl);
|
||||||
#else
|
#else
|
||||||
@ -545,6 +546,7 @@ doformat(volatile Term otail, volatile Term oargs, int sno USES_REGS)
|
|||||||
tmpbase = NULL;
|
tmpbase = NULL;
|
||||||
} else {
|
} else {
|
||||||
tmpbase = res;
|
tmpbase = res;
|
||||||
|
|
||||||
goto do_type_int_error;
|
goto do_type_int_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit e0e072ad7fbe7558e69197135cc657a02365224a
|
Subproject commit e9135f8b6e2058f7133a7c16e2eb33ffa47749fc
|
42
pl/boot.yap
42
pl/boot.yap
@ -2,7 +2,7 @@
|
|||||||
* *
|
* *
|
||||||
* YAP Prolog *
|
* YAP Prolog *
|
||||||
* *
|
* *
|
||||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||||
* *
|
* *
|
||||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-2014 *
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-2014 *
|
||||||
* *
|
* *
|
||||||
@ -251,7 +251,9 @@ private(_).
|
|||||||
'$run_at_thread_start'/0,
|
'$run_at_thread_start'/0,
|
||||||
'$system_catch'/4,
|
'$system_catch'/4,
|
||||||
'$undefp'/1,
|
'$undefp'/1,
|
||||||
'$version'/0]).
|
'$version'/0]).
|
||||||
|
|
||||||
|
'$undefp'(G, _) :- writeln(G), fail.
|
||||||
|
|
||||||
:- use_system_module( '$_absf', ['$system_library_directories'/2]).
|
:- use_system_module( '$_absf', ['$system_library_directories'/2]).
|
||||||
|
|
||||||
@ -433,7 +435,7 @@ true :- true.
|
|||||||
[trace, end_of_file],
|
[trace, end_of_file],
|
||||||
Prompt, Goal, Bindings), !,
|
Prompt, Goal, Bindings), !,
|
||||||
(nonvar(Err) ->
|
(nonvar(Err) ->
|
||||||
print_message(error,Err), fail
|
'$early_print'(error,Err), fail
|
||||||
;
|
;
|
||||||
true
|
true
|
||||||
).
|
).
|
||||||
@ -479,7 +481,7 @@ true :- true.
|
|||||||
;
|
;
|
||||||
true
|
true
|
||||||
),
|
),
|
||||||
print_message(informational,prompt(BreakLevel,TraceDebug)),
|
'$early_print'(informational,prompt(BreakLevel,TraceDebug)),
|
||||||
fail.
|
fail.
|
||||||
'$enter_top_level' :-
|
'$enter_top_level' :-
|
||||||
get_value('$top_level_goal',GA), GA \= [], !,
|
get_value('$top_level_goal',GA), GA \= [], !,
|
||||||
@ -757,7 +759,7 @@ number of steps.
|
|||||||
recorded('$import','$import'(NM,Mod,NH,H,_,_),R),
|
recorded('$import','$import'(NM,Mod,NH,H,_,_),R),
|
||||||
NM \= Mod,
|
NM \= Mod,
|
||||||
functor(NH,N,Ar),
|
functor(NH,N,Ar),
|
||||||
print_message(warning,redefine_imported(Mod,NM,N/Ar)),
|
'$early_print'(warning,redefine_imported(Mod,NM,N/Ar)),
|
||||||
erase(R),
|
erase(R),
|
||||||
fail.
|
fail.
|
||||||
'$not_imported'(_, _).
|
'$not_imported'(_, _).
|
||||||
@ -848,13 +850,10 @@ number of steps.
|
|||||||
).
|
).
|
||||||
|
|
||||||
'$out_neg_answer' :-
|
'$out_neg_answer' :-
|
||||||
( '$undefined'(print_message(_,_),prolog) ->
|
'$early_print'( help, false),
|
||||||
'$present_answer'(user_error,'false.~n')
|
|
||||||
;
|
|
||||||
print_message(help,false)
|
|
||||||
),
|
|
||||||
fail.
|
fail.
|
||||||
|
|
||||||
|
|
||||||
'$do_yes_no'([X|L], M) :-
|
'$do_yes_no'([X|L], M) :-
|
||||||
!,
|
!,
|
||||||
'$csult'([X|L], M).
|
'$csult'([X|L], M).
|
||||||
@ -895,10 +894,10 @@ number of steps.
|
|||||||
fail
|
fail
|
||||||
;
|
;
|
||||||
C== 10 -> '$add_nl_outside_console',
|
C== 10 -> '$add_nl_outside_console',
|
||||||
( '$undefined'(print_message(_,_),prolog) ->
|
( '$undefined'('$early_print'(_,_),prolog) ->
|
||||||
format(user_error,'yes~n', [])
|
format(user_error,'yes~n', [])
|
||||||
;
|
;
|
||||||
print_message(help,yes)
|
'$early_print'(help,yes)
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
C== 13 ->
|
C== 13 ->
|
||||||
@ -1380,10 +1379,10 @@ bootstrap(F) :-
|
|||||||
|
|
||||||
'$enter_command'(Stream,Mod,top) :- !,
|
'$enter_command'(Stream,Mod,top) :- !,
|
||||||
read_term(Stream, Command, [module(Mod), syntax_errors(dec10),variable_names(Vars), term_position(Pos)]),
|
read_term(Stream, Command, [module(Mod), syntax_errors(dec10),variable_names(Vars), term_position(Pos)]),
|
||||||
'$command'(Command,Vars,Pos,Status).
|
'$command'(Command,Vars,Pos,Status).
|
||||||
'$enter_command'(Stream,Mod,Status) :-
|
'$enter_command'(Stream,Mod,Status) :-
|
||||||
read_clause(Stream, Command, [variable_names(Vars), term_position(Pos)]),
|
read_clause(Stream, Command, [variable_names(Vars), term_position(Pos)]),
|
||||||
'$command'(Command,Vars,Pos,Status).1
|
'$command'(Command,Vars,Pos,Status).
|
||||||
|
|
||||||
'$abort_loop'(Stream) :-
|
'$abort_loop'(Stream) :-
|
||||||
'$do_error'(permission_error(input,closed_stream,Stream), loop).
|
'$do_error'(permission_error(input,closed_stream,Stream), loop).
|
||||||
@ -1580,6 +1579,19 @@ log_event( String, Args ) :-
|
|||||||
format( atom( M ), String, Args),
|
format( atom( M ), String, Args),
|
||||||
log_event( M ).
|
log_event( M ).
|
||||||
|
|
||||||
|
'$early_print'( Lev, Msg ) :-
|
||||||
|
( '$undefined'(print_message(_,_),prolog) ->
|
||||||
|
'$show'(Lev, Msg)
|
||||||
|
;
|
||||||
|
print_message(Lev, Msg)
|
||||||
|
).
|
||||||
|
|
||||||
|
'$show'(_,Msg) :-
|
||||||
|
format(user_error, '~w~n', [Msg]).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@}
|
@}
|
||||||
*/
|
*/
|
||||||
|
@ -227,7 +227,7 @@ load_files(Files,Opts) :-
|
|||||||
'$lf_option'(dialect, 20, yap).
|
'$lf_option'(dialect, 20, yap).
|
||||||
'$lf_option'(format, 21, source).
|
'$lf_option'(format, 21, source).
|
||||||
'$lf_option'(redefine_module, 22, Warn) :-
|
'$lf_option'(redefine_module, 22, Warn) :-
|
||||||
( var(Warn) -> current_prolog_flag( redefine_warnings, Redefine ), Redefine = Warn ; true )).
|
( var(Warn) -> current_prolog_flag( redefine_warnings, Redefine ), Redefine = Warn ; true ).
|
||||||
'$lf_option'(reexport, 23, false).
|
'$lf_option'(reexport, 23, false).
|
||||||
'$lf_option'(sandboxed, 24, false).
|
'$lf_option'(sandboxed, 24, false).
|
||||||
'$lf_option'(scope_settings, 25, false).
|
'$lf_option'(scope_settings, 25, false).
|
||||||
@ -465,11 +465,11 @@ load_files(Files,Opts) :-
|
|||||||
% check if there is a qly file
|
% check if there is a qly file
|
||||||
% start_low_level_trace,
|
% start_low_level_trace,
|
||||||
'$absolute_file_name'(File,[access(read),file_type(qly),file_errors(fail),solutions(first),expand(true)],F,qload_file(File)),
|
'$absolute_file_name'(File,[access(read),file_type(qly),file_errors(fail),solutions(first),expand(true)],F,qload_file(File)),
|
||||||
open( F, read, Stream , [type(binary)] ),
|
open( F, read, Stream , [type(binary)] ),
|
||||||
H0 is heapused, '$cputime'(T0,_),
|
'$q_header'( Stream, Type ),
|
||||||
( '$q_header'( Stream, Type ),
|
( Type == file
|
||||||
Type == file
|
|
||||||
->
|
->
|
||||||
|
H0 is heapused, '$cputime'(T0,_),
|
||||||
time_file64(F, T0F),
|
time_file64(F, T0F),
|
||||||
stream_property(PlStream, file_name(FilePl)),
|
stream_property(PlStream, file_name(FilePl)),
|
||||||
time_file64(FilePl, T0Fl),
|
time_file64(FilePl, T0Fl),
|
||||||
@ -485,7 +485,7 @@ load_files(Files,Opts) :-
|
|||||||
working_directory( _, OldD),
|
working_directory( _, OldD),
|
||||||
'$lf_opt'('$location', TOpts, ParentF:_Line),
|
'$lf_opt'('$location', TOpts, ParentF:_Line),
|
||||||
'$reexport'( TOpts, ParentF, Reexport, ImportList, File ),
|
'$reexport'( TOpts, ParentF, Reexport, ImportList, File ),
|
||||||
print_message(Verbosity, loaded( loaded, F, M, T, H)),
|
'$early_print'(Verbosity, loaded( loaded, F, M, T, H)),
|
||||||
% stop_low_level_trace,
|
% stop_low_level_trace,
|
||||||
'$exec_initialisation_goals'
|
'$exec_initialisation_goals'
|
||||||
;
|
;
|
||||||
@ -686,7 +686,7 @@ db_files(Fs) :-
|
|||||||
StartMsg = consulting,
|
StartMsg = consulting,
|
||||||
EndMsg = consulted
|
EndMsg = consulted
|
||||||
),
|
),
|
||||||
print_message(Verbosity, loading(StartMsg, UserFile)),
|
'$early_print'(Verbosity, loading(StartMsg, UserFile)),
|
||||||
'$lf_opt'(skip_unix_header , TOpts, SkipUnixHeader),
|
'$lf_opt'(skip_unix_header , TOpts, SkipUnixHeader),
|
||||||
( SkipUnixHeader == true
|
( SkipUnixHeader == true
|
||||||
->
|
->
|
||||||
@ -699,7 +699,7 @@ db_files(Fs) :-
|
|||||||
'$import_to_current_module'(File, ContextModule, Imports, _, TOpts),
|
'$import_to_current_module'(File, ContextModule, Imports, _, TOpts),
|
||||||
'$current_module'(Mod, SourceModule),
|
'$current_module'(Mod, SourceModule),
|
||||||
H is heapused-H0, '$cputime'(TF,_), T is TF-T0,
|
H is heapused-H0, '$cputime'(TF,_), T is TF-T0,
|
||||||
print_message(Verbosity, loaded(EndMsg, File, Mod, T, H)),
|
'$early_print'(Verbosity, loaded(EndMsg, File, Mod, T, H)),
|
||||||
'$end_consult',
|
'$end_consult',
|
||||||
'$q_do_save_file'(File, UserFile, TOpts ),
|
'$q_do_save_file'(File, UserFile, TOpts ),
|
||||||
(
|
(
|
||||||
@ -855,12 +855,12 @@ db_files(Fs) :-
|
|||||||
'$loaded'(Y, X, Mod, _OldY, _L, include, _, Dir, []),
|
'$loaded'(Y, X, Mod, _OldY, _L, include, _, Dir, []),
|
||||||
( '$nb_getval'('$included_file', OY, fail ) -> true ; OY = [] ),
|
( '$nb_getval'('$included_file', OY, fail ) -> true ; OY = [] ),
|
||||||
nb_setval('$included_file', Y),
|
nb_setval('$included_file', Y),
|
||||||
print_message(Verbosity, loading(including, Y)),
|
'$early_print'(Verbosity, loading(including, Y)),
|
||||||
'$loop'(Stream,Status),
|
'$loop'(Stream,Status),
|
||||||
set_stream(OldStream, alias(loop_stream) ),
|
set_stream(OldStream, alias(loop_stream) ),
|
||||||
close(Stream),
|
close(Stream),
|
||||||
H is heapused-H0, '$cputime'(TF,_), T is TF-T0,
|
H is heapused-H0, '$cputime'(TF,_), T is TF-T0,
|
||||||
print_message(Verbosity, loaded(included, Y, Mod, T, H)),
|
'$early_print'(Verbosity, loaded(included, Y, Mod, T, H)),
|
||||||
working_directory(_Dir, Dir0),
|
working_directory(_Dir, Dir0),
|
||||||
nb_setval('$included_file',OY).
|
nb_setval('$included_file',OY).
|
||||||
|
|
||||||
@ -993,8 +993,7 @@ prolog_load_context(source, F0) :-
|
|||||||
F0 = user_input
|
F0 = user_input
|
||||||
).
|
).
|
||||||
prolog_load_context(stream, Stream) :-
|
prolog_load_context(stream, Stream) :-
|
||||||
'$nb_getval'('$consulting_file', _, fail),
|
stream_property(Stream, alias(loop_stream) ).
|
||||||
'$current_loop_stream'(Stream).
|
|
||||||
|
|
||||||
|
|
||||||
% if the file exports a module, then we can
|
% if the file exports a module, then we can
|
||||||
@ -1032,7 +1031,7 @@ prolog_load_context(stream, Stream) :-
|
|||||||
'$file_is_unchanged'(F, R, Age),
|
'$file_is_unchanged'(F, R, Age),
|
||||||
!,
|
!,
|
||||||
% ( F = '/usr/local/share/Yap/rbtrees.yap' ->start_low_level_trace ; true),
|
% ( F = '/usr/local/share/Yap/rbtrees.yap' ->start_low_level_trace ; true),
|
||||||
recorded('$module','$module'(F,NM,_ASource,_P,_),_)
|
recorded('$module','$module'(F,NM,_ASource,_P,_),_),
|
||||||
( M == NM -> true ; recorded('$module','$module'(F,NM,_Source,_P,_),_) ), !.
|
( M == NM -> true ; recorded('$module','$module'(F,NM,_Source,_P,_),_) ), !.
|
||||||
|
|
||||||
'$file_is_unchanged'(F, R, Age) :-
|
'$file_is_unchanged'(F, R, Age) :-
|
||||||
@ -1345,7 +1344,7 @@ last one, onto underscores.
|
|||||||
|
|
||||||
'$add_multifile'(File,Name,Arity,Module) :-
|
'$add_multifile'(File,Name,Arity,Module) :-
|
||||||
recorded('$multifile_defs','$defined'(File,Name,Arity,Module), _), !.
|
recorded('$multifile_defs','$defined'(File,Name,Arity,Module), _), !.
|
||||||
% print_message(warning,declaration((multifile Module:Name/Arity),ignored)).
|
% '$early_print'(warning,declaration((multifile Module:Name/Arity),ignored)).
|
||||||
'$add_multifile'(File,Name,Arity,Module) :-
|
'$add_multifile'(File,Name,Arity,Module) :-
|
||||||
recordz('$multifile_defs','$defined'(File,Name,Arity,Module),_), !,
|
recordz('$multifile_defs','$defined'(File,Name,Arity,Module),_), !,
|
||||||
fail.
|
fail.
|
||||||
@ -1617,7 +1616,7 @@ End of conditional compilation.
|
|||||||
|
|
||||||
|
|
||||||
'$if_call'(G) :-
|
'$if_call'(G) :-
|
||||||
catch('$eval_if'(G), E, (print_message(error, E), fail)).
|
catch('$eval_if'(G), E, ('$early_print'(error, E), fail)).
|
||||||
|
|
||||||
'$eval_if'(Goal) :-
|
'$eval_if'(Goal) :-
|
||||||
expand_term(Goal,TrueGoal),
|
expand_term(Goal,TrueGoal),
|
||||||
|
44
pl/init.yap
44
pl/init.yap
@ -2,7 +2,7 @@
|
|||||||
* *
|
* *
|
||||||
* YAP Prolog *
|
* YAP Prolog *
|
||||||
* *
|
* *
|
||||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
** Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||||
* *
|
* *
|
||||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||||
* *
|
* *
|
||||||
@ -123,11 +123,14 @@ otherwise.
|
|||||||
|
|
||||||
:-set_prolog_flag(verbose, normal).
|
:-set_prolog_flag(verbose, normal).
|
||||||
|
|
||||||
:- [ 'directives.yap',
|
:-set_prolog_flag(gc_trace, verbose).
|
||||||
'utils.yap',
|
|
||||||
'control.yap',
|
:- [
|
||||||
'arith.yap',
|
'arith.yap',
|
||||||
'flags.yap'
|
'directives.yap',
|
||||||
|
'utils.yap',
|
||||||
|
'control.yap',
|
||||||
|
'flags.yap'
|
||||||
].
|
].
|
||||||
|
|
||||||
:- [ 'preds.yap',
|
:- [ 'preds.yap',
|
||||||
@ -332,10 +335,39 @@ If this hook predicate succeeds it must instantiate the _Action_ argument to th
|
|||||||
|
|
||||||
:- dynamic user:exception/3.
|
:- dynamic user:exception/3.
|
||||||
|
|
||||||
|
/*
|
||||||
|
Add some tests
|
||||||
|
*/
|
||||||
:- yap_flag(user:unknown,error).
|
:- yap_flag(user:unknown,error).
|
||||||
|
|
||||||
:- stream_property(user_input, tty(true)) -> set_prolog_flag(readline, true) ; true.
|
:- stream_property(user_input, tty(true)) -> set_prolog_flag(readline, true) ; true.
|
||||||
|
|
||||||
|
aa b.
|
||||||
|
|
||||||
|
p(X,Y) :- Y is X*X.
|
||||||
|
|
||||||
|
prefix(information, '% ', S, user_error) --> [].
|
||||||
|
|
||||||
|
:- format('~d~n', [a]).
|
||||||
|
|
||||||
|
:- format('~d~n', []).
|
||||||
|
|
||||||
|
:- p(X,Y).
|
||||||
|
|
||||||
|
a(1).
|
||||||
|
|
||||||
|
a.
|
||||||
|
|
||||||
|
a(2).
|
||||||
|
a(2).
|
||||||
|
|
||||||
|
lists:member(1,[1]).
|
||||||
|
|
||||||
|
clause_to_indicator(T, M:Name/Arity) :- ,
|
||||||
|
strip_module(T, M, T1),
|
||||||
|
pred_arity( T1, Name, Arity ).
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@}
|
@}
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +52,7 @@ lists:append([H|T], L, [H|R]) :-
|
|||||||
lists:append(T, L, R).
|
lists:append(T, L, R).
|
||||||
|
|
||||||
|
|
||||||
:- set_prolog_flag(source, false)). % :- no_source.
|
:- set_prolog_flag(source, false). % :- no_source.
|
||||||
|
|
||||||
% lists:delete(List, Elem, Residue)
|
% lists:delete(List, Elem, Residue)
|
||||||
% is true when List is a list, in which Elem may or may not occur, and
|
% is true when List is a list, in which Elem may or may not occur, and
|
||||||
|
@ -527,13 +527,15 @@ qload_module(Mod) :-
|
|||||||
).
|
).
|
||||||
'$qload_module'(Mod, File, SourceModule) :-
|
'$qload_module'(Mod, File, SourceModule) :-
|
||||||
open(File, read, S, [type(binary)]),
|
open(File, read, S, [type(binary)]),
|
||||||
'$q_header'( S, Type ),
|
%check verifies if a saved state;
|
||||||
|
'$q_header'( S, Type ), !,
|
||||||
( Type == module ->
|
( Type == module ->
|
||||||
'$qload_module'(S , Mod, File, SourceModule)
|
'$qload_module'(S , Mod, File, SourceModule)
|
||||||
;
|
;
|
||||||
Type == file ->
|
Type == file ->
|
||||||
'$qload_file'(S, File)
|
'$qload_file'(S, File)
|
||||||
),
|
),
|
||||||
|
!,
|
||||||
close(S).
|
close(S).
|
||||||
|
|
||||||
'$qload_module'(_S, Mod, _File, _SourceModule) :-
|
'$qload_module'(_S, Mod, _File, _SourceModule) :-
|
||||||
|
Reference in New Issue
Block a user