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.

APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS<br />

end,<br />

/∗Returns the length <strong>of</strong> a let binding.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

lb: the let binding<br />

Results:<br />

=======<br />

Int: the length <strong>of</strong> the let binding<br />

∗/<br />

getLengthLetBinding : LetBinding → Int<br />

getLengthLetBinding(lb) ≡<br />

case lb <strong>of</strong><br />

MakeBinding(b) → getLengthBinding(b),<br />

MakeRecordPattern(vn, p) → 1,<br />

MakeListPatternLet(lp) → 1<br />

end,<br />

/∗Returns the length <strong>of</strong> a binding.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

b: the binding<br />

Results:<br />

=======<br />

Int: the length <strong>of</strong> the binding<br />

∗/<br />

getLengthBinding : Binding → Int<br />

getLengthBinding(b) ≡<br />

case b <strong>of</strong><br />

IdBinding(id) → 1,<br />

Make_ProductBinding(pb) →<br />

getLengthBindingList(binding_list(pb))<br />

end,<br />

/∗Returns the number <strong>of</strong> parameters <strong>of</strong> a binding<br />

list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

bl: the binding list<br />

Results:<br />

=====<br />

274

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

Saved successfully!

Ooh no, something went wrong!