In program analysis, a '''polyvariant''' or '''context-sensitive''' analysis (as opposed to a '''monovariant''' or '''context-insensitive''' analysis) analyzes each function multiple times—typically once at each call site—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–208|doi=10.1017/S095679680100394X|year=2001|citeseerx=10.1.1.36.4441|s2cid=16895848 }}</ref> Polyvariance is common in data-flow and pointer analyses.
Forms of polyvariance include:
* Call-site sensitivity{{sfn|Smaragdakis|Balatsouras|2015}} * The 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}}