4 research outputs found

    On the Multi-Language Construction

    Get PDF
    Modern software is no more developed in a single programming language. Instead, programmers tend to exploit cross-language interoperability mechanisms to combine code stemming from different languages, and thus yielding fully-fledged multi-language programs. Whilst this approach enables developers to benefit from the strengths of each single-language, on the other hand it complicates the semantics of such programs. Indeed, the resulting multi-language does not meet any of the semantics of the combined languages. In this paper, we broaden the boundary functions-based approach a la Matthews and Findler to propose an algebraic framework that provides a constructive mathematical notion of multi-language able to determine its semantics. The aim of this work is to overcome the lack of a formal method (resp., model) to design (resp., represent) a multi-language, regardless of the inherent nature of the underlying languages. We show that our construction ensures the uniqueness of the semantic function (i.e., the multi-language semantics induced by the combined languages) by proving the initiality of the term model (i.e., the abstract syntax of the multi-language) in its category

    Programming Languages and Systems

    Get PDF
    This open access book constitutes the proceedings of the 28th European Symposium on Programming, ESOP 2019, which took place in Prague, Czech Republic, in April 2019, held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2019

    Algebraically modelling object-orientated programs.

    Get PDF
    We explore the process of building algebraic models of the behaviour of Java classes. A fundamental building block of object-oriented programs is the class that can typically contain multiple fields, constructors, and methods. In Java a programmer can control access to the various methods, fields and constructors of a class. We will be formally specifying and documenting a class' public behaviour algebraically. In practice even a simple Java class can have complex behaviour. A full algebraic specification (FAS) of a class can be complicated and hard to understand for someone who wishes to quickly ascertain the behaviour of a class. This complexity is largely as a result of machinery needed to define class behaviours that are implicit, that is behaviour that is considered part of Java's general language behaviour and defines the general structure of classes, methods, fields and constructors. However, it is unreasonable to expect a programmer to write such full specifications. Therefore we introduce the concept of an Algebraic Class Specification (ACS) that provides a much reduced version of the FAS of a class. The ACS is therefore more readable and is aimed at showing what we consider to be key information in the specification of a class that cannot be programmatically inferred from the language definition. Using the ACS we present a methodology for generating an FAS thus reducing the complexity of specification for the user. We will show that the ACS provides a reader with a clear formal understanding of a class' behaviour using a minimum of information. The ACS is designed to be human readable yet still machine readable. We will show that in order to aid users in creating specifications of classes we have mimicked the Java syntax closely in the specification syntax. We will, in addition, present a methodology for embedding the formal semantic description for a Java class within javadoc comments thus allowing Java API documentation to contain both a formal specification of the behaviour of a class and its components and an informal general textual description. These techniques have been developed by the analysis of case studies. We will demonstrate all of these techniques applied to a wide and varied range of both invented and existing examples of Java classes
    corecore