Skip to content

Commit d36a4ee

Browse files
committed
88/57 interp/compiled on tests/quick_quality/
1 parent 0354b7d commit d36a4ee

File tree

10 files changed

+3896
-3363
lines changed

10 files changed

+3896
-3363
lines changed

libraries/logicmoo_utils/prolog/xlisting/xlisting_web.pl

Lines changed: 442 additions & 440 deletions
Large diffs are not rendered by default.

mettalog

Lines changed: 76 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,53 @@ export RUST_BACKTRACE=full
12191219
# Set default reference file name based on hostname
12201220
DefaultSav="Sav.$(hostname).MeTTaLog"
12211221
need_compile=0 # Ensure this is initialized
1222+
INTERP_SRC_DIR="${INTERP_SRC_DIR:-.}"
1223+
checksum_file="$INTERP_SRC_DIR/lastbuilt.checksum"
1224+
1225+
# Function to calculate and save checksums in $INTERP_SRC_DIR
1226+
save_checksums() {
1227+
local dir="${INTERP_SRC_DIR:-.}"
1228+
# Set checksum_file if not already set
1229+
if [[ -z "$checksum_file" ]]; then
1230+
checksum_file="$dir/lastbuilt.checksum"
1231+
fi
1232+
find "$dir" -type f \( -name "*.pl" -o -name "*.metta" \) \
1233+
-exec sha256sum "{}" + | sort > "$checksum_file"
1234+
DEBUG "Checksums saved to $checksum_file"
1235+
}
1236+
# Function to check if any files have changed in $INTERP_SRC_DIR
1237+
check_for_changes() {
1238+
local dir="${INTERP_SRC_DIR:-.}"
1239+
1240+
# Set checksum_file if not already set
1241+
if [[ -z "$checksum_file" ]]; then
1242+
checksum_file="$dir/lastbuilt.checksum"
1243+
fi
1244+
1245+
if [[ ! -f "$checksum_file" ]]; then
1246+
#echo "No checksum file found in $dir. Needs rebuilt."
1247+
#need_compile=1
1248+
return 1
1249+
fi
12221250

1251+
local temp_file
1252+
temp_file=$(mktemp)
1253+
1254+
find "$dir" -type f \( -name "*.pl" -o -name "*.metta" \) \
1255+
-exec sha256sum "{}" + | sort > "$temp_file"
1256+
1257+
if diff -q "$checksum_file" "$temp_file" &> /dev/null; then
1258+
#echo "No changes detected in $dir."
1259+
rm "$temp_file"
1260+
return 0
1261+
else
1262+
# echo "Changes detected in $dir!"
1263+
# Suppress diff output completely
1264+
# (you could log it somewhere instead if needed)
1265+
rm "$temp_file"
1266+
return 2
1267+
fi
1268+
}
12231269

12241270

12251271
# Check if any .pl file is newer than the skip_compile file
@@ -1236,6 +1282,7 @@ if [[ -f "$INTERP_SRC_DIR/skip_compile" ]]; then
12361282
done
12371283
fi
12381284

1285+
12391286
if [[ "$exe" == "force" ]]; then
12401287
exe=true
12411288
rm -f "$INTERP_SRC_DIR/skip_compile"
@@ -1258,16 +1305,16 @@ if [[ "$exe" == "true" ]]; then
12581305
need_compile=1
12591306
else
12601307
# Check if any .pl file is newer than the reference file
1261-
for pl_file in "$INTERP_SRC_DIR"/*_*.*; do
1262-
if [[ ! -e "$pl_file" ]]; then
1263-
DEBUG "{ORANGE}No matching .pl files found in $INTERP_SRC_DIR."
1264-
# If a .pl file is newer than the reference file, trigger recompilation
1265-
elif [[ "$pl_file" -nt "$reference_file" ]]; then
1266-
DEBUG "${ORANGE}$pl_file is newer than $reference_file."
1267-
need_compile=1
1268-
break # Exit loop early as compilation is already needed
1269-
fi
1270-
done
1308+
if check_for_changes; then
1309+
DEBUG "✅ Checksum OK: No changes detected in \$INTERP_SRC_DIR"
1310+
elif [[ $? -eq 1 ]]; then
1311+
DEBUG "⚠️ Checksum file not found."
1312+
need_compile=1
1313+
else
1314+
DEBUG "❌ Checksum MISMATCH: removing $INTERP_SRC_DIR/skip_compile"
1315+
rm -f "$INTERP_SRC_DIR/skip_compile"
1316+
need_compile=1
1317+
fi
12711318
fi
12721319
fi
12731320

@@ -1310,6 +1357,8 @@ if [[ -f "$INTERP_SRC_DIR/skip_compile" ]]; then
13101357
rm -f "$TEMP_DIR/tmp.??*"
13111358
fi
13121359

1360+
had_display=0
1361+
original_display=""
13131362
NEED_CLEANUP=0
13141363
STYLE=EXE
13151364

@@ -1321,13 +1370,20 @@ fi
13211370

13221371
# Function to cleanup compiled file if execution is interrupted or unsuccessful
13231372
compiler_cleanup() {
1373+
1374+
if [[ $had_display -eq 1 ]]; then
1375+
export DISPLAY="$original_display"
1376+
DEBUG "Restored DISPLAY=$DISPLAY"
1377+
fi
1378+
13241379
if [[ $NEED_CLEANUP -eq 1 ]]; then
13251380
NEED_CLEANUP=0
13261381

13271382
# If the success file is missing, remove the binary
13281383

13291384
if [[ -f "$reference_file" && -f "$METTALOG_COMPILE_SUCCESS" ]]; then
13301385
rm -f "$METTALOG_COMPILE_SUCCESS"
1386+
save_checksums
13311387
DEBUG "{$GREEN}CREATED $reference_file"
13321388
STYLE=EXE
13331389
else
@@ -1364,8 +1420,17 @@ compiler_cleanup() {
13641420

13651421
}
13661422

1423+
13671424
if [[ $need_compile -eq 1 && "$exe" == "true" ]]; then
13681425

1426+
1427+
if [[ -n "$DISPLAY" ]]; then
1428+
had_display=1
1429+
original_display="$DISPLAY"
1430+
unset DISPLAY
1431+
DEBUG "Temporarily unset DISPLAY (was $original_display)"
1432+
fi
1433+
13691434
NEED_CLEANUP=1
13701435
# Register cleanup before starting compilation
13711436
(
@@ -1383,11 +1448,9 @@ if [[ $need_compile -eq 1 && "$exe" == "true" ]]; then
13831448
MAKE_REF_FILE="swipl ${SWI_OPTIONS[*]} -l '$INTERP_SRC_DIR/metta_interp.pl' -g 'qcompile_mettalog.' -- ${ADD_COMPILE_ARG[*]} --exeout=$reference_file"
13841449
DEBUG "MAKE_REF_FILE = $MAKE_REF_FILE"
13851450

1386-
unset DISPLAY
1387-
13881451
# Execute the compilation command
13891452
set +e
1390-
DEBUG "${BOLD}Compiling $reference_file..."
1453+
DEBUG "${BOLD}Compiling $reference_file..."
13911454
eval "$MAKE_REF_FILE"
13921455
# trap reset_settings compiler_cleanup SIGINT SIGTERM EXIT
13931456
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
; TODO: Let the "importPaths" be modifiable, but I want better string manipulation atoms
2+
; The contents of this file are evaluated for each new runner in the runner's top context

prolog/metta_lang/metta_compiler.pl

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,92 @@
245245
partial_combine_lists(L1,L2,Lcomb,L1a,L2a).
246246
partial_combine_lists(L1,L2,[],L1,L2).
247247

248+
is_proper_arg(O):- compound(O),iz_conz(O), \+ is_list(O),!,bt, trace.
249+
is_proper_arg(_).
250+
% This hook is called when an attributed var is unified
251+
proper_list_attr:attr_unify_hook(_, Value) :- \+ compound(Value),!.
252+
proper_list_attr:attr_unify_hook(_, Value) :- is_list(Value),!.
253+
proper_list_attr:attr_unify_hook(_, Value) :- iz_conz(Value),!,trace.
254+
proper_list_attr:attr_unify_hook(_, _Value).
255+
% Attach the attribute if not already present and not already a proper list
256+
ensure_proper_list_var(Var) :- var(Var),!, put_attr(Var, proper_list_attr, is_proper_arg).
257+
ensure_proper_list_var(Var) :- is_proper_arg(Var),!.
258+
259+
260+
eval_at(_Fn,Where):- nb_current('eval_in_only',NonNil),NonNil\==[],!,Where=NonNil.
261+
eval_at( Fn,Where):- use_evaluator(fa(Fn, _), Only, only),!,Only=Where.
262+
eval_at(_Fn,Where):- option_value(compile,false),!,Where=interp.
263+
eval_at( Fn,Where):- use_evaluator(fa(Fn, _), Where, enabled),!.
264+
eval_at( Fn,Where):- nb_current(disable_compiler,WasDC),member(Fn,WasDC), Where==compiler,!,fail.
265+
eval_at( Fn,Where):- nb_current(disable_interp,WasDC),member(Fn,WasDC), Where==interp,!,fail.
266+
eval_at(_Fn,Where):- option_value(compile,full),!,Where=compiler.
267+
eval_at(_Fn, _Any):- !.
268+
269+
must_use_interp(Fn, only_interp(Fn), true):- use_evaluator(fa(Fn, _), interp, only).
270+
must_use_interp(_ , eval_in_only(compiler), never):- nb_current('eval_in_only',compiler).
271+
must_use_interp(_ , eval_in_only(interp), true):- nb_current('eval_in_only',interp).
272+
must_use_interp(Fn, disable_compiler(Fn), true):- nb_current(disable_compiler,WasDC), member(Fn,WasDC).
273+
must_use_interp(Fn,compiler_disabled(Fn), true):- use_evaluator(fa(Fn, _), compiler, disabled).
274+
must_use_interp(Fn,unknown(Fn), unknown).
275+
276+
must_use_compiler(_ ,eval_in_only(compiler)):- nb_current('eval_in_only',compiler).
277+
must_use_compiler(_ ,eval_in_only(interp)):- nb_current('eval_in_only',interp), fail.
278+
must_use_compiler(Fn,only_compiler(Fn)):- use_evaluator(fa(Fn, _), compiler, only).
279+
must_use_compiler(Fn,disable_interp(Fn)):- nb_current(disable_interp,WasDC), member(Fn,WasDC).
280+
must_use_compiler(Fn,interp_disabled(Fn)):- use_evaluator(fa(Fn, _), interp, disabled).
281+
282+
% Compiler is Disabled for Fn
283+
ci(PreInterp,Fn,Len,Eval,RetVal,_PreComp,_Compiled):- fail,
284+
once(must_use_interp(Fn,Why,TF)),
285+
TF \== unknown, TF \== never,
286+
debug_info(must_use_interp,why(Why,Fn=TF)),
287+
TF == true, !,
288+
289+
% \+ nb_current(disable_interp,WasDI),member(Fn,WasDI),
290+
call(PreInterp),
291+
maplist(lazy_eval_to_src,Eval,Src),
292+
if_t(Eval\=@=Src,
293+
debug_info(lazy_eval_to_src,ci(Fn,Len,Eval,RetVal))),
294+
%eval_fn_disable(Fn,disable_compiler,interp,((call(PreComp),call(Compiled)))),
295+
debug_info(Why,eval_args(Src,RetVal)),!,
296+
eval_args(Src,RetVal).
297+
298+
ci(_PreInterp,Fn,Len,_Eval,_RetVal,PreComp,Compiled):-
299+
%(nb_current(disable_interp,WasDI),member(Fn,WasDI);
300+
%\+ nb_current(disable_compiler,WasDC),member(Fn,WasDC)),!,
301+
%\+ \+ (maplist(lazy_eval_to_src,Eval,Src),
302+
% if_t(Eval\=@=Src, debug_info(lazy_eval_to_src,ci(Fn,Len,Eval,RetVal)))),
303+
if_t(false,debug_info(call_in_only_compiler,ci(Fn,Len,Compiled))),!,
304+
% eval_fn_disable(Fn,disable_compiler,eval_args(EvalM,Ret))
305+
%show_eval_into_src(PreInterp,Eval,_EvalM),
306+
(call(PreComp),call(Compiled)),
307+
%eval_fn_disable(Fn,disable_compiler,(call(PreComp),call(Compiled))),
308+
true.
309+
310+
eval_fn_disable(Fn,DisableCompiler,Call):-
311+
(nb_current(DisableCompiler,Was)->true;Was=[]),
312+
(New = [Fn|Was]),
313+
Setup = nb_setval(DisableCompiler,New),
314+
Restore = nb_setval(DisableCompiler,Was),
315+
redo_call_cleanup(Setup,Call,Restore).
316+
317+
318+
lazy_eval_to_src(A,O):- nonvar(O),trace,A=O.
319+
%lazy_eval_to_src(A,O):- var(A),!,O=A,ensure_proper_list_var(A).
320+
lazy_eval_to_src(A,O):- \+ compound(A),!,O=A.
321+
%lazy_eval_to_src(A,P):- is_list(A), maplist(lazy_eval_to_src,A,P),!.
322+
lazy_eval_to_src(A,P):- [H|T] = A, lazy_eval_to_src(H,HH),lazy_eval_to_src(T,TT),!,P= [HH|TT].
323+
lazy_eval_to_src(A,P):- as_p1_expr(A,P),!.
324+
325+
delistify(L,D):- is_list(L),L=[D],!.
326+
delistify(L,L).
327+
328+
create_prefixed_name(Prefix,LenArgs,FnName,String) :-
329+
%(sub_string(FnName, 0, _, _, "f") -> break ; true),
330+
length(LenArgs,L),
331+
append([Prefix,L|LenArgs],[FnName],Parts),
332+
atomic_list_concat(Parts,'_',String).
333+
248334
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
249335
%%%%%%%%%%%%%%%%% Evaluation (!)
250336
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

prolog/metta_lang/metta_compiler_lib.pl

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
:- dynamic(transpiler_predicate_store/7).
2-
:- discontiguous transpiler_predicate_store/7.
3-
:- discontiguous transpiler_predicate_nary_store/9.
4-
:- discontiguous compile_flow_control/8.
2+
:- discontiguous(transpiler_predicate_store/7).
3+
:- dynamic(transpiler_predicate_nary_store/9).
4+
:- discontiguous(transpiler_predicate_nary_store/9).
5+
:- multifile(compile_flow_control/8).
6+
:- discontiguous(compile_flow_control/8).
7+
:- ensure_loaded(metta_compiler).
58

69
from_prolog_args(_,X,X).
710
:-dynamic(pred_uses_fallback/2).
@@ -236,16 +239,19 @@
236239
%%%%%%%%%%%%%%%%%%%%% lists
237240

238241
transpiler_predicate_store(builtin, 'car-atom', [1], '@doc', '@doc', [x(noeval,eager,[list])], x(noeval,eager,[])).
239-
'mc__1_1_car-atom'([H|_],H).
242+
'mc__1_1_car-atom'(HT,H):- check_type_error( \+ is_list(HT),'car-atom'(HT,H)),HT=[H|_].
240243

241244
transpiler_predicate_store(builtin, 'cdr-atom', [1], '@doc', '@doc', [x(noeval,eager,[list])], x(noeval,eager,[list])).
242-
'mc__1_1_cdr-atom'([_|T],T).
245+
'mc__1_1_cdr-atom'(HT,T):- check_type_error( \+ is_list(HT),'cdr-atom'(HT,T)),HT=[_|T].
243246

244247
transpiler_predicate_store(builtin, 'cons-atom', [2], '@doc', '@doc', [x(noeval,eager,[]), x(noeval,eager,[list])], x(noeval,eager,[list])).
245-
'mc__1_2_cons-atom'(A,B,[A|B]).
248+
'mc__1_2_cons-atom'(A,B,AB):- check_type_error( \+ is_list(B),'cons-atom'(A,B,AB)),AB=[A|B].
246249

247250
transpiler_predicate_store(builtin, 'decons-atom', [1], '@doc', '@doc', [x(noeval,eager,[list])], x(noeval,eager,[list])).
248-
'mc__1_1_decons-atom'([A|B],[A,B]).
251+
'mc__1_1_decons-atom'(AB1,AB2):- check_type_error( \+ is_list(AB1), decons_atom(AB1,AB2)),!,[A|B]=AB1,AB2=[A,B].
252+
253+
check_type_error( Check, Error):- if_t(Check, raise_type_error( Check, Error)).
254+
raise_type_error( Check, Error):- trace,throw(raise_type_error( Check, Error)).
249255

250256
%transpiler_predicate_store(builtin, 'length', [1], '@doc', '@doc', [x(noeval,eager,[list])], x(noeval,eager,[number])).
251257
%'mc__1_1_length'(L,S) :- length(L,S).
@@ -292,6 +298,7 @@
292298
'mc__1_1_collapse'(ispuU(Ret,Code),R) :- fullvar(Ret),!,findall(Ret,Code,R).
293299
'mc__1_1_collapse'(ispuU(X,true),[X]) :- !.
294300
'mc__1_1_collapse'(ispuU(A,Code),X) :- atom(A),!,findall(_,Code,X),maplist(=(A),X).
301+
'mc__1_1_collapse'(ispuU(A,Code),X) :- !, findall(A,Code,X). %,maplist(=(A),X).
295302
'mc__1_1_collapse'(ispen(Ret,Code,_),R) :- fullvar(Ret),!,findall(Ret,Code,R).
296303
'mc__1_1_collapse'(ispeEn(X,true,_),[X]) :- !.
297304
'mc__1_1_collapse'(ispeEn(A,Code,_),X) :- atom(A),!,findall(_,Code,X),maplist(=(A),X).
@@ -446,6 +453,10 @@
446453
assign_or_direct_var_only(QuotedCode2,RetResult,QuotedResult2,QuotedCode1a),
447454
assign_or_direct_var_only(QuotedCode2,RetResultN,QuotedResult2,QuotedCode1N).
448455

456+
%:- initialization(setup_library_call(builtin, 'chain', [3], '@doc', '@doc', [x(eval,eager,[]), x(noeval,eager,[]), x(eval,lazy,[])], x(noeval,eager,[])), program).
457+
458+
459+
449460
%%%%%%%%%%%%%%%%%%%%% random number generation
450461

451462
use_python_main_rng('&rng'):-!.
@@ -610,6 +621,10 @@
610621
'mc__1_1_eval-string'(String,Res) :-
611622
eval_string(String,Res).
612623

624+
transpiler_predicate_store(builtin,'eval-in-only', [1], ['Symbol','Atom'], 'Atom', [x(doeval,eager,[]), x(noeval,eager,[])], x(doeval,eager,[])).
625+
'mc__1_1_eval-in-only'(Where,Eval,Res) :-
626+
eval_in_only(Where,Eval,Res).
627+
613628
transpiler_predicate_nary_store(builtin, 'py-atom', 1, ['Atom'], 'Atom', 'Atom', [x(doeval,eager,[])], x(noeval,eager,[]), x(doeval,eager,[])).
614629
'mc_n_1__py-atom'(SymRef,Specialize,ResO) :-
615630
py_atom(SymRef,Res), specialize_res(Res,Specialize,ResO).
@@ -625,9 +640,7 @@
625640
transpiler_predicate_nary_store(builtin, 'py-dot-call!', 1, ['Atom'], 'Atom', 'Atom', [x(doeval,eager,[])], x(noeval,eager,[]), x(doeval,eager,[])).
626641
'mc_n_1__py-dot-call!'(SymRef,Args,Ret) :-
627642
eval_in_only(interp,[['py-dot'|SymRef]|Args],Ret).
628-
%make_py_dot(Arg1,Arg2,Res)
629-
%py_call_method_and_args(SymRef,Args,Res),
630-
%py_metta_return_value(_RetType,Ret,Res)
643+
631644

632645

633646
this_is_in_compiler_lib.
@@ -668,8 +681,9 @@
668681
metta_body_macro(HeadIs, AsBodyFn, AsBodyFnOut):-
669682
must_det_lls((
670683
nop((term_variables(HeadIs+AsBodyFn,Vars),copy_term(Vars,Copy),ss_freeze_vars(Vars,Copy))),
671-
metta_body_macro_stack(bu,HeadIs, [], AsBodyFn, AsBodyFnE),
672-
metta_body_macro_stack(td,HeadIs, [], AsBodyFnE, AsBodyFnMid),
684+
metta_body_macro_stack(td1,HeadIs, [], AsBodyFn, AsBodyFnE),
685+
metta_body_macro_stack(bu,HeadIs, [], AsBodyFnE, AsBodyFnMidE),
686+
metta_body_macro_stack(td2,HeadIs, [], AsBodyFnMidE, AsBodyFnMid),
673687
(AsBodyFn =@= AsBodyFnMid -> AsBodyFnMid = AsBodyFnOut ;
674688
metta_body_macro(HeadIs, AsBodyFnMid, AsBodyFnOut)),
675689
nop((ss_unfreeze_vars(Vars,Copy))))).
@@ -720,15 +734,15 @@
720734
metta_body_macro_pass(bu,['chain',[Ceval,Eval],Var|Rest], ['let',Var,Eval|Rest]):- Ceval == eval,!.
721735
metta_body_macro_pass(bu,['chain',Eval,Var|Rest], ['let',Var,Eval|Rest]).
722736

723-
metta_body_macro_pass(td,[['py-dot'|Args]|Rest], ['py-dot-call',Args|Rest]).
724-
metta_body_macro_pass(td,[['py-atom'|Args]|Rest], ['py-atom-call',Args|Rest]).
737+
metta_body_macro_pass(td1,[['py-dot'|Args]|Rest], ['py-dot-call',Args|Rest]).
738+
metta_body_macro_pass(td1,[['py-atom'|Args]|Rest], ['py-atom-call',Args|Rest]).
725739
%metta_body_macro_pass(bu,[eval,Next], Next).
726-
metta_body_macro_pass(td,[NonOp|More], AsBodyFn):- \+ callable(NonOp),!,[NonOp|More]= AsBodyFn.
740+
727741
% metta_body_macro_pass(td,[eval,Eval], Eval).
728742

729-
metta_body_macro_pass(td,['unique',Eval],
743+
metta_body_macro_pass(td2,['unique',Eval],
730744
['let',Var,['call-fn!','no_repeats_var'],
731-
['let',Res,Eval,['metta-unify',Var,Res],Res]]).
745+
['let',Res,Eval,['metta-unify',Var,Res],Res]]):- fail.
732746

733747
metta_body_macro_pass(_,AsBodyFnOut, AsBodyFnOut).
734748

prolog/metta_lang/metta_debug.pl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,10 +790,8 @@
790790
is_extreme_debug(G):- is_douglas, !, call(G).
791791
is_extreme_debug(_).
792792

793-
sub_var_safely(Var,Source):-
794-
woc(sub_var(Var,Source)).
795-
796-
sub_term_safely(Sub,Source):- acyclic_term(Source),!,sub_term(Sub,Source).
793+
sub_var_safely(Sub,Source):- assertion(acyclic_term(Source)),!,sub_var(Sub,Source).
794+
sub_term_safely(Sub,Source):- assertion(acyclic_term(Source)),!,sub_term(Sub,Source).
797795

798796

799797
maybe_abolish_trace:- \+ is_flag(abolish_trace), !.
@@ -964,10 +962,16 @@
964962
debug_info( Topic, Info):- notrace(debug_info0( Topic, Info)).
965963
debug_info0( Topic, Info):- ignore(catch(((nop(setup_show_hide_debug),!,ignore(debug_info_filtered( Topic, Info)))),_,fail)),!.
966964

965+
debug_info_filtered( Topic, Info):- var(Topic),!, debug_info_filtered(unknown, Info).
967966
debug_info_filtered( always(Topic), Info):- !, once((filter_matches_var(hide,Topic);filter_matches_var(hideall,Topic);debug_info_now([always,Topic], Info))),!.
968967
debug_info_filtered( Topic,_Info):- filter_matches_var(hideall,Topic), !.
969968
debug_info_filtered( Topic, Info):- filter_matches_var(showall,Topic), !, debug_info_now([showall,Topic], Info),!.
970969
debug_info_filtered(_Topic,_Info):- is_qcompiling, dont_show_any_qcompile,!.
970+
971+
% Roy requested to make it easy to hide stdlib building in transpiler
972+
debug_info_filtered(_Topic,_Info):- currently_stdlib, (filter_matches_var(hideall,stdlib); filter_matches_var(hide,stdlib)),!.
973+
debug_info_filtered(_Topic,_Info):- currently_stdlib, \+ filter_matches_var(showall,stdlib), \+ filter_matches_var(show,stdlib),!.
974+
971975
debug_info_filtered( Topic, Info):- filter_matches_var(show, Topic), !, ignore(debug_info_now( Topic, Info)),!.
972976

973977
%debug_info_filtered( Topic, Info):- some_debug_show(Why,Topic), !, debug_info_now([Why,Topic], Info),!.

0 commit comments

Comments
 (0)