scispace - formally typeset
Search or ask a question

Showing papers on "Program transformation published in 1997"


Journal ArticleDOI
TL;DR: ADIC (Automatic Differentiation of C), a new AD tool for ANSI-C programs, is introduced and a modular design that provides a foundation for both rapid prototyping of better AD algorithms and their sharing across AD tools for different languages is described.
Abstract: In scientific computing, we often require the derivatives ∂f/∂x of a function f expressed as a program with respect to some input parameter(s) x, say. Automatic Differentiation (AD) techniques augment the program with derivative computation by applying the chain rule of calculus to elementary operations in an automated fashion. This article introduces ADIC (Automatic Differentiation of C), a new AD tool for ANSI-C programs. ADIC is currently the only tool for ANSI-C that employs a source-to-source program transformation approach; that is, it takes a C code and produces a new C code that computes the original results as well as the derivatives. We first present ADIC ‘by example’ to illustrate the functionality and ease of use of ADIC and then describe in detail the architecture of ADIC. ADIC incorporates a modular design that provides a foundation for both rapid prototyping of better AD algorithms and their sharing across AD tools for different languages. A component architecture called AIF (Automatic Differentiation Intermediate Form) separates core AD concepts from their language-specific implementation and allows the development of generic AD modules that can be reused directly in other AIF-based AD tools. The language-specific ADIC front-end and back-end canonicalize C programs to make them fit for semantic augmentation and manage, for example, the association of a program variable with its derivative object. We also report on applications of ADIC to a semiconductor device simulator, 3-D CFD grid generator, vehicle simulator, and neural network code. © 1997 John Wiley & Sons, Ltd.

202 citations


Journal Article
TL;DR: Current data abstraction mechanisms are not adequate to control sharing of state in the general case involving objects in linked structures and the pervading possibility of sharing is a source of errors and an obstacle to language implementation techniques.
Abstract: Current data abstraction mechanisms are not adequate to control sharing of state in the general case involving objects in linked structures. The pervading possibility of sharing is a source of errors and an obstacle to language implementation techniques. We present a general extension to programming languages which makes the ability to share state a first class property of a data type, resolving a long-standing flaw in existing data abstraction mechanisms. Balloon types enforce a strong form of encapsulation: no state reachable (directly or transitively) by a balloon object is referenced by any external object. Syntactic simplicity is achieved by relying on a non-trivial static analysis as the checking mechanism. Balloon types are applicable in a wide range of areas such as program transformation, memory management and distributed systems. They are the key to obtaining self-contained composite objects, truly opaque data ions and value types-important concepts for the development of large scale, provably correct programs.

189 citations


Proceedings Article
20 Nov 1997
TL;DR: It is shown how, given type and mode information about procedures in a logic program, it is possible to (semi-automatically) derive nontrivial lower bounds on their computational costs.
Abstract: It is generally recognized that information about the runtime cost of computations can be useful for a variety of applications, including program transformation, granularity control during parallel execution, and query optimization in deductive databases. Most of the work to date on compile-time cost estimation of logic programs has focused on the estimation of upper bounds on costs. However, in many applications, such as parallel implementations on distributed-memory machines, one would prefer to work with lower bounds instead. The problem with estimating lower bounds is that in general, it is necessary to account for the possibility of failure of head unification, leading to a trivial lower bound of 0. In this paper, we show how, given type and mode information about procedures in a logic program, it is possible to (semi-automatically) derive nontrivial lower bounds on their computational costs. We also discuss the cost analysis for the special and frequent case of divide-and-conquer programs and show how —as a pragmatic short-term solution —it may be possible to obtain useful results simply by identifying and treating divide-and-conquer programs specially.

102 citations


Patent
05 Aug 1997
TL;DR: In this paper, a software-implemented method for validating the correctness of parallel computer programs, written in various programming languages, with respect to these programs' corresponding sequential computer programs is presented.
Abstract: A software-implemented method for validating the correctness of parallel computer programs, written in various programming languages, with respect to these programs' corresponding sequential computer programs. Validation detects errors that could cause parallel computer programs to behave incorrectly or to produce incorrect results, and is accomplished by transforming these parallel computer programs under the control of a general purpose computer and sequentially executing the resulting transformed programs. The validation method is system-independent and is portable across various computer architectures and platforms since validation is accomplished via program transformation; thus, the method does not depend on the features of a particular hardware architecture or configuration, operating system, compiler, linker, or thread environment. The input to the validation method is a parallel computer program. The parallel computer program results from annotating its corresponding sequential computer program with a parallelism specification; the annotations describe constraints in the sequential program to be relaxed to allow the exploitation of parallelism. Validation is accomplished by detecting semantic inconsistencies between the parallel computer program and its corresponding sequential computer program. The validation method translates the input parallel computer program into a second, sequential computer program such that the second sequential computer program, when executed, detects and reports the semantic inconsistencies between the parallel computer program and its corresponding sequential computer program.

81 citations


Proceedings ArticleDOI
01 May 1997
TL;DR: Syntax from Concrete Syntax as discussed by the authors ] is a syntax from concrete syntax (SCTS) based approach for syntactically annotated concrete syntactic expressions. But
Abstract: Syntax from Concrete Syntax

77 citations


Book ChapterDOI
03 Sep 1997
TL;DR: The basis of the tracing method is a program transformation carried out by the compiler: transformed programs compute the same values as the original, but embedded in functional data structures that also include redex trails showing how the values were obtained.
Abstract: We describe the design and implementation of a system for tracing computations in a lazy functional language The basis of our tracing method is a program transformation carried out by the compiler: transformed programs compute the same values as the original, but embedded in functional data structures that also include redex trails showing how the values were obtained A special-purpose display program enables detailed but selective exploration of the redex trails, with cross-links to the source program

72 citations


Journal ArticleDOI
TL;DR: This work presents the first source-level profiler for a compiled, nonstrict, higher-order, purely functional language capable of measuring time as well as space usage and gives a formal specification of the attribution of execution costs to cost centers.
Abstract: We present the first source-level profiler for a compiled, nonstrict, higher-order, purely functional language capable of measuring time as well as space usage. Our profiler is implemented in a production-quality optimizing compiler for Haskell and can successfully profile large applications. A unique feature of our approach is that we give a formal specification of the attribution of execution costs to cost centers. This specification enables us to discuss our design decisions in a precise framework, prove properties about the attribution of costs, and examine to effects of different program transformations on the attribution of costs. Since it is not obvious how to map this specification onto a particular implementation, we also present an implementation-oriented operational semantics, and prove it equivalent to the specification.

71 citations


Journal ArticleDOI
01 Jul 1997
TL;DR: This paper investigates the theoretical limitations and practical problems of standard specialization tools, presents multi-level specialization, and demonstrates that, in combination with the cogen approach, it is far more practical than previously supposed.
Abstract: Program specialization can divide a computation into several computation stages. This paper investigates the theoretical limitations and practical problems of standard specialization tools, presents multi-level specialization, and demonstrates that, in combination with the cogen approach, it is far more practical than previously supposed. The program generator which we designed and implemented for a higher-order functional language converts programs into very compact multi-level generating extensions that guarantee fast successive specialization. Experimental results show a remarkable reduction of generation time and generator size compared to previous attempts of multi-level specialization by self-application. Our approach to multi-level specialization seems well-suited for applications where generation time and program size are critical.

58 citations


Journal ArticleDOI
TL;DR: A fault-classification scheme and a fault-seeding method that are based on the manifestation of faults in the program dependence graph (PDG) are presented and the operation of the fault seeder is used to perform a study of the effectiveness of dataflow testing and mutation testing.

44 citations


Book ChapterDOI
01 May 1997
TL;DR: In this article, the authors describe an approach to constructing software that can help not only to ensure the correctness of numerical computations but also automate much of the drudge-work involved in preparing such software.
Abstract: Writing correct numerical software is a complex, demanding, and, at times, even a boring, task. In this chapter, we describe an approach to constructing software—program specification and transformation—and allied tools that can help not only to ensure the correctness of numerical computations but also automate much of the drudge-work involved in preparing such software. This approach to software construction holds out the exciting prospect of enabling the numerical analyst or specialist in scientific computing to concentrate on correctly capturing the problem to be solved, while delegating the details of programming the software and adapting it to specialized computing environments to automated tools.

43 citations


01 Jan 1997
TL;DR: It is shown how, given type and mode information about procedures in a logic program, it is possible to derive non-trivial lower bounds on their computational costs, and experimental results from a preliminary implementation of the proposed approach are presented.
Abstract: It is generally recognized that information about the runtime cost of computations can be useful for a variety of applications, including program transformation, granularity control during parallel execution, and query optimization in deductive databases Most of the work to date on compile-time cost estimation of logic programs has focused on the estimation of upper bounds on costs However, in many applications, such as parallel implementations on distributed-memory machines, one would prefer to work with lower bounds instead The problem with estimating lower bounds is that in general, it is necessary to account for the possibility of failure of head unification, leading to a trivial lower bound of 0 In this paper, we show how, given type and mode information about procedures in a logic program, it is possible to (semi-automatically) derive non-trivial lower bounds on their computational costs We also discuss the cost analysis for the special and frequent case of divide-and-conquer programs and show how — as a pragmatic short-term solution — it may be possible to obtain useful results simply by identifying and treating divide-and-conquer programs specially Finally, we present experimental results from a preliminary implementation of the proposed approach, applied to automatic parallel task size control

Proceedings ArticleDOI
11 Nov 1997
TL;DR: This work builds upon recent results by Hogsted, Carter, and Ferrante (1997), who aim at determining the cumulated idle time spent by all processors while executing the partitioned (tiled) computation domain and provides an accurate solution for all values of the rise parameter.
Abstract: In the framework of fully permutable loops, tiling has been studied extensively as a source-to-source program transformation. We build upon recent results by Hogsted, Carter, and Ferrante (1997), who aim at determining the cumulated idle time spent by all processors while executing the partitioned (tiled) computation domain. We propose new, much shorter proofs of all their results and extend these in several important directions. More precisely, we provide an accurate solution for all values of the rise parameter that relates the shape of the iteration space to that of the tiles, and for all possible distributions of the tiles to processors. In contrast, the authors in Hogsted, Carter, and Ferrante (1997) deal only with a limited number of cases and provide upper bounds rather than exact formulas.

Patent
Peter F. Sweeney1, Frank Tip1
02 Oct 1997
TL;DR: In this article, the authors propose a mechanism that eliminates redundant components from objects of a program by detecting situations where a member of a given class is used by some, but not all instances of that class, and the elimination of this member from the instances where it is not needed.
Abstract: A mechanism is provided that eliminates redundant components from objects of a program. Specifically, the mechanism is capable of detecting situations where a member of a given class is used by some, but not all instances of that class, and the elimination of this member from the instances where it is not needed. This is accomplished by an analysis of the program and its class hierarchy, followed by the construction of a new, specialized class hierarchy and a transformation of the program. These operations preserve the original behavior of the program, and have the effect of “optimizing away” unneeded class members from objects. The invention is also capable of replacing class hierarchies that exhibit virtual inheritance with class hierarchies that only exhibit nonvirtual inheritance, and is applicable across a broad spectrum of inheritance structures. Transformation of virtual into nonvirtual inheritance improves program performance because it reduces the time required to access members that are located in virtual base classes. In addition, it may reduce the space required to represent objects.

Proceedings ArticleDOI
01 Jan 1997
TL;DR: This work considers a set of transformation rules which extend the ones used for partial evaluation, and proposes a strategy to direct the application of these extended rules so to derive very efficient specialized programs.
Abstract: Program specialization is a collection of program transformation techniques for improving program efficiency by exploiting some information available at compile-time about the input data. We show that current techniques for program specialization based on partial evaluation do not perform well on nondeterministic logic programs. We then consider a set of transformation rules which extend the ones used for partial evaluation, and we propose a strategy to direct the application of these extended rules so to derive very efficient specialized programs. The efficiency improvements which may even be exponential, are achieved because the derived programs are semi-deterministic and the operations which are performed by the initial programs in different branches of the computation trees, are performed in the specialized programs within single branches. We also make use of mode information to guide the unfolding process and to reduce nondeterminism. To exemplify our technique, we show that we can automatically derive very efficient semi-deterministic matching programs and semi-deterministic parsers for regular languages. The derivations we have performed could not have been done by previously known partial evaluation techniques.

Book ChapterDOI
01 Jul 1997
TL;DR: This work considers an example application of the π-calculus, the programming language Pict of Pierce and Turner, primarily in order to see how far it is possible to argue, from facts about the application, that some model is the most appropriate.
Abstract: The concurrency theory literature contains many proposals for models of process algebras. We consider an example application of the π-calculus, the programming language Pict of Pierce and Turner, primarily in order to see how far it is possible to argue, from facts about the application, that some model is the most appropriate. We discuss informally the sense in which the semantics of Pict relates to the behaviour of actual implementations. Based on this we give an operational model of the interactions between a Pict implementation (considered as the abstract behaviour of a C program) and its environment (modelling an operating system and user). We then give a class of abstract machines and a definition of abstract machine correctness, using an adapted notion of testing, and prove that a sample abstract machine is indeed correct. We briefly discuss the standard of correctness appropriate for program transformations and the induced precongruence. Many of the semantic choices do indeed turn out to be determined by facts about Pict.

Journal Article
TL;DR: This talk shows that this technique, augmented by a preliminary abstract interpretation, can yield safe, efficient execution of programs in an unsafe language, and a change in program style, from one list representation to another.
Abstract: Earlier work has shown that partial evaluation of a self-interpreter with respect to an input program can be used to effect program transformation. This talk shows that this technique, augmented by a preliminary abstract interpretation, can yield, among many other transformations: . Safe, efficient execution of programs in an unsafe language, and . A change in program style, from one list representation to another Further, partial evaluation can be viewed as an on-line polyvariant abstract interpretation, augmented by code generation. This view generalizes conventional projection-based partial evaluation in the direction of Turchin's supercompilation.

Book ChapterDOI
15 Sep 1997
TL;DR: A complete set of rules to turn an arbitrary program into a normal form is presented; this form is the parallel composition of very simple subprocesses, allowing a very flexible analysis of how they can be combined to produce the final result of the partitioning.
Abstract: In this paper we present a characterisation of the hardware/software partitioning problem as a program transformation task. Both the input and the output of the partitioning are expressed as processes in occam, and the partitioning itself is conducted by the application of a set of rules derived from an algebraic semantics of occam. The partitioning is designed in such a way to allow the complete separation of the efficiency and the correctness aspects of the process. A complete set of rules to turn an arbitrary program into a normal form is presented; this form is the parallel composition of very simple subprocesses, allowing a very flexible analysis of how they can be combined (in clusters) to produce the final result of the partitioning.

Journal ArticleDOI
TL;DR: The development of a method to identify objects in legacy systems, specifically those coded in the imperative language, FORTRAN-77, is discussed, using a modification of the program slicing concept introduced by Weiser in 1984.

Book ChapterDOI
08 Sep 1997
TL;DR: This talk shows that this technique, augmented by a preliminary abstract interpretation, can yield, among many other transformations, safe, efficient execution of programs in an unsafe language, and a change in program style, from one list representation to another.
Abstract: Earlier work has shown that partial evaluation of a self-interpreter with respect to an input program can be used to effect program transformation. This talk shows that this technique, augmented by a preliminary abstract interpretation, can yield, among many other transformations: • Safe, efficient execution of programs in an unsafe language, and • A change in program style, from one list representation to another

Book ChapterDOI
08 Sep 1997
TL;DR: A new method to achieve set-based analysis reusing the main transformation described in [FSV Y91], and it is expected that this tree automaton approach will lead to an efficient implementation, contrary to the first conclusions of [ FSVY91].
Abstract: Compile-time program analysis aims to extract from a program properties useful for efficient implementations and sofware verification. A property of interest is the computational semantics of a program. For decidability reasons, only an approximation of this semantics can be computed. Set-based analysis [Hei92a] provides an elegant and accurate method for this. In the logic programming framework, this computation can be related to type inference [MR85]. In [FSVY91], a simpler presentation based on program transformation and algorithms on alternating tree automata is proposed. Unfortunately, the authors focussed on type checking (i.e. a membership test to the approximate semantics). We propose in this paper a new method to achieve set-based analysis reusing the main transformation described in [FSV Y91]. The main tool for both computation and representation of the result of set-based analysis is tree automata. This leads to a global and coherent presentation of the problem of set-based analysis combined with the simplicity of [FSVY91]. We obtain also a complexity characterization for the problem and our method. We expect that this tree automaton approach will lead to an efficient implementation, contrary to the first conclusions of [FSVY91].

Journal Article
TL;DR: A program transformation is introduced that simply ignores synchronization, and a success semantics is introduced, which is equivalent to the standard semantics thus justifying the use of suspension analysis to generate sound approximations for suspension-free programs.
Abstract: Because of synchronization based on blocking ask, some of the most important techniques for data flow analysis of (sequential) constraint logic programs (clp) are no longer applicable to cc languages. In particular, the generalized approach to the semantics, intended to factorize the (standard) semantics so as to make explicit the domain-dependent features (i.e. operators and semantic objects which may be influenced by abstraction) becomes useless for relevant applications. A possible solution to this problem is based on a more abstract (non-standard) semantics: the success semantics, which models non suspended computations only. With a program transformation (NoSynch) that simply ignores synchronization, we obtain a clp-like program which allows us to apply standard techniques for data flow analysis. For suspension-free programs the success semantics is equivalent to the standard semantics thus justifying the use of suspension analysis to generate sound approximations. A second transformation (Angel) is introduced, applying a different abstraction of synchronization in possibly suspending programs and resulting in a framework which is adequate to suspension analysis. Applicability and accuracy of these solutions are investigated.

Book ChapterDOI
28 Jul 1997
TL;DR: A deeper analysis of the transformation approach's complexity is presented and an optimized SCC-oriented evaluation is described and it is shown that by the method no more work is done than by the alternating fixpoint procedure.
Abstract: We present a bottom-up algorithm for the computation of the well-founded model of non-disjunctive logic programs which is based on the set of elementary program transformations studied by Brass and Dix [4, 5]. The transformation approach has been introduced in more detail in [7]. In this paper we present a deeper analysis of its complexity and describe an optimized SCC-oriented evaluation. We show that by our method no more work is done than by the alternating fixpoint procedure [23, 24] and that there are examples where our algorithm is significantly superior.

Book ChapterDOI
08 Sep 1997
TL;DR: A static analysis method is proposed for inferring how many times each communication channel is used during execution of concurrent programs: a type system that is sensitive to usage information is constructed for this purpose and a type reconstruction algorithm is developed.
Abstract: Powerful concurrency primitives in recent concurrent languages and thread libraries provide the great flexibility about implementation of high-level features like concurrent objects. However, they are so low-level that they often make it difficult to check global correctness of programs or to perform aggressive code optimization. We propose a static analysis method for inferring how many times each communication channel is used during execution of concurrent programs: a type system that is sensitive to usage information is constructed for this purpose and a type reconstruction algorithm is developed. Our analysis can, in particular, automatically detect linear channels (communication channels used just once): as studied by Kobayashi, Pierce, and Turner, they are very useful for reasoning about program behavior and aggressive code optimization. Our analysis has already been implemented and applied to the compiler of a concurrent language HACL; we present the results of simple benchmarks to show performance improvement gained by our analysis.

Book ChapterDOI
TL;DR: This paper studies the semantic properties of a general transformation technique called unfolding in the context of functional logic languages, and proves that the resulting transformation still preserves the computed answer semantics of the initial program, under the usual conditions for the completeness of innermost conditional narrowing.
Abstract: Functional logic languages with a complete operational semantics are based on narrowing, a generalization of term rewriting where unification replaces matching. In this paper, we study the semantic properties of a general transformation technique called unfolding in the context of functional logic languages. Unfolding a program is defined as the application of narrowing steps to the calls in the program rules in some appropriate form. We show that, unlike the case of pure logic or pure functional programs, where unfolding is correct w.r.t. practically all available semantics, unrestricted unfolding using narrowing does not preserve program meaning, even when we consider the weakest notion of semantics the program can be given. We single out the conditions which guarantee that an equivalent program w.r.t. the semantics of computed answers is produced. Then, we study the combination of this technique with a folding transformation rule in the case of innermost conditional narrowing, and prove that the resulting transformation still preserves the computed answer semantics of the initial program, under the usual conditions for the completeness of innermost conditional narrowing. We also discuss a relationship between unfold/fold transformations and partial evaluation of functional logic programs.

Book ChapterDOI
10 Jul 1997
TL;DR: This work provides a theoretical basis for studying the termination of tabled logic programs executed under SLG-resolution using a left-to-right computation rule, and presents a characterisation of quasi-termination by means of the notion of semi-acceptability of ttable programs.
Abstract: We provide a theoretical basis for studying the termination of tabled logic programs executed under SLG-resolution using a left-to-right computation rule To this end, we study the classes of quasi-terminating and LG-terminating programs (for a set of atomic goals S) These are tabled logic programs where execution of each call from S leads to only a finite number of different (ie, non-variant) calls, and a finite number of different calls and computed answer substitutions for them, respectively We then relate these two classes through a program transformation, and present a characterisation of quasi-termination by means of the notion of quasi-acceptability of tabled programs The latter provides us with a practical method of proving termination and the method is illustrated on non-trivial examples of tabled logic programs

Book ChapterDOI
14 Apr 1997
TL;DR: This work shows how the control generation problem can be tackled with a simple automatic transformation that relies on information about the depths of SLD-trees and introduces the notion of a semi delay recurrent program which generalises previous ideas in the termination literature for reasoning about logic programs with dynamic selection rules.
Abstract: The objective of control generation in logic programming is to automatically derive a computation rule for a program that is efficient and yet does not compromise program correctness. Progress in solving this important problem has been slow and, to date, only partial solutions have been proposed where the generated programs are either incorrect or inefficient. We show how the control generation problem can be tackled with a simple automatic transformation that relies on information about the depths of SLD-trees. To prove correctness of our transform we introduce the notion of a semi delay recurrent program which generalises previous ideas in the termination literature for reasoning about logic programs with dynamic selection rules.

Journal ArticleDOI
TL;DR: The aim of this paper is to introduce a technique, called program window inference, to handle contextual information during derivations in the refinement calculus, borrowed from a technique for handling context in theorem proving.

Journal ArticleDOI
TL;DR: An alternating fixpoint semantics of update programs is described and it is shown that it can express all nondeterministic database transformations.
Abstract: The paper presents a language of update programs that integrates logical queries, bulk updates and hypothetical reasoning in a seamless manner. There is no syntactic or semantic distinction between queries and updates. Update programs extend logic programs with negation in both syntax and semantics. They allow bulk updates in which an arbitrary update is applied simultaneously for all answers of an arbitrary query. Hypothetical reasoning is naturally supported by testing the success or failure of an update. We describe an alternating fixpoint semantics of update programs and show that it can express all nondeterministic database transformations.

Journal ArticleDOI
TL;DR: This paper introduces a new approach, called region-based compilation, wherein the compiler, after inlining, repartitions the program into more desirable compilation units, termed regions, allowing the compiler to control problem size and complexity while exposing inter-procedural scheduling, optimization and code motion opportunities.
Abstract: The most important task of a compiler designed to exploit instruction-level parallelism (ILP) is instruction scheduling. If higher levels of ILP are to be achieved, the compiler must use, as the unit of scheduling, regions consisting of multiple basic blocks—preferably those that frequently execute consecutively, and which capture cycles in the program’s execution. Traditionally, compilers have been built using the function as the unit of compilation. In this framework, function boundaries often act as barriers to the formation of the most suitable scheduling regions. Function inlining may be used to circumvent this problem by assembling strongly coupled functions into the same compilation unit, but at the cost of very large function bodies. Consequently, global optimizations whose compile time and space requirements are superlinear in the size of the compilation unit, may be rendered prohibitively expensive. This paper introduces a new approach, called region-based compilation, wherein the compiler, after inlining, repartitions the program into more desirable compilation units, termed regions. Region-based compilation allows the compiler to control problem size and complexity while exposing inter-procedural scheduling, optimization and code motion opportunities.

Book ChapterDOI
10 Jul 1997
TL;DR: Schema-based program transformation has been proposed as an effective technique for the optimisation of logic programs as discussed by the authors, where schemata are applied to a logic program, mapping inefficient constructs to more efficient ones.
Abstract: Schema-based program transformation [8] has been proposed as an effective technique for the optimisation of logic programs. Schemata are applied to a logic program, mapping inefficient constructs to more efficient ones. One challenging aspect of the technique is that of proving that the schemata are correct.