trueagi-io / hyperon-experimental

MeTTa programming language implementation
https://metta-lang.dev
MIT License
134 stars 45 forks source link

Hangs on unification #589

Open Adam-Vandervorst opened 7 months ago

Adam-Vandervorst commented 7 months ago

On 1fe7492

(= ((($s $x) $y) mul) ($s (M $x $y)))
(= ($s (put $x)) ($s $x))
!((E $p) mul)

hangs.

This should return ((E $p) mul) unreduced.

vsbogd commented 7 months ago

Yes, it hangs because (E $p) is matched first and goes into infinite loop.

vsbogd commented 7 months ago

Possible way to fix it is checking that (E $p) depends on calculating itself and breaking the loop.