Every constructive model of computation (CMC) has an underlying composition mechanism for combining simple computation devices into more complex ones. Composition can be done by (explicitly or implicitly) defining control flow, data flow or any combination thereof. Control flow specifies the order in which individual computation devices are activated, whereas data flow defines how data is exchanged among them. Unfortunately, traditional CMCs either mix data and control or only consider one dimension explicitly, which makes it difficult to reason about data flow and control flow separately. Reasoning about these dimensions orthogonally is a crucial desideratum for optimisation, maintainability and verification purposes. In this paper, we introduce a novel model that explicitly treats data flow and control flow as separate dimensions, while providing modularity. As the model is rooted in category theory, it provides category-theoretic operations for compositionally constructing sequential or parallel composites. Compositionality entails that a composite exhibits the same properties as its respective constituents, including separation of concerns and modularity.
翻译:每一种计算构造模型(CMC)都内在地包含一种组合机制,用于将简单的计算设备组合成更复杂的系统。组合可以通过(显式或隐式地)定义控制流、数据流或两者的任意结合来实现。控制流规定了各个计算设备的激活顺序,而数据流则定义了设备间的数据交换方式。遗憾的是,传统的CMC要么将数据流与控制流混合处理,要么仅显式考虑其中一个维度,这使得难以分别对数据流与控制流进行推理。从正交角度对这两个维度进行推理对于优化、可维护性和验证至关重要。本文提出了一种新型模型,该模型将数据流与控制流明确视为两个独立维度,同时保持模块化特性。由于该模型基于范畴论,它提供了范畴论运算来组合构造顺序或并行的组合体。组合性意味着组合体与其各个组成部分具有相同的性质,包括关注点分离和模块化。