Compositional Separation of Control Flow and Data Flow

Damian Arellanes
DOI: https://doi.org/10.48550/arXiv.2309.06397
2023-12-24
Abstract: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.
Logic in Computer Science
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the difficulty in separating data flow and control flow in traditional Models of High - Level Computation (MHCs). Specifically, traditional MHCs either mix data flow and control flow together or only explicitly consider one of the dimensions. This coupling makes it difficult to independently reason about the computational order and the production/consumption of data, and also complicates the verification, optimization or modification of these dimensions. To solve this problem, the author proposes a new MHC, which explicitly treats data flow and control flow as two independent dimensions and provides modular capabilities. Through this method, optimization, maintenance and verification can be carried out more conveniently. ### Specific Problem Description 1. **Coupling of Data Flow and Control Flow**: - In traditional MHCs, data flow and control flow are usually coupled together, which makes it difficult to independently analyze and optimize these two aspects. - This coupling results in the possibility that when verifying, optimizing or modifying the control flow, the data flow may be affected, and vice versa. 2. **Lack of Orthogonality**: - Existing MHCs lack the ability to orthogonally handle data flow and control flow, which limits their application and expansion in complex systems. 3. **Modularity and Composability**: - Existing models have deficiencies in terms of modularity and composability, and it is difficult to construct complex high - order computational behaviors. ### Solution The author introduces a new MHC, which is based on category theory, clearly distinguishes between data flow and control flow, and provides the following features: - **Separation of Concerns**: Data flow and control flow are clearly separated, making it possible to independently handle and optimize these two dimensions. - **Modularity**: By separating data flow and control flow, the model has better modular characteristics, which is convenient for constructing complex computational structures. - **Composability**: The model supports combinatorial operations such as sequential, parallel, branching and iterative, allowing complex computational structures to be constructed from simple computational units. Through these improvements, the new model can better support optimization, maintenance and verification, and is applicable to fields such as software engineering and artificial intelligence. ### Summary The main objective of this paper is to solve the problem of difficult separation of data flow and control flow in traditional models by introducing a new MHC, thereby improving the model's composability, modularity and orthogonal processing ability, and further supporting more complex high - order computational behaviors.