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 />

equalsTypesProduct :<br />

TypeExpr ∗ × TypeExpr ∗ → Bool<br />

equalsTypesProduct(tel1, tel2) ≡<br />

if tel1 = 〈〉 then true<br />

else<br />

equalsTypes(hd tel1, hd tel2) ∧<br />

equalsTypesProduct(tl tel1, tl tel2)<br />

end,<br />

/∗Compares two set type expressions.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

tes1: the set type expression<br />

tes2: the set type expression<br />

Results:<br />

=====<br />

Bool: true if they are identical, false otherwise<br />

∗/<br />

equalsTypesSet : TypeExprSets × TypeExprSets → Bool<br />

equalsTypesSet(tes1, tes2) ≡<br />

case tes1 <strong>of</strong><br />

FiniteSetTypeExpr(te1) →<br />

case tes2 <strong>of</strong><br />

FiniteSetTypeExpr(te2) →<br />

equalsTypes(te1, te2),<br />

→ false<br />

end,<br />

InfiniteSetTypeExpr(te1) →<br />

case tes2 <strong>of</strong><br />

InfiniteSetTypeExpr(te2) →<br />

equalsTypes(te1, te2),<br />

→ false<br />

end<br />

end,<br />

/∗Compares two list type expressions.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

tel1: the list type expression<br />

tel2: the list type expression<br />

Results:<br />

=====<br />

227

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

Saved successfully!

Ooh no, something went wrong!