-
Notifications
You must be signed in to change notification settings - Fork 6
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
Forcing normalization in Coq #3
Comments
Thanks for the suggestions!
BTW, the reason I even have a working recent Coq is your apt build repository, thanks a lot for that! Also, the tree normalizations are all slightly slower with your |
Ah, yes, I made a typo. The "in" after compute is important (the parentheses are not).
Probably it spends time hashconsing the term. The other two possibilities are that just retypechecking the term is slow (when you make a definition, the kernel has to retypecheck the term) or that it's doing something else strange I'm not aware of.
Glad to hear! Did you also install libcoq-ocaml-dev? That might be needed for
This is probably because the inductive conversion doesn't need to store the entire datastructure in memory. You can probably get the speedup back by defining a fixedpoint that walks the tree and consumes it, and then Eval compute in that. For example, if the tree were a nat, you could write |
I forgot to address the "returns instantly" bit. It's possible there's a special optimization for unused let binders. Does the same thing happen with vm_compute? What about if you use |
It happens with vm_compute and also with |
Oh, are these HOAS trees? The cbv strategies won't normalize under binders until the very end, so if most of the computation ends up under a binder, and then the tree disappears due to being unused, then it'll never happen. |
Tried opam again,
This is the usual error that I get. I was not able to get useful information about this the last time I tried, perhaps you know what's happening. The issue is perhaps an old opam installation, which infected my system in some way, despite my efforts to purge it. |
According to ocaml/opam#3424 (comment), you either need an updated version of |
You can get around this in a couple of ways. You can do
Eval compute let _ := <large tree> in tt
(works forcompute
,vm_compute
,native_compute
,cbv
, does not work well forlazy
,simpl
,cbn
). You can doDefinition foo := Eval compute in <large tree>
. You can doGoal True. let x := eval compute in (<large tree>) in idtac. Abort.
You can can also use a VM or native cast in eq_refl checking, which will cause Coq to fully normalize the type (on both sides, so you are actually measuring 4x normalization time, probably), e.g.,let x := <large tree> in eq_refl x <: x = x
orlet x := <large tree> in eq_refl x <<: x = x
(the former is a VM cast, the latter is a native cast).The text was updated successfully, but these errors were encountered: