Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referential transparency on non-deterministic functions #700

Open
AnnelineD opened this issue May 27, 2024 · 0 comments
Open

Referential transparency on non-deterministic functions #700

AnnelineD opened this issue May 27, 2024 · 0 comments

Comments

@AnnelineD
Copy link

Describe the bug
Non-deterministic functions are not referentially transparent.

To Reproduce

> !(subtraction (superpose (a b d)) (intersection (superpose (a b c)) (superpose (a b d))))
[d]
> (= (test6 $set $subset) (subtraction $subset (intersection $set $subset)))
> !(test6 (superpose (a b c)) (superpose (a b d)))
[b, d, a, d, a, b, d]

Expected behavior
The wrapped function test6 produces the same result as the top-level test.

Actual behavior
test6 gets applied element-wise.

Additional context

  • MeTTa version: 0.1.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant