You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: over-specialized backward rules in vcgen's spec rule cache (#14431)
This PR fixes `vcgen` failing with `Failed to apply rule` when the same
equality spec matches two different programs within one run, e.g. the
equations of a recursive function registered via `vcgen [f]`: the cached
backward rule was specialized to the first matched program and could not
be applied to the next one.
The rule built from an equality spec unified the equation's LHS with the
goal's program, baking the first program's arguments and dictionaries
into a rule that is cached per spec theorem, `WP` instance and excess
argument count. Rule construction now treats equality specs like `⊑ wp`
specs: it pins only what the cache key determines, namely the monad, the
value and predicate types and the `WP` instance, and leaves the
equation's remaining variables, including instance binders, as schematic
rule parameters that applying the rule binds against the concrete goal
program. Dictionary projections this substitution exposes in the premise
program are reduced by the existing head-reduction step before the next
spec lookup, which also makes the construction-time dictionary synthesis
and projection reduction unnecessary.
0 commit comments