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.

12.1. TRANSFORMATIONS OF CONSTRUCTS OUTSIDE RSLA<br />

12.1.8 Axioms<br />

Axioms can be transformed almost as value definitions since value definitions<br />

are a short way <strong>of</strong> writing axioms. The extension should therefore be almost<br />

straight forward. It is necessary to consider quantified expressions though.<br />

12.1.9 Quantified Expressions<br />

Quantified expressions are <strong>of</strong> the form:<br />

quantifier typing1, ..., typingn • value_expr<br />

A quantified expression is transformed by transforming the constituent<br />

value expression. If the typings contain types <strong>of</strong> interest the corresponding<br />

variables must be assigned the values <strong>of</strong> the value names in the typing. Due<br />

to side effects an equivalence expression must be established, for example:<br />

∃ x : T • obs(x)<br />

✄<br />

∃ x : T • ( t := x ; obs() ≡ t := x ; true )<br />

where T is a type <strong>of</strong> interest and t is the corresponding variable.<br />

If the quantified expression contains universal quantification over a type<br />

<strong>of</strong> interest this is replaced by the always combinator ✷, see Example 12.1.<br />

Example 12.1 – <strong>Transformation</strong> <strong>of</strong> a quantified expression<br />

type<br />

T = Int<br />

value<br />

f : T → Int<br />

axiom<br />

∀ x : T • f(x) > x<br />

✄<br />

type<br />

T = Int<br />

variable<br />

t : T<br />

value<br />

f : Unit → read t Int<br />

axiom<br />

✷ f() > t<br />

125

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

Saved successfully!

Ooh no, something went wrong!