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.

238 Introduction to the Semantics <strong>of</strong> POOSL<br />

A rule has zero or more premises and one conclusion. It tells us how we can construct a<br />

complex mathematical object (the conclusions) from simpler ones (the premises). A rule<br />

may have a condition which has to be fulfilled whenever the rule is to be applied. If this<br />

condition is vacuously true, it is omitted. Rules with premises that are vacuously true<br />

are called axioms. Axioms define what are considered primitive mathematical objects.<br />

Together, the axioms and rules define a collection <strong>of</strong> mathematical objects. This collection<br />

contains those and only those objects that are derivable from these axioms and rules.<br />

Inductive Pro<strong>of</strong>s<br />

Axioms and rules are used to define mathematical objects. The same axioms and rules,<br />

however, can also be used to prove some property about these objects. First the property<br />

is proved for all primitive objects defined by the axioms. Then, for each rule, the property<br />

is proved for the complex objects defined by the conclusion <strong>of</strong> that rule. Such a pro<strong>of</strong><br />

uses the assumption that the property already holds for the objects used in the premises<br />

<strong>of</strong> the rule. This assumption is called the induction hypothesis. The pro<strong>of</strong>s themselves are<br />

called pro<strong>of</strong>s by rule induction.<br />

Mathematical Induction<br />

Mathematical induction is probably the most well-known form <strong>of</strong> induction. It is based<br />

on the collection <strong>of</strong> natural numbers. is inductively defined by one axiom and one<br />

rule:<br />

¡£<br />

¡£ ¡£<br />

¡ To a property, say P(n), one can use rule induction. One starts by<br />

0<br />

n<br />

n 1<br />

prove for each n<br />

proving P(0). Then P(n 1) is proved under the assumption that P(n) already holds.<br />

This form <strong>of</strong> induction is commonly called mathematical induction (on n).<br />

Inductive Function Definitions<br />

We will repeatedly define functions in an inductive way. As a simple example, consider<br />

the well-known faculty function fac : £ . It is defined by one axiom and one rule:<br />

fac(n) k<br />

if ¡£ n<br />

fac(0) 1 fac(n 1) k(n 1)<br />

It is however quite unusual to define functions this way. We will therefore follow the<br />

convention and use the more usual notation:<br />

fac(0) 1 and fac(n 1) (n 1)fac(n) for n ¡£<br />

Using rule induction one is able to prove that each object fac(n) satisfies some property<br />

P. It is also possible, however, to use mathematical induction on n. Then the axiom and<br />

rule in the definition <strong>of</strong> are used as a basis for induction. The axiom and rule <strong>of</strong> the<br />

definition <strong>of</strong> fac are used as well, but they serve a different purpose. Both <strong>of</strong> these forms<br />

<strong>of</strong> induction are applied in this thesis.<br />

Backus Naur Form (BNF)<br />

As we explained in Subsection 7.4.1, we will occasionally have to define collections <strong>of</strong><br />

syntactic elements. Consider, for instance, the collection Bin <strong>of</strong> binary representations<br />

<strong>of</strong> natural numbers. Bin is defined as

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

Saved successfully!

Ooh no, something went wrong!