trueagi-io / metta-wam

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

Semantics of Nondeterminism? #161

Open vulecoff opened 1 month ago

vulecoff commented 1 month ago

Take the following code:

!(== (match &self nonexistents ok) ok)

What should this return when we cannot find a match for a given atom? Currently Hyperon returns empty [], and MettaLog gives [False]. On Hyperon's interpretation, if we could not find any matches, then we cannot do any comparisons, thus empty. MettaLog's interpretation (if this is intended and not a bug), then the result is false b/c in all possible non-deterministic paths, there does not exist a value that equals ok.

I think Empty result is a more predictable behavior for non-determinism.

TeamSPoon commented 1 day ago

Yes. I like their result better.. I am going to strive for that