Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
Solution Proposal Functional Programming Sheet 11 (\x y.plus y x) ((\z.times z 7) 8) 9
 

Summary: Solution Proposal Functional Programming ­ Sheet 11
Exercise 1
(a)
(\x y.plus y x) ((\z.times z 7) 8) 9
(\y.plus y ((\z.times z 7) 8)) 9
lo
(\x y.plus y x) (times 8 7) 9
li
plus 9 ((\z.times z 7) 8)
lo
(\y.plus y (times 8 7)) 9
li
plus 9 (times 8 7)
lo li
(b) For leftmost-outermost reduction, here we get the following reduction sequence:
(g.g plus (g div (g times 7))) (f x.f 4 x)
(f x.f 4 x) plus ((f x.f 4 x) div ((f x.f 4 x) times 7))
(x. plus 4 x) ((f x.f 4 x) div ((f x.f 4 x) times 7)) =: s
plus 4 ((f x.f 4 x) div ((f x.f 4 x) times 7))
plus 4 ((x.div 4 x) ((f x.f 4 x) times 7))

  

Source: Ábrahám, Erika - Fachgruppe Informatik, Rheinisch Westfälische Technische Hochschule Aachen (RWTH)

 

Collections: Computer Technologies and Information Sciences