fix prolog_flags for chr.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1802 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2007-02-26 10:41:40 +00:00
parent 621e47f8a4
commit e10bb2a6ae
7 changed files with 46 additions and 17 deletions

View File

@ -3772,6 +3772,7 @@ call_gc(UInt gc_lim, Int predarity, CELL *current_env, yamop *nextop)
(ASP-H0)*sizeof(CELL) > gc_lim &&
H-H0 > (LCL0-ASP)/2) {
effectiveness = do_gc(predarity, current_env, nextop);
Yap_atom_gc();
if (effectiveness < 0)
return FALSE;
if (effectiveness > 90) {

View File

@ -849,6 +849,7 @@ InitFlags(void)
#else
yap_flags[ALLOW_ASSERTING_STATIC_FLAG] = TRUE;
#endif
yap_flags[GENERATE_DEBUG_INFO_FLAG] = TRUE;
/* current default */
yap_flags[INDEXING_MODE_FLAG] = INDEX_MODE_MULTI;
yap_flags[TABLING_MODE_FLAG] = 0;
@ -1402,7 +1403,7 @@ Yap_InitWorkspace(int Heap, int Stack, int Trail, int max_table_size,
/* InitAbsmi must be done before InitCodes */
/* This must be done before initialising predicates */
Yap_heap_regs->system_pred_goal_expansion_func = FALSE;
for (i = 0; i <= TABLING_MODE_FLAG; i++) {
for (i = 0; i <= LAST_FLAG; i++) {
yap_flags[i] = 0;
}
GcCalls = 0;

View File

@ -11,8 +11,11 @@
* File: stdpreds.c *
* comments: General-purpose C implemented system predicates *
* *
* Last rev: $Date: 2007-01-28 14:26:37 $,$Author: vsc $ *
* Last rev: $Date: 2007-02-26 10:41:40 $,$Author: vsc $ *
* $Log: not supported by cvs2svn $
* Revision 1.117 2007/01/28 14:26:37 vsc
* WIN32 support
*
* Revision 1.116 2006/12/13 16:10:23 vsc
* several debugger and CLP(BN) improvements.
*
@ -3364,6 +3367,11 @@ p_set_yap_flags(void)
return(FALSE);
yap_flags[STACK_DUMP_ON_ERROR_FLAG] = value;
break;
case GENERATE_DEBUG_INFO_FLAG:
if (value != 0 && value != 1)
return(FALSE);
yap_flags[GENERATE_DEBUG_INFO_FLAG] = value;
break;
case INDEXING_MODE_FLAG:
if (value < INDEX_MODE_OFF || value > INDEX_MODE_MAX)
return(FALSE);

10
H/Yap.h
View File

@ -10,7 +10,7 @@
* File: Yap.h.m4 *
* mods: *
* comments: main header file for YAP *
* version: $Id: Yap.h,v 1.20 2007-02-18 00:26:36 vsc Exp $ *
* version: $Id: Yap.h,v 1.21 2007-02-26 10:41:40 vsc Exp $ *
*************************************************************************/
#include "config.h"
@ -514,9 +514,11 @@ typedef enum
HALT_AFTER_CONSULT_FLAG = 15,
FAST_BOOT_FLAG = 16,
STACK_DUMP_ON_ERROR_FLAG = 17,
INDEXING_MODE_FLAG = 18,
GENERATE_DEBUG_INFO_FLAG = 18,
INDEXING_MODE_FLAG = 19,
TABLING_MODE_FLAG = 20,
/* let this be the last one */
TABLING_MODE_FLAG = 19
LAST_FLAG = 21
} yap_flags;
#define STRING_AS_CHARS 0
@ -560,7 +562,7 @@ typedef enum
YAP_AGC_SIGNAL = 0x20000 /* call atom garbage collector asap */
} yap_signals;
#define NUMBER_OF_YAP_FLAGS TABLING_MODE_FLAG + 1
#define NUMBER_OF_YAP_FLAGS LAST_FLAG
/************************ prototypes **********************************/

View File

@ -6549,7 +6549,7 @@ Just fail
@findex system_options (yap_flag/2 option)
@* This read only flag tells which options were used to compile
YAP. Currently it informs whether the system supports
@code{coroutining}, @code{depth_limit}, the @code{low_level_tracer},
@code{coroutining}, @code{depth_limit}, @code{low_level_tracer},
@code{or-parallelism}, @code{rational_trees}, @code{tabling},
@code{threads}, or the @code{wam_profiler}.

View File

@ -213,6 +213,7 @@ use_module(M,F,Is) :-
'$change_alias_to_stream'('$loop_stream',Stream),
get_value('$consulting',Old),
set_value('$consulting',false),
'$access_yap_flags'(18,GenerateDebug),
'$consult_infolevel'(InfLevel),
recorda('$initialisation','$',_),
( Reconsult = reconsult ->
@ -241,6 +242,7 @@ use_module(M,F,Is) :-
true
),
'$change_alias_to_stream'('$loop_stream',OldStream),
'$set_yap_flags'(18,GenerateDebug),
set_value('$consulting',Old),
set_value('$consulting_file',OldF),
cd(OldD),

View File

@ -189,16 +189,21 @@ yap_flag(syntax_errors, Option) :-
% compatibility flag
yap_flag(enhanced,on) :- !, set_value('$enhanced',true).
yap_flag(enhanced,off) :- set_value('$enhanced',[]).
%
% SWI compatibility flag
%
yap_flag(generate_debug_info,V) :- var(V), !,
source_mode(OnOff,OnOff),
(OnOff = on -> V = true ; V = false).
yap_flag(generate_debug_info,true) :- !.
yap_flag(generate_debug_info,false) :- !.
yap_flag(generate_debug_info,X) :-
'$do_error'(domain_error(flag_value,generate_domain_info+X),yap_flag(generate_debug_info,X)).
var(X), !,
'$access_yap_flags'(18,Options),
(Options =:= 0 -> X = false ; X = true ).
yap_flag(generate_debug_info,true) :- !,
'$set_yap_flags'(18,1).
yap_flag(generate_debug_info,false) :- !,
'$set_yap_flags'(18,0).
yap_flag(generate_debug_info,X) :-
'$do_error'(domain_error(flag_value,generate_debugging_info+X),yap_flag(generate_debugging_info,X)).
%
% show state of $
%
@ -232,11 +237,11 @@ yap_flag(bounded,X) :-
% do or do not indexation
yap_flag(index,X) :- var(X),
'$access_yap_flags'(18, X1),
'$access_yap_flags'(19, X1),
'$transl_to_index_mode'(X1,X), !.
yap_flag(index,X) :-
'$transl_to_index_mode'(X1,X), !,
'$set_yap_flags'(18,X1).
'$set_yap_flags'(19,X1).
yap_flag(index,X) :-
'$do_error'(domain_error(flag_value,index+X),yap_flag(index,X)).
@ -254,7 +259,7 @@ yap_flag(home,X) :-
% tabling mode
yap_flag(tabling_mode,Options) :-
var(Options), !,
'$access_yap_flags'(19,Options).
'$access_yap_flags'(20,Options).
yap_flag(tabling_mode,[]) :- !.
yap_flag(tabling_mode,[HOption|TOption]) :- !,
yap_flag(tabling_mode,HOption),
@ -264,7 +269,7 @@ yap_flag(tabling_mode,(Option1,Option2)) :- !,
yap_flag(tabling_mode,Option2).
yap_flag(tabling_mode,Option) :-
'$transl_to_tabling_mode'(Flag,Option),
'$set_yap_flags'(19,Flag).
'$set_yap_flags'(20,Flag).
yap_flag(tabling_mode,Options) :-
'$do_error'(domain_error(flag_value,tabling_mode+Options),yap_flag(tabling_mode,Options)).
@ -458,6 +463,15 @@ yap_flag(redefine_warnings,X) :-
yap_flag(redefine_warnings,X) :-
'$do_error'(domain_error(flag_value,redefine_warnings+X),yap_flag(redefine_warnings,X)).
yap_flag(chr_toplevel_show_store,X) :-
var(X), !,
nb_getval('$chr_toplevel_show_store',X).
yap_flag(chr_toplevel_show_store,X) :-
(X = true ; X = false), !,
nb_setval('$chr_toplevel_show_store',X).
yap_flag(chr_toplevel_show_store,X) :-
'$do_error'(domain_error(flag_value,chr_toplevel_show_store+X),yap_flag(chr_toplevel_show_store,X)).
yap_flag(single_var_warnings,X) :-
var(X), !,
('$syntax_check_mode'(on,_), '$syntax_check_single_var'(on,_) ->
@ -660,6 +674,7 @@ yap_flag(max_threads,X) :-
V = bounded ;
V = char_conversion ;
V = character_escapes ;
V = chr_toplevel_show_store ;
V = debug ;
V = debugger_print_options ;
V = discontiguous_warnings ;