リビジョン | 0a19ae72ffee29f969aa58f518b813a2b8b17a3c (tree) |
---|---|
日時 | 2023-11-09 06:11:16 |
作者 | Albert Mietus < albert AT mietus DOT nl > |
コミッター | Albert Mietus < albert AT mietus DOT nl > |
more AR docs
@@ -28,7 +28,7 @@ | ||
28 | 28 | |BR| |
29 | 29 | Alternatively, each component can be a process, where te several processes communicate with e.g. unix-pipes, or |
30 | 30 | network-connections). And there are many more option, not only separated in space, but also in time: As the AIGR can be |
31 | -serialised [#pickle]_, it is possible to save it in file, and read it for the next component, later ... | |
31 | +serialised [#pickle]_, it is possible to save it in file, and read it for the next component, later ... | |
32 | 32 | |
33 | 33 | .. Important:: Although it is possible to saving a (pickled) AIGR, that component (nor action) is **NOT** a `Writer`! |
34 | 34 |
@@ -67,10 +67,10 @@ | ||
67 | 67 | |
68 | 68 | .. uml:: AIGR_Transformers.puml |
69 | 69 | :align: right |
70 | + :scale: 50% | |
70 | 71 | |
71 | 72 | FSM |
72 | 73 | --- |
73 | - | |
74 | 74 | In Castle, one can directly describe a FSM (see: :ref:`FSMs-are-needed`) including advance/extended variants. Like |
75 | 75 | the non-deterministic “NFA”s, and the “State-Charts” (known from UML), with orthogonale regions and hierarchically |
76 | 76 | ‘superstates’. See :need:`U_FSM_Syntax` for the demands. |
@@ -104,7 +104,7 @@ | ||
104 | 104 | the receiving event-handler expect a traditional call, will not work. By choosing one Machinery-Transformer, all |
105 | 105 | bolt-and nuts will fit. |
106 | 106 | |
107 | -.. caution:: This is not an requirement | |
107 | +.. caution:: This is **not** an requirement! | |
108 | 108 | |
109 | 109 | One can imagine, that (eventually) a Mixed-Machinery is used. Ultimately, only the details of each (individual) |
110 | 110 | connection should be aligned. |
@@ -163,11 +163,49 @@ | ||
163 | 163 | |
164 | 164 | .. _AIGR_component: |
165 | 165 | |
166 | +The AIGR auxiliary component | |
167 | +============================ | |
168 | + | |
169 | +The `AIGR` *auxiliary* component describes & handles the ‘:ref:`AIGR`’ and is used by all regulair components. Sometimes | |
170 | +it (the `AIGR`) is called an `“intermediate language” (‘IM’), or “intermediate representation” (‘IR’) | |
171 | +<https://en.wikipedia.org/wiki/Intermediate_representation>`__. Many existing IMs are quite “flat”, low-level and very | |
172 | +operational, like `RTL <https://en.wikipedia.org/wiki/Register_transfer_language>`__ or `SSA | |
173 | +<https://en.wikipedia.org/wiki/Static_single-assignment_form>`__ -- they are great to convert code to assembly. | |
166 | 174 | |
167 | 175 | |
168 | -The AIGR auxiliary component | |
169 | -============================ | |
170 | -ToDo | |
176 | + | |
177 | +.. uml:: AIGR-exampleSieve.puml | |
178 | + :align: right | |
179 | + :scale: 70% | |
180 | + :caption: The *Sieve Protocols*, as example of a AIGR (part) | |
181 | + | |
182 | +For the *CCastle Workshop Tools*, a more abstract representation is chosen, with more structure. Visually, it resembles | |
183 | +a tree, but without the need to have a single root (making it a “forest”), and with interconnects (making it a | |
184 | +graph). Structurally, it is not dissimular to the XLM/DOM, known by many webpages; but again without the “single | |
185 | +document-root” -- the DOM has interconnects, known as “links” (a term not used in the AIGR). | |
186 | +|BR| | |
187 | +The AIGR reminds also to the AST (of CCastle), after all, each language construct is “stored” in the AIGR. Some see it as a | |
188 | +semantically parsed AST. A namedID (like a variable, or function) in the source, when in the same namespace denotes the | |
189 | +same artifact -- even it is mention at several places (and can have aliases). In the AIGR it is the same ‘node’ having | |
190 | +multiple incoming ‘edges’ -- and so, violates the tree’s non-cycle rule. | |
191 | + | |
192 | +The AIGR-component describes all possible elements, and the relations (so it is a bit like the XML `DTD | |
193 | +<https://en.wikipedia.org/wiki/Document_type_definition>`__ or `Schema | |
194 | +<https://en.wikipedia.org/wiki/XML_schema>`__). And has (will have) general routines to facilitate handling the AIGR. | |
195 | +|BR| | |
196 | +By example, you can expect routines to “save” an AIGR to file, and “load” is later. | |
197 | + | |
198 | +.. warning:: Although the AIGR is a graph, the AIGR-component will **not** be able to visualize that graph. | |
199 | + | |
200 | + Other workshop tools may do that, and probably use the AIGR-component to read it. The visualising is part of that | |
201 | + tool | |
202 | + | |
203 | + | |
204 | +Currently, the AIGR is in the design phase, and may change. | |
205 | +|BR| | |
206 | +For that reason, only a Python dataclass reference model is available (Work-in-Progress). The (unit & behaviour) tests | |
207 | +and TesDoubles make it quite understandable. Once, it will be fully documented (and versioned) And available for | |
208 | +multiple languages (including Castle :-) | |
171 | 209 | |
172 | 210 | |
173 | 211 |
@@ -0,0 +1,40 @@ | ||
1 | +@startuml | |
2 | +!include AR_skins.inc | |
3 | + | |
4 | +folder "AIGR example" #c0c0c0 { | |
5 | +object StartSieve <<EventProtocol>> | |
6 | +object runTo <<Event>>{ | |
7 | + max: int | |
8 | +} | |
9 | +object newMax <<Event>> { | |
10 | + max: int | |
11 | +} | |
12 | + StartSieve *-- runTo | |
13 | + StartSieve *-- newMax | |
14 | + | |
15 | + | |
16 | +object SlowStart << EventProtocol>> | |
17 | +object queue_max <<TypedParameter>> { | |
18 | + :int | |
19 | +} | |
20 | +object setMax <<Event>> { | |
21 | + setMax :int | |
22 | +} | |
23 | + SlowStart *-- setMax | |
24 | + SlowStart *- queue_max | |
25 | + | |
26 | +object "SlowStart(1)" as SlowStart_1 <<ProtocolWrapper>> { | |
27 | + queue_max=1 | |
28 | +} | |
29 | + SlowStart <-- SlowStart_1: based on | |
30 | + | |
31 | + | |
32 | +object SimpleSieve <<EventProtocol>> | |
33 | + SlowStart_1 <-- SimpleSieve: based_on | |
34 | + | |
35 | +object input <<Event>> { | |
36 | + try :int | |
37 | +} | |
38 | + SimpleSieve *--input | |
39 | +} | |
40 | +@enduml |
@@ -1,8 +1,8 @@ | ||
1 | 1 | @startuml |
2 | 2 | skin rose |
3 | -'!include AR_skins.inc | |
3 | +!include AR_skins.inc | |
4 | 4 | left to right direction |
5 | -scale 0.5 | |
5 | + | |
6 | 6 | |
7 | 7 | ''NOTE: Old RTD/plantuml.1.2020.2.jar syntax! |
8 | 8 |
@@ -27,3 +27,9 @@ | ||
27 | 27 | BorderColor #000066 |
28 | 28 | BackgroundColor #eeeeff |
29 | 29 | } |
30 | + | |
31 | +skinparam object { | |
32 | + BorderColor #000066 | |
33 | + BackgroundColor white | |
34 | + FontColor #000066 | |
35 | +} |
@@ -1,50 +0,0 @@ | ||
1 | -.. -*- plantuml -*- | |
2 | - | |
3 | -TestDoubles/AIGR: The protocols of the Sieve | |
4 | -============================================ | |
5 | - | |
6 | -.. uml:: | |
7 | - | |
8 | - @startuml | |
9 | - | |
10 | - object StartSieve <<EventProtocol>> | |
11 | - object runTo <<Event>>{ | |
12 | - max: int | |
13 | - } | |
14 | - object newMax <<Event>> { | |
15 | - max: int | |
16 | - } | |
17 | - StartSieve *-- runTo | |
18 | - StartSieve *-- newMax | |
19 | - | |
20 | - '--- | |
21 | - | |
22 | - object SlowStart << EventProtocol>> | |
23 | - object queue_max <<TypedParameter>> { | |
24 | - :int | |
25 | - } | |
26 | - object setMax <<Event>> { | |
27 | - setMax :int | |
28 | - } | |
29 | - SlowStart *-- setMax | |
30 | - SlowStart *- queue_max | |
31 | - | |
32 | - '--- | |
33 | - | |
34 | - object "SlowStart(1)" as SlowStart_1 <<ProtocolWrapper>> { | |
35 | - queue_max=1 | |
36 | - } | |
37 | - SlowStart <-- SlowStart_1: based on | |
38 | - | |
39 | - | |
40 | - '--- | |
41 | - | |
42 | - object SimpleSieve <<EventProtocol>> | |
43 | - SlowStart_1 <-- SimpleSieve: based_on | |
44 | - | |
45 | - object input <<Event>> { | |
46 | - try :int | |
47 | - } | |
48 | - SimpleSieve *--input | |
49 | - | |
50 | - @enduml |