Closed noskill closed 7 months ago
@vsbogd when i run metta puzzle.metta
it hangs forever
I tried it locally on a latest main
and it finishes quickly enough.
This is not logic programming style yet (assuming you wanted to make it as-close as to Prolog as possible), it can be done with a more direct Prolog translation without any let statement just with is. (please see Mattermost)
@patham9
it's possible to remove let:
(= (eq $X $Y)
(let $C (same $X $Y) (if (== $C True) True False)))
(= (eq $X $Y)
(if (== (same $X $Y) True) True False))
But what is the difference? Prolog considers that answer is false if it can't prove true, metta just returns expression unreduced, so i decided to emulate prolog behaviour with "let".
porting simple prolog programs to metta