-
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
Use Agda Haskell lib instead of MAlonzo #6562
base: master
Are you sure you want to change the base?
Conversation
f39f958
to
d869dad
Compare
d8d411a
to
e79dae4
Compare
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.
This looks quite reasonable. The example command took ~15s on my machine - is it mostly the decision procedure?
-- ^ The trace produced by the simplification process | ||
-> IO () | ||
runCertifier (Just certName) (SimplifierTrace simplTrace) = do | ||
let processAgdaAST Simplification {beforeAST, stage, afterAST} = |
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.
nit: add type signature so it is easier to tell what it does.
instance AgdaUnparse AgdaFFI.UTerm where | ||
agdaUnparse = | ||
\case | ||
AgdaFFI.UVar n -> "(UVar " ++ agdaUnparse (fromInteger n :: Natural) ++ ")" |
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.
Perhaps future work, but you can use pretty printing operators like <+>
so that you don't need to worry about space.
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.
Yeah, with pretty-printing we could have proper indentation for example. But I agree it's not too important.
1d473c9
to
a3fe0e9
Compare
Must have been a botched merge/rebase. I just rebased with master and I think it's fixed now. Thanks for noticing. |
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.
This looks good - it works nicely! I was going to delve into why it is slower than the other version, but I suspect that is because is actually serialising things, and not just printing "not implemented" :) I can come up with dozens of nice things we can do next, but those can wait for the next PR.
Fixes #6424
To test, do
cabal exec uplc -- example -s factorial | cabal exec uplc -- optimise --certify factorialCert
.Pre-submit checklist: