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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

of resource usage for the step. If a resource is specified as an interval, rac is a value<br />

taken from the interval. <strong>The</strong> symbol T RU i is used to denote the timed update set, with<br />

resource usage, of the i th step, where t i is the step duration, RC i is the set of consumed<br />

resources, and U i is the update set:<br />

T RU i = (t i , RC i , U i )<br />

<strong>The</strong> execution semantics are also extended to reflect resource usage. Because resources<br />

are limited quantities, if an executing ASM utilizes more than a resource’s<br />

limits, execution halts. Execution is well-defined only if resource utilization falls below<br />

the boundaries of the available resources. Resource usage is slightly different than<br />

time in that the resource utilization for a given update set starts with the time of the previous<br />

update set and lasts through the rule completion. <strong>The</strong> consumption of a resource<br />

for an update set T RU i lasts during an open interval (gt i−1 , gt i ].<br />

<strong>The</strong> state definition is also extended to reflect resource consumption:<br />

T RS i = (gt i , SRC i , S i )<br />

<strong>The</strong> sequence of states for a run that ends after n steps:<br />

T RS 1 , T RS 2 , . . . , T RS n<br />

For update sets with resources, the ◦ operator is defined as follows:<br />

T RS i = T RS i−1 ◦T RU i = (gt i−1 , RC i−1 , S i−1 )◦(t i , RC i , U i ) = (gt i−1 +t i , RC i , S i−1 ◦U i )<br />

For all gt in the open interval (gt i−1 , gt i ), the state T RS will be (gt, RC i , S i−1 ).<br />

This definition reflects the behavior that resource consumption will begin with the start<br />

of a rule execution and will last until the rule execution is finished.<br />

<strong>The</strong> example from section 2.2 is extended to reflect the time and resource consumption<br />

behavior. <strong>The</strong> example is listed in <strong>TASM</strong> example 2. <strong>The</strong> example uses two<br />

resources, processor usage and memory usage.<br />

Three sample update sets for different initial conditions of variable values are<br />

shown below:<br />

• Initial condition: ((light, OFF), (switch, UP))<br />

Update set: ((5, ((memory, 200), (processor, 25)), ((light, ON))))<br />

• Initial condition: ((light, ON), (switch, DOWN))<br />

Update set: ((6, ((memory, 100), (processor, 15)), ((light, OFF))))<br />

• Initial condition: ((light, OFF) (switch, DOWN))<br />

Update set: ((0, ((memory, 0), (processor, 0)), ∅))<br />

Formally, we can express the behavior and state progression of the first set of initial<br />

conditions as follows:<br />

• T RS 0 = (0, ((memory, 0), (processor, 0)), ((light, OF F ), (switch, UP )))<br />

15

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

Saved successfully!

Ooh no, something went wrong!