Verification of Programs with Mutual Recursion in Pifagor Language
- Authors: Ushakova M.S.1, Legalov A.I.1
-
Affiliations:
- Siberian Federal University, Institute of Space and Information Technology
- Issue: Vol 52, No 7 (2018)
- Pages: 850-866
- Section: Article
- URL: https://journal-vniispk.ru/0146-4116/article/view/175648
- DOI: https://doi.org/10.3103/S0146411618070301
- ID: 175648
Cite item
Abstract
In the article, we consider verification of programs with mutual recursion in the data driven functional parallel language Pifagor. In this language the program could be represented as a data flow graph, that has no control connections, and only has data relations. Under these conditions it is possible to simplify the process of formal verification, since there is no need to analyse resource conflicts, which are present in the systems with ordinary architectures. The proof of programs correctness is based on the elimination of mutual recursions by program transformation. The universal method of mutual recursion of an arbitrary number of functions elimination consists in constructing the universal recursive function that simulates all the functions in mutual recursion. A natural number is assigned to each function in mutual recursion. The universal recursive function takes as its argument the number of a function to be simulated and the arguments of this function. In some cases of the indirect recursion it is possible to use a simpler method of program transformation, namely, the merging of the functions code into a single function. To remove mutual recursion of an arbitrary number of functions, it is suggested to construct a graph of all connected functions and transform this graph by removing functions that are not connected with the target function, then by merging functions with indirect recursion and finally by constructing the universal recursive function. It is proved that in the Pifagor language such transformations of functions as code merging and universal recursive function construction do not change the correctness of the initial program. The example of partial correctness proof is given for the program that parses a simple arithmetic expression. We construct the graph of all connected functions and demonstrate two methods of proofs: by means of code merging and by means of the universal recursive function.
About the authors
M. S. Ushakova
Siberian Federal University, Institute of Space and Information Technology
Author for correspondence.
Email: ksv@akadem.ru
Russian Federation, Krasnoyarsk, 660074
A. I. Legalov
Siberian Federal University, Institute of Space and Information Technology
Author for correspondence.
Email: legalov@mail.ru
Russian Federation, Krasnoyarsk, 660074
Supplementary files
