egraphs-good / egglog

egraphs + datalog!
https://egraphs-good.github.io/egglog/
MIT License
417 stars 46 forks source link

[Utility] Warning for missing ruleset name #325

Open oflatt opened 8 months ago

oflatt commented 8 months ago

In egglog programs, we often add things to rulesets and run these rulesets. Forgetting to add a ruleset has been a big source of bugs in egglog programs.

We should add a feature that allows an error when a ruleset is not provided. We have several options here.

  1. We could add a "strict" mode using set-option that throws an error when a ruleset is not provided
  2. We could detect if a ruleset was never run and print a warning in that case

Or we could do both of those

yihozhang commented 8 months ago

It is tedious to give specify the ruleset for each rule, and for simple programs people just want their rule to be in the default rule set. I think a better design is just to have a different syntax for rulesets so that it is impossible to forget. What do you think?

(ruleset optimization

  (rule (...) (...))
  (rule (...) (...))
  ...
)
oflatt commented 8 months ago

Yeah, that would be good too!

oflatt commented 8 months ago

I'm just putting this on the board as an issue to address more urgently