|
1569 | 1569 | on_set_value(_Note,abort_trace,true):- nocut, ignore(abort_trace),!. |
1570 | 1570 |
|
1571 | 1571 | on_set_value(_Note,show, Value):- |
1572 | | - if_t( \+ prolog_debug:debugging(filter_default,_,_), set_option_value(filter_default,hide)), |
| 1572 | + if_t( \+ option_value(default_show_hide,_), set_option_value(default_show_hide,hide)), |
1573 | 1573 | listify(Value,List), maplist(set_tf_debug(true),List). |
1574 | 1574 | on_set_value(_Note,hide,Value):- |
1575 | | - if_t( \+ prolog_debug:debugging(filter_default,_,_), (set_option_value(filter_default,show))), |
| 1575 | + if_t( \+ option_value(default_show_hide,_), (set_option_value(default_show_hide,show))), |
1576 | 1576 | listify(Value,List), maplist(set_tf_debug(false),List). |
1577 | 1577 |
|
| 1578 | +on_set_value(_Note,trace, Value):- |
| 1579 | + if_t( \+ option_value(default_trace_notrace,_), set_option_value(default_trace_notrace,notrace)), |
| 1580 | + listify(Value,List), maplist(set_tf_debug(true),List). |
| 1581 | +on_set_value(_Note,notrace,Value):- |
| 1582 | + if_t( \+ option_value(default_trace_notrace,_), (set_option_value(default_trace_notrace,trace))), |
| 1583 | + listify(Value,List), maplist(set_tf_debug(false),List). |
| 1584 | + |
| 1585 | + |
1578 | 1586 | on_set_value(_Note,log,true):- |
1579 | 1587 | % Switch to mettalog mode if 'log' is set to true. |
1580 | 1588 | switch_to_mettalog,!. |
|
1833 | 1841 | % |
1834 | 1842 | user_io(G) :- |
1835 | 1843 | % Execute the goal using the user_io_0/1 helper. |
1836 | | - notrace(user_io_0(G)). |
| 1844 | + user_io_0(G). |
1837 | 1845 |
|
1838 | 1846 | %! user_io_0(:Goal) is det. |
1839 | 1847 | % |
|
4132 | 4140 | % Pass the components to `load_hook1/5` for further processing. |
4133 | 4141 | load_hook1(Load, Self, [Eq, H, B]). |
4134 | 4142 |
|
4135 | | -load_hook0(Load, Assertion) :- fail, |
| 4143 | +load_hook0(Load, Assertion) :- |
4136 | 4144 | % Extract components of the assertion using `assertion_hb/5`. |
4137 | 4145 | once(assertion_fact(Assertion, Self, Fact)), !, |
4138 | 4146 | % Pass the components to `load_hook1/5` for further processing. |
|
4157 | 4165 | % load_hook1(_Load, '&corelib', _Eq, _H, _B) :- !. |
4158 | 4166 |
|
4159 | 4167 | metta_asserted_hook(_Load, Self, [Eq,H,B]):- Eq == '=', compiler_assertz(metta_function_asserted(Self,H,B)),!. |
4160 | | -metta_asserted_hook(_Load, Self, StuffHook):- send_to_pl_file(metta_other_asserted(Self,StuffHook)),!. |
| 4168 | +%metta_asserted_hook(_Load, Self, [Eq,H,B]):- Eq == 'ALT=', compiler_assertz(metta_function_asserted(Self,H,B)),!. |
| 4169 | +metta_asserted_hook(_Load, Self, StuffHook):- compiler_assertz( metta_other_asserted(Self,StuffHook)). %send_to_pl_file( metta_other_asserted(Self,StuffHook)))),!. |
4161 | 4170 |
|
4162 | 4171 | load_hook1(Load, Self, StuffHook) :- |
4163 | | - once(metta_asserted_hook(Load, Self, StuffHook)), fail. |
| 4172 | + metta_asserted_hook(Load, Self, StuffHook), fail. |
| 4173 | + |
4164 | 4174 | load_hook1(Load, Self, Fact) :- |
4165 | 4175 | % Ensure the Metta compiler is ready for use. |
4166 | 4176 | once(use_metta_compiler),!, |
|
4184 | 4194 |
|
4185 | 4195 | :- dynamic(did_load_hook_compiler/3). |
4186 | 4196 |
|
4187 | | -load_hook_compiler(Load, Self, Assertion):- \+ \+ ((did_load_hook_compiler(Load, Self, Assertion1),Assertion1=@=Assertion)),!, |
| 4197 | +load_hook_compiler(Load, Self, Assertion):- |
| 4198 | + \+ \+ ((did_load_hook_compiler(Load, Self, Assertion1),Assertion1=@=Assertion)),!, |
4188 | 4199 | %debug_info(skip_load_repeated_hook_compiler(Load, Self, Assertion)),!. |
4189 | 4200 | debug_info(skip_2nd(Load, Self, Assertion)),!. |
4190 | 4201 | load_hook_compiler(Load, Self, Assertion):- |
|
7255 | 7266 | % is allowed, it handles modifications to `system:notrace/1` to customize its behavior. |
7256 | 7267 | % |
7257 | 7268 |
|
7258 | | -nts1 :- !. % Disable redefinition by cutting execution. |
| 7269 | +%nts1 :- !. % Disable redefinition by cutting execution. |
7259 | 7270 | nts1 :- is_flag(notrace),!. |
7260 | 7271 | nts1 :- no_interupts(nts1r). |
| 7272 | +%nts1r :- !. % Disable redefinition by cutting execution. |
7261 | 7273 | nts1r :- |
7262 | 7274 | % Redefine the system predicate `system:notrace/1` to customize its behavior. |
7263 | 7275 | redefine_system_predicate(system:notrace/1), |
|
0 commit comments