Abstract
The precision of a static analysis can be improved by increasing the context-sensitivity of the analysis. In a type-based formulation of static analysis for functional languages this can be achieved by, e.g., introducing let-polyvariance or subtyping. In this paper we go one step further by defining a higher-ranked polyvariant type system so that even properties of lambda-bound identifiers can be generalized over. We do this for dependency analysis, a generic analysis that can be instantiated to a range of different analyses that in this way all can profit.
We prove that our analysis is sound with respect to a call-by-name semantics and that it satisfies a so-called noninterference property. We provide a type reconstruction algorithm that we have proven to be terminating, and sound and complete with respect to its declarative specification. Our principled description can serve as a blueprint for making other analyses higher-ranked.
Chapter PDF
Similar content being viewed by others
References
Abadi, M., Banerjee, A., Heintze, N., Riecke, J.G.: A core calculus of dependency. In: Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL ’99. Association for Computing Machinery (ACM) (1999). https://doi.org/10.1145/292540.292555
Algehed, M., Russo, A.: Encoding dcc in haskell. In: Proceedings of the 2017 Workshop on Programming Languages and Analysis for Security. pp. 77–89. PLAS ’17, ACM, New York, NY, USA (2017). https://doi.org/10.1145/3139337.3139338
Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proceedings of the 9th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL ’82. Association for Computing Machinery (ACM) (1982). https://doi.org/10.1145/582153.582176
Dowek, G.: Handbook of automated reasoning. chap. Higher-order Unification and Matching, pp. 1009–1062. Elsevier Science Publishers B. V., Amsterdam, The Netherlands (2001), http://dl.acm.org/citation.cfm?id=778522.778525
Dussart, D., Henglein, F., Mossin, C.: Polymorphic recursion and subtype qualifications: Polymorphic binding-time analysis in polynomial time. In: Static Analysis, pp. 118–135. Springer Nature (1995). https://doi.org/10.1007/3-540-60360-3_36
Foster, J.N., Greenwald, M.B., Moore, J.T., Pierce, B.C., Schmitt, A.: Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem. ACM Trans. Program. Lang. Syst. 29(3) (May 2007). https://doi.org/10.1145/1232420.1232424
Glynn, K., Stuckey, P.J., Sulzmann, M., Söndergaard, H.: Boolean constraints for binding-time analysis. In: PADO ’01: Proceedings of the Second Symposium on Programs as Data Objects. pp. 39–62. Springer-Verlag, London, UK (2001)
Goguen, J.A., Meseguer, J.: Security policies and security models. In: 1982 IEEE Symposium on Security and Privacy. pp. 11–11 (April 1982). https://doi.org/10.1109/SP.1982.10014
Heintze, N., Riecke, J.G.: The SLam calculus. In: Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL ’98. Association for Computing Machinery (ACM) (1998). https://doi.org/10.1145/268946.268976
Henglein, F.: Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 253–289 (4 1993). https://doi.org/10.1145/169701.169692
Hoffmann, J., Das, A., Weng, S.C.: Towards automatic resource bound analysis for ocaml. In: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages. pp. 359–373. POPL 2017, ACM, New York, NY, USA (2017). https://doi.org/10.1145/3009837.3009842
Holdermans, S., Hage, J.: Polyvariant flow analysis with higher-ranked polymorphic types and higher-order effect operators. In: Proceedings of the 15th ACM SIGPLAN international conference on Functional programming - ICFP ’10. Association for Computing Machinery (ACM) (2010). https://doi.org/10.1145/1863543.1863554
Jones, S.P., Vytiniotis, D., Weirich, S., Shields, M.: Practical type inference for arbitrary-rank types. Journal of Functional Programming 17(1), 1–82 (2007). https://doi.org/10.1017/S0956796806006034
Kfoury, A., Tiuryn, J.: Type reconstruction in finite rank fragments of the second-order \(\uplambda \)-calculus. Information and Computation 98(2), 228–257 (6 1992). https://doi.org/10.1016/0890-5401(92)90020-g
Kmett, E.: The lens library (2018), http://lens.github.io/, consulted 9/7/2018
Koot, R.: Higher-ranked exception types (2015), https://github.com/ruudkoot/phd/tree/master/higher-ranked-exception-types, accessed 2018–03-09
Koot, R., Hage, J.: Type-based exception analysis for non-strict higher-order functional languages with imprecise exception semantics. In: Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation - PEPM ’15. Association for Computing Machinery (ACM) (2015). https://doi.org/10.1145/2678015.2682542
Lourenço, L., Caires, L.: Dependent information flow types. In: Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. pp. 317–328. POPL ’15, ACM, New York, NY, USA (2015). https://doi.org/10.1145/2676726.2676994
Lucassen, J.M., Gifford, D.K.: Polymorphic effect systems. In: POPL ’88: Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of programming languages. pp. 47–57. ACM, New York, NY, USA (1988). https://doi.org/10.1145/73560.73564
McLean, J.: Security Models. Wiley Press (1994). https://doi.org/10.1002/0471028959
Miller, D.: A logic programming language with lambda-abstraction, function variables, and simple unification. In: Extensions of Logic Programming, pp. 253–281. Springer Nature (1991). https://doi.org/10.1007/bfb0038698
Milner, R.: A theory of type polymorphism in programming. Journal of Computer and System Sciences 17(3), 348–375 (12 1978). https://doi.org/10.1016/0022-0000(78)90014-4
Mycroft, A.: Polymorphic type schemes and recursive definitions. In: Lecture Notes in Computer Science, pp. 217–228. Springer Nature (1984). https://doi.org/10.1007/3-540-12925-1_41
Nielson, F., Nielson, H., Hankin, C.: Principles of Program Analysis. Springer Verlag, second printing edn. (2005)
Pottier, F., Simonet, V.: Information flow inference for ml. ACM Trans. Program. Lang. Syst. 25(1), 117–158 (2003). https://doi.org/10.1145/596980.596983
Thorand, F., Hage, J.: Addendum with proofs, definitions and examples for the esop 2020 paper, higher-ranked annotation polymorphic dependency analysis, http://www.staff.science.uu.nl/~hage0101/downloads/hrp-addendum.pdf
Tip, F.: A survey of program slicing techniques. Tech. rep., Amsterdam, The Netherlands, The Netherlands (1994)
Wansbrough, K., Jones, S.P.: Once upon a polymorphic type. In: Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL ’99. Association for Computing Machinery (ACM) (1999). https://doi.org/10.1145/292540.292545
Zhang, G.: Binding-Time Analysis: Subtyping versus Subeffecting. Msc thesis (2008), http://people.cs.uu.nl/jur/downloads/guangyuzhang-msc.pdf
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
Copyright information
© 2020 The Author(s)
About this paper
Cite this paper
Thorand, F., Hage, J. (2020). Higher-Ranked Annotation Polymorphic Dependency Analysis. In: Müller, P. (eds) Programming Languages and Systems. ESOP 2020. Lecture Notes in Computer Science(), vol 12075. Springer, Cham. https://doi.org/10.1007/978-3-030-44914-8_24
Download citation
DOI: https://doi.org/10.1007/978-3-030-44914-8_24
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-44913-1
Online ISBN: 978-3-030-44914-8
eBook Packages: Computer ScienceComputer Science (R0)