-
Notifications
You must be signed in to change notification settings - Fork 103
Quadratic symbolic expression only #2647
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
Conversation
Make variable generic.
…r-labs/powdr into quadratic_symbolic_expression
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.
Let's go 🚀
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.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
executor/src/witgen/jit/symbolic_expression.rs:141
- [nitpick] The method compute_updated uses operator matching for both 'Sub' and 'Add' with negation. Consider using explicit subtraction to improve clarity, unless operator overloading for '-' is definitively the intended behavior.
match op {
executor/src/witgen/jit/symbolic_expression.rs:116
- New branches introduced in compute_updated and apply_update would benefit from added test cases to verify that all update scenarios and operator overloading behaviors work as expected.
/// Applies a variable update and returns a modified version if there was a change.
SymbolicExpression::Concrete(_) => None, | ||
SymbolicExpression::Symbol(v, _) => { | ||
if *v == variable_update.variable { | ||
assert!(variable_update.known); |
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.
Using an assert here may lead to a runtime panic in production if variable_update.known is false. Consider handling this case more gracefully, for example by returning an error or a None value with a proper log message.
assert!(variable_update.known); | |
if !variable_update.known { | |
// Log a message or handle the error gracefully if needed. | |
return None; | |
} |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
}; | ||
match op { | ||
BinaryOperator::Add => Some(l + r), | ||
BinaryOperator::Sub => Some(l + -r), |
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.
Could use l - r
here now
No description provided.