Skip to content

Enhance test_egg_substitution_fx_xyz to cover symmetry, transitivity, congruence, and substitution - #30

Merged
hzhangxyz merged 3 commits into
mainfrom
copilot/fix-egg-test-example
Dec 23, 2025
Merged

Enhance test_egg_substitution_fx_xyz to cover symmetry, transitivity, congruence, and substitution#30
hzhangxyz merged 3 commits into
mainfrom
copilot/fix-egg-test-example

Conversation

Copilot AI commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Plan to Fix test_egg_substitution_fx_xyz

  • Understand the issue and current test structure
  • Modify test_egg_substitution_fx_xyz to be more comprehensive by combining:
    • Symmetry: test that a=b derives b=a
    • Transitivity: test that a=b, b=c derives a=c
    • Congruence: test that b=c derives f(b)=f(c)
    • Substitution: test that f(a), a=c derives f(c)
  • Run tests to validate the changes work correctly
  • Verify the test is more complex and comprehensive as requested
  • Fix pre-commit formatting issues
Original prompt

This section details on the original issue you should resolve

<issue_title>egg的测试的倒数第二个例子不合适</issue_title>
<issue_description>test_egg_substitution_fx_xyz这个需要修改得复杂点。

现在这个不合适,应该把前面几个综合起来测试,现在缺了a=b得到b=a和test_egg_congruence_fx_fy</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…metry, transitivity, congruence, and substitution

Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix egg test to include complex scenarios Enhance test_egg_substitution_fx_xyz to cover symmetry, transitivity, congruence, and substitution Dec 23, 2025
Copilot AI requested a review from hzhangxyz December 23, 2025 01:06
@hzhangxyz

Copy link
Copy Markdown
Member

@copilot 修一下pre commit的问题

@hzhangxyz
hzhangxyz marked this pull request as ready for review December 23, 2025 02:08
Copilot AI review requested due to automatic review settings December 23, 2025 02:08
Co-authored-by: hzhangxyz <11623447+hzhangxyz@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 test_egg_substitution_fx_xyz test to comprehensively validate the integration of four core egraph equality rules (symmetry, transitivity, congruence, and substitution) rather than testing only a simple substitution chain.

  • Replaced simple variable chain test (x=y, y=z, f(x) → f(z)) with an integrated scenario using a, b, c variables
  • Added verification for symmetry (a=b → b=a), transitivity (a=b, b=c → a=c), congruence (b=c → f(b)=f(c)), and substitution (f(a), a=c → f(c))
  • Enhanced test assertions from one to four, checking each egraph rule individually

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI commented Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

@copilot 修一下pre commit的问题

Fixed in commit 90d629b. The pre-commit formatter removed trailing whitespace from the docstring (lines 136 and 141). All pre-commit checks now pass.

@hzhangxyz
hzhangxyz merged commit 805f5c6 into main Dec 23, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

egg的测试的倒数第二个例子不合适

3 participants