20.01.2015 Views

The TASM Language Reference Manual Version 1.1 - Synrc

The TASM Language Reference Manual Version 1.1 - Synrc

The TASM Language Reference Manual Version 1.1 - Synrc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>The</strong> distribution of the ⊕ operator over the set of consumed resources is the same<br />

as for the ⊗ operator:<br />

RC p ⊕ RC c = (rc p1 , . . . , rc pn ) ⊕ (rc c1 , . . . , rc cn )<br />

= (rc p1 ⊕ rc c1 , . . . , rc pn ⊕ rc cn )<br />

= ((rr p1 , rac p1 ) ⊕ (rr c1 , rac c1 ), . . . ,<br />

(rr pn , rac pn ) ⊕ (rr cn , rac cn ))<br />

= ((rr p1 , rac p1 ⊕ rac c1 ), ...<br />

((rr pn , rac pn ⊕ rac cn ))<br />

<strong>The</strong> resources consumed by the rule execution will be determined by the parent,<br />

if a resource annotation exists in the parent. Otherwise, it will be determined by the<br />

child:<br />

rac p ⊕ rac c =<br />

{<br />

rac c<br />

rac p<br />

if rac p = ⊥<br />

otherwise<br />

Intuitively, the composition between parent update sets and child update sets is<br />

such that the parent machine overrides the child machine. If the parent machine has<br />

annotations, those annotations override the annotations from child machines. If a parent<br />

machine doesn’t have an annotation, then its behavior is defined by the annotations of<br />

the auxiliary machines it uses.<br />

Figure 2.1 shows a hierarchy of machines for an sample rule execution. Each numbered<br />

square represents a machine. Machine ”1” represents the rule of the main machine<br />

being executed; all other squares represent either sub machines or function machines<br />

used to derive the update set returned by the main machine. Machine ”3” is<br />

an example of a machine that plays the role of parent (of machine ”7”) and child (of<br />

machine ”1”).<br />

1<br />

2 3 4<br />

5 6<br />

7<br />

Figure 2.1: Hierarchical composition<br />

Each machine generates an update set T RU i , where i is the machine number. <strong>The</strong><br />

derivation of the returned update set is done in a bottom-up fashion, where T RU ret is<br />

the update set returned by the main machine:<br />

20

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!