|
2 | 2 |
|
3 | 3 | The "Block Diagram Protocol Library" or bdp-lib for short is a library for instantiating and validating fundamental block diagrams. Additional functionalities and enhancements come out of libraries which use it as the base object. |
4 | 4 |
|
| 5 | +**For full documentation please use this bdp-lib site [here](https://blockscience.github.io/bdp-lib/)** |
| 6 | + |
5 | 7 | ## Functional Requirements |
6 | 8 |
|
7 | 9 | 1. The library provides a schema for defining out the elements of a basic block diagram. |
8 | 10 | 2. The library can be extended with two primitive functionalities: |
| 11 | + |
9 | 12 | A. Modifying - Support for basic zooming, tearing and linking functions while not breaking validity rules |
| 13 | + |
10 | 14 | B. Enriching - Attatching further enhancements such as types, units, semantic labels, etc. |
11 | 15 | 3. The library performs validation for the following constraints: |
| 16 | + |
12 | 17 | A. All inputs follow the schemas supplied |
| 18 | + |
13 | 19 | B. All references (through IDs) are present |
| 20 | + |
14 | 21 | C. All ports/domains have one and only one input |
| 22 | + |
15 | 23 | D. [Optional] All blocks are connected to at least one other block |
16 | 24 |
|
17 | | -## Component Definitions |
18 | | - |
19 | | -### Space |
20 | | - |
21 | | -A space represents the values passed between blocks. |
22 | | - |
23 | | -### Block |
24 | | - |
25 | | -A block represents a unit of computation or action |
26 | | - |
27 | | -### Concrete Block |
28 | | - |
29 | | -A concrete block is a specific instance of a block |
30 | | - |
31 | | -### Wiring |
32 | | - |
33 | | -A relationship that goes from one blocks codomain to another blocks domain |
34 | | - |
35 | | -### System |
36 | | - |
37 | | -Defines out the spaces, blocks, concrete blocks and wirings used in a system |
38 | | - |
39 | | -## JSON Spec |
40 | | - |
41 | | -The JSON spec is held within docs/JSON-Spec, schema.md has the high level schema and then individual components are further defined in the linked files in great detail. That being said, the following is the underlying schema in terms of purely types. |
42 | | - |
43 | | -## Example bdp-lib Input |
44 | | - |
45 | | -```{ |
46 | | - "Spaces": [ |
47 | | - {"ID": "S1", "Name": "Space A", "Description": "A space"}, |
48 | | - {"ID": "S2", "Name": "Space B", "Description": "Another space"}, |
49 | | - {"ID": "S3", "Name": "Space C", "Description": "A third space"}, |
50 | | - ], |
51 | | - "Blocks": [ |
52 | | - { |
53 | | - "ID": "B1", |
54 | | - "Name": "Block A", |
55 | | - "Description": "A block", |
56 | | - "Domain": ["S1"], |
57 | | - "Codomain": ["S2"], |
58 | | - }, |
59 | | - { |
60 | | - "ID": "B2", |
61 | | - "Name": "Block B", |
62 | | - "Description": "Another block", |
63 | | - "Domain": ["S1"], |
64 | | - "Codomain": ["S3"], |
65 | | - }, |
66 | | - { |
67 | | - "ID": "B3", |
68 | | - "Name": "Block C", |
69 | | - "Description": "A third block", |
70 | | - "Domain": ["S2", "S3"], |
71 | | - "Codomain": ["S1", "S1"], |
72 | | - }, |
73 | | - ], |
74 | | - "ConcreteBlocks": [ |
75 | | - { |
76 | | - "ID": "CB1", |
77 | | - "Name": "Concrete Block A", |
78 | | - "Description": "A concrete block", |
79 | | - "Parent": "B1", |
80 | | - }, |
81 | | - { |
82 | | - "ID": "CB2", |
83 | | - "Name": "Concrete Block B", |
84 | | - "Description": "Another concrete block", |
85 | | - "Parent": "B2", |
86 | | - }, |
87 | | - { |
88 | | - "ID": "CB3", |
89 | | - "Name": "Concrete Block C", |
90 | | - "Description": "A third concrete block", |
91 | | - "Parent": "B3", |
92 | | - }, |
93 | | - ], |
94 | | - "Wires": [ |
95 | | - { |
96 | | - "ID": "W1", |
97 | | - "Parent": "S2", |
98 | | - "SourceBlock": "CB1", |
99 | | - "TargetBlock": "CB3", |
100 | | - "SourceIndex": 0, |
101 | | - "TargetIndex": 0, |
102 | | - }, |
103 | | - { |
104 | | - "ID": "W2", |
105 | | - "Parent": "S3", |
106 | | - "SourceBlock": "CB2", |
107 | | - "TargetBlock": "CB3", |
108 | | - "SourceIndex": 0, |
109 | | - "TargetIndex": 1, |
110 | | - }, |
111 | | - { |
112 | | - "ID": "W3", |
113 | | - "Parent": "S1", |
114 | | - "SourceBlock": "CB3", |
115 | | - "TargetBlock": "CB1", |
116 | | - "SourceIndex": 0, |
117 | | - "TargetIndex": 0, |
118 | | - }, |
119 | | - { |
120 | | - "ID": "W4", |
121 | | - "Parent": "S1", |
122 | | - "SourceBlock": "CB3", |
123 | | - "TargetBlock": "CB2", |
124 | | - "SourceIndex": 1, |
125 | | - "TargetIndex": 0, |
126 | | - }, |
127 | | - ], |
128 | | - "Systems": [ |
129 | | - { |
130 | | - "ID": "Sys1", |
131 | | - "Name": "System A", |
132 | | - "Description": "A system", |
133 | | - "ConcreteBlocks": ["CB1", "CB2", "CB3"], |
134 | | - "Wires": ["W1", "W2", "W3", "W4"], |
135 | | - } |
136 | | - ], |
137 | | -} |
138 | | -``` |
139 | 25 |
|
| 26 | +## Conceptual Framework |
| 27 | + |
| 28 | +The conceptual framework distinguishes abstract patterns that we reuse from concrete components which satisfy those patterns. The abstract patterns tell us how things can be wired together but they cannot themselves be wired, only their concrete counterparts can be wired. By preserving these seperation we can identify and take advantage of stuctural similarities in the systems we're modeling. |
| 29 | + |
| 30 | +The following table categorizes components into **abstract vs. concrete** and **structural vs. behavioral** dimensions: |
| 31 | + |
| 32 | +| | Abstract | Concrete | |
| 33 | +|--------------|-----------|-----------| |
| 34 | +| **Structure** | Space | Wire | |
| 35 | +| **Behavior** | Block | Processor | |
| 36 | + |
| 37 | +This classification provides a clear distinction between the elements of the system: |
| 38 | + |
| 39 | +- **Abstract Structure (Space)**: Represents the conceptual spaces through which data, signals, or states flow. |
| 40 | +- **Abstract Behavior (Block)**: Defines reusable templates describing how components behave in a system. |
| 41 | +- **Concrete Structure (Wire)**: Connects instantiated components (processors) according to defined spaces. |
| 42 | +- **Concrete Behavior (Processor)**: An instance of a block that interacts within the system based on its structure. |
| 43 | + |
| 44 | +In summary, **spaces and blocks define the abstract model**, while **wires and processors bring it into concrete implementation** through instantiation and connectivity. |
0 commit comments