A Strategy For Semi-automatic Program Development
2005
Sign up for access to the world's latest research
Abstract
In this paper we first review the knowledge-based approach to software construction. The knowledge-based approach to software develoment promises attractive solutions to the problems plaguing software develoment. But to realize these benefits knowledge about programming must be well understood, formalized and engineered into a functioning system. This paper presents some aspects of such a formalization, describing knowledge about the procedural implementation of recursive functions and about data structure selection. A significant feature of this approach is that a single transformation may substantially affect the program form, implenienting a high-level design decision. A detailed derivation of a depth-first search algorithm to compute the height of a directed acyclic graph is presented.
Related papers
digital.library.ksu.edu.sa
The paper presents a critical overview of the development in the area of automating the program formation. seen in a broader perspecti ve from automatic program synthesis to computer aided software engineering. The fundamental problems are identified in the area of automatic program synthesis, intelligent support of software development, computer aided software engineering. The trends in related fields, e&pecially in artificial intelligence are surveyed and the possible influence is evaluated. Need for urgent development of theory of programming is recognised. In parallel, knowledge engineering methods should be considered because they allow building models of the respective domain.
Lecture Notes in Computer Science, 1998
Program Synthesis, which is the task of discovering programs that realize user intent, can be useful in several scenarios: discovery of new algorithms, helping regular programmers automatically discover tricky/mundane programming details, enabling people with no programming background to develop scripts for performing repetitive tasks (end-user programming), and even problem solving in the context of automating teaching. In this tutorial, I will describe the three key dimensions that should be taken into account in designing any program synthesis system: expression of user intent, space of programs over which to search, and the search technique [1]. (i) The user intent can be expressed in the form of logical relations between inputs and outputs, input-output examples, demonstrations, natural language, and inefficient or related programs. (ii) The search space can be over imperative or functional programs (with possible restrictions on the control structure or the operator set), or over restricted models of computations such as regular/context-free grammars/transducers, or succinct logical representations. (iii) The search technique can be based on exhaustive search, version space algebras, machine learning techniques (such as belief propagation or genetic programming), or logical reasoning techniques based on SAT/SMT solvers. I will illustrate these concepts by brief description of various program synthesis projects that target synthesis of a wide variety of programs such as standard undergraduate textbook algorithms (e.g., sorting, dynamic programming), program inverses (e.g., decoders, deserializers), bitvector manipulation routines, deobfuscated programs, graph algorithms, text-manipulating routines, geometry algorithms etc.
Proceedings of the Second International Conference on Evaluation of Novel Approaches to Software Engineering, 2007
Rule-based programming paradigm is omnipresent in number of engineering domains. However, there are some fundamental semantical differences between it, and classic procedural, or object-oriented approaches. Even though, there has been a lot of effort to use rules to model business logic in classic software no generic solution has been provided so far. In this paper a new approach for generalized rule-based programming is given. It is based on a use of advanced rule representation, which includes an extended attribute-based language, a non-monotonic inference strategy, with explicit inference control on the rule level. The paper shows how some typical programming constructions, as well as classic programs can be modelled in this approach. The approach can largely improve both the design and the implementation of complex software.
Lecture Notes in Computer Science, 2001
Automatic Programming (AP) systems have been used in a great variety of ways since the early days of software engineering. They have been used in AI related research approaches with the aim to generate computer programs from informal, incomplete, natural language-like specifications as well as in more pragmatic approaches related to 4th level languages. Terms such as "application generator", "transformational system", "code synthesizer", "generative software development" were used for naming various approaches to AP. This paper presents a categorization scheme for AP systems. In this categorization scheme, a clear distinction is made between the AI related, hard AP-and soft AP systems. After that, a broad range of AP systems as well as their position in the categorization scheme is presented. Finally we discuss the relation between AP and software reuse. 8 W. Goebl Approaches to Soft Automatic Programming Formal Specification (general purpose, 100%, formal language) Formal languages like Z can be used to define the behavior of a system completely. Most approaches on AP systems using formal languages do not focus on a domain but are general purpose, and aim at full generation. The advantage of formal languages is that they can easily be transformed by transformation rules. Producing the generated code is done step-by-step. The system doing the code production process is more a transformer or synthesizer than a generator. AP systems using formal specifications are often called "Code Synthesizers" or "Transformation System". A good example for a program synthesis system using formal specifications is the approach by Dershowitz [21]. A formal specification of the program is transformed step-by-step into executable code. The transformations are performed by synthesis rules that generate code to solve the current goal or transform the goal in one or more sub-goals. Although Dershowitz achieves the final programs using his transformation system, it requires considerable input from the user to guide the system and provide the correct goals [12]. Jia and Skevoulis [22] present an approach to synthesizing functional and robust code from object-oriented design models and Z specifications (a formal language) and operation specifications. It is based on an integrated notation of the Unified Modeling Language and a slightly extended Z notation to include object-oriented concepts and structures. The approach provides a number of choices for different design and implementation schemes from which the developer can choose the best ones for the problem at hand. Code is generated which is fully functional and can be compiled and executed without modifications. The approach does not focus on any domain. Currently there is just a research prototype, which demonstrates the feasibility of this approach. There is a wide agreement that formal approaches have proved to be too slow and unwieldy for practical use. It is very difficult for most people to specify problems formally, and it is too computational expensive for even the fastest hardware to automatically derive programs from specifications [9]. Most formal specification languages require the same sort of care and attention to detail that traditional programming requires [10].
The Computer Journal, 1999
The transformation of a recursive program to an iterative equivalent is a fundamental operation in Computer Science. In the reverse direction, the task of reverse engineering (analysing a given program in order to determine its specification) can be greatly ameliorated if the program can be re-expressed in a suitable recursive form. But the existing recursion removal transformations, such as the techniques discussed by Knuth [1] and Bird [2], can only be applied in the reverse direction if the source program happens to match the structure produced by a particular recursion removal operation. In this paper we describe a much more powerful recursion removal and introduction operation which describes its source and target in the form of an action system (a collection of labels and calls to labels). A simple, mechanical, restructuring operation can be applied to a great many iterative programs which will put them in a suitable form for recursion introduction. Our transformation generates strictly more iterative versions than the standard methods, including those of Knuth and Bird [1,2]. With the aid of this theorem we prove a (somewhat counterintuitive) result for programs that contain sequences of two or more recursive calls: under a reasonable commutativity condition, "depth-first" execution is more general than "breadth-first" execution. In "depth-first" execution, the execution of each recursive call is completed, including all sub-calls, before execution of the next call is started. In "breadth-first" execution, each recursive call in the sequence is partially executed but any sub-calls are temporarily postponed. This result means that any breadth-first program can be reimplemented as a corresponding depth-first program, but the converse does not hold. We also treat the case of "random-first" execution, where the execution order is implementation dependent. For the more restricted domain of tree searching we show that breadth first search is the most general form. We also give two examples of recursion introduction as an aid to formal reverse engineering.
Computer Aided Verification, 2013
Input-output examples are a simple and accessible way of describing program behaviour. Program synthesis from input-output examples has the potential of extending the range of computational tasks achievable by end-users who have no programming knowledge, but can articulate their desired computations by describing input-output behaviour. In this paper, we present Escher, a generic and efficient algorithm that interacts with the user via input-output examples, and synthesizes recursive programs implementing intended behaviour. Escher is parameterized by the components (instructions) that can be used in the program, thus providing a generic synthesis algorithm that can be instantiated to suit different domains. To search through the space of programs, Escher adopts a novel search strategy that utilizes special data structures for inferring conditionals and synthesizing recursive procedures. Our experimental evaluation of Escher demonstrates its ability to efficiently synthesize a wide range of programs, manipulating integers, lists, and trees. Moreover, we show that Escher outperforms a state-ofthe-art SAT-based synthesis tool from the literature.
IEEE Transactions on Software Engineering, 1990
The Kestrel Interactive Development System (KIDS) provides automated support for the development of correct and e cient programs from formal specications. The system has components for performing algorithm design, deductive inference, program simpli cation, partial evaluation, nite di erencing optimizations, data type re nement, compilation, and other development operations. Although their application is interactive, all of the KIDS operations are automatic except the algorithm design tactics which require some interaction at present. Dozens of programs have been derived using the system and we believe that KIDS could be developed to the point that it becomes economical to use for routine programming. To illustrate the use of KIDS, we trace the derivation of an algorithm for enumerating solutions to the k-queens problem. The initial algorithm that KIDS designs takes about sixty minutes on a SUN-4/110 to nd all 92 solutions to the 8-queens problem instance. The nal optimized version nds the same solutions in under one second.
Software & Microsystems
The need is argued for a rigorous and general theory of structured programming as a basis for improving software quality. Formal graph theoretic methods are developed which allow the structural modelling, metrication and reconstruction of sequential programs in terms of precisely defined general sets of basic control structures. Throughout, concepts are illustrated by examples based on actual Basic and Pascal text.
Journal of King Saud University - Computer and Information Sciences, 1996
The paper investigates possibilities of writing programs with having the relevant knowledge on programing available in explicity fonn. in order to perform experiments, a knowledge base was built which codes some of the knowledge related to the problem of selecting a proper data type in the process of program formation. The base is presented in paper along with one experiment which also shows the system performance and user-system interaction. The experiment setting is such that the llser makes a guess which data type is appropriate to use and this hypothesis is either confirmed or rejected by the system. Moreover, as a result of the system's deductive reasoning other acceptable data types are proposed by the system. The result shows that the system is able to provide an advice to a programer. This can be particularly useful in the process of learning programing.

Loading Preview
Sorry, preview is currently unavailable. You can download the paper by clicking the button above.
References (8)
- R. Balzer, T. Cheatham, C. Green, "Software technology in the 1990's: using a new paradigm," Computer Magazine, 1983.
- R. Burstall, and J. Darlington, "A transfor- mational sys tern for developing recursive pro- grams, " J. Ass Comp. Mach., vol. 24, 1, Jan. 1977.
- A. Goldberg, and R. Paige, "Stream Pro- cessing," ACM Conf. Lisp and Functional Pro- gramming, 1984.
- G. Kotik, "Knowledge-based compilation of high-level datatypes," technical report, Kestrel Institute, 1983.
- R. Kowalski, Logic for problem solving, North Holland, 1979.
- Z. Manna, and R. Waldinger, "A deductive approach to program synthesis, " ACM Trans. Programming Language Syst. (TUPLAS), vol. 2, 1, pp. 90-121, Jan. 1980.
- W. Scherlis, and D. Scott, "First steps toward inferential programming," technical report, Dept. of Computer Science, Carnegie- Mellon University, 1983.
- SI E. Shonberg, J. Schwartz, and M. Sharir, "An automatic technique for selection of data representations in SETL programs, " ACM Trans. Programming Language Syst. (TOPLAS), vol. 3, 2, pp. 126-143, April 1981.