-
Notifications
You must be signed in to change notification settings - Fork 54
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
Have assertEqual support alpha equivalence #744
Comments
We have a Rust function which checks two atoms for being alpha-equivalent: hyperon-experimental/lib/src/atom/matcher.rs Line 1253 in 9c126b1
Thus it is not a problem to add couple new operations actually. |
Awesome, would you do it? Or would you rather have me do it? I'll be a bit slower but it should be within my reach. |
Also, there are at least two ways to do it:
Even if we go with 2, I think it would be useful to expose |
Also, how would you name in MeTTa
|
Also, a different issue that I'm bringing only because we are discussing names. I don't understand the name |
As @DaddyWesker started working on it I am adding my thought on it. I think adding hyperon-experimental/lib/src/atom/matcher.rs Line 1253 in 9c126b1
I would vote for reimplementing I believe name of the |
After more thoughts, I think it is better to have |
I want to add that I have many unit tests that are purposely testing equality without alpha equivalence. |
In general I agree. But in practice there are many situations when user's expectation of names are more or less arbitrary and interpreter can choose another naming (see #127 (comment) for example). Anyway I don't object adding separate alpha equivalent assert. |
That makes sense too, let's see what @Necr0x0Der has to say. |
Describe the bug
Probably not a bug, but it would be very convenient if
assertEqual
andassertEqualToResult
could support alpha-equivalence. Either it could be the default (maybe undesirable though), or new assert operators, such asassertAlphaEqual
andassertAlphaEqualToResult
could be added.To Reproduce
Steps to reproduce the behavior:
Expected behavior
If
assertEqual
supported alpha-equivalence it would output[()]
.Actual behavior
Instead it outputs
Additional context
assertAlphaEqual
andassertAlphaEqualToResult
than relaxing the behavior ofassertEqual
. Such addition could be at the Rust level or at the MeTTa level. Note that I have already implemented an alpha-equivalence MeTTa function here https://github.com/ngeiswei/chaining/blob/97923a18f3c6138f2eaf697e89ca9500e219e729/experimental/converters/calculi-converter.metta#L311-L327. However it is slow and I wonder if it would be actually easier to implement at the Rust level. If you think implementing it at the MeTTa level is fine, I'm happy to take care of it.The text was updated successfully, but these errors were encountered: