egraphs-good / egglog

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

Error when using `vec-of` in rule is not readable #370

Open gussmith23 opened 7 months ago

gussmith23 commented 7 months ago

Error: image

Rule:

(rule
 ((= ha1_s (GetOutput (ModuleInstance "HalfAdd" (vec-of "a" "b") (vec-of a b)) "sum"))
  (= ha1_c (GetOutput (ModuleInstance "HalfAdd" (vec-of "a" "b") (vec-of a b)) "carry"))
  (= fa_s (GetOutput (ModuleInstance "HalfAdd" (vec-of "a" "b") (vec-of ha1_s c)) "sum"))
  (= ha2_c (GetOutput (ModuleInstance "HalfAdd" (vec-of "a" "b") (vec-of ha1_s c)) "carry"))
  (= fa_c (Op2 (Or) ha1_c ha2_c)))
 ((union fa_s (GetOutput (ModuleInstance "FullAdd" (vec-of "a" "b" "c") (vec-of a b c)) "sum"))
  (union fa_c (GetOutput (ModuleInstance "FullAdd" (vec-of "a" "b" "c") (vec-of a b c)) "carry")))
 :ruleset adders)

@oflatt says this is due to the use of vec-of. Working around it with a cons list, but the error isn't great!

Thanks @zsisco for finding this.