skip to main content
10.1007/978-3-642-35873-9_21guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

Sound and Complete Flow Typing with Unions, Intersections and Negations

Published: 20 January 2013 Publication History

Abstract

Flow typing is becoming a popular mechanism for typing existing programs written in untyped languages e.g. JavaScript, Racket, Groovy. Such systems require intersections for the true-branch of a type test, negations for the false-branch, and unions to capture the flow of information at meet points. Type systems involving unions, intersections and negations require a subtype operator which is non-trivial to implement. Frisch et al. demonstrated that this problem was decidable. However, their proof was not constructive and does not lend itself naturally to an implementation. In this paper, we present a sound and complete algorithm for subtype testing in the presence of unions, intersections and negations.

References

[1]
Cartwright, R., Fagan, M.: Soft typing. In: Proceedings of the ACM Conference on Programming Language Design and Implementation PLDI, pp. 278---292 1991
[2]
Ancona, D., Ancona, M., Cuni, A., Matsakis, N.D.: RPython: a step towards reconciling dynamically and statically typed OO languages. In: Proceedings of the Dynamic Languages Symposium DLS, pp. 53---64 2007
[3]
Ousterhout, J.K.: Scripting: Higher-level programming for the 21st century. IEEE Computer 313, 23---30 1998
[4]
Spinellis, D.: Java makes scripting languages irrelevant? IEEE Software 223, 70---71 2005
[5]
Loui, R.P.: In praise of scripting: Real programming pragmatism. IEEE Computer 417, 22---26 2008
[6]
Bloom, B., Field, J., Nystrom, N., Östlund, J., Richards, G., Strnisa, R., Vitek, J., Wrigstad, T.: Thorn: robust, concurrent, extensible scripting on the JVM. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages and Applications OOPSLA, pp. 117---136 2009
[7]
Hindley, J.R.: The principal type-scheme of an object in combinatory logic. Transactions of the AMS 146, 29---60 1969
[8]
Milner, R.: A theory of type polymorphism in programming. Journal of Computer and System Sciences 17, 348---375 1978
[9]
The Scala programming language, http://lamp.epfl.ch/scala/
[10]
Bierman, G., Meijer, E., Torgersen, M.: Lost in translation: formalizing proposed extensions to C#. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages and Applications OOPSLA, pp. 479---498 2007
[11]
Remy, D., Vouillon, J.: Objective ML: An effective object-oriented extension to ML. Theory And Practice of Object Systems 41, 27---50 1998
[12]
Foster, J.S., Terauchi, T., Aiken, A.: Flow-sensitive type qualifiers. In: Proceedings of the ACM Conference on Programming Language Design and Implementation PLDI, pp. 1---12 2002
[13]
Ekman, T., Hedin, G.: Pluggable checking and inferencing of non-null types for Java. Journal of Object Technology 69, 455---475 2007
[14]
Male, C., Pearce, D.J., Potanin, A., Dymnikov, C.: Java bytecode verification for @NonNull types. In: Proceedings of the Confererence on Compiler Construction CC, pp. 229---244 2008
[15]
Fähndrich, M., Leino, K.R.M.: Declaring and checking non-null types in an object-oriented language. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages and Applications OOPSLA, pp. 302---312 2003
[16]
Myers, A.C.: JFlow: Practical mostly-static information flow control. In: Proceedings of the ACM symposium on the Principles Of Programming Languages POPL, pp. 228---241 1999
[17]
Hunt, S., Sands, D.: On flow-sensitive security types. In: Proceedings of the ACM Symposium on the Principles Of Programming Languages POPL, pp. 79---90 2006
[18]
Russo, A., Sabelfeld, A.: Dynamic vs. static flow-sensitive security analysis. In: Proc. CSF, pp. 186---199 2010
[19]
Pearce, D.J.: JPure: A Modular Purity System for Java. In: Knoop, J. ed. CC 2011. LNCS, vol. 6601, pp. 104---123. Springer, Heidelberg 2011
[20]
Foster, J.S., Fähndrich, M., Aiken, A.: A theory of type qualifiers. In: Proceedings of the ACM conference on Programming Language Design and Implementation PLDI, pp. 192---203 1999
[21]
Pominville, P., Qian, F., Vallée-Rai, R., Hendren, L., Verbrugge, C.: A Framework for Optimizing Java Using Attributes. In: Wilhelm, R. ed. CC 2001. LNCS, vol. 2027, pp. 334---554. Springer, Heidelberg 2001
[22]
Andreae, C., Noble, J., Markstrum, S., Millstein, T.: A framework for implementing pluggable type systems. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages and Applications OOPSLA, pp. 57---74 2006
[23]
Tobin-Hochstadt, S., Felleisen, M.: The design and implementation of typed Scheme. In: Proceedings of the ACM Symposium on the Principles Of Programming Languages POPL, pp. 395---406 2008
[24]
Tobin-Hochstadt, S., Felleisen, M.: Logical types for untyped languages. In: Proceedings of the ACM International Conference on Functional Programming ICFP, pp. 117---128 2010
[25]
Guha, A., Saftoiu, C., Krishnamurthi, S.: Typing Local Control and State Using Flow Analysis. In: Barthe, G. ed. ESOP 2011. LNCS, vol. 6602, pp. 256---275. Springer, Heidelberg 2011
[26]
Winther, J.: Guarded type promotion: eliminating redundant casts in Java. In: Proceedings of the Workshop on Formal Techniques for Java-like Programs, pp. 6:1---6:8 2011
[27]
What's new in Groovy 2.0?, http://www.infoq.com/articles/new-groovy-20
[28]
The Whiley programming language, http://whiley.org
[29]
Pearce, D., Noble, J.: Implementing a language with flow-sensitive and structural typing on the JVM. Electronic Notes in Computer Science 2791, 47---59 2011
[30]
Pearce, D.J., Cameron, N., Noble, J.: Whiley: a language with flow-typing and updateable value semantics. Technical Report ECSTR12-09, Victoria University of Wellington 2012
[31]
Lindholm, T., Yellin, F.: The Java Virtual Machine Specification, 2nd edn. Addison-Wesley 1999
[32]
Leroy, X.: Java bytecode verification: algorithms and formalizations. Journal of Automated Reasoning 303/4, 235---269 2003
[33]
Frisch, A., Castagna, G., Benzaken, V.: Semantic subtyping: Dealing set-theoretically with function, union, intersection, and negation types. Journal of the ACM 554, 19:1---19:64 2008
[34]
Aiken, A., Wimmers, E.L.: Type inclusion constraints and type inference. In: Proc. FPCA, pp. 31---41 1993
[35]
Damm, F.M.: Subtyping with Union Types, Intersection Types and Recursive Types. In: Hagiya, M., Mitchell, J.C. eds. TACS 1994. LNCS, vol. 789, pp. 687---706. Springer, Heidelberg 1994
[36]
Castagna, G., Frisch, A.: A Gentle Introduction to Semantic Subtyping. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. eds. ICALP 2005. LNCS, vol. 3580, pp. 30---34. Springer, Heidelberg 2005
[37]
Frisch, A., Castagna, G., Benzaken, V.: Semantic subtyping. In: Proceedings of the ACM/IEEE Symposium on Logic In Computer Science LICS, pp. 137---146 2002
[38]
Garey, M.R., Johnson, D.S.: Computers and intractability; a guide to the theory of NP-completeness. W.H. Freeman 1979
[39]
Umans, C.: The minimum equivalent DNF problem and shortest implicants. Journal of Computer and System Sciences 63 2001
[40]
Buchfuhrer, D., Umans, C.: The complexity of boolean formula minimization. Journal of Computer and System Sciences 771, 142---153 2011
[41]
Pearce, D.J.: Sound and complete flow typing with unions, intersections and negations. Technical Report ECSTR12-20, Victoria University of Wellington 2012
[42]
Goldberg, A.: A specification of Java loading and bytecode verification. In: Proc. CCS, pp. 49---58 1998
[43]
Pusch, C.: Proving the Soundness of a Java Bytecode Verifier Specification in Isabelle/HOL. In: Cleaveland, W.R. ed. TACAS 1999. LNCS, vol. 1579, pp. 89---103. Springer, Heidelberg 1999
[44]
Büchi, M., Weck, W.: Compound types for java. In: Proceedings of the ACM conference on Object-Oriented Programming, Systems, Languages and Applications OOPSLA, pp. 362---373 1998
[45]
Igarashi, A., Nagira, H.: Union types for object-oriented programming. In: Proceedings of the Symposium on Applied Computing SAC, pp. 1435---1441 2006
[46]
Plümicke, M.: Intersection types in java. In: Proceedings of the Conference on Principles and Practices of Programming in Java PPPJ, pp. 181---188. ACM, New York 2008
[47]
Hosoya, H., Pierce, B.C.: XDuce: A statically typed XML processing language. ACM Transactions on Internet Technology 32, 117---148 2003
[48]
Benzaken, V., Castagna, G., Frisch, A.: CDuce: An XML-centric general-purpose language. In: Proceedings of the ACM International Conference on Functional Programming ICFP, pp. 51---63 2003

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Guide Proceedings
VMCAI 2013: Proceedings of the 14th International Conference on Verification, Model Checking, and Abstract Interpretation - Volume 7737
January 2013
554 pages
ISBN:9783642358722

Publisher

Springer-Verlag

Berlin, Heidelberg

Publication History

Published: 20 January 2013

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 06 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media