Skip to main content
Log in

Loop-invariant Optimization in the Pifagor Language

  • Published:
Automatic Control and Computer Sciences Aims and scope Submit manuscript

Abstract

The paper considers methods of program transformation equivalent to optimizing the cycle invariant, applied to the functional data-flow model implemented in the Pifagor programming language. Optimization of the cycle invariant in imperative programming languages is reduced to a displacement from the cycle of computations that do not depend on variables that are changes in the loop. A feature of the functional data flow parallel programming language Pifagor is the absence of explicitly specified cyclic computations (the loop operator). However, recurring calculations in this language can be specified recursively or by applying specific language constructs (parallel lists). Both mechanisms provide the possibility of parallel execution. In the case of optimizing a recursive function, repeated calculations are carried out into an auxiliary function, the main function performing only the calculation of the invariant. When optimizing the invariant in computations over parallel lists, the calculation of the invariant moves from the function that executes over the list items to the function containing the call. The paper provides a definition of “invariant” applied to the Pifagor language, algorithms for its optimization, and examples of program source codes, their graph representations (the program dependence graph) before and after optimization. The algorithm shown for computations over parallel lists is applicable only to the Pifagor language, because it rests upon specific data structures and the computational model of this language. However, the algorithm for transforming recursive functions may be applied to other programming languages.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1.
Fig. 2.
Fig. 3.

Similar content being viewed by others

REFERENCES

  1. Aho, A.V., Lam, M.S., Ravi Sethi, and Ullman, J.D., Compilers: Principles, Techniques, and Tools, 2006, Addison Wesley, 2nd ed.

    Google Scholar 

  2. Dortman, P.A., Program optimization in SFP, in Programmnye sredstva i matematicheskie osnovy informatiki (Software Tools and Mathematical Foundations of Informatics), Novosibirsk, 2004, pp. 43–49.

    Google Scholar 

  3. Legalov, A.I., Matkovsky, I.V., Kropacheva, M.S., Udalova, Y.V., and Vasilev, V.M., Technological aspects of creating, converting and executing functional data-flow parallel programs, Scientific Service on the Internet: All Facets of Parallelism: Proceedings of the International Supercomputer Conference, Moscow, 2013, pp. 443–447.

  4. Legalov, A.I., Vasilyev, V.S., Matkovskii, I.V., and Ushakova, M.S., Support tools for creation and transformation of functional-dataflow parallel programs, Tr. Inst. Sist. Progr. Ross. Akad. Nauk, 2017, vol. 29, no. 5, pp. 165–184.

    Google Scholar 

  5. Legalov, A.I., Functional language for creating of architectural independent parallel programs Comput. Technol., 2005, vol. 10, no. 1, pp. 71–89.

    MATH  Google Scholar 

Download references

ACKNOWLEDGMENTS

The research is supported by RFBR (research project no. 17-07-00288).

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to V. S. Vasilev or A. I. Legalov.

Additional information

The article was translated by the authors.

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Vasilev, V.S., Legalov, A.I. Loop-invariant Optimization in the Pifagor Language. Aut. Control Comp. Sci. 52, 843–849 (2018). https://doi.org/10.3103/S0146411618070295

Download citation

  • Received:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.3103/S0146411618070295

Keywords:

Navigation