Quantified shares_value (future work)¶
Problem¶
shares_value(other, key) is an ∃-style relation: "there exists some
value that both sides emit." Under quantification, it becomes
∃ i, j. left[i].key == right[j].key — Z3 handles existentials via
Skolemization, but composing with the rest of the ∀-quantified algebra
is awkward.
v1 raises UnsupportedError when either side has quantified facts.
Sketch¶
- Skolemize each side's quantifier — introduce a Skolem index
i_leftandj_right. - Translate
shares_valueto0 ≤ i_left < length_left ∧ 0 ≤ j_right < length_right ∧ left[i_left].key == right[j_right].key. - Negate to test for proof; existential becomes universal.
Trade-offs¶
- More Z3 quantifier alternations (∀ → ∃ → ∀) — slower proofs.
- Failure mode harder to interpret (Z3 reports "unknown" more often).
Recommendation¶
Defer until a real example needs it. v1 surfaces UnsupportedError
pointing here.