Skip to content

Commit

Permalink
Update dummy data from egglog
Browse files Browse the repository at this point in the history
  • Loading branch information
mwillsey committed Jan 12, 2024
1 parent 702ae07 commit 6013e65
Show file tree
Hide file tree
Showing 7 changed files with 1,468 additions and 626 deletions.
15 changes: 15 additions & 0 deletions data/dummy_examples/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# make the .json data from the .egg files in this directory
# run make from this directory
# FIXME this doesn't quite work yet, egglog
# doesn't export roots properly

egg_files = $(wildcard *.egg)
json_files = $(egg_files:.egg=.json)

all: $(json_files)

egglog_manifest = ../../../egglog/Cargo.toml

%.json: %.egg
cargo run --manifest-path $(egglog_manifest) -- $< --to-json

10 changes: 5 additions & 5 deletions data/dummy_examples/ab_add.egg
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
; DAG extraction notices that balanced trees are much cheaper
; Optimal tree is (let t1 (a + b) in let t2 = (t1 + t1) in (t2 + t2)
; Which is cost 5 and proportional to the logarithm of the number of nodes
(define A2 (Add (A) (A)))
(define A4 (Add A2 A2))
(define B2 (Add (B) (B)))
(define B4 (Add B2 B2))
(define t (Add A4 B4))
(let A2 (Add (A) (A)))
(let A4 (Add A2 A2))
(let B2 (Add (B) (B)))
(let B4 (Add B2 B2))
(let t (Add A4 B4))

(run 10)
Loading

0 comments on commit 6013e65

Please sign in to comment.