|
| 1 | +# Concept Math Specs Ideation |
| 2 | + |
| 3 | +## Executive Summary |
| 4 | + |
| 5 | +- The following research note defines out the most parsimonious schemas and relations for a concept math spec |
| 6 | +- The idea is that this can be further enhanced and plugged into other interoperable workflows |
| 7 | +- For example, schemas for the spaces can be added in at a further point and potentially have specified types |
| 8 | + |
| 9 | +## Proposed JSON Schema |
| 10 | + |
| 11 | +### Space |
| 12 | + |
| 13 | +1. Name: PrimaryKey, string |
| 14 | +2. Description: Optional, string |
| 15 | + |
| 16 | +### Block |
| 17 | + |
| 18 | +1. Name: PrimaryKey, string |
| 19 | +2. Description: Optional, string |
| 20 | +3. Domain: ForeignKeys to Space.Name, List[string] |
| 21 | +4. Codomain: ForeignKeys to Space.Name, List[string] |
| 22 | + |
| 23 | +### Wiring |
| 24 | + |
| 25 | +- Might need a name or something for IDs |
| 26 | +- Might want to consider allowing multiple target and source ports |
| 27 | + |
| 28 | +#### Option 1: |
| 29 | + |
| 30 | +1. Source: string, such as "BlockA-1" for second port of BlockA codomain |
| 31 | +2. Target: string, such as "BlockB-0" for first port of BlockB domain |
| 32 | + |
| 33 | +#### Option 2: |
| 34 | + |
| 35 | +1. SourceBlock: ForeignKey to Block.Name, string |
| 36 | +2. TargetBlock: ForeignKey to Block.Name, string |
| 37 | +3. Source Port: Related to SourceBlock.Codomain as the index, integer |
| 38 | +4. Target Port: Related to TargetBlock.Domain as the index, integer |
| 39 | + |
| 40 | + |
| 41 | +### Systems |
| 42 | + |
| 43 | +1. Name: PrimaryKey, string |
| 44 | +2. Description: Optional, string |
| 45 | +3. Wirings: ForeignKeys to Wiring, List[strings] |
| 46 | + |
| 47 | + |
| 48 | +## Current MSML Wiring & Comparison |
| 49 | + |
| 50 | +- Currently a wiring needs two components - the type (either stack or parallel) and the components, a list of blocks or wirings (there is a recursive wiring builder that makes sure the wirings get created in the right order) |
| 51 | +- For a stack block, all adjacent blocks have validations that domain and codomain map |
| 52 | +- Internally, all the port wirings are automatically built out for both mapping as well as execution |
| 53 | +- Wirings in this way can be built out to automatically map to the proposed "Wiring" schema in concept specs or potentially changed |
| 54 | +- The wirings are similar to a DAG |
| 55 | +- A stack block wiring has domain of the first component and codomain of the last component |
| 56 | +- A parallel block has the summation of component domains and component codomains |
| 57 | +- There are future potential wiring types such as a looping block or having a notation for multiple outputs of the spaces, i.e. similar to if we have 1-N outputs that are variable between a block but they all follow the same codomain space schema |
| 58 | + |
| 59 | + |
| 60 | +## Proposed Relational Schema V2 |
| 61 | + |
| 62 | +### Space |
| 63 | + |
| 64 | +1. ID: PrimaryKey |
| 65 | +2. Name: string |
| 66 | +3. Description: Optional, string |
| 67 | + |
| 68 | +### Block |
| 69 | + |
| 70 | +1. ID: PrimaryKey |
| 71 | +2. Name: string |
| 72 | +3. Description: Optional, string |
| 73 | + |
| 74 | +### Ports |
| 75 | + |
| 76 | +1. ID: PrimaryKey |
| 77 | +2. Name: string |
| 78 | +3. Index: Integer |
| 79 | +4. Space: ForeignKey to Space.Name, string |
| 80 | + |
| 81 | +### Terminals |
| 82 | + |
| 83 | +1. ID: PrimaryKey |
| 84 | +2. Name: string |
| 85 | +3. Index: Integer |
| 86 | +4. Space: ForeignKey to Space.Name, string |
| 87 | + |
| 88 | +## Proposed Schema V2 |
| 89 | + |
| 90 | +### Space |
| 91 | + |
| 92 | +{"ID": PrimaryKey, |
| 93 | +"Name": string, |
| 94 | +"Description": string} |
| 95 | + |
| 96 | +### Block |
| 97 | + |
| 98 | +{"ID": PrimaryKey, |
| 99 | +"Name": string, |
| 100 | +"Description": string, |
| 101 | +"Domain": List[Space.ID], |
| 102 | +"Codomain": List[Space.ID]} |
| 103 | + |
| 104 | +## Concrete Block |
| 105 | + |
| 106 | +{"ID": PrimaryKey, |
| 107 | +"Name": string, |
| 108 | +"Description": string, |
| 109 | +"Parent": Block.ID} |
| 110 | + |
| 111 | +- It is legal to have many to one concrete blocks of abstract blocks |
| 112 | + |
| 113 | +## Wire (Concrete Space) |
| 114 | + |
| 115 | +{"ID": PrimaryKey, |
| 116 | +"Parent": Space.ID, |
| 117 | +"SourceBlock": ConcreteBlock.ID, |
| 118 | +"TargetBlock": ConcreteBlock.ID, |
| 119 | +"SourceIndex": int, |
| 120 | +"TargetIndex": int} |
| 121 | + |
| 122 | +- Check matches up |
| 123 | + |
| 124 | +## System |
| 125 | + |
| 126 | +{"ConcreteBlocks": List[ConcreteBlock.ID], |
| 127 | +"Wires": List[Wire.ID]} |
| 128 | + |
| 129 | +- Check that: |
| 130 | + - All of the ports/domain need to be filled |
| 131 | + - All domain ports only get one input |
| 132 | + - Terminals can go 0...N ports (and they would just be sending replicas of the same output) |
0 commit comments