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

Create successful ePaper yourself

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

7.3 The Role <strong>of</strong> Semantics 233<br />

7.3 The Role <strong>of</strong> Semantics<br />

We repeatedly mentioned that POOSL language is a formal language 2 . This means that<br />

the syntax (the form) as well as the semantics (the intended meaning) <strong>of</strong> every language<br />

construct is defined in a formal, mathematical way. Defining the syntax <strong>of</strong> languages in<br />

a formal way is nowadays quite common. There exists a well-developed and widelyknown<br />

mathematical theory <strong>of</strong> formal languages which supports the accurate description<br />

<strong>of</strong> the syntax <strong>of</strong> languages, and the correct implementation <strong>of</strong> lexical scanners and<br />

parsers [Ten91]. A similar uniform mathematical theory for language semantics is still<br />

lacking. Nevertheless, there do exist a number <strong>of</strong> well-developed approaches towards<br />

semantics. Despite <strong>of</strong> this, only very few languages come equipped with a complete<br />

formal definition <strong>of</strong> their semantics [Hen90].<br />

With respect to the semantics POOSL, we have chosen for a Plotkin-style structural<br />

operational semantics[Plo77, Plo81, Plo83]. An operational semantics describes how the<br />

language constructs are executed on some abstract machine. The term structural states<br />

that the semantics is defined in terms <strong>of</strong> the syntactic structure <strong>of</strong> specifications. The<br />

reasons to develop a semantics, and especially a structural operational semantics, are<br />

diverse:<br />

Language Design<br />

First <strong>of</strong> all, and most importantly, designing a good (specification) language is a very<br />

complex task. When one attempts to combine different language primitives, unexpected<br />

and counterintuitive interactions arise [Ten91]. Since constructing a formal semantics<br />

requires a thorough understanding <strong>of</strong> every ’corner’ <strong>of</strong> the language, these interactions<br />

can be detected as early as possible and different alternatives can be evaluated systematically.<br />

The construction <strong>of</strong> a semantics further prevents a language from being ’polluted’<br />

by many bizarre language constructs. Therefore, a language and its formal semantics<br />

should be developed simultaneously, thereby using the semantics as a tool which guides<br />

the language design. More about this subject is described in Section 9.7.<br />

Unambiguous Documentation<br />

Next to its use for language design, a semantics, and especially an operational semantics,<br />

can be helpful when the precise meaning <strong>of</strong> a construct must be known. Since reference<br />

manuals and language standards are, in general, expressed informally, ambiguities may<br />

arise about the precise meaning <strong>of</strong> some construct. A formal semantics can then be<br />

consulted to resolve these ambiguities. Further, a rigorous semantic description can be<br />

<strong>of</strong> assistance in creating manuals or standards in the first place.<br />

Behaviour-Preserving Transformations<br />

Behaviour-preserving transformations form an important base <strong>of</strong> the SHE method. A<br />

transformation takes a specification and transforms it into another one. A behaviourpreserving<br />

transformation is a special kind <strong>of</strong> transformation whose correctness is known<br />

2 In fact, a more adequate term would be rigorous language. In this thesis we will <strong>of</strong>ten use the term<br />

formal instead <strong>of</strong> term rigorous. In a strict sense, the terms refer to different notions (see for example<br />

[Ten91]).

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

Saved successfully!

Ooh no, something went wrong!