Improve check error message and document query-based semantics for constructor terms#843
Draft
Improve check error message and document query-based semantics for constructor terms#843
check error message and document query-based semantics for constructor terms#843Conversation
…m behavior Agent-Logs-Url: https://github.com/egraphs-good/egglog/sessions/7ca6f621-bd4b-4430-89c1-ef6dc4f7e6a7 Co-authored-by: saulshanabrook <1186124+saulshanabrook@users.noreply.github.com>
…or term Agent-Logs-Url: https://github.com/egraphs-good/egglog/sessions/7ca6f621-bd4b-4430-89c1-ef6dc4f7e6a7 Co-authored-by: saulshanabrook <1186124+saulshanabrook@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix materialize checks for constructors to ensure correctness
Improve Apr 9, 2026
check error message and document query-based semantics for constructor terms
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.
checkruns a query against existing e-graph state — constructor terms must already be present for a check to succeed, unlike primitives. This mismatch between expectation and behavior produced unhelpful errors with no indication of the root cause.Changes
CheckErrornow reads"Check failed (are the relevant terms present in the e-graph?)"instead of the bare"Check failed".Command::Checkdoc comment now explicitly states thateqsortconstructor terms must be pre-existing in the e-graph, with a before/after example contrasting in-graph vs. out-of-graph term behavior.check-constructor-not-in-egraph.egg): Covers the failing case from the issue, successful check afterlet-binding, equality between two variables pointing to the same constructor term, and continued failure for unintroduced terms.Example
Error before introducing the term: