# Polyvariance

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Polyvariance
> Markdown URL: https://mediated.wiki/source/Polyvariance.md
> Source: https://en.wikipedia.org/wiki/Polyvariance
> Source revision: 1169351952
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

In [program analysis](/source/program_analysis), a '''polyvariant''' or '''context-sensitive''' analysis (as opposed to a '''monovariant''' or '''context-insensitive''' analysis) analyzes each [function](/source/function_(computer_science)) multiple times&mdash;typically once at each [call site](/source/call_site)&mdash;to improve the precision of the analysis.<ref>{{cite journal|first1=Jens|last1=Palsberg|authorlink1=Jens Palsberg|first2=Christina|last2=Pavlopoulou|authorlink2=Christina Pavlopoulou|title=From Polyvariant Flow Information to Intersection and Union Types|journal=Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL '98)|volume=11|issue=3|pages=197&ndash;208|doi=10.1017/S095679680100394X|year=2001|citeseerx=10.1.1.36.4441|s2cid=16895848 }}</ref> Polyvariance is common in [data-flow](/source/Data-flow_analysis) and [pointer](/source/Pointer_analysis) analyses.

Forms of polyvariance include:

* Call-site sensitivity{{sfn|Smaragdakis|Balatsouras|2015}}
* The [Cartesian product](/source/Cartesian_product) algorithm<ref>{{Cite book |last1=Gilray |first1=Thomas |last2=Adams |first2=Michael D. |last3=Might |first3=Matthew |title=Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming |chapter=Allocation characterizes polyvariance: A unified methodology for polyvariant control-flow analysis |date=2016-09-04 |chapter-url=https://doi.org/10.1145/2951913.2951936 |series=ICFP 2016 |location=New York, NY, USA |publisher=Association for Computing Machinery |pages=407–420 |doi=10.1145/2951913.2951936 |isbn=978-1-4503-4219-3|s2cid=7768606 }}</ref>
* Object sensitivity{{sfn|Smaragdakis|Balatsouras|2015}}
* Type sensitivity{{sfn|Smaragdakis|Balatsouras|2015}}

The first two are more often used for dataflow analyses, the latter two are more frequently used for pointer analyses.

== References ==
{{reflist}}
===Sources===
*{{cite journal
 |last1=Smaragdakis
 |first1=Yannis
 |last2=Balatsouras
 |first2=George
 |date=2015
 |title=Pointer Analysis
 |url=https://yanniss.github.io/points-to-tutorial15.pdf
 |journal=Foundations and Trends in Programming Languages
 |volume=2
 |issue=1
 |pages=1–69
 |access-date=May 30, 2019
|doi=10.1561/2500000014
 }}

{{Program analysis}}
Category:Program analysis
Category:Polymorphism (computer science)

{{comp-sci-stub}}

---
Adapted from the Wikipedia article [Polyvariance](https://en.wikipedia.org/wiki/Polyvariance) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Polyvariance?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
