From ad2b3812f3af8ce70deff83c8be216d94e0ed528 Mon Sep 17 00:00:00 2001 From: logicmoo Date: Sat, 21 Dec 2024 22:22:17 -0800 Subject: [PATCH] top-self --- prolog/metta_lang/metta_eval.pl | 8 +------- prolog/metta_lang/metta_interp.pl | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/prolog/metta_lang/metta_eval.pl b/prolog/metta_lang/metta_eval.pl index 7e92404e8a..20604499e4 100755 --- a/prolog/metta_lang/metta_eval.pl +++ b/prolog/metta_lang/metta_eval.pl @@ -2287,13 +2287,7 @@ %eval_40(Eq,RetType,_Dpth,_Slf,['==',X,Y],Res):- !, subst_args(Eq,RetType,_Dpth,_Slf,['==',X,Y],Res). eval_20(Eq,RetType,Depth,Self,['==', X,Y],Res):- - suggest_type(RetType,'Bool'), - eval_until_unify_self([h_e,'=='],Eq,_SharedType,Depth,Self,X,Y, Res), - (Res=='False' -> (!, fail) ; fail). - -%eval_40(Eq,RetType,_Depth,Self,[EQ,X,Y],TF):- fail, EQ=='==', !, -% suggest_type(RetType,'Bool'), -% as_tf(eval_until_unify(Eq,_SharedType, X, Y), TF). + (var(X);var(Y)),!,X\==Y,!, Res='False',suggest_type(RetType,'Bool'). eval_40(Eq,RetType,Depth,Self,['==',X,Y],TF):- !, suggest_type(RetType,'Bool'), as_tf(eval_until_eq(Eq,_SharedType, Depth,Self, X, Y), TF). diff --git a/prolog/metta_lang/metta_interp.pl b/prolog/metta_lang/metta_interp.pl index f4e32c2348..b8ec7f3778 100755 --- a/prolog/metta_lang/metta_interp.pl +++ b/prolog/metta_lang/metta_interp.pl @@ -414,8 +414,8 @@ option_value_name_default_type_help('answer-format', 'show', ['rust', 'silent', 'detailed'], "Control how results are displayed", 'Output and Logging'). option_value_name_default_type_help('repeats', true, [true, false], "false to avoid repeated results", 'Miscellaneous'). option_value_name_default_type_help('time', true, [false, true], "Enable or disable timing for operations (in Rust compatibility mode, this is false)", 'Miscellaneous'). -option_value_name_default_type_help('vn', auto, [auto, true, false], "Enable or disable, (auto = enable but not if it breaks stuff) EXPERIMENTAL BUG-FIX where variable names are preserved (see https://github.com/trueagi-io/metta-wam/issues/221)", 'Miscellaneous'). -option_value_name_default_type_help('top-self', false, [true, false, auto], "When set, stop pretending &self==&top", 'Miscellaneous'). +option_value_name_default_type_help('vn', true, [true, auto, false], "Enable or disable, (auto = enable but not if it breaks stuff) EXPERIMENTAL BUG-FIX where variable names are preserved (see https://github.com/trueagi-io/metta-wam/issues/221)", 'Miscellaneous'). +option_value_name_default_type_help('top-self', true, [true, false, auto], "When set, stop pretending &self==&top", 'Miscellaneous'). % Testing and Validation option_value_name_default_type_help('synth-unit-tests', false, [false, true], "Synthesize unit tests", 'Testing and Validation').