Skip to content

Commit

Permalink
correctly outputing expressions seperating them by eclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
JJponce0913 committed Aug 22, 2024
1 parent 6013b52 commit 909a5d1
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/core/egg-herbie.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -1194,29 +1194,18 @@
(match cmd
[`(single . ,extractor) ; single expression extraction
(define regraph (make-regraph egg-graph))
(define nodenumber 0)
(displayln "%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
(define eclasses (regraph-eclasses regraph))
(define n (vector-length eclasses))
(for ([id (in-range n)])
(displayln "___________________")

(define eclass (vector-ref eclasses id))
(for ([enode eclass])
(display nodenumber)
(display ": ")
(displayln enode)
(set! nodenumber (+ nodenumber 1))
;(displayln "___________________")
)
)

(displayln "%%%%%%%%%%%%%%%%%%%%%%%%%%%%")

(displayln "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
(define extract-id (extractor regraph))
(define reprs (egg-runner-reprs runner))
(for/list ([id (in-list root-ids)]
[repr (in-list reprs)])
(regraph-extract-best regraph extract-id id repr))]
(define eclass (regraph-extract-variants regraph extract-id id repr))
(for([expr eclass])
(displayln expr))
(regraph-extract-best regraph extract-id id repr)
)
]
[`(multi . ,extractor) ; multi expression extraction
(define regraph (make-regraph egg-graph))
(define extract-id (extractor regraph))
Expand Down

0 comments on commit 909a5d1

Please sign in to comment.