Skip to content

Polyvariance

A static-analysis design that retains distinct abstract approximations for selected calling contexts or value origins instead of merging them into one state.

Version
v1 · 2026-10-03 · History
Domain-specific #
13504
Domain group
Applied Sciences & Engineering
Origin domain
Computer Science & Software Engineering
Subdomains
Static Program Analysis, Abstract Interpretation → Computer Science & Software Engineering
Aliases
Polyvariant analysis

Core Idea

A static analyzer cannot run a program on every possible input, so it tracks approximate facts such as “this value might be positive” or “this pointer might refer to these objects.” If it combines every use of one function too early, facts from one caller can contaminate the result for another. Polyvariance retains separate approximate states for selected contexts or value origins. A call site, receiver object, or abstract input can supply the key; none is the only valid choice. The analyzer still has to cover every feasible execution soundly.

Scope of Application

This is a computer-science technique within interprocedural data-flow, control-flow, points-to, type and related static analyses. For instance, two calls with different abstract signs can be kept apart, while an object-oriented pointer analysis may distinguish receiver-related contexts. More contexts can improve useful precision but cost time and memory. A mere human habit of “considering context” is an analogy, not program-analysis polyvariance.

Clarity

Polyvariance helps explain an “unknown” analysis result: is the program genuinely ambiguous, or did the analysis merge unlike callers? Inspecting the context key and the separate states reveals where the uncertainty arose. It also distinguishes the number of dynamic calls from the number of abstract variants retained.

Manages Complexity

Rather than represent every execution history, the analyzer chooses a finite or tractable distinction policy, such as the last call site or a short call string. The resulting contexts compress histories while preserving selected correlations. Too few distinctions produce false joins; too many can make analysis impractical.

Abstract Reasoning

When an analyzer produces a false positive, find the join that mixed incompatible facts. Try a context key that separates those cases, verify each new state still covers its assigned feasible executions, then measure the useful precision gain against extra computation. A key is justified by the client question, not by the mere possibility of creating more variants.

Knowledge Transfer

The same design question applies across kinds of static analysis: what facts must remain separate to answer the query without an explosion of states? The broader idea of partitioning information appears elsewhere, but this entry remains domain-specific because it requires abstract program states, control-flow propagation and soundness over possible executions. See the staged V2 for mapped cases and source limitations.

Neighborhood in Abstraction Space

Polyvariance sits in a moderately populated region (58th percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Logical Inference, Modality & Conditional Structures (27 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-08