Repository navigation
Conversation
huggingface#87) - Guard sympy_solve_and_compare to return False when solved_gold or solved_pred is empty, preventing vacuous all([]) equality matches on symbol-free relations. - Request dict=True from sympy.solve for Eq comparisons and sort items with default_sort_key to properly support single and multi-variable equations. - In sympy_compare_relational, prevent constant numerical differences (e.g. 3 - 4 == 1 - 2) from falsely matching unrelated numerical relations. - Add comprehensive test suite in tests/test_symbol_free_equations.py covering symbol-free OlympiadBench relations, numerical relations, and symbolic equations.
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
Fixes #87.
Resolves an issue where
verify()erroneously returnedTruefor structurally different equations lacking free symbols (such as OlympiadBench function applications like$I_{e}(0)=\gamma I_{i}(0)$vs$I_{i}(0)=I_{e}(0)$) or contradictory numerical relations with matching differences (like$3 = 4$vs$1 = 2$).Key Changes
sympy_solve_and_comparereturnsFalseifnot solved_gold or not solved_pred, preventing vacuousall([])equality matches.dict=TrueEquation Solving: Requestdict=Truefromsolve()forEqcomparisons and order dictionary keys withdefault_sort_key(item[0])to support single- and multi-variable equations.sympy_compare_relational, prevent relations with constant numerical differences from matching via difference equality.tests/test_symbol_free_equations.py.Validation
pytest tests/pass (0 regressions).ruff.