2022-05-28T07:45:30Zhttps://nagoya.repo.nii.ac.jp/oaioai:nagoya.repo.nii.ac.jp:000094082021-03-01T11:59:48Z項書換えにおける逆計算へのプログラム変換アプローチTransformational approach to inverse computation in term rewritingNishida, Naoki26892In this thesis, we approach by program transformation to inverse computation in term rewriting.Inverse computation of a given program (or function) is the calculation of the possible input of the program for a given output. Inverse interpreters are algorithmic approaches to inverse computation, which computes the possible input from a given program and a given output. Inverse compilers are transformational approaches, which generates from a given program a program computing the possible input of the given program for a given output. Such a generated program is called an inverse program of the given program. Once the inverse program is generated for the given program, inverse computation can be done by the inverse program inputing a given output of the original program. In this thesis, we propose inverse compilers for term rewriting systems (TRSs, for short). As the first step, we treat a class of TRSs, called PT-TRSs. PT-TRSs can define pure treeless functions which are often used in program transformations and have the future that each argument of defined symbols appearing in the right-hand side is a variable. While they can be easily treated in program transformation, their syntax is very restrictive and the class of functions defined as PT-TRSs is narrow. Hence we extend the inverse compiler for PT-TRSs to that for constructor TRSs. Constructor TRSs includes PT-TRSs properly, and it is known that their computation power is equivalent to that of Turing machines.Both of the inverse compilers proposed in this thesis are consisting of two parts. The first part is an actual inverse compiler that generates from a given TRS a conditional TRS(CTRS) which computes inverse of the given TRS. We show the correctness of our inverse compilers by proving that the generated CTRSs are inverse programs of the given TRSs. The second part is a program transformation of the generated CTRS into a TRS with extra variables, which is considered to be equivalent to the generated CTRS. TRSs with extra variables are called EV-TRSs, which can contain extra variables in the right-hand sides of their rewrite rules. Extra variables are variables which appear in the conditional part or the right-hand side of a conditional rewrite rule but not in the left-hand side. In order to show the correctness of the program transformation in the second part, we show soundness and completeness of the generated EV-TRSs with respect to the terms which are treated by the input CTRSs.We also show the general relationships between the syntactic properties of the input TRS and its inverse EV-TRS generated by our inverse compilers. Three of such relationships are very important. One is that the generated EV-TRSs are constructor systems. A second is that the generated EV-TRS is a TRS if the input TRS is non-erasing. The other is that the generated EV-TRS is right-linear (left-linear) if the input is left-linear (right-linear, respectively).EV-TRSs contain two serious problems for practical use of them. One is that their one-step of rewrite relation by a rule which contains an extra variable is infinitely branching even if renamed terms are regarded as the same. The other is that they are not terminating at all if extra variables are contained. Therefore, EV-TRSs in general cannot be executed efficiently. Unfortunately, the inverse programs generated by out inverse compilers are EV-TRSs. Therefore a simulation method of rewrite relation of EV-TRS s is necessary.To simulate rewrite relation of EV-TRS s, we show that narrowing substituting a fresh variable for each extra variable can simulate, as a narrowing sequence starting from ground terms, a rewrite sequence of a given EV-TRS if the EV-TRS is right-linear or any redex which is reduced in the rewrite sequence is not introduced by means of extra variables. Since narrowing is finitely branching up to renaming and those starting from ground terms are sometimes terminating, the above problems of EV-TRSs are avoided. Since the narrowing of TRSs on ground terms is equal to the rewrite relation of them and every rewrite sequence of TRSs can be considered as a ground rewrite sequence, the computation of TRSs can be also done by the narrowing. Hence, the input and output programs of our inverse compilers can be worked on the same interpretation. Termination is one of the important properties of computation. Since the computation of our inverse EV-TRSs is simulated by narrowing, to guarantee the termination of the inverse computation by our approaches, we propose two termination proof methods of narrowing, especially starting from ground terms. One is based on the notion of active chains, and another is based on the dependency pair method which is a termination proof method for rewrite relations of TRSs. Solutions of inverse computation are not always unique, and hence all solution search is necessary. However, it is known that all solution search is expensive. For the purpose of improving efficiency of inverse computation, we show that basic narrowing is sufficient to simulate rewrite sequences of right-linear EV-TRSs. Since the left-linearity is often assumed in first-order functional programs and inverse EV-TRSs of linear constructor TRSs are right-linear, this result is useful for the efficience of our inverse computation. We also show that for linear constructor EV-TRSs, all normal forms of a given terminating term can be obtained by innermost narrowing. To generate innermost-terminating inverse TRSs, we give a condition on the relationship between the depth of the both hand sides of each rewrite rules in the input non-erasing TRSs. The condition for each rule is that the root symbol of the right-hand side is not a defined symbol, the depth of the left-hand side is two or less if the right-hand side is a variable, or less than the number of constructors in the shortest path from the root to variables or defined symbols in the right-hand side.Since every redex is innermost in rewrite sequences representing inverse computation, innermost termination is sufficient as termination of inverse computation. As an extension of the proposed inverse compilers, we tackle partial inverse computation. Partial inverse computation is the calculation of some of the possible unknown input for a program, a given output and the known input. We extend the inverse compiler for constructor TRS s into a compiler which generate a CTRS computing partial inverses of the input TRS. Finally, we give some examples as applications of the generated inverse compilers. These shows that inverse compilers are advantageous over inverse interpreters.名古屋大学博士学位論文 学位の種類:博士(工学) (課程) 学位授与年月日:平成16年3月25日thesis2004-03-25application/pdf13901甲第6287号http://hdl.handle.net/2237/11185https://nagoya.repo.nii.ac.jp/record/9408/files/ko6287.pdfeng