Skip to content

Conversation

@sophie-de-jong
Copy link
Contributor

There is currently no way to create your own domain-specific variables that interop with egg's engine. This PR aims to fix that by adding a From<Symbol> implementation for Var.

This enables custom parsers for patterns that define the string representation of a variable, for example many algebra systems use uppercase letters (e.g. X + Y -> Y + X) to denote their variables. Currently egg only supports variables with a question mark prefix (e.g. ?x, ?#1).

The only problem I can see this change creating is that it's no longer guaranteed that any variables used by egg have a ? prefix, but I don't think the code relies on this anywhere.

@mwillsey
Copy link
Member

Nice! Thanks for the PR.

@mwillsey mwillsey merged commit 1276316 into egraphs-good:main Sep 23, 2025
2 checks passed
@sophie-de-jong sophie-de-jong deleted the from-symbol-var branch September 24, 2025 01:59
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.

2 participants