-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement pruning #84
Comments
Can you elaborate? Pruning should not change any types or IMRs. It merely involves deleting nodes that are not executed. I'm sure we could find some extra opportunities for sharing by messing around with type inference, but that's also unrelated to pruning. |
Take
We take the
The left Since the type of |
I'm still not following. Whatever its IMR winds up being, this will inform how sharing happens. But still I don't see the problem with pruning and finalizing types (in either order) and then sharing (later, when serializing the program). |
I think pruning first and sharing later works. My warning was mostly about a "what if" scenario that we should try to avoid. My IMR example was wrong; thanks for pointing this out. I am trying to rationalize what Russell told me months ago. Another attempt: The first witness node has type This is an artificial example, but there might be more realistic ones. Sharing still works, so we probably don't care. Still, it is interesting that the IMR may change. |
Prune first and share later is correct. Sharing should simply be considered part of the serialization format, and thus must occur last/in tandem with serialization. |
Yes, if you were to finalize the types of an unpruned program, some nodes would have different IMRs than they would after pruning. Similarly if you populate (or change) witness values, the IMRs will change. But prior to pruning the program is not valid, so the "IMR"s you comupte are basically just dummy values to assist in serializing the program. I think I understand what you're saying -- that a different set of nodes will be shared based.on what you do with your witnesses -- but this is a trivial observation because the set of nodes period may be different, so of course the set of shared nodes may be different. |
case
nodes should be replaced withassertl
orassertr
if their left or right branches, respectively, are not used during execution. Pruning should happen during finalization.Pruning is non-trivial in conjunction with sharing, since inferred types may change. Witness targets may shrink and IMRs may change, recursively leading to more sharing.
The text was updated successfully, but these errors were encountered: