Preview

Modeling and Analysis of Information Systems

Advanced search

Polyprograms and Polyprogram Bisimulation

https://doi.org/10.18255/1818-1015-2018-5-534-548

Abstract

A polyprogram is a generalization of a program which admits multiple definitions of a single function. Such objects arise in different transformation systems, such as the Burstall-Darlington framework or equality saturation. In this paper, we introduce the notion of a polyprogram in a non-strict first-order functional language. We define denotational semantics for polyprograms and describe some possible transformations of polyprograms, namely we present several main transformations in two different styles: in the style of the Burstall-Darlington framework and in the style of equality saturation. Transformations in the style of equality saturation are performed on polyprograms in decomposed form, where the difference between functions and expressions is blurred, and so is the difference between substitution and unfolding. Decomposed polyprograms are well suited for implementation and reasoning, although they are not very human-readable. We also introduce the notion of polyprogram bisimulation which enables a powerful transformation called merging by bisimulation, corresponding to proving equivalence of functions by induction or coinduction. Polyprogram bisimulation is a concept inspired by bisimulation of labelled transition systems, but yet it is quite different, because polyprogram bisimulation treats every definition as self-sufficient, that is a function is considered to be defined by any of its definitions, whereas in an LTS the behaviour of a state is defined by all transitions from this state. We present an algorithm for enumerating polyprogram bisimulations of a certain form. The algorithm consists of two phases: enumerating prebisimulations and converting them to proper bisimulations. This separation is required because polyprogram bisimulations take into account the possibility of parameter permutation. We prove correctness of this algorithm and formulate a certain weak form of its completeness. The article is published in the author’s wording.

About the Author

Sergei Grechanik
Keldysh Institute of Applied Mathematics.
Russian Federation

 PhD.

Moscow.



References

1. Abel A., Altenkrich T., “A predicative analysis of structural recursion”, Journal of Functional Programming, 12:1 (2002), 1-41.

2. Ariola Z. M., Klop J. W., Plump D., “Bisimilarity in Term Graph Rewriting”, Information and Computation, 156 (2000), 2-24.

3. Burstall R. M., Darlington J., “A transformation system for developing recursive programs”, Journal of the ACM, 24:1 (1977), 44-67.

4. Emelyanov P., “Analysis of equality relationships for imperative programs”, CoRR, 2006, https://arxiv.org/abs/cs/0609092.

5. Grechanik S., “Inductive prover based on equality saturation (extended version)”, Proceedings of the Fourth International Valentin Turchin Workshop on Metacomputation, 2014, 26-53.

6. Nelson G., Oppen D.C., “Fast decision procedures based on congruence closure”, Journal of the ACM, 27:2 (1980), 356-364.

7. Sands D., “Total correctness by local improvement in the transformation of functional programs”, ACM TOPLAS, 18:2 (1996), 175-234.

8. Tate R., Stepp M., Tatlock Z., Lerner S., “Equality saturation: a new approach to optimization”, SIGPlAn Not., 44:1 (2009), 264-276.

9. Turchin V., “The concept of a supercompiler”, ACM TOPLAS, 8:3 (1986), 292-325.

10. Scott D.S., “Domains for Denotational Semantics”, Automata, Languages, and Programming: 9th Colloquium Aarhus, Denmark, Lecture Notes in Computer Science, 140, 1982, 577-610.

11. Klyuchnikov I., Romanenko S., “Towards Higher-Level Supercompilation”, Proceedings of the Second International Workshop on Metacomputation in Russia, 2010, 82-101.


Review

For citations:


Grechanik S. Polyprograms and Polyprogram Bisimulation. Modeling and Analysis of Information Systems. 2018;25(5):534–548. https://doi.org/10.18255/1818-1015-2018-5-534-548

Views: 897


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 License.


ISSN 1818-1015 (Print)
ISSN 2313-5417 (Online)