Back
ExamFull examExam paper only

13 02 13

Full exam for Principles of Programming Languages in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Principles of Programming Languages, 2013.02.13 Notes: - Total available time: 2h. - You may use any written material you need. - You cannot use computers, phones or laptops during the exam. Exercise 1, Haskell (5+6 pts) CBCB Inc. produces its goods (bikes and other stuff) by

Principles of Programming LanguagesFull exam

Document information

What's included in this study material

Full exam for Principles of Programming Languages in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Principles of Programming Languages, 2013.02.13 Notes: - Total available time: 2h. - You may use any written material you need. - You cannot use computers, phones or laptops during the exam. Exercise 1, Haskell (5+6 pts) CBCB Inc. produces its goods (bikes and other stuff) by

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 1

Principles of Programming Languages, 2013.02.13 Notes: - Total available time: 2h. - You may use any written material you need. - You cannot use computers, phones or laptops during the exam. Exercise 1, Haskell (5+6 pts) CBCB Inc. produces its goods (bikes and other stuff) by assembling various parts coming from several suppliers. CBCB is connected to its suppliers through a number of supply brokers, and each of them is specialized in dealing one type of item (e.g. wheels, components, brakes...). At a fixed scheduled times (say, once every three months) each broker sends to CBCB's server a message containing the current offers from its suppliers (e.g. of wheels). Such message is a sequence of offers of analogous items. CBCB's server enqueues such sequence in a sequence of sequences; when this is complete, the servers calls the procedure allPossibleBikes to return all the possible combinations of bikes that could be built. Example: supply broker 1 sends (ultra-wheel-1, WheelyWheel); supply broker 2 sends ("very nice frame", "another frame", "frame000"); supply broker 3 sends (3444,712,9938,115403). In this case allPossibleBikes should return the sequence: (ultra-wheel-1 "very nice frame" 3444) (WheelyWheel "very nice frame" 3444) (ultra-wheel-1 "another frame" 3444) (WheelyWheel "another frame" 3444) (ultra-wheel-1 "frame000" 3444) (WheelyWheel "frame000" 3444) (ultra-wheel-1 "very nice frame" 712) (WheelyWheel "very nice frame" 712) (ultra-wheel-1 "another frame" 712) (WheelyWheel "another frame" 712) (ultra-wheel-1 "frame000" 712) (WheelyWheel "frame000" 712) (ultra-wheel-1 "very nice frame" 9938) (WheelyWheel "very nice frame" 9938) (ultra-wheel-1 "another frame" 9938) (WheelyWheel "another frame" 9938) (ultra-wheel-1 "frame000" 9938) (WheelyWheel "frame000"…

Preview

First page of the document.

First page: 13 02 13