Skip to content

Commit

Permalink
made sure --log=true vs --log=false works
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSPoon committed Dec 28, 2024
1 parent b7e7595 commit 80802ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 9 additions & 5 deletions prolog/metta_lang/metta_interp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,12 @@

is_tRuE(TF):- TF=='True',!.
is_tRuE(TF):- TF=='true',!.
is_flag0(What):- nb_current(What,TF),TF\==[],!,is_tRuE(TF).
is_flag0(What):- current_prolog_flag(What,TF),TF\==[],!,is_tRuE(TF).
is_fAlSe(TF):- TF=='False',!.
is_fAlSe(TF):- TF=='false',!.
is_flag0(What):- nb_current(What,TF),is_tRuE(TF), !.
is_flag0(What):- nb_current(What,TF),is_fAlSe(TF), !, fail.
is_flag0(What):- current_prolog_flag(What,TF),is_tRuE(TF),!.
is_flag0(What):- current_prolog_flag(What,TF),is_fAlSe(TF),!.
is_flag0(What):-
symbol_concat('--',What,FWhat),symbol_concat(FWhat,'=true',FWhatTrue),
symbol_concat('--no-',What,NoWhat),symbol_concat(FWhat,'=false',FWhatFalse),
Expand All @@ -250,12 +254,12 @@
is_flag0(What,_FWhatTrue,FWhatFalse):-
current_prolog_flag(os_argv,ArgV),
member(FWhat,FWhatFalse),member(FWhat,ArgV),!,
notrace(catch(set_prolog_flag(What,false),_,true)),
%notrace(catch(set_prolog_flag(What,false),_,true)),
set_option_value(What,'False'),!,fail.
is_flag0(What,FWhatTrue,_FWhatFalse):-
current_prolog_flag(os_argv,ArgV),
member(FWhat,FWhatTrue),member(FWhat,ArgV),!,
notrace(catch(set_prolog_flag(What,true),_,true)),
%notrace(catch(set_prolog_flag(What,true),_,true)),
set_option_value(What,'True'),!.
is_flag0(What,_FWhatTrue,_FWhatFalse):-
current_prolog_flag(os_argv,ArgV),
Expand Down Expand Up @@ -427,7 +431,7 @@
option_value_name_default_type_help('tabling', auto, [auto, true, false], "When to use predicate tabling (memoization)", 'Optimization and Compilation').

% Output and Logging
option_value_name_default_type_help('log', false, [false, true], "Enable or disable logging", 'Output and Logging').
option_value_name_default_type_help('log', unset, [false, unset, true], "Act like MeTTaLog more so than H-E (also does generate more logging)", 'Output and Logging').
all_option_value_name_default_type_help('html', false, [false, true], "Generate HTML output", 'Output and Logging').
all_option_value_name_default_type_help('python', true, [true, false], "Enable Python functions", 'Output and Logging').
option_value_name_default_type_help('output', './', ['./'], "Set the output directory", 'Output and Logging').
Expand Down
3 changes: 2 additions & 1 deletion prolog/metta_lang/metta_ontology.pfc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,14 @@
:- endif.
*/

:- if(false).
a==>b.
b==>bb.

a.
:- b.
:- bb.
:- endif.

%:- pfcWhy1(a).
%:- pfcWhy1(b).
Expand Down

0 comments on commit 80802ea

Please sign in to comment.