9 research outputs found

    Compiling Actions by Partial Evaluation, Revisited

    Get PDF
    We revisit Bondorf and Palsberg's compilation of actions using< the offline syntax-directed partial evaluator Similix (FPCA'93, JFP'96), and we compare it in detail with using an online type-directed partial evaluator. In contrast to Similix, our type-directed partial evaluator is idempotent and requires no "binding-time improvements." It also appears to consume about 7 times less space and to be about 28 times faster than Similix, and to yield residual programs that are perceptibly more efficient than those generated by Similix

    A Categorical Axiomatics for Bisimulation

    Full text link

    Theory and Practice of Action Semantics

    Get PDF
    Action Semantics is a framework for the formal descriptionof programming languages. Its main advantage over other frameworksis pragmatic: action-semantic descriptions (ASDs) scale up smoothly torealistic programming languages. This is due to the inherent extensibilityand modifiability of ASDs, ensuring that extensions and changes tothe described language require only proportionate changes in its description.(In denotational or operational semantics, adding an unforeseenconstruct to a language may require a reformulation of the entire description.)After sketching the background for the development of action semantics,we summarize the main ideas of the framework, and provide a simpleillustrative example of an ASD. We identify which features of ASDsare crucial for good pragmatics. Then we explain the foundations ofaction semantics, and survey recent advances in its theory and practicalapplications. Finally, we assess the prospects for further developmentand use of action semantics.The action semantics framework was initially developed at the Universityof Aarhus by the present author, in collaboration with David Watt(University of Glasgow). Groups and individuals scattered around fivecontinents have since contributed to its theory and practice

    Tagging, encoding, and jones optimality

    Get PDF
    A partial evaluator is said to be Jones-optimal if the result of specializing a self-interpreter with respect to a source program is textually identical to the source program, modulo renaming. Jones optimality has already been obtained if the self-interpreter is untyped. If the selfinterpreter is typed, however, residual programs are cluttered with type tags. To obtain the original source program, these tags must be removed.; ; A number of sophisticated solutions have already been proposed. We observe, however, that with a simple representation shift, ordinary partial evaluation is already Jones-optimal, modulo an encoding. The representation shift amounts to reading the type tags as constructors for higherorder abstract syntax. We substantiate our observation by considering a typed self-interpreter whose input syntax is higher-order. Specializing this interpreter with respect to a source program yields a residual program that is textually identical to the source program, modulo renaming.Publicado en Basic Research in Computer Science, April, 2003.Laboratorio de Investigaci贸n y Formaci贸n en Inform谩tica Avanzad

    OASIS: An optimizing action-based compiler generator

    Full text link

    Action semantics of unified modeling language

    Get PDF
    The Uni ed Modeling Language or UML, as a visual and general purpose modeling language, has been around for more than a decade, gaining increasingly wide application and becoming the de-facto industrial standard for modeling software systems. However, the dynamic semantics of UML behaviours are only described in natural languages. Speci cation in natural languages inevitably involves vagueness, lacks reasonability and discourages mechanical language implementation. Such semi-formality of UML causes wide concern for researchers, including us. The formal semantics of UML demands more readability and extensibility due to its fast evolution and a wider range of users. Therefore we adopt Action Semantics (AS), mainly created by Peter Mosses, to formalize the dynamic semantics of UML, because AS can satisfy these needs advantageously compared to other frameworks. Instead of de ning UML directly, we design an action language, called ALx, and use it as the intermediary between a typical executable UML and its action semantics. ALx is highly heterogeneous, combining the features of Object Oriented Programming Languages, Object Query Languages, Model Description Languages and more complex behaviours like state machines. Adopting AS to formalize such a heterogeneous language is in turn of signi cance in exploring the adequacy and applicability of AS. In order to give assurance of the validity of the action semantics of ALx, a prototype ALx-to-Java translator is implemented, underpinned by our formal semantic description of the action language and using the Model Driven Approach (MDA). We argue that MDA is a feasible way of implementing this source-to-source language translator because the cornerstone of MDA, UML, is adequate to specify the static aspect of programming languages, and MDA provides executable transformation languages to model mapping rules between languages. We also construct a translator using a commonly-used conventional approach, in i which a tool is employed to generate the lexical scanner and the parser, and then other components including the type checker, symbol table constructor, intermediate representation producer and code generator, are coded manually. Then we compare the conventional approach with the MDA. The result shows that MDA has advantages over the conventional method in the aspect of code quality but is inferior to the latter in terms of system performance

    Sort Inference in Action Semantics

    Get PDF
    Action semantics is a semantic meta-language developed by Mosses and Watt for specifying programming languages. The work reported in this thesis is part of a project to develop a system, called ACTRESS, that is a semantics-directed compiler generator based on action semantics. The aims of this project are to demonstrate the suitability of action semantics for this task, and to produce a system that improves on the performance of previous semantics-directed compiler generators. Moreover the ACTRESS system aims to accept a wide range of programming languages, including dynamically-scoped and dynamically-typed languages, but not to penalise the implementations of statically-typed or statically-bound languages as a result. ACTRESS automatically generates a compiler from an action semantic description of a programming language, and has been used to generate compilers for a small declarative language and a small imperative language. The generated compiler uses a number of standard modules to compile the action denoting a program into efficient object code. Amongst these modules is the action notation sort checker. The role of the action notation sort checker is vital. It analyses an action and infers detailed information about the sorts of data flowing between the sub-actions. Without this information, erroneous actions could not be detected, and efficient code generation would not be possible. The problem of sort inference for action notation is a complicated one. Firstly, action notation has an unusual sort system, which includes individuals as sorts, sort join, and sort meet. Secondly, the complex data flows in action notation prevent a simple bottom-up or top-down analysis. In general, actions have polymorphic sorts. Thirdly, we aim to be as general as possible, and allow actions that still require sort checks when the action is performed. We must detect the places in an action where a run-time sort check is necessary, and annotate the action accordingly. In this thesis, we present a sort inference algorithm for action notation, that is specified as a collection of sort inference rules, and we describe the implementation of this algorithm to produce the action notation sort checker. Furthermore, we formulate a soundness property for our sort inference algorithm, and prove its soundness with respect to the natural semantics of ACTRESS action notation. Finally, we compare ACTRESS with other semantics-directed compiler generators that use action semantics, and suggest possible improvements and future research

    Action Notation Transformations

    Get PDF
    ACTRESS is a semantics-directed compiler generation system based on action semantics. Its aim is to generate compilers whose performance is closer to hand-written compilers than the ones generated by other semantics-directed compiler generators. ACTRESS generates a compiler for a language based solely on the language's action semantic description. We describe the process by which this is achieved. A compiler for action notation, the formal notation used in action semantic descriptions, is the core of the generated compilers. We specify and implement a code generator for the action notation compiler. We also present the design and implementation of an action notation interpreter. A conventional hand-written compiler eliminates, whenever possible, references to identifiers at compile time. Some storage allocation is often performed at compile-time too. We can see both steps as transformations whose main objective is to improve the quality of the object code. The compiler writer, based on his knowledge of properties of the source language, implements these "transformations" as best as he can. In the context of ACTRESS, where action notation can be seen as the intermediate language of every generated compiler, we adopt a similar approach. We introduce a set of transformations, called action transformations, which allow the systematic and automatic elimination of bindings in action notation for statically scoped languages. They also allocate storage statically whenever possible. We formalise and implement these action transformations. The transformations may be included in generated compilers. We show that this inclusion improves the quality of the object code generated by ACTRESS' compilers. In general, action transformations are a way to do some static processing of actions. Transforming actions corresponds to partially performing them, leaving less work to be done at performance time. Thus, transformed actions are more efficient. Binding elimination exposes the static and dynamic nature of bindings in action notation. This relates with the binding discipline one can find in a programming language. We study the binding discipline of action notation and we state a condition which identifies a statically scoped action. We extend this condition to a sufficient condition on the action semantics of a language which tells if the language is statically scoped. This condition can be implemented as an analysis to be performed by ACTRESS, at compiler generation time, to decide which transformations will be included in a generated compiler for the language. Finally, we list possibilities for improvements and potential areas for further research

    Compiling actions by partial evaluation

    No full text
    corecore