-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agda Translation Efficiency improvements #6713
base: master
Are you sure you want to change the base?
Conversation
…suggestion that fixes the line explosion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably more efficient indeed, but it's still way more guesswork than required for at least some of the transformations. But this way you are also going against what the actual optimizations do as they normally look at the outermost constructor first and I suppose it's possible that some of them may product the same constructor as a result (I don't have any concrete examples, sorry). Which isn't a correctness issue, just more legwork for the certifier to do.
Have we already tried running the certifier on some real word programs? We don't need to do it for all optimization passes simultaneously, doing just for some individually would already be interesting.
I'm not sure I understand? This function runs on the entire ASTs of the before- and after- programs. I don't think any of the optimisations operate on the As you say: we should try it as see. |
Yes , but if you're squint enough, that's kinda what the optimizations do. They don't just skip the entirety of the AST and then go bottom-up applying the rules, they do it top-down instead. Let's say we have an "optimization" that reorders lambdas and applications turning
into
Since the certification has De Bruijn indices, There's no general solution to this, hence why I've been saying that certification for every optimization needs to be defined with efficiency concerns in mind. And if we do try to make the certifier efficient, then I think this PR makes things worse, not better, because previously you had control over how things evaluate and now you're forced to always optimistically skip matching constructors first. But yes:
|
Change the order of the
translation?
decision procedure to try simple AST matching before it tries the translation relation. This makes the code more repetitive but it should be quicker.This also adopts an idea from Ulf Norell that collapses the enormous number of lines needed in previous versions for all the non-matching AST patterns.