[Do not merge] Replace Polynomial/poly! with symbolic expression system#69
Draft
[Do not merge] Replace Polynomial/poly! with symbolic expression system#69
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (84.80%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
- Coverage 96.36% 95.96% -0.41%
==========================================
Files 197 197
Lines 27210 27676 +466
==========================================
+ Hits 26222 26560 +338
- Misses 988 1116 +128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…r, Display, and Serde
59817b2 to
9fbca74
Compare
9fbca74 to
b6681ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/expr.rs: symbolic expression system with AST, Pratt parser, evaluator, Display, and Serde (string round-tripping)poly!macro to string expression literals (e.g.,"3 * n ^ 2 + m")ReductionOverhead, export system, cost functions, and graph module to useExprsrc/polynomial.rsandpoly!macro (replaced entirely byExpr)What Changed
The overhead DSL now supports arbitrary expressions beyond polynomials: exponentiation with non-integer bases (
1.44 ^ n), built-in functions (log2,sqrt,min,max,floor,ceil), and full arithmetic. Expressions are parsed from string literals at construction time and serialize as strings in JSON.Test Plan