Reasoning about Code Generation in Two-Level Languages
نویسنده
چکیده
We show that two-level languages are not only a good tool for describing code-generation algorithms, but a good tool for reasoning about them as well. Indeed, some general properties of two-level languages capture common proof obligations of code-generation algorithms in the form of twolevel programs. To prove that the generated code behaves as desired, we use an erasure property, which equationally relates the generated code to an erasure of the original two-level program in the object language, thereby reducing the two-level proof obligation to a simpler one-level obligation. To prove that the generated code satis es certain syntactic constraints, e.g., that it is in some normal form, we use a type-preservation property for a re ned type system that enforces these constraints. In addition, to justify concrete implementations of codegeneration algorithms in one-level languages, we use a native embedding of a two-level language into a one-level language. We present two-level languages with these properties both for a call-by-name object language and for a call-byvalue object language with computational e ects. Indeed, it is these properties that guide our language design in the callby-value case. We consider two classes of non-trivial applications: one-pass transformations into continuation-passing style and type-directed partial evaluation for call-by-name and for call-by-value.
منابع مشابه
Mechanized Reasoning for Binding Constructs in Typed Assembly Language Using Coq
Mechanized reasoning about programming languages and type systems is becoming increasingly important for the development of certified code frameworks. For instance, in order to realize the safety and security potential of proof-carrying code (PCC) [3] the development of formal, machine-checkable proofs is a necessity. Much of the difficulty and research surrounding PCC involves the generation o...
متن کاملDelegation vs Inheritance for Typestate Analysis
For several decades, inheritance and delegation have been widely adopted for code reuse in object-oriented languages. Though extensive research has explored the expressiveness of these techniques, little is known about how the choice between them affects formal reasoning. In this paper, we explore this question by describing two core languages that are identical except for the use of inheritanc...
متن کاملBehavior Programming Language and Automated Code Generation for Agent Behavior Control
Behavior-based agents are becoming increasingly used across a variety of platforms. The common approach to building such agents involves implementing the behavior synchronization and management algorithms directly in the agent’s programming environment. This process makes it hard, if not impossible, to share common components of a behavior architecture across different agent implementations. Th...
متن کاملKnowlog: A Declarative Language for Reasoning about Knowledge in Distributed Systems
In the last few years, database researchers started to investigate how recursive queries and deductive languages can be applied to find solutions to the new emerging trends in distributed computing. We think that their works are extremely valuable, but a missing piece in their proposals is the capability to express statements about the knowledge state of distributed nodes. In fact, reasoning ab...
متن کاملA Hierarchical Method for Reasoning about Distributed Programming Languages
This paper presents a technique for specifying and reasoning about the operational semantics of distributed programming languages. We formalize the concept of \vertical stacking" of distributed systems, an extension of Joyce's, Windley's and Curzon's stacking methodologies for sequential systems and of the CLI \short stack" which stacks interpreters for object code, assembly code, and a high-le...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2000