数据流设计作为一种可视化的编程语言

S. Eisenbach, Lee McLoughlin, C. Sadler
{"title":"数据流设计作为一种可视化的编程语言","authors":"S. Eisenbach, Lee McLoughlin, C. Sadler","doi":"10.1145/75199.75242","DOIUrl":null,"url":null,"abstract":"Data-flow design techniques and the functional programming style both decompose problems in a data-driven fashion. We propose a method based on data-flow diagrams which yields designs which can be mechanically translated into code written in a functional programming language. Users who specify or design systems with data-flow techniques can effectively execute their specifications or designs with a minimum of additional &sign decisions and without recourse to a programming language. Data-flow diagram elements behave as programming constructs in a “visual pmgramming” language. The paper solves a single problem to illustrate the methodology and show the kind of code produced. 1. A Functional Design Methodology The potential which a functional programming language has for producing programs capable of running on parallel hardware is beginning to be exploited by hardware designers looking to produce experimental parallel machines[l]. Ultimately these promise to turn into extremely fast, widely available computing engines on which many of the substantial processing tasks of the future will be performed. However most programmers would agree that a language like Hopc[2] imposes a “functional programming style” which may not very closely match the types of problems which they are trying to solve. The software crisis is happening in the commercial and industrial arcnas[3], not in research laboratories, and academics and rescarchcrs must be careful not to provide solutions to problems which pcople don’t actually have. What we thought was needed was a functional design methodology which decomposed typical problems in such a way that the functional programming style would suggest itself at the implementation stage. WC were attracted to the family of data driven design methodologies because there appear to be some similarities between the data driven design philosophy and the functional programming philosophy. A data driven design tcchniquc dccomposcs a problem into a network of processes linked by durujbws, this arrangement being represented pictorially as a “data-flow diagram”“, or more usually, a hierarchy of data-flow diagrams. In constructing these designs, no consideration is given to the flow of “control”. Likewise, functional programming languages are characterizcd by an absence of control-flow constructs dictated by the requirement for rcfcrcntial transparcncy[4]. Instead functions are invoked by the existence of their argumznfs (incoming flows) rather than by programmer initiation, and the evaluation model envisages the functional components of a program executing in parallel on a network of processors. A data-flow diagram can be thought of therefore as a circuit diagram for a configuration of processors built to execute the corresponding (functional) program. The problem is that a set of data-flow diagrams is an informal represenmtion of one particular aspect of a program’s design while the ultimate pmgram is formal at least in the sense that there can be no semantic ambiguity in the source-code whatever language it is written in. Traditional methodologies solve this problem by introducing more and more refined represenml&s of other design decisions via, for instance, entity-relationship. Permission to copy without fee all or part of this mate& is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publtcatron and its date appear, and notice IS given that copying is by perrruss~on of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specdic Permission. Data-Flow Design as a Visual Programming Language Department of Computing Mathematics and Statistics, Polytechnic of North London, Holloway Road, London. N78DB Great Britain diagrams or structure charts[S]. Eventually, if enough detail is supplied it is possible to transform the design into a program mechanically[6][7]. However the effort which must go into this, and the potential for introducing error, makes following the methodology practically indistinguishable from actual programming and many programmers prefer to follow their inclinations and plunge straight into code. If the target language is low-level the amount of detail required is correspondingly greater. By contrast. a very high-level language should meet the designer half-way and the transition to code could occur much carlier in the design process. We set out to find how early in the process coding could begin. We found that once the data-flow diagram stage is complete, the functions which it identifies must be specified and the structure of the data in flows and stores must be deftned. We do the former in pseudocode and the latter in a data dictionary. Together these provide enough information to generate code mechanically without any further design &xisions. To reap the benefits of automatic code generation some of the informality must be given up. For example we found it necessary to eliminate all consideration of input/output operations from the data-flow part of the design. We need to do further theoretical work to link data-flow semantics with programming constructs more formally before judging how crucial the loss of informality will be. In this paper we omit discussion of our approach to data stores which is currently rather ud hoc pending the development of facilities for pcrsistcnt data in Hope. Finally, we have not yet applied our method to as wide a range of problems as we plan to prior to refining our prototype tool. 2. Finding the Day of the Week A worked example is presented here to illustrate the application of the design technique and to show how Hope code can be mechanically derived. The problem is to read any date from (1800-2000) in the form dd/mm/yyyy and to compute the day of the week on which that date fell (or will fall). There is a concise algorithm which provides a solution to this problem@]. The day on which January 1 falls for any given year in the indicated range can be calculated from the formula: (4+Y+(Y+3)/4-(Y-17Ol/lOO+(Y-1601)/400+3)) MOD 7 where Y is the year and where Sunday corresponds to 0. The day of any date after January 1 is computed by brute force, adding up the days of the intervening months and date in the current month. This is not a complex problem but it is rich enough to demonstrate the different aspects of design and the underlying algorithm gives a fair illustration of the functional programming style 2.1. Data-flow Design Design begins with a data-flow diagram which shows the confext external inputs and outputs within which the program operates. The whole program is represented as a single process (a circle in the diagram see Figure 1) with the input “flowing” in from its source (Keyboard) and output data flowing to the sink (Screen). Decomposition consists of elaborating the functions (processes) which transform inputs into outputs in a hierarchy of diagrams. All flows and processes are named. Diagrams are constructed with the aid of a Design Editor. As a diagram is constructed simple consistency checks are applied to ensure the integrity of the diagram set. 281 01989 ACM O-89791 -305-1/89/0500/0281$00.75","PeriodicalId":435917,"journal":{"name":"International Workshop on Software Specification and Design","volume":"68 5","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1989-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"9","resultStr":"{\"title\":\"Data-flow design as a visual programming language\",\"authors\":\"S. Eisenbach, Lee McLoughlin, C. Sadler\",\"doi\":\"10.1145/75199.75242\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Data-flow design techniques and the functional programming style both decompose problems in a data-driven fashion. We propose a method based on data-flow diagrams which yields designs which can be mechanically translated into code written in a functional programming language. Users who specify or design systems with data-flow techniques can effectively execute their specifications or designs with a minimum of additional &sign decisions and without recourse to a programming language. Data-flow diagram elements behave as programming constructs in a “visual pmgramming” language. The paper solves a single problem to illustrate the methodology and show the kind of code produced. 1. A Functional Design Methodology The potential which a functional programming language has for producing programs capable of running on parallel hardware is beginning to be exploited by hardware designers looking to produce experimental parallel machines[l]. Ultimately these promise to turn into extremely fast, widely available computing engines on which many of the substantial processing tasks of the future will be performed. However most programmers would agree that a language like Hopc[2] imposes a “functional programming style” which may not very closely match the types of problems which they are trying to solve. The software crisis is happening in the commercial and industrial arcnas[3], not in research laboratories, and academics and rescarchcrs must be careful not to provide solutions to problems which pcople don’t actually have. What we thought was needed was a functional design methodology which decomposed typical problems in such a way that the functional programming style would suggest itself at the implementation stage. WC were attracted to the family of data driven design methodologies because there appear to be some similarities between the data driven design philosophy and the functional programming philosophy. A data driven design tcchniquc dccomposcs a problem into a network of processes linked by durujbws, this arrangement being represented pictorially as a “data-flow diagram”“, or more usually, a hierarchy of data-flow diagrams. In constructing these designs, no consideration is given to the flow of “control”. Likewise, functional programming languages are characterizcd by an absence of control-flow constructs dictated by the requirement for rcfcrcntial transparcncy[4]. Instead functions are invoked by the existence of their argumznfs (incoming flows) rather than by programmer initiation, and the evaluation model envisages the functional components of a program executing in parallel on a network of processors. A data-flow diagram can be thought of therefore as a circuit diagram for a configuration of processors built to execute the corresponding (functional) program. The problem is that a set of data-flow diagrams is an informal represenmtion of one particular aspect of a program’s design while the ultimate pmgram is formal at least in the sense that there can be no semantic ambiguity in the source-code whatever language it is written in. Traditional methodologies solve this problem by introducing more and more refined represenml&s of other design decisions via, for instance, entity-relationship. Permission to copy without fee all or part of this mate& is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publtcatron and its date appear, and notice IS given that copying is by perrruss~on of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specdic Permission. Data-Flow Design as a Visual Programming Language Department of Computing Mathematics and Statistics, Polytechnic of North London, Holloway Road, London. N78DB Great Britain diagrams or structure charts[S]. Eventually, if enough detail is supplied it is possible to transform the design into a program mechanically[6][7]. However the effort which must go into this, and the potential for introducing error, makes following the methodology practically indistinguishable from actual programming and many programmers prefer to follow their inclinations and plunge straight into code. If the target language is low-level the amount of detail required is correspondingly greater. By contrast. a very high-level language should meet the designer half-way and the transition to code could occur much carlier in the design process. We set out to find how early in the process coding could begin. We found that once the data-flow diagram stage is complete, the functions which it identifies must be specified and the structure of the data in flows and stores must be deftned. We do the former in pseudocode and the latter in a data dictionary. Together these provide enough information to generate code mechanically without any further design &xisions. To reap the benefits of automatic code generation some of the informality must be given up. For example we found it necessary to eliminate all consideration of input/output operations from the data-flow part of the design. We need to do further theoretical work to link data-flow semantics with programming constructs more formally before judging how crucial the loss of informality will be. In this paper we omit discussion of our approach to data stores which is currently rather ud hoc pending the development of facilities for pcrsistcnt data in Hope. Finally, we have not yet applied our method to as wide a range of problems as we plan to prior to refining our prototype tool. 2. Finding the Day of the Week A worked example is presented here to illustrate the application of the design technique and to show how Hope code can be mechanically derived. The problem is to read any date from (1800-2000) in the form dd/mm/yyyy and to compute the day of the week on which that date fell (or will fall). There is a concise algorithm which provides a solution to this problem@]. The day on which January 1 falls for any given year in the indicated range can be calculated from the formula: (4+Y+(Y+3)/4-(Y-17Ol/lOO+(Y-1601)/400+3)) MOD 7 where Y is the year and where Sunday corresponds to 0. The day of any date after January 1 is computed by brute force, adding up the days of the intervening months and date in the current month. This is not a complex problem but it is rich enough to demonstrate the different aspects of design and the underlying algorithm gives a fair illustration of the functional programming style 2.1. Data-flow Design Design begins with a data-flow diagram which shows the confext external inputs and outputs within which the program operates. The whole program is represented as a single process (a circle in the diagram see Figure 1) with the input “flowing” in from its source (Keyboard) and output data flowing to the sink (Screen). Decomposition consists of elaborating the functions (processes) which transform inputs into outputs in a hierarchy of diagrams. All flows and processes are named. Diagrams are constructed with the aid of a Design Editor. As a diagram is constructed simple consistency checks are applied to ensure the integrity of the diagram set. 281 01989 ACM O-89791 -305-1/89/0500/0281$00.75\",\"PeriodicalId\":435917,\"journal\":{\"name\":\"International Workshop on Software Specification and Design\",\"volume\":\"68 5\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1989-04-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"9\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"International Workshop on Software Specification and Design\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/75199.75242\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Workshop on Software Specification and Design","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/75199.75242","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 9

摘要

数据流设计技术和函数式编程风格都以数据驱动的方式分解问题。我们提出了一种基于数据流图的方法,该方法产生的设计可以机械地翻译成用函数式编程语言编写的代码。使用数据流技术指定或设计系统的用户可以有效地执行他们的规格或设计,而不需要使用编程语言。数据流图元素表现为“可视化编程”语言中的编程结构。本文解决了一个单独的问题来说明该方法并展示了生成的代码类型。1. 函数式编程语言在生成能够在并行硬件上运行的程序方面的潜力,正开始被硬件设计师用来开发实验性并行机器[1]。最终,它们有望变成速度极快、广泛可用的计算引擎,未来许多实质性的处理任务将在这些引擎上执行。然而,大多数程序员都同意,像Hopc[2]这样的语言强加了一种“函数式编程风格”,这可能与他们试图解决的问题类型不太匹配。软件危机发生在商业和工业领域[3],而不是在研究实验室,学者和研究人员必须小心,不要为人们实际上没有的问题提供解决方案。我们认为需要的是一种功能设计方法,这种方法可以分解典型的问题,从而使函数式编程风格在实现阶段脱颖而出。WC被数据驱动设计方法家族所吸引,因为数据驱动设计哲学和函数式编程哲学之间似乎有一些相似之处。数据驱动的设计技术将一个问题分解成一个由durujbws连接的过程网络,这种排列以图形方式表示为“数据流图”,或者更常见的是数据流图的层次结构。在构建这些设计时,没有考虑到“控制”的流程。同样地,函数式编程语言的特点是缺乏控制流结构,这是对精确透明性的要求[4]。相反,函数是通过它们的参数znfs(传入流)的存在而不是程序员初始化来调用的,并且评估模型设想了程序的功能组件在处理器网络上并行执行。因此,数据流图可以看作是为执行相应(功能性)程序而构建的处理器配置的电路图。问题是,一组数据流图是程序设计的一个特定方面的非正式表示,而最终的程序是正式的,至少在某种意义上,无论用什么语言编写,源代码中都不会有语义歧义。传统方法通过引入越来越精细的其他设计决策的表示来解决这个问题,例如,实体-关系。允许免费复制本文件的全部或部分内容,前提是这些副本不是为了直接商业利益而制作或分发的,必须出现ACM版权声明、出版物的标题和日期,并注明复制是由计算机协会授权进行的。以其他方式复制或重新发布,需要付费和/或特别许可。数据流设计作为一种可视化程序设计语言,北伦敦理工学院计算数学与统计系,伦敦霍洛威路。[78db]英国图或结构图[S]。最终,如果提供了足够的细节,就有可能将设计机械地转化为程序[6][7]。然而,必须为此付出的努力,以及引入错误的可能性,使得遵循这种方法实际上与实际编程难以区分,许多程序员更喜欢遵循自己的喜好,直接投入到代码中。如果目标语言是低级的,那么所需的细节就相应更多。相比之下。一种非常高级的语言应该满足设计者的要求,并且在设计过程中可以更早地过渡到代码。我们开始寻找过程编码可以在多早的时候开始。我们发现,一旦数据流图阶段完成,就必须指定它所标识的功能,并且必须定义流和存储中的数据结构。前者在伪代码中实现,后者在数据字典中实现。这些组合在一起提供了足够的信息来机械地生成代码,而无需任何进一步的设计和修改。为了获得自动代码生成的好处,必须放弃一些非正式性。 例如,我们发现有必要从设计的数据流部分消除对输入/输出操作的所有考虑。我们需要做进一步的理论工作,将数据流语义与编程结构更正式地联系起来,然后再判断非正式性的丧失有多重要。在本文中,我们省略了对我们的数据存储方法的讨论,该方法目前相当临时,等待Hope中实际数据的设施的发展。最后,在完善原型工具之前,我们还没有将我们的方法应用到广泛的问题中。2. 这里给出了一个有效的例子来说明设计技术的应用,并展示了如何机械地推导出Hope代码。问题是要以dd/mm/yyyy的形式读取(1800-2000)中的任何日期,并计算该日期发生(或将发生)的星期几。有一个简洁的算法可以解决这个问题@]。在指定范围内的任何年份中,1月1日的日期可由公式(4+Y+(Y+3)/4-(Y- 17ol /lOO+(Y-1601)/400+3)) MOD 7计算,其中Y为年份,星期日对应于0。1月1日之后的任何日期的天数都是通过蛮力计算的,将中间月份的天数和当前月份的日期相加。这不是一个复杂的问题,但它足够丰富,可以演示设计的不同方面,底层算法可以很好地说明函数式编程风格2.1。数据流设计设计从数据流图开始,数据流图显示程序在其中运行的外部输入和输出。整个程序被表示为单个进程(图1中的圆圈),输入数据从源(键盘)流入,输出数据流向接收(屏幕)。分解包括细化功能(过程),这些功能(过程)在图的层次结构中将输入转换为输出。所有流和流程都被命名。图表是在设计编辑器的帮助下构建的。在构造图时,应用简单的一致性检查来确保图集的完整性。281 - 1989 acm 0 -89791 -305-1/89/0500/0281$00.75
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Data-flow design as a visual programming language
Data-flow design techniques and the functional programming style both decompose problems in a data-driven fashion. We propose a method based on data-flow diagrams which yields designs which can be mechanically translated into code written in a functional programming language. Users who specify or design systems with data-flow techniques can effectively execute their specifications or designs with a minimum of additional &sign decisions and without recourse to a programming language. Data-flow diagram elements behave as programming constructs in a “visual pmgramming” language. The paper solves a single problem to illustrate the methodology and show the kind of code produced. 1. A Functional Design Methodology The potential which a functional programming language has for producing programs capable of running on parallel hardware is beginning to be exploited by hardware designers looking to produce experimental parallel machines[l]. Ultimately these promise to turn into extremely fast, widely available computing engines on which many of the substantial processing tasks of the future will be performed. However most programmers would agree that a language like Hopc[2] imposes a “functional programming style” which may not very closely match the types of problems which they are trying to solve. The software crisis is happening in the commercial and industrial arcnas[3], not in research laboratories, and academics and rescarchcrs must be careful not to provide solutions to problems which pcople don’t actually have. What we thought was needed was a functional design methodology which decomposed typical problems in such a way that the functional programming style would suggest itself at the implementation stage. WC were attracted to the family of data driven design methodologies because there appear to be some similarities between the data driven design philosophy and the functional programming philosophy. A data driven design tcchniquc dccomposcs a problem into a network of processes linked by durujbws, this arrangement being represented pictorially as a “data-flow diagram”“, or more usually, a hierarchy of data-flow diagrams. In constructing these designs, no consideration is given to the flow of “control”. Likewise, functional programming languages are characterizcd by an absence of control-flow constructs dictated by the requirement for rcfcrcntial transparcncy[4]. Instead functions are invoked by the existence of their argumznfs (incoming flows) rather than by programmer initiation, and the evaluation model envisages the functional components of a program executing in parallel on a network of processors. A data-flow diagram can be thought of therefore as a circuit diagram for a configuration of processors built to execute the corresponding (functional) program. The problem is that a set of data-flow diagrams is an informal represenmtion of one particular aspect of a program’s design while the ultimate pmgram is formal at least in the sense that there can be no semantic ambiguity in the source-code whatever language it is written in. Traditional methodologies solve this problem by introducing more and more refined represenml&s of other design decisions via, for instance, entity-relationship. Permission to copy without fee all or part of this mate& is granted provided that the copies are not made or distributed for direct commercial advantage, the ACM copyright notice and the title of the publtcatron and its date appear, and notice IS given that copying is by perrruss~on of the Association for Computing Machinery. To copy otherwise, or to republish, requires a fee and/or specdic Permission. Data-Flow Design as a Visual Programming Language Department of Computing Mathematics and Statistics, Polytechnic of North London, Holloway Road, London. N78DB Great Britain diagrams or structure charts[S]. Eventually, if enough detail is supplied it is possible to transform the design into a program mechanically[6][7]. However the effort which must go into this, and the potential for introducing error, makes following the methodology practically indistinguishable from actual programming and many programmers prefer to follow their inclinations and plunge straight into code. If the target language is low-level the amount of detail required is correspondingly greater. By contrast. a very high-level language should meet the designer half-way and the transition to code could occur much carlier in the design process. We set out to find how early in the process coding could begin. We found that once the data-flow diagram stage is complete, the functions which it identifies must be specified and the structure of the data in flows and stores must be deftned. We do the former in pseudocode and the latter in a data dictionary. Together these provide enough information to generate code mechanically without any further design &xisions. To reap the benefits of automatic code generation some of the informality must be given up. For example we found it necessary to eliminate all consideration of input/output operations from the data-flow part of the design. We need to do further theoretical work to link data-flow semantics with programming constructs more formally before judging how crucial the loss of informality will be. In this paper we omit discussion of our approach to data stores which is currently rather ud hoc pending the development of facilities for pcrsistcnt data in Hope. Finally, we have not yet applied our method to as wide a range of problems as we plan to prior to refining our prototype tool. 2. Finding the Day of the Week A worked example is presented here to illustrate the application of the design technique and to show how Hope code can be mechanically derived. The problem is to read any date from (1800-2000) in the form dd/mm/yyyy and to compute the day of the week on which that date fell (or will fall). There is a concise algorithm which provides a solution to this problem@]. The day on which January 1 falls for any given year in the indicated range can be calculated from the formula: (4+Y+(Y+3)/4-(Y-17Ol/lOO+(Y-1601)/400+3)) MOD 7 where Y is the year and where Sunday corresponds to 0. The day of any date after January 1 is computed by brute force, adding up the days of the intervening months and date in the current month. This is not a complex problem but it is rich enough to demonstrate the different aspects of design and the underlying algorithm gives a fair illustration of the functional programming style 2.1. Data-flow Design Design begins with a data-flow diagram which shows the confext external inputs and outputs within which the program operates. The whole program is represented as a single process (a circle in the diagram see Figure 1) with the input “flowing” in from its source (Keyboard) and output data flowing to the sink (Screen). Decomposition consists of elaborating the functions (processes) which transform inputs into outputs in a hierarchy of diagrams. All flows and processes are named. Diagrams are constructed with the aid of a Design Editor. As a diagram is constructed simple consistency checks are applied to ensure the integrity of the diagram set. 281 01989 ACM O-89791 -305-1/89/0500/0281$00.75
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Message from the Chairs TRMCS in TCOZ Feature Engineering Formalizing System Structure Concern-driven design for a specification language supporting component-based software engineerin
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1