23.08.2013 Views

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

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.

8.6 Primitive deepCopy Messages 255<br />

(1) Dom(¡ ¡ ) = Dom( ¡<br />

¡ ¡ (2) ( k m)(x) ¥<br />

(3) ¡<br />

) = ¡ £¡<br />

k ¡ m<br />

¢ k ¡ Dom(¡ )¦<br />

¢ ¢<br />

if¡ ¢ ¢ ¡<br />

if¡ ¡ ¡<br />

p m ( k)(x) p NDObj<br />

( k)(x) ( k)(x) PDObj<br />

¢ ¢<br />

for ¡ Dom(¡ all k ) ¡ Dom(¡ and x ( k))<br />

¡<br />

¢ ¢<br />

( k m) ( k) ¡ Dom(¡ for all k )<br />

¡<br />

This definition states that relabelling a minimal Sys-structure consists <strong>of</strong> replacing ¢ all<br />

non-primitive data object identifiers k by objects identifiers k m. All primitive objects<br />

remain unchanged. The relabelling <strong>of</strong> a minimal Sys-structure yields another minimal<br />

Sys-structure. The pro<strong>of</strong> <strong>of</strong> this fact is <strong>of</strong> a similar complexity as the pro<strong>of</strong> <strong>of</strong> Proposition<br />

1.<br />

The semantics <strong>of</strong> deepCopy messages is formalised by axioms (21) and (22) <strong>of</strong> the<br />

transition system <strong>of</strong> Section A.1. Axiom (21) deals with deepCopies <strong>of</strong> primitive objects<br />

and (22) with deepCopies <strong>of</strong> non-primitive objects.<br />

(21) Primitive method deepCopy, primitive objects<br />

deepCopy()¥ ¡ ¥ s¥<br />

¡<br />

¥ Sys £<br />

¥ ¡ ¥ s¥<br />

This axiom states that the deepCopy <strong>of</strong> a primitive object yields the primitive object<br />

itself.<br />

(22) Primitive method deepCopy, non-primitive objects<br />

if<br />

<br />

where copy( <br />

deepCopy()¥ ¡ ¥ s¥<br />

¡<br />

<br />

¡<br />

¥ Sys £<br />

<br />

¡ ¡ ¡ ¡ ¥ ¡ ¡ ¡ ¡ ¥ s¥<br />

¡<br />

¥ Sys<br />

¡<br />

¡ ¡ ¡ ¥ Sys<br />

¥<br />

¡<br />

<br />

¡ ¡ ¡ ¡ ¡ ¥ CDl ¡<br />

¡<br />

¡ ¡ ¡ ¡ ¡ (¡ ¡<br />

is a Sys-structure , Sys CD1 CDj ,<br />

CDj data class C MD1 MD MDl , C ) and<br />

MD deepCopy() primitive<br />

¥<br />

¡ <br />

¡ ¡ ¡ ¥ ¡ ¡<br />

¡ ¥ ¡ , relabel MaxId(¡ ( ¡ ¥ ) ) <br />

¡ ¡ <br />

¡ ¥ ¡ ¡ ¡ ¡ ¡ ¥ ¡ ¡<br />

¡ ¡ ¥<br />

¡ ¥<br />

¡ ¡ ¡ ¡ ¡ , ¡ ¡ ¡ ¡ ¡ ¦ ¡ ¡ ¡ ¡ ¡<br />

)<br />

and ¡ ¡ ¡<br />

¡ ¡ ¦ ¡ ¡<br />

¡<br />

Axiom (22) states that a deepCopy <strong>of</strong> ¡ object is being made in three steps. In the first<br />

step a copy is made. This copy is being relabelled by adding the MaxId(¡ number ) to<br />

all its object MaxId(¡ identifiers. ) is the largest object identifier which is contained in<br />

the original ¡ state , so the newly created identifiers are all ’fresh’. As a final step, the<br />

relabelled object is added to the original state and type, and the (new) object identifier<br />

¡ ¡ ¡ associated with ¡ is the evaluated result <strong>of</strong> the deepCopy operation.<br />

¡<br />

The theory <strong>of</strong> this paragraph is not just developed to describe deepCopy messages.<br />

Later, we will need the same theory to describe data object passing between process<br />

objects.<br />

¡ ¡ ,

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

Saved successfully!

Ooh no, something went wrong!