trueagi-io / metta-wam

A Hyperon MeTTa Interpreter/Transpilier that targets the Warren Abstract Machine
12 stars 11 forks source link

Incorrectly trigger reduction with function definition with structural name #126

Open ngeiswei opened 2 months ago

ngeiswei commented 2 months ago

The following code

(= (((λ $x) $x) $y) $y)
!((λ $f) (($f $z) $g))

should output

[((λ $f) (($f $z) $g))]

as in MeTTa-Rust, however in MeTTaLog it outputs

[ ( (λ (λ $_25496)) $_25518)
, ( (λ ((λ $_31682) $_31682)) ($_25496 $_31712))]
ngeiswei commented 2 months ago

That has to do with the variable_operation feature of MeTTa-Rust, which is disabled by default. The following issue goes in detail over it https://github.com/trueagi-io/hyperon-experimental/issues/242.