-
Notifications
You must be signed in to change notification settings - Fork 61
Handle function application in rewrite checker #1877
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
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the rewrite checker to handle function application expressions, enabling equivalence checking for expressions like f(x) + 1 and 1 + f(x). The change allows the system to unpack and properly represent function applications even when the function and arguments are undefined.
- Adds support for function application (
Ap) pattern matching in the algebrite expression printer - Improves debugging output for unknown expression types with detailed logging
- Updates a TODO comment attribution
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| print_endline( | ||
| "Algebrite rewrite checker received unknown value of type " | ||
| ++ Exp.show(exp), | ||
| ); |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding debug output via print_endline in production code can clutter console output and may not be appropriate for all environments. Consider using a proper logging mechanism or making this conditional based on a debug flag.
| ); | |
| if (debug) { | |
| print_endline( | |
| "Algebrite rewrite checker received unknown value of type " | |
| ++ Exp.show(exp), | |
| ); | |
| }; |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1877 +/- ##
==========================================
- Coverage 50.79% 50.68% -0.11%
==========================================
Files 204 204
Lines 21355 21376 +21
==========================================
- Hits 10847 10835 -12
- Misses 10508 10541 +33
🚀 New features to boost your workflow:
|
|
Fixed length (builtins) and list concat handling. Still working on the function stuff, we may need to chat about how to handle those generally. |
9712ed2 to
c135936
Compare




Allows us to rewrite-check things like

f(x) + 1being equivalent to1 + f(x); all we have to do is unpack function application. Even works whenf, xhave not been defined:Closes #1842.