<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.3 20210610//EN" "JATS-journalpublishing1-3.dtd">
<article article-type="research-article" dtd-version="1.3" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="ru"><front><journal-meta><journal-id journal-id-type="publisher-id">mais</journal-id><journal-title-group><journal-title xml:lang="ru">Моделирование и анализ информационных систем</journal-title><trans-title-group xml:lang="en"><trans-title>Modeling and Analysis of Information Systems</trans-title></trans-title-group></journal-title-group><issn pub-type="ppub">1818-1015</issn><issn pub-type="epub">2313-5417</issn><publisher><publisher-name>Yaroslavl State University</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.18255/1818-1015-2018-5-534-548</article-id><article-id custom-type="elpub" pub-id-type="custom">mais-755</article-id><article-categories><subj-group subj-group-type="heading"><subject>Research Article</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="ru"><subject>Материалы конференции</subject></subj-group><subj-group subj-group-type="section-heading" xml:lang="en"><subject>Conference Papers</subject></subj-group></article-categories><title-group><article-title>Полипрограммы и бисимуляция полипрограмм</article-title><trans-title-group xml:lang="en"><trans-title>Polyprograms and Polyprogram Bisimulation</trans-title></trans-title-group></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0001-8575-9689</contrib-id><name-alternatives><name name-style="eastern" xml:lang="ru"><surname>Гречаник</surname><given-names>Сергей Александрович</given-names></name><name name-style="western" xml:lang="en"><surname>Grechanik</surname><given-names>Sergei</given-names></name></name-alternatives><bio xml:lang="ru"><p>канд. физ.-мат. наук. </p><p>Москва.</p></bio><bio xml:lang="en"><p> PhD.</p><p>Moscow.</p></bio><email xlink:type="simple">sergei.grechanik@gmail.com</email><xref ref-type="aff" rid="aff-1"/></contrib></contrib-group><aff-alternatives id="aff-1"><aff xml:lang="ru"><institution>Институт прикладной математики им. М.В. Келдыша РАН.</institution><country>Россия</country></aff><aff xml:lang="en"><institution>Keldysh Institute of Applied Mathematics.</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2018</year></pub-date><pub-date pub-type="epub"><day>28</day><month>10</month><year>2018</year></pub-date><volume>25</volume><issue>5</issue><elocation-id>534–548</elocation-id><permissions><copyright-statement>Copyright &amp;#x00A9; Гречаник С.А., 2018</copyright-statement><copyright-year>2018</copyright-year><copyright-holder xml:lang="ru">Гречаник С.А.</copyright-holder><copyright-holder xml:lang="en">Grechanik S.</copyright-holder><license xml:lang="ru" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>Данная работа распространяется под лицензией Creative Commons Attribution 4.0.</license-p></license><license xml:lang="en" license-type="creative-commons-attribution" xlink:href="https://creativecommons.org/licenses/by/4.0/" xlink:type="simple"><license-p>This work is licensed under a Creative Commons Attribution 4.0 License.</license-p></license></permissions><self-uri xlink:href="https://www.mais-journal.ru/jour/article/view/755">https://www.mais-journal.ru/jour/article/view/755</self-uri><abstract><p>Полипрограмма — это обобщение программы, допускающее множественность определений одной и той же функции. Подобные объекты возникают в различных системах преобразования программ, таких как система Бёрстолла–Дарлингтона и насыщение равенствами. В данной работе мы вводим понятие полипрограммы на нестрогом функциональном языке первого порядка. Мы определяем денотационную семантику полипрограмм и описываем некоторые преобразования полипрограмм в двух разных стилях: в стиле системы Бёрстолла–Дарлингтона и в стиле насыщения равенствами. Преобразования в стиле насыщения равенствами осуществляются над полипрограммами в расчленённой форме, в которой стирается грань между функциями и выражениями и между подстановкой и раскрытием вызова функции. Расчленённые полипрограммы хорошо подходят для реализации и проведения рассуждений, но трудны для человеческого восприятия. Мы также вводим понятие бисимуляции полипрограмм, на котором основано преобразование — слияние по бисимуляции, соответствующее доказательству эквивалентности функций по индукции или коиндукции. Бисимуляция полипрограмм — понятие, вдохновлённое понятием бисимуляции размеченных систем переходов, но несколько от него отличающееся, поскольку бисимуляция полипрограмм рассматривает каждое определение как самодостаточное, т.е. функция полипрограммы задаётся любым своим определением, в то время как в размеченной системе переходов поведение системы в состоянии определяется всей совокупностью переходов, которые можно осуществить из этого состояния. Мы предлагаем алгоритм перечисления бисимуляций некоторого определённого вида. Алгоритм состоит из двух фаз: перечисление пребисимуляций и преобразование их в бисимуляции. Такое разделение требуется из-за того, что бисимуляции полипрограмм учитывают возможность перестановки параметров функций. Мы доказываем корректность данного алгоритма, а также формулируем некоторую слабую форму его полноты. Статья публикуется в авторской редакции.</p></abstract><trans-abstract xml:lang="en"><p>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.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>полипрограммы</kwd><kwd>преобразование программ</kwd><kwd>насыщение равенствами</kwd><kwd>бисимуляция</kwd></kwd-group><kwd-group xml:lang="en"><kwd>polyprograms</kwd><kwd>program transformation</kwd><kwd>equality saturation</kwd><kwd>bisimulation</kwd></kwd-group><funding-group><funding-statement xml:lang="ru">РФФИ № 18-31-00412</funding-statement><funding-statement xml:lang="en">Russian Foundation for Basic Research, Grant N 18-31-00412</funding-statement></funding-group></article-meta></front><back><ref-list><title>References</title><ref id="cit1"><label>1</label><citation-alternatives><mixed-citation xml:lang="ru">Abel A., Altenkrich T., “A predicative analysis of structural recursion”, Journal of Functional Programming, 12:1 (2002), 1-41.</mixed-citation><mixed-citation xml:lang="en">Abel A., Altenkrich T., “A predicative analysis of structural recursion”, Journal of Functional Programming, 12:1 (2002), 1-41.</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Ariola Z. M., Klop J. W., Plump D., “Bisimilarity in Term Graph Rewriting”, Information and Computation, 156 (2000), 2-24.</mixed-citation><mixed-citation xml:lang="en">Ariola Z. M., Klop J. W., Plump D., “Bisimilarity in Term Graph Rewriting”, Information and Computation, 156 (2000), 2-24.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">Burstall R. M., Darlington J., “A transformation system for developing recursive programs”, Journal of the ACM, 24:1 (1977), 44-67.</mixed-citation><mixed-citation xml:lang="en">Burstall R. M., Darlington J., “A transformation system for developing recursive programs”, Journal of the ACM, 24:1 (1977), 44-67.</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Emelyanov P., “Analysis of equality relationships for imperative programs”, CoRR, 2006, https://arxiv.org/abs/cs/0609092.</mixed-citation><mixed-citation xml:lang="en">Emelyanov P., “Analysis of equality relationships for imperative programs”, CoRR, 2006, https://arxiv.org/abs/cs/0609092.</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">Grechanik S., “Inductive prover based on equality saturation (extended version)”, Proceedings of the Fourth International Valentin Turchin Workshop on Metacomputation, 2014, 26-53.</mixed-citation><mixed-citation xml:lang="en">Grechanik S., “Inductive prover based on equality saturation (extended version)”, Proceedings of the Fourth International Valentin Turchin Workshop on Metacomputation, 2014, 26-53.</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">Nelson G., Oppen D.C., “Fast decision procedures based on congruence closure”, Journal of the ACM, 27:2 (1980), 356-364.</mixed-citation><mixed-citation xml:lang="en">Nelson G., Oppen D.C., “Fast decision procedures based on congruence closure”, Journal of the ACM, 27:2 (1980), 356-364.</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">Sands D., “Total correctness by local improvement in the transformation of functional programs”, ACM TOPLAS, 18:2 (1996), 175-234.</mixed-citation><mixed-citation xml:lang="en">Sands D., “Total correctness by local improvement in the transformation of functional programs”, ACM TOPLAS, 18:2 (1996), 175-234.</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Tate R., Stepp M., Tatlock Z., Lerner S., “Equality saturation: a new approach to optimization”, SIGPlAn Not., 44:1 (2009), 264-276.</mixed-citation><mixed-citation xml:lang="en">Tate R., Stepp M., Tatlock Z., Lerner S., “Equality saturation: a new approach to optimization”, SIGPlAn Not., 44:1 (2009), 264-276.</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">Turchin V., “The concept of a supercompiler”, ACM TOPLAS, 8:3 (1986), 292-325.</mixed-citation><mixed-citation xml:lang="en">Turchin V., “The concept of a supercompiler”, ACM TOPLAS, 8:3 (1986), 292-325.</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">Scott D.S., “Domains for Denotational Semantics”, Automata, Languages, and Programming: 9th Colloquium Aarhus, Denmark, Lecture Notes in Computer Science, 140, 1982, 577-610.</mixed-citation><mixed-citation xml:lang="en">Scott D.S., “Domains for Denotational Semantics”, Automata, Languages, and Programming: 9th Colloquium Aarhus, Denmark, Lecture Notes in Computer Science, 140, 1982, 577-610.</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">Klyuchnikov I., Romanenko S., “Towards Higher-Level Supercompilation”, Proceedings of the Second International Workshop on Metacomputation in Russia, 2010, 82-101.</mixed-citation><mixed-citation xml:lang="en">Klyuchnikov I., Romanenko S., “Towards Higher-Level Supercompilation”, Proceedings of the Second International Workshop on Metacomputation in Russia, 2010, 82-101.</mixed-citation></citation-alternatives></ref></ref-list><fn-group><fn fn-type="conflict"><p>The authors declare that there are no conflicts of interest present.</p></fn></fn-group></back></article>
