<?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-4-358-381</article-id><article-id custom-type="elpub" pub-id-type="custom">mais-729</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>Articles</subject></subj-group></article-categories><title-group><article-title>Верификация программ со взаимной рекурсией на языке Пифагор</article-title><trans-title-group xml:lang="en"><trans-title>Verification of Programs with Mutual Recursion in the Pifagor Language</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-0003-4234-2714</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>Ushakov</surname><given-names>Mariya S.</given-names></name></name-alternatives><bio xml:lang="ru"><p>аспирант</p></bio><bio xml:lang="en"><p>graduate student</p></bio><email xlink:type="simple">ksv@akadem.ru</email><xref ref-type="aff" rid="aff-1"/></contrib><contrib contrib-type="author" corresp="yes"><contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-5487-0699</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>Legalov</surname><given-names>Alexander I.</given-names></name></name-alternatives><bio xml:lang="ru"><p>д-р техн. наук, профессор</p></bio><bio xml:lang="en"><p>doctor of science</p></bio><email xlink:type="simple">legalov@mail.ru</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>Siberian Federal University, Institute of Space and Information Technology</institution><country>Russian Federation</country></aff></aff-alternatives><pub-date pub-type="collection"><year>2018</year></pub-date><pub-date pub-type="epub"><day>27</day><month>08</month><year>2018</year></pub-date><volume>25</volume><issue>4</issue><fpage>358</fpage><lpage>381</lpage><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">Ushakov M.S., Legalov A.I.</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/729">https://www.mais-journal.ru/jour/article/view/729</self-uri><abstract><p>В работе рассматривается верификация программ со взаимной рекурсией для языка функционально-потокового параллельного программирования Пифагор. В языке используется модель представления программы в виде графа потока данных (информационного графа), в котором нет дополнительных управляющих связей, а присутствуют только информационные зависимости. Это позволяет упростить процесс верификации, так как не требует анализа возникающих в традиционных архитектурах дополнительных ресурсных конфликтов. Доказательство корректности программы опирается на удаление взаимных рекурсий посредством преобразования программы. Универсальным способом удаления взаимной рекурсии произвольного количества функций является построение универсальной рекурсивной функции, которая выполняет работу всех исходных функций и принимает, кроме аргумента выполняемой функции, натуральное число, являющееся номером выполняемой функции. В ряде случаев, когда присутствует косвенная рекурсия, можно использовать более простой способ преобразования — объединение кода функций, при котором происходит объединение тел вызывающих друг друга функций. Для преобразования произвольной рекурсии в прямую предлагается построение графа всех связанных функций и последующая трансформация данного графа путём удаления функций, не связанных с рассматриваемой, объединения косвенно рекурсивных функций и построения универсальной рекурсивной функции. Доказывается, что изменение функции на языке Пифагор при объединении кода и построении универсальной рекурсивной функции не влияет на корректность исходной программы. Приводится пример доказательства частичной корректности программы на языке Пифагор, осуществляющей синтаксический разбор простого арифметического выражения. После построения графа всех связанных функций рассматриваются два способа доказательства: с использованием объединения кода функций и с построением универсальной рекурсивной функции.</p></abstract><trans-abstract xml:lang="en"><p>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 has only 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 the 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. An 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.</p></trans-abstract><kwd-group xml:lang="ru"><kwd>функционально-потоковое параллельное программирование</kwd><kwd>язык программирования Пифагор</kwd><kwd>корректность рекурсий</kwd><kwd>удаление взаимной рекурсии</kwd><kwd>универсальная рекурсивная функция</kwd></kwd-group><kwd-group xml:lang="en"><kwd>data driven functional parallel programming</kwd><kwd>Pifagor programming language</kwd><kwd>correctness of recursions</kwd><kwd>elimination of mutual recursion</kwd><kwd>universal recursive function</kwd></kwd-group><funding-group><funding-statement xml:lang="ru">Исследование выполняется при финансовой поддержке РФФИ в рамках научного проекта № 17-07-00288</funding-statement><funding-statement xml:lang="en">The research is supported by RFBR (research project No 17-07-00288)</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">Непомнящий В. А., Рякин О. М., Прикладные методы верификации программ, Радио и связь, М., 1988, 255 с.</mixed-citation><mixed-citation xml:lang="en">Nepomnyashchiy V. A., Ryakin O. M., Prikladnye metody verifikatsii programm, Radio i svyaz, M., 1988, 255 pp., (in Russian).</mixed-citation></citation-alternatives></ref><ref id="cit2"><label>2</label><citation-alternatives><mixed-citation xml:lang="ru">Boyer R.S., Moore J.S., A computational logic, Academic Press, New York, 1979, 420 pp.</mixed-citation><mixed-citation xml:lang="en">Boyer R.S., Moore J.S., A computational logic, Academic Press, New York, 1979, 420 pp.</mixed-citation></citation-alternatives></ref><ref id="cit3"><label>3</label><citation-alternatives><mixed-citation xml:lang="ru">Vazou N., Seidel E.L., Jhala R., Vytiniotis D., Peyton-Jones S., “Refinement Types for Haskell”, SIGPLAN Not., 49:9 (2014), 269–282.</mixed-citation><mixed-citation xml:lang="en">Vazou N., Seidel E.L., Jhala R., Vytiniotis D., Peyton-Jones S., “Refinement Types for Haskell”, SIGPLAN Not., 49:9 (2014), 269–282.</mixed-citation></citation-alternatives></ref><ref id="cit4"><label>4</label><citation-alternatives><mixed-citation xml:lang="ru">Giesl J., “Termination of nested and mutually recursive algorithms”, Journal of Automated Reasoning, 19:1 (1997), 1–29.</mixed-citation><mixed-citation xml:lang="en">Giesl J., “Termination of nested and mutually recursive algorithms”, Journal of Automated Reasoning, 19:1 (1997), 1–29.</mixed-citation></citation-alternatives></ref><ref id="cit5"><label>5</label><citation-alternatives><mixed-citation xml:lang="ru">Легалов А. И., “Функциональный язык для создания архитектурно-независимых параллельных программ”, Вычислительные технологии, 10:1 (2005), 71–89</mixed-citation><mixed-citation xml:lang="en">Legalov A. I., “Functional language for creating of architectural independent parallel programs”, Computational Technologies, 10:1 (2005), 71–89, (in Russian).</mixed-citation></citation-alternatives></ref><ref id="cit6"><label>6</label><citation-alternatives><mixed-citation xml:lang="ru">Кропачева М. С., Легалов А. И., “Формальная верификация программ, написанных на функционально-потоковом языке параллельного программирования”, Моделирование и анализ информационных систем, 19:5 (2012), 81–99</mixed-citation><mixed-citation xml:lang="en">Kropacheva M. S., Legalov A. I., “Formal Verification of Programs in the Functional DataFlow Parallel Language”, Automatic Control and Computer Sciences, 47:7 (2013), 373– 384</mixed-citation></citation-alternatives></ref><ref id="cit7"><label>7</label><citation-alternatives><mixed-citation xml:lang="ru">Ushakova M. S., Legalov A. I., “Automation of Formal Verification of Programs in the Pifagor Language”, Modeling and Analysis of Information Systems, 22:4 (2015), 578–589.</mixed-citation><mixed-citation xml:lang="en">Ushakova M. S., Legalov A. I., “Automation of Formal Verification of Programs in the Pifagor Language”, Modeling and Analysis of Information Systems, 22:4 (2015), 578–589.</mixed-citation></citation-alternatives></ref><ref id="cit8"><label>8</label><citation-alternatives><mixed-citation xml:lang="ru">Giesl J., “Termination of nested and mutually recursive algorithms”, Journal of Automated Reasoning, 19:1 (1997), 1–29.</mixed-citation><mixed-citation xml:lang="en">Giesl J., “Termination of nested and mutually recursive algorithms”, Journal of Automated Reasoning, 19:1 (1997), 1–29.</mixed-citation></citation-alternatives></ref><ref id="cit9"><label>9</label><citation-alternatives><mixed-citation xml:lang="ru">Bevers E., Lewi J., “Proving termination of (conditional) rewrite systems”, Acta Informatica, 30:6 (1993), 537–568.</mixed-citation><mixed-citation xml:lang="en">Bevers E., Lewi J., “Proving termination of (conditional) rewrite systems”, Acta Informatica, 30:6 (1993), 537–568.</mixed-citation></citation-alternatives></ref><ref id="cit10"><label>10</label><citation-alternatives><mixed-citation xml:lang="ru">Plumer L., Termination Proofs for Logic Programs, Lecture Notes in Artificial Intelligence, 446, 1990, 142 pp.</mixed-citation><mixed-citation xml:lang="en">Plumer L., Termination Proofs for Logic Programs, Lecture Notes in Artificial Intelligence, 446, 1990, 142 pp.</mixed-citation></citation-alternatives></ref><ref id="cit11"><label>11</label><citation-alternatives><mixed-citation xml:lang="ru">Giesl J., “Termination Analysis for Functional Programs Using Term Orderings”, International Static Analysis Symposium, LNCS, 983, 1995, 154–171.</mixed-citation><mixed-citation xml:lang="en">Giesl J., “Termination Analysis for Functional Programs Using Term Orderings”, International Static Analysis Symposium, LNCS, 983, 1995, 154–171.</mixed-citation></citation-alternatives></ref><ref id="cit12"><label>12</label><citation-alternatives><mixed-citation xml:lang="ru">Walther C., “On Proving the Termination of Algorithm by Machine”, Artificial Intelligence, 71:1 (1994), 101–157.</mixed-citation><mixed-citation xml:lang="en">Walther C., “On Proving the Termination of Algorithm by Machine”, Artificial Intelligence, 71:1 (1994), 101–157.</mixed-citation></citation-alternatives></ref><ref id="cit13"><label>13</label><citation-alternatives><mixed-citation xml:lang="ru">Кушниренко А. Г., Лебедев Г. В., Программирование для математиков, Наука, М., 1988, 384 с.</mixed-citation><mixed-citation xml:lang="en">Kushnirenko A. G., Lebedev G. V., Programmirovanie dlya matematikov, Nauka, M., 1988, 384 pp., (in Russian).</mixed-citation></citation-alternatives></ref><ref id="cit14"><label>14</label><citation-alternatives><mixed-citation xml:lang="ru">Головешкин В. А., Ульянов М. В., Теория рекурсии для программистов, Физматлит, М., 2006, 296 с.</mixed-citation><mixed-citation xml:lang="en">Goloveshkin V. A., Ul’yanov M. V., Teoriya rekursii dlya programmistov, Fizmatlit, M., 2006, 296 pp., (in Russian).</mixed-citation></citation-alternatives></ref><ref id="cit15"><label>15</label><citation-alternatives><mixed-citation xml:lang="ru">Мальцев А. И., Алгоритмы и рекурсивные функции, Наука, М., 1986, 368 с.</mixed-citation><mixed-citation xml:lang="en">Mal’tsev A. I., Algoritmy i rekursivnye funktsii, Nauka, M., 1986, 368 pp., (in Russian).</mixed-citation></citation-alternatives></ref><ref id="cit16"><label>16</label><citation-alternatives><mixed-citation xml:lang="ru">Hoare C. A. R., “An axiomatic basis for computer programming”, Communications of the ACM, 10:12 (1969), 576–585.</mixed-citation><mixed-citation xml:lang="en">Hoare C. A. R., “An axiomatic basis for computer programming”, Communications of the ACM, 10:12 (1969), 576–585.</mixed-citation></citation-alternatives></ref><ref id="cit17"><label>17</label><citation-alternatives><mixed-citation xml:lang="ru">Ушакова М. С., “Семантика типов данных функционально-потокового языка параллельного программирования Пифагор”, Образовательные ресурсы и технологии, 2016, № 2(14), 263–269</mixed-citation><mixed-citation xml:lang="en">Ushakova M. S., “Semantics of program data types for functional data-flow parallel programming language Pifagor”, Educational resources and technologies, 2016, № 2(14), 263–269, (in Russian).</mixed-citation></citation-alternatives></ref><ref id="cit18"><label>18</label><citation-alternatives><mixed-citation xml:lang="ru">Шилов Н. В., Основы синтаксиса, семантики, трансляции и верификации программ, Издательство СО РАН, Новосибирск, 2009, 340 с.</mixed-citation><mixed-citation xml:lang="en">Shilov N. V., Osnovy sintaksisa, semantiki, translyatsii i verifikatsii programm, Izdatelstvo SO RAN, Novosibirsk, 2009, 340 pp., (in Russian).</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>
