Polyprograms and Polyprogram Bisimulation
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 fir...
Main Author: | |
---|---|
Format: | Article |
Language: | English |
Published: |
Yaroslavl State University
2018-10-01
|
Series: | Моделирование и анализ информационных систем |
Subjects: | |
Online Access: | https://www.mais-journal.ru/jour/article/view/755 |
_version_ | 1797878032265904128 |
---|---|
author | Sergei Grechanik |
author_facet | Sergei Grechanik |
author_sort | Sergei Grechanik |
collection | DOAJ |
description | 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. |
first_indexed | 2024-04-10T02:26:16Z |
format | Article |
id | doaj.art-a28e4bd1321440bc8ee75c5292654487 |
institution | Directory Open Access Journal |
issn | 1818-1015 2313-5417 |
language | English |
last_indexed | 2024-04-10T02:26:16Z |
publishDate | 2018-10-01 |
publisher | Yaroslavl State University |
record_format | Article |
series | Моделирование и анализ информационных систем |
spelling | doaj.art-a28e4bd1321440bc8ee75c52926544872023-03-13T08:07:29ZengYaroslavl State UniversityМоделирование и анализ информационных систем1818-10152313-54172018-10-0125510.18255/1818-1015-2018-5-534-548526Polyprograms and Polyprogram BisimulationSergei Grechanik0Институт прикладной математики им. М.В. Келдыша РАН.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.https://www.mais-journal.ru/jour/article/view/755полипрограммыпреобразование программнасыщение равенствамибисимуляция |
spellingShingle | Sergei Grechanik Polyprograms and Polyprogram Bisimulation Моделирование и анализ информационных систем полипрограммы преобразование программ насыщение равенствами бисимуляция |
title | Polyprograms and Polyprogram Bisimulation |
title_full | Polyprograms and Polyprogram Bisimulation |
title_fullStr | Polyprograms and Polyprogram Bisimulation |
title_full_unstemmed | Polyprograms and Polyprogram Bisimulation |
title_short | Polyprograms and Polyprogram Bisimulation |
title_sort | polyprograms and polyprogram bisimulation |
topic | полипрограммы преобразование программ насыщение равенствами бисимуляция |
url | https://www.mais-journal.ru/jour/article/view/755 |
work_keys_str_mv | AT sergeigrechanik polyprogramsandpolyprogrambisimulation |