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.

C.1. FORMAL SPECIFICATION OF THE TRANSFORMER<br />

Id-set × LetDef ∗ × FUNC × TRANS →<br />

AccessResult<br />

getAccessObsLetDefList(idset, ldl, func, trans) ≡<br />

if ldl = 〈〉 then mk_AccessResult(〈〉, idset)<br />

else<br />

let<br />

ar =<br />

getAccessObs(<br />

idset, value_expr(hd ldl), Unknown, func,<br />

trans),<br />

ar ′ =<br />

getAccessObsLetDefList(<br />

idSet(ar), tl ldl, func, trans)<br />

in<br />

mk_AccessResult(<br />

removeDuplets(<br />

accessList(ar) accessList(ar ′ )),<br />

idSet(ar ′ ))<br />

end<br />

end,<br />

/∗Returns an access list <strong>of</strong> the values <strong>of</strong> types<br />

<strong>of</strong> interest read from during evaluation <strong>of</strong> a<br />

case branch list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

idset: the functions already evaluated<br />

cbl: the case branch list<br />

et: the expected type <strong>of</strong> the case expression<br />

Result:<br />

=======<br />

AccessResult: the corresponding access result<br />

∗/<br />

getAccessObsCaseBranch :<br />

Id-set × CaseBranch ∗ × ExpType × FUNC × TRANS →<br />

AccessResult<br />

getAccessObsCaseBranch(idset, cbl, et, func, trans) ≡<br />

if cbl = 〈〉 then mk_AccessResult(〈〉, idset)<br />

else<br />

let<br />

ar =<br />

getAccessObs(<br />

idset, value_expr(hd cbl), et, func, trans),<br />

261

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

Saved successfully!

Ooh no, something went wrong!