Fixed point 2.0 - #439
Conversation
|
Thanks for contributing to formality! :) |
|
I am very interested to know how the new fixed point computation and memoization are done here, but I am still very much don't understand after reading for a bit xD It will be nice to talk about this in next office hour because I might need to ask questions continuously depends on the answer to get the full picture. |
let's do that |
| // Descendants completed in this round may have depended on the old | ||
| // approximation. Clear them before evaluating the rules again so | ||
| // they cannot be reused as though they were valid at the new point. | ||
| iteration_guard.invalidate(); |
There was a problem hiding this comment.
hmm... I am wondering if we really need to invalidate every completed computation here. Could some results already be final and independent of the cycle, allowing us to re evaluate only the relevant components and reuse the rest?
What does this PR do?
This PR refactors the judgment and fixed-point runtime options. We used to have a separate
#[fixed_point]combinator for Rust functions but lately I've been moving everything instead to judgment functions which I think is better. This PR merges the fixed-point code into the judgment code and also adds memoization. We only memoize within the solving of a particular judgment to avoid interactions between tests.How does it work, what questions do you have?
The way memoization and fixed point cycles interact is as follows: when computing a judgment J, we also compute a set of memoized judgment results MJ. This set MJ is local to the computation of J. Once we have completed all proofs of J: if J is the root judgment, we just drop the memoized results. Otherwise, we merge them into the parent. When a judgment re-executes to reach a fixed point, we discard all of its memoizations because they are no longer correct.
No real questions.
AI disclosure