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

Add a lightweight check for requires of equations when matching is indeterminate #4053

Open
geo2a opened this issue Sep 27, 2024 · 0 comments
Labels
booster Relates to booster code enhancement New feature or request

Comments

@geo2a
Copy link
Collaborator

geo2a commented Sep 27, 2024

When matching of a function equation is indeterminate, Booster will abort the application of this function. However, sometimes the requires clause of the same equation can fully instantiated with the determinate part of the matching substitution. If the instantiated requires clause is false, we are safe to conclude that the equation does not apply, and we can proceed to attempting other equations of this function.

@PetarMax suggests to tweak the algorithm of applying equations:

  • when matching is indeterminate, extract the determinate part of the substitution
  • if that is non-empty, apply it to the requires clause and simplify with LLVM
  • if any of the conjuncts is false --- we are safe to conclude the equation does not apply

Notes:

  • the result of the equation application can only become negative or remain indeterminate. There's no way we can apply the equation if matching is indeterminate
  • it is critical to not call the SMT solver on this requires clause, as it may introduce a massive performance regression. That's why we restrict ourselves to a concrete LLVM simplification and simplify the requires clause recursively with other equations.
@geo2a geo2a added booster Relates to booster code enhancement New feature or request labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
booster Relates to booster code enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant