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

Struct-Valued Analysis Cause Infinite Loop #153

Closed
kylebd99 opened this issue May 1, 2023 · 3 comments
Closed

Struct-Valued Analysis Cause Infinite Loop #153

kylebd99 opened this issue May 1, 2023 · 3 comments

Comments

@kylebd99
Copy link
Contributor

kylebd99 commented May 1, 2023

My use case requires a complicated struct for the analysis value. However, when you use a struct, the default equality to compare them is object equality. This causes an infinite loop in the analyze! code because it believes that the analysis value keeps changing.

The fix that I've found is to define a special Egraphs.isequal() function to properly define equality between my structs. This may not be intuitive though for future users, so you may want to update the documentation to include this workaround for struct-valued analyses.

@0x0f0f0f
Copy link
Member

0x0f0f0f commented May 2, 2023

Have you tried using AutoHashEquals on the struct?

@0x0f0f0f
Copy link
Member

Any news on this?

@kylebd99
Copy link
Contributor Author

kylebd99 commented Jun 7, 2023

Sorry for the slow response, I just tested it, and autohashequals worked for me! I'm a little hesitant about it because of the effects that it has on storing objects in dicts, but it works great for now. Thanks for putting the effort into this package by the way. It's been really helpful for my research.

@kylebd99 kylebd99 closed this as completed Jun 7, 2023
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

2 participants