egraphs-good / egglog

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

hello world, or... how do you get "output"? #303

Closed donbright closed 9 months ago

donbright commented 9 months ago

i have watched several videos on rewrite rules and equality saturation, and i have some experience with yacc/bison so i think im getting the basic idea. ... but

... on the web version of egglog, im trying to figure out, when i click 'run', is there a way to make it output a text "answer" to the upright window?

for example if i open the example for Fibonacci, https://egraphs-good.github.io/egglog/?example=fibonacci, i see a line named (run 7) and so i click run and im expecting 13 to print in the upper right in text. but nothing prints. instead it makes a very big graph on the bottom right.

i realize the "result" is somewhere in the graph on the bottom right, but ... i have to scroll through the graph trying to find it.

thanks!!

yihozhang commented 9 months ago

Yep, you can use the extract command (e.g. (extract (fib 7))).

donbright commented 9 months ago

thanks!!!!!!!