Conversation
…parsing, and feedback, with tests and documentation updates.
This branch has not been deployed
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.
Problem
Chained equalities were silently truncated.
parse_expressionsplit on=butonly used the first two parts, so everything after the second operand was
discarded — never parsed, never validated, no error.
x = y = zbecameEq(x, y), and a wrong third term was marked correct:x = y = wx = y = zx = y = 5x = y = 7x = y = zx = yThe preview showed the student's full
x=y=zback to them, so nothing on screenhinted that only
x = ywas being graded.Changes
parse_expressionnow parses every operand and returns the conjunction of theequalities between adjacent ones:
x = y = z→And(Eq(x, y), Eq(y, z)). Asingle equality is still a bare
Equality, so that path is unchanged. An emptyoperand (
x = = y) is now a parse error.check_equality_equivalenceinapp/context/symbolic.py, mirroringcheck_inequality_equivalence. Chains are compared by solution set, since achain carries no meaning in the order it is written —
z = y = xstates whatx = y = zstates, and scaled or offset chains (2x = 2y = 2z) match too.Non-affine chains fall back to matching parts one-to-one.
CHAIN_NOT_EQUALITY/EQUALITY_NOT_CHAINfeedback tags for a chaincompared against a single equality.
Stacked on #276
Based on
feature/inequalities, notmain. Merge #276 first, then retargetthis to
main; until then the diff againstmainincludes #276's commits.🤖 Generated with Claude Code