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

Replace PyEDA with AEON #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

daemontus
Copy link
Contributor

This PR replaces the Boolean function manipulation features of PyEDA with AEON using an updated DNF algorithm that is much better at generating "syntactically monotonic" DNF representations.

I've added a basic benchmark using a group of collected models to compare the performance. All the benchmark is doing is computing the first minimal trap space, so it has to generate the ASP encoding and run clingo. However, it is not running any correctness checks, since for that we would need all the minimal trap spaces. The actual data from the comparison is linked at the end of the pull request.

Main things to consider:

  • Neither PyEDA nor AEON can detect 100% of the monotonic interactions based on DNF alone. Currently, AEON can show "syntactic monotonicity" in 58 extra models compared to PyEDA (174 vs 116). But it is not a complete win: there are a few models where PyEDA shows monotonicity but AEON does not. Nevertheless, the overall count is higher for AEON.
  • If you ever want to check which functions are truly monotonic, I've added a is_unate_symbolic method to test that, but it is not used anywhere at the moment; I just used it for testing and figured it could be useful in the future.
  • AEON can solve two models that PyEDA could not (079 and Skin3D). That is, with the AEON encoding, we find the first trap space for all models in less than one minute.
  • The DNFs produced by AEON are smaller (42351 fewer clauses compared to PyEDA). Similar to the monotonicity, this is not a complete win, but when AEON "loses", it is by a very small margin.

Overall, if it was easy to keep using PyEDA, a portfolio approach that combines both would make sense. But if PyEDA is no longer maintained, it seems that AEON should be on average just as good, even though it isn't completely superior.

Comparison table: https://docs.google.com/spreadsheets/d/1-RSaHbcmGX8NVvQ36081FaEnHAc53uHjyPUTB4t7yDE/edit?usp=sharing

Raw data:
baseline.zip
current.zip

@daemontus
Copy link
Contributor Author

Also: I included the benchmark models in the pull request. If you don't want that in the repository, we can remove it. I just thought it would be useful for future reference.

@pauleve
Copy link
Member

pauleve commented Sep 19, 2024

Waouh, this is absolutely awesome, thank you so much @daemontus for this work!
I'll do a bit of testing on my side and then merge. Probably that I'll keep the pyEDA code with optional dependency and a switch so we can fallback to it for specific cases.

@daemontus
Copy link
Contributor Author

That sounds great. Let me know if you need anything else on my part :)

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

Successfully merging this pull request may close these issues.

2 participants