Every Model of High-Level Computation (MHC) 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 computations are activated, whereas data flow defines how data is exchanged among them. Unfortunately, traditional MHCs 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 MHC 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, parallel, branchial or iterative composites. Compositionality entails that a composite exhibits the same properties as its respective constituents, including separation of concerns and modularity. We conclude the paper by demonstrating how our proposal can be used to model high-level computations in two different application domains: software engineering and artificial intelligence.
翻译:每一种高级计算模型(MHC)都拥有一种底层的组合机制,用于将简单的计算设备组合成更复杂的设备。组合可以通过(显式或隐式地)定义控制流、数据流或其任意组合来实现。控制流规定了各独立计算被激活的顺序,而数据流则定义了数据如何在它们之间传递。遗憾的是,传统的高级计算模型要么将数据流与控制流混合在一起,要么仅显式考虑其中一个维度,这使得难以对数据流和控制流进行独立推理。正交地推理这些维度是优化、可维护性和验证的一个关键理想目标。在本文中,我们引入了一种新颖的高级计算模型,该模型将数据流与控制流作为两个独立的维度显式处理,同时提供了模块化特性。由于该模型植根于范畴论,它提供了范畴论运算,用于组合地构造顺序、并行、分支或迭代复合体。组合性意味着复合体与其各自组成部分具有相同的性质,包括关注点分离和模块化。最后,我们通过展示我们的提议如何用于在两个不同应用领域(软件工程和人工智能)中建模高级计算来结束本文。