Abstract

We propose an integration of structural subtyping with boolean connectives and semantic subtyping to define a Java-like programming language that exploits the benefits of both techniques. Semantic subtyping is an approach to defining subtyping relation based on set-theoretic models, rather than syntactic rules. On the one hand, this approach involves some non trivial mathematical machinery in the background. On the other hand, final users of the language need not know this machinery and the resulting subtyping relation is very powerful and intuitive. While semantic subtyping is naturally linked to the structural one, we show how the framework can also accommodate the nominal subtyping. Several examples show the expressivity and the practical advantages of our proposal.

Highlights

  • A type system for a programming language is a set of deduction rules that enable type derivations for the terms of the language

  • The semantic approach presents several advantages: it allows a natural definition of boolean operators and the meaning of types is more intuitive for the programmer, who does not need to know the theory behind the curtain

  • We address the semantic subtyping approach (Section 3) by applying it to an object-oriented core language; the result will be an objectoriented system with boolean connectives and structural subtyping

Read more

Summary

Introduction

A type system for a programming language is a set of deduction rules that enable type derivations for the terms of the language. One proceeds as follows: first define the language, the set of syntactic types and the subtyping relation by deduction rules. Instead, one starts from a model of the language and an interpretation of types as subsets of this model; the subtyping relation is defined as inclusion of sets denoting types. This approach has received less attention than the syntactic one because it is more technical: it is not trivial to define the interpretation of types as subsets of a model, or to define a model at all. The semantic approach presents several advantages: it allows a natural definition of boolean operators and the meaning of types is more intuitive for the programmer, who does not need to know the theory behind the curtain (as usual in sophisticated programming environments)

Methods
Discussion
Conclusion
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.