Skip to content

Commit

Permalink
some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
oflatt committed Feb 10, 2025
1 parent ec3ca48 commit cd7e272
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dag_in_context/src/utility/terms.egg
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
(ruleset terms)
;; helpers keeps track of the new best extracted terms
(ruleset terms-helpers)
;; helpers-helpers runs `Smaller` rules, resolving the merge function for helpers
(ruleset terms-helpers-helpers)

(sort TermAndCost)
(function Smaller (TermAndCost TermAndCost) TermAndCost)

(function ExtractedExpr (Expr) TermAndCost
:merge (Smaller old new))
;; potential extractions- use so that we don't modify the
;; timestamp of ExtractedExpr when the costs are equal
;; potential extractions- use so that when the costs are equal, we don't change the term
;; this preserves egglog's timestamp of when the last time ExtractedExpr was changed, fixing a big performance problem
(relation PotentialExtractedExpr (Expr TermAndCost))

(function TCPair (Term i64) TermAndCost)
Expand Down

0 comments on commit cd7e272

Please sign in to comment.