Skip to content

Minimize both AstSize and number of rewrites? #229

Answered by oflatt
AlienKevin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @AlienKevin
I think you have some confusion about extraction cost functions and proofs.
The extraction cost function has no influence on how many steps a proof has. Egg has a built-in algorithm for trying to minimize the number of steps in a proof using a greedy strategy, so it just tries it's best. It's an NP-hard problem to find the smallest proof.
So once you call explain_equivalence, it tries to find the smallest proof for the two terms you give it.

Also, make sure you are using the most recent version of egg (:

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@AlienKevin
Comment options

@oflatt
Comment options

@AlienKevin
Comment options

Answer selected by oflatt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants