Identification of the Program Text and Algorithm Correspondence Based on the Control Graph Constructive-Synthesizing Model

O. Kuropiatnyk, B. M. Yakovenko
{"title":"Identification of the Program Text and Algorithm Correspondence Based on the Control Graph Constructive-Synthesizing Model","authors":"O. Kuropiatnyk, B. M. Yakovenko","doi":"10.15802/stp2021/245666","DOIUrl":null,"url":null,"abstract":"Purpose.The main article purpose is to develop and implement the method for identifying the correspondence between the text and the program algorithm represented in the form of a flowchart. As part of the method work conversion of the input data in the graph representation is performed by means of constructive-synthesizing modelling. Methodology. To compare the program text and flowchart, we constructed a mathematical model for converting the program code into a graphical representation on the basis of control structures. To build the model, the apparatus of constructive-synthesizing modeling and its methods were used: specialization, concretization, interpretation and implementation. The graph representation of the text is created taking into account the control operators; the flowcharts are created using a json file containing the description of the diagram elements and their links. To compare the graphs we use the breadth-first search algorithm with the number of identical vertices being counted. To obtain the software implementation of the developed method and models we used the technology of object-oriented programming and CASE-technologies, which are based on the unified modeling language UML. Findings A method is proposed to present the text and the flowchart of the program in a uniform format of the directed graph (control graph) and to evaluate their correspondence by the number of identical vertices. For its formalization and automated usage, we developed constructive-synthesizing models of input data transformers. The program application was developed based on the models and the method. Originality. The methods of constructive-synthesizing modeling in the tasks of processing texts written in artificial languages were further developed. We developed the system of constructors, which transforms text program in C++ into a control graph. Practical value. The results are significant for solving such tasks as assembling program texts for borrowings detection, determining the correspondence of the program algorithms and their software implementations to improve coding skills. The graph representation produced by the developed system of constructors can be used for investigation of influence of optimization and code refactoring on the program complexity using McCabe's metrics.","PeriodicalId":120413,"journal":{"name":"Science and Transport Progress. Bulletin of Dnipropetrovsk National University of Railway Transport","volume":"25 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-08-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Science and Transport Progress. Bulletin of Dnipropetrovsk National University of Railway Transport","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.15802/stp2021/245666","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Purpose.The main article purpose is to develop and implement the method for identifying the correspondence between the text and the program algorithm represented in the form of a flowchart. As part of the method work conversion of the input data in the graph representation is performed by means of constructive-synthesizing modelling. Methodology. To compare the program text and flowchart, we constructed a mathematical model for converting the program code into a graphical representation on the basis of control structures. To build the model, the apparatus of constructive-synthesizing modeling and its methods were used: specialization, concretization, interpretation and implementation. The graph representation of the text is created taking into account the control operators; the flowcharts are created using a json file containing the description of the diagram elements and their links. To compare the graphs we use the breadth-first search algorithm with the number of identical vertices being counted. To obtain the software implementation of the developed method and models we used the technology of object-oriented programming and CASE-technologies, which are based on the unified modeling language UML. Findings A method is proposed to present the text and the flowchart of the program in a uniform format of the directed graph (control graph) and to evaluate their correspondence by the number of identical vertices. For its formalization and automated usage, we developed constructive-synthesizing models of input data transformers. The program application was developed based on the models and the method. Originality. The methods of constructive-synthesizing modeling in the tasks of processing texts written in artificial languages were further developed. We developed the system of constructors, which transforms text program in C++ into a control graph. Practical value. The results are significant for solving such tasks as assembling program texts for borrowings detection, determining the correspondence of the program algorithms and their software implementations to improve coding skills. The graph representation produced by the developed system of constructors can be used for investigation of influence of optimization and code refactoring on the program complexity using McCabe's metrics.
基于控制图构造综合模型的程序文本识别与算法对应
目的。本文的主要目的是开发和实现识别以流程图形式表示的文本和程序算法之间对应关系的方法。作为该方法的一部分,通过构造综合建模对图表示中的输入数据进行功转换。方法。为了比较程序文本和流程图,我们建立了一个数学模型,将程序代码转换为基于控制结构的图形表示。在构建模型的过程中,采用了建构综合建模装置及其方法:专门化、具体化、解释和实现。考虑到控制操作符,创建文本的图形表示;流程图是使用一个json文件创建的,该文件包含图表元素及其链接的描述。为了比较图,我们使用宽度优先搜索算法,计算相同顶点的数量。为了获得所开发方法和模型的软件实现,我们采用了基于统一建模语言UML的面向对象编程技术和case技术。提出了一种以有向图(控制图)的统一格式表示程序文本和流程图的方法,并通过相同顶点的数量来评估它们的对应性。为了使其形式化和自动化使用,我们开发了输入数据转换器的构造综合模型。基于该模型和方法开发了程序应用程序。创意。进一步发展了人工语言文本处理任务中的构造综合建模方法。我们开发了构造函数系统,将c++文本程序转换成控制图。实用价值。研究结果对于解决程序文本的汇编、借阅检测、确定程序算法及其软件实现的对应关系等问题具有重要意义。开发的构造函数系统生成的图形表示可以用于使用McCabe的度量来研究优化和代码重构对程序复杂性的影响。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信