Academia.edu no longer supports Internet Explorer.
To browse Academia.edu and the wider internet faster and more securely, please take a few seconds to upgrade your browser.
2009
…
3 pages
1 file
This paper discusses the transformation of recursive algorithms into iterative ones, particularly in the context of programming languages like Prolog that lack built-in iterative structures. It highlights the efficiency benefits of using iteration over recursion, such as reduced time and memory usage. The study details examples of how recursive procedures can be restructured to iterative forms, using Prolog code to illustrate the transformation and the associated memory optimization.
Information Processing Letters, 1976
2013
Applicative/functional programming is considerably simplified through the use of specific recursion patterns as opposed to general recursion. The viability of catamorphic recursion patterns as a pragmatic and theoretical basis makes it feasible to consider a programming language based on them. Syntactic considerations focus on notation to clarify the structures involved in the use of catamorphisms in this critical role. More fundamental semantic considerations involve the recognition that a catamorphic programming style essentially involves the treatment of data exclusively as functions and the extension of this approach to the derivation of other types of data whose behaviours are not generally catamorphic. Implementation by preprocessing into Haskell can be structured to avoid the limitations of Haskell's types, but a general regime of dynamic types seems unavoidable as an alternative. Clear connections with other work on subrecursive programming illuminates other paths for further development.
ACM Sigcse Bulletin, 2000
We propose a gradual approach to teach recursion. Our main assumption is that the difficulty in learning recursion does not come from the recursion concept itself, but from its interaction with other mechanisms of imperative programming. We use this basic idea to propose a new pedagogical approach. On the one hand, recursion is introduced in a gradual way by means of three fields (grammars, functional programming and imperative programming). On the other hand, each instance of recursion is explained so that all of its accompanying mechanisms are clearly identified.
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.
1998
Functional programming languages are shown to be useful in the teaching of the concepts of recursion and iteration. The functional language approach presented in this paper has advantages over imperative languages in the area of analysis of recursive and iterative algorithms. Examples using the J and Scheme programming languages, with emphasis on the use of functional programming notation in exposition are given. 1
2015
Dedication This dissertation is dedicated to the loving memory of my mother, Nadia. Her support, encouragement, and constant love have sustained me throughout my life. I also dedicate this dissertation to my husband, Mohamed. I give my deepest expression of love and appreciation for the encouragement that he gave and the sacrifices he made during my graduate program. iii First of all, all thanks due to ALLAH. May His peace and blessings be upon his prophet for granting me the chance to successfully complete my PhD. My heartfelt gratitude to my advisor, Professor Clifford A. Shaffer for his inspiration, enthusiasm, invaluable guidance, and patience. He has taught me many things, and this work would not have been possible without his encouragement and support. I would like to especially thank Dr. Stephen Edwards for his precious feedback and guidance. I would also like to thank my other committee members Dr. Hicham El Mongui, Dr. Jeremy Ernst and Dr. Aditya Prakash for their support, feedback and efforts reviewing my work and dissertation. It is my honor to have worked and learned from them. * In this dissertation we used the term "CS3" to open refer to a Data Structures and Algorithms course taken subsequent to a traditional CS2 course
WSEAS Transactions on Computers archive, 2009
The automatic programming system has been considered by means of which it becomes easier to carry out traditional programming stages. There is discussed both recursive forms: parallel, interrecursion and recursion of high level that exist for functional programming languages and induction methods for the purpose of their verification. The way how to present imperative languages easy and double cycles by means of recursion forms is shown, the possibility of verification has been studied for each recursion form.
Information and Software Technology, 2015
Context: In software engineering, taking a good election between recursion and iteration is essential because their efficiency and maintenance are different. In fact, developers often need to transform iteration into recursion (e.g., in debugging, to decompose the call graph into iterations); thus, it is quite surprising that there does not exist a public transformation from loops to recursion that can be used in industrial projects (i.e., it is automatic, it handles all kinds of loops, it considers exceptions, etc.).
2012 First International Workshop on Formal Methods in Software Engineering: Rigorous and Agile Approaches (FormSERA), 2012
Recursion patterns (such as "foldr" and elaborations thereof) have the potential to supplant explicit recursion in a viable subrecursive functional style of programming. Especially however in order to be able to eschew explicit recursion entirely, even in the definition of new recursion patterns, it's essential to identify and validate a minimal set of basic recursion patterns. The immediate plausibility of foldr is validated by its application to the implementation of functions and recursion patterns, and especially by an abstract characterization of the programming devices used in these applications used to overcome complementary information deficiencies in data and control.
Loading Preview
Sorry, preview is currently unavailable. You can download the paper by clicking the button above.
Partial Evaluation and Semantic-Based Program Manipulation, 2006
Science of Computer Programming, 1985
Information Processing Letters, 1984
Informatics in education, 2007
ACM SIGCSE Bulletin, 2008
Banach Center Publications, 1993
Dependable Software Engineering. Theories, Tools, and Applications, 2021
Information and Software Technology, 1990