26.09.2013 Views

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

10.3. USING THE TRANSFORMER<br />

named database. The transformation is done using the following command:<br />

java translator.RSLRunner A_DATABASE3 I_DATABASE1 database:Database<br />

The result can be found in Specification 10.4.<br />

Specification 10.4 – Concrete imperative specification <strong>of</strong> the database<br />

scheme I_DATABASE1 =<br />

class<br />

type<br />

Database = Key →m Data,<br />

Key,<br />

Data<br />

end<br />

Validation<br />

variable<br />

database : Database<br />

value<br />

empty : Unit → write database Unit<br />

empty() ≡ database := [ ],<br />

insert :<br />

Key × Data → read database write database Unit<br />

insert(k, d) ≡ database := database † [ k ↦→ d ],<br />

remove : Key → read database write database Unit<br />

remove(k) ≡ database := database \ {k},<br />

defined : Key → read database Bool<br />

defined(k) ≡ k ∈ dom database,<br />

lookup : Key ∼ → read database Data<br />

lookup(k) ≡ database(k)<br />

Normally the development step from applicative <strong>into</strong> imperative specification<br />

cannot be formally verified, but by using the transformation rules, which are<br />

115

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

Saved successfully!

Ooh no, something went wrong!