Results 1 - 10
of
21
Static and Dynamic Semantics Processing
- Proceedings of the Eighteenth Annual ACM Symposium on Principles of Programming Languages
, 1991
"... This paper presents a step forward in the use of partial evaluation for interpreting and compiling programs, as well as for automatically generating a compiler from denotational definitions of programming languages. We determine the static and dynamic semantics of a programming language, reduce the ..."
Abstract
-
Cited by 47 (25 self)
- Add to MetaCart
This paper presents a step forward in the use of partial evaluation for interpreting and compiling programs, as well as for automatically generating a compiler from denotational definitions of programming languages. We determine the static and dynamic semantics of a programming language, reduce the expressions representing the static semantics, and generate object code by instantiating the expressions representing the dynamic semantics. By processing the static semantics of the language, programs get compiled. By processing the static semantics of the partial evaluator, compilers are generated. The correctness of a compiler is guaranteed by the correctness of both the executable specification and our partial evaluator. The results reported in this paper improve on previous work in the domain of compiler generation [16, 30], and solves several open problems in the domain of partial evaluation [15]. In essence: ffl Our compilation goes beyond a mere syntax-tosemantics mapping since the ...
On the Construction of Correct Compiler Back-Ends: An ASM Approach
- Journal of Universal Computer Science
, 1997
"... : Existing works on the construction of correct compilers have at least one of the following drawbacks: (i) correct compilers do not compile into machine code of existing processors. Instead they compile into programs of an abstract machine which ignores limitations and properties of real-life proce ..."
Abstract
-
Cited by 27 (5 self)
- Add to MetaCart
: Existing works on the construction of correct compilers have at least one of the following drawbacks: (i) correct compilers do not compile into machine code of existing processors. Instead they compile into programs of an abstract machine which ignores limitations and properties of real-life processors. (ii) the code generated by correct compilers is orders of magnitudes slower than the code generated by unverified compilers. (iii) the considered source language is much less complex than real-life programming languages. This paper focuses on the construction of correct compiler backends which generate machine-code for real-life processors from realistic intermediate languages. Our main results are the following: (i) We present a proof approach based on abstract state machines for bottom-up rewriting system specifications (BURS) for back-end generators. A significant part of this proof can be parametrized with the intermediate and machine language. (ii) The performance of the code con...
A Provably Correct Compiler Generator
, 1992
"... We have designed, implemented, and proved the correctness of a compiler generator that accepts action semantic descriptions of imperative programming languages. The generated compilers emit absolute code for an abstract RISC machine language that currently is assembled into code for the SPARC and th ..."
Abstract
-
Cited by 26 (2 self)
- Add to MetaCart
We have designed, implemented, and proved the correctness of a compiler generator that accepts action semantic descriptions of imperative programming languages. The generated compilers emit absolute code for an abstract RISC machine language that currently is assembled into code for the SPARC and the HP Precision Architecture. Our machine language needs no run-time type-checking and is thus more realistic than those considered in previous compiler proofs. We use solely algebraic specifications; proofs are given in the initial model. 1 Introduction The previous approaches to proving correctness of compilers for non-trivial languages all use target code with run-time type-checking. The following semantic rule is typical for these target languages: (FIRST : C; hv 1 ; v 2 i : S) ! (C; v 1 : S) The rule describes the semantics of an instruction that extracts the first component of the top-element of the stack, provided that the top-element is a pair. If not, then it is implicit that the...
Semantics-Based Compiling: A Case Study in Type-Directed Partial Evaluation
- Eighth International Symposium on Programming Language Implementation and Logic Programming
"... . We illustrate a simple and e#ective solution to semantics-based compiling. Our solution is based on "type-directed partial evaluation", and -- our compiler generator is expressed in a few lines, and is e#cient; -- its input is a well-typed, purely functional definitional interpreter in the sty ..."
Abstract
-
Cited by 21 (8 self)
- Add to MetaCart
. We illustrate a simple and e#ective solution to semantics-based compiling. Our solution is based on "type-directed partial evaluation", and -- our compiler generator is expressed in a few lines, and is e#cient; -- its input is a well-typed, purely functional definitional interpreter in the style of denotational semantics; -- the output of the generated compiler is e#ectively three-address code, in the fashion and e#ciency of the Dragon Book; -- the generated compiler processes several hundred lines of source code per second. The source language considered in this case study is imperative, blockstructured, higher-order, call-by-value, allows subtyping, and obeys stack discipline. It is bigger than what is usually reported in the literature on semantics-based compiling and partial evaluation. Our compiling technique uses the first Futamura projection, i.e., we compile programs by specializing a definitional interpreter with respect to the program. Specialization is carri...
Polymorphic Type Inference and Semi-Unification
, 1989
"... In the last ten years declaration-free programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically type ..."
Abstract
-
Cited by 21 (2 self)
- Add to MetaCart
In the last ten years declaration-free programming languages with a polymorphic typing discipline (ML, B) have been developed to approximate the flexibility and conciseness of dynamically typed languages (LISP, SETL) while retaining the safety and execution efficiency of conventional statically typed languages (Algol68, Pascal). These polymorphic languages can be type checked at compile time, yet allow functions whose arguments range over a variety of types. We investigate several polymorphic type systems, the most powerful of which, termed Milner-Mycroft Calculus, extends the so-called let-polymorphism found in, e.g., ML with a polymorphic typing rule for recursive definitions. We show that semi-unification, the problem of solving inequalities over firstorder terms, characterizes type checking in the Milner-Mycroft Calculus to polynomial time, even in the restricted case where nested definitions are disallowed. This permits us to extend some infeasibility results for related combinato...
Generating Action Compilers by Partial Evaluation
- Journal of Functional Programming
, 1996
"... Compiler generation based on Mosses' action semantics has been studied by Brown, Moura, and Watt, and also by the second author. The core of each of their systems is a handwritten action compiler, producing either C or machine code. We have obtained an action compiler in a much simpler way: by parti ..."
Abstract
-
Cited by 12 (1 self)
- Add to MetaCart
Compiler generation based on Mosses' action semantics has been studied by Brown, Moura, and Watt, and also by the second author. The core of each of their systems is a handwritten action compiler, producing either C or machine code. We have obtained an action compiler in a much simpler way: by partial evaluation of an action interpreter. Even though our compiler produces Scheme code, the code runs as fast as that produced by the previous action compilers. 1 Introduction Action semantics is a framework for formal semantics of programming languages, developed by Mosses [16, 17, 18] and Watt [19, 26]. It differs from denotational semantics in using semantic entities called actions, rather than higher-order functions. Compiler generation based on action semantics has been studied by Brown, Moura, and Watt [6], and also by the second author [22, 20, 21]. Journal of Functional Programming, 6(2):269--298, 1996. Also in Proc. FPCA'93, pages 308--317. The core of each of their two action se...
An Automatically Generated and Provably Correct Compiler for a Subset of Ada
- In IEEE International Conference on Computer Languages
, 1992
"... We describe the automatic generation of a provably correct compiler for a non-trivial subset of Ada. The compiler is generated from an action semantic description; it emits absolute code for an abstract RISC machine language that currently is assembled into code for the SPARC and the HP Precision Ar ..."
Abstract
-
Cited by 11 (2 self)
- Add to MetaCart
We describe the automatic generation of a provably correct compiler for a non-trivial subset of Ada. The compiler is generated from an action semantic description; it emits absolute code for an abstract RISC machine language that currently is assembled into code for the SPARC and the HP Precision Architecture. The generated code is an order of magnitude better than what is produced by compilers generated by the classical systems of Mosses, Paulson, and Wand. The use of action semantics makes the processable language specification easy to read and pleasant to work with. In Proc. ICCL'92, Fourth IEEE International Conference on Computer Languages, pages 117--126. 1 Introduction The purpose of a language designer's workbench, envisioned by Pleban, is to drastically improve the language design process. The major components in such a workbench are: ffl A specification language whose specifications are easily maintainable, and accessible without knowledge of the underlying theory; and f...
ASM-Based Mechanized Verification of Compiler Back-Ends
"... We describe an approach to mechanically prove the correctness of BURS specifications and show how such a tool can be connected with BURS based back-end generators [9]. The proofs are based on the operational semantics of both source and target system languages specified by means of Abstract Stat ..."
Abstract
-
Cited by 10 (2 self)
- Add to MetaCart
We describe an approach to mechanically prove the correctness of BURS specifications and show how such a tool can be connected with BURS based back-end generators [9]. The proofs are based on the operational semantics of both source and target system languages specified by means of Abstract State Machines [14]. In [27] we decomposed the correctness condition based on these operational semantics into local correctness conditions for each BURS rule and showed that these local correctness conditions can be proven independently. The specification and verification system PVS is used to mechanicaly verify BURS-rules based on formal representations of the languages involved. In particular, we have defined PVS proof strategies which enable an automatic verification of the rules. Using PVS, several erroneous rules have been found. Moreover, from failed proof attempts we were able to correct them.
A realistic compiler generator based on high-level semantics
- In Fourteenth Symposium on Principles of Programming Languages
, 1987
"... peteOCAELN.engin.UMich.EDU We have developed a new style of semantic definition called high-level semantics. In constrast to traditional de-notational semantics, high-level semantics is suitable for both defining the functional meaning of programming lan-guages, as well as describing realistic compi ..."
Abstract
-
Cited by 9 (0 self)
- Add to MetaCart
peteOCAELN.engin.UMich.EDU We have developed a new style of semantic definition called high-level semantics. In constrast to traditional de-notational semantics, high-level semantics is suitable for both defining the functional meaning of programming lan-guages, as well as describing realistic compiler implcmen-tations. Moreover, high-level specifications are consid-erably more descriptive and intelligible than traditional specifications. This paper describer the compiler generator MESS, which embodies the principles of high-level semantics. MESS has been used to generate compilers for nontrivial languages. The compilers are efficient, and produce ob-ject programs that are competitive with those generated by hand-written compilers. 1
User Defined Syntax
- Department of Computer Sciences, Chalmers University of Technology and University
, 1992
"... This thesis describes two examples of user defined syntax. The first, and most thoroughly investigated, is a new datatype construction, the conctype, the elements of which have a very flexible syntax. An embedded language can easily be introduced into a programming language using conctypes and compu ..."
Abstract
-
Cited by 7 (2 self)
- Add to MetaCart
This thesis describes two examples of user defined syntax. The first, and most thoroughly investigated, is a new datatype construction, the conctype, the elements of which have a very flexible syntax. An embedded language can easily be introduced into a programming language using conctypes and computations are easily expressed using the concrete syntax and a special pattern matching form. The second example is user defined distfix operators which give a user possibility to extend the syntax for expressions in a programming language. We describe both a user's view and the implementation of these two examples. In both cases, context-free grammars serve as a basis for the definition of the new syntax. A problem that is investigated is how to disambiguate grammars with precedences. To see how this should be done we investigate which language a grammar together with precedence rules defines. For a subclass of context-free grammars we give a predicate that defines the precedence correct syn...

