A Theoretical Foundation for Generation of Equivalent Transformation Rules (Program Transformation, Symbolic Computation and Algebraic Manipulation)

In the “Equivalent Transformation model” (ET model), computation is regarded as equivalent transformation (ET) of declarative descriptions, and programs consist of ET rules and control description. Programs may be improved by adoption of each new rule, and finally a correct and efficient program may be obtained. A method for generating equivalent transformation rules from a given set of definite clauses is proposed. In this method, we generate new equivalent transformation rules by transforming meta-descriptions, each of which represents many problem descriptions. We also develop a theoretical foundation for the method based on the concept of equivalence of meta-descriptions. 1 Difficulty of Unfolding 1.1 Problem Solving by unfolding Many problems can be solved by transforming the problem description equivalently into a simpler form. For example, let $P$ be a set consisting of the following definite clauses, where $app$ means append. initial$(X, z)arrow app(X,Y, Z)$ . $app([A|X], Y, [A|Z])arrow app(X, Y, Z)$ . $app([], \mathrm{Y},Y)arrow$ . We consider two problems, $(q_{1}, P)$ and $(q_{2}, P)$ , where $q_{1}=\dot{i}n\dot{i}t\dot{i}al([1,2], [1,2,3,4])$ , $q_{2}=initial(x, [1,2,3])$ . When given the first query $q_{1}$ , we first make a set of definite clauses: $P_{1}=P\cup\{yesarrow initial([1,2], [1,2,3,4])\}$ . Then, $P_{1}$ is transformed equivalently as follows (Only the yes clause in $P_{1}$ is changed.). $yesarrow initial([1,2], [1,2,3,4])$ . $yesarrow app([1,2],Y, [1,2,3,4])$ . $yesarrow app([2], Y, [2,3,4])$ . $yesarrow app([],Y, [3,4])$ . $yesarrow$ . From this transformation, the answer “yes” is obtained. When given the second query $q_{2}=initial(x, [1,2,3])$ , we first make a new set of definite clauses: $P_{2}=P\cup\{anS(x)arrow in\dot{i}tial(X, [1,2,3])\}$ . Then, $P_{2}$ is transformed equivalently as follows (Only the ans clause in $P_{2}$ is changed.). 1: ans $(X)\triangleleft-initial(x, [1,2,3])$ . 2: ans$(X)arrow app(X,Y, [1,2,3])$ . 3: ans $([])arrow$ . ans$([1|W])arrow app(W,Y, [2,3])$ . 4: ans$([])arrow$ . ans $([1])arrow$ . 数理解析研究所講究録 1125巻 2000年 44-58 44

[1]  Yoshihiko Futamura,et al.  Essence of Generalized Partial Computation , 1991, Theor. Comput. Sci..