Skip to content

Commit

Permalink
Add note in is_not_zero example.
Browse files Browse the repository at this point in the history
Closes #297
  • Loading branch information
mwillsey committed Feb 9, 2024
1 parent 812c76c commit 38be469
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ impl Applier<SimpleLanguage, ()> for MySillyApplier {
fn is_not_zero(var: &'static str) -> impl Fn(&mut EGraph, Id, &Subst) -> bool {
let var = var.parse().unwrap();
let zero = SimpleLanguage::Num(0);
// note this check is just an example,
// checking for the absence of 0 is insufficient since 0 could be merged in later
// see https://github.com/egraphs-good/egg/issues/297
move |egraph, _, subst| !egraph[subst[var]].nodes.contains(&zero)
}
```
Expand Down

0 comments on commit 38be469

Please sign in to comment.