From 38be469fe11f94124f98fd25046cfc31278b3594 Mon Sep 17 00:00:00 2001 From: Max Willsey Date: Fri, 9 Feb 2024 13:59:49 -0800 Subject: [PATCH] Add note in is_not_zero example. Closes #297 --- src/macros.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/macros.rs b/src/macros.rs index 58afca0e..ac39e2ec 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -281,6 +281,9 @@ impl Applier 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) } ```