Reference no: EM132401146
CMT304 Programming Paradigms Assignment - Cardiff University, UK
Assessment Title - Logic and Functional Programming
Learning Outcomes Assessed - Discuss and contrast the issues, features, design and concepts of logic and functional programming.
Assignment - Consider the following situation:
Patent requests are submitted to the patent office and are reviewed by the technical board. Each patent request is verified and discussed by a group of technical board members chosen by the head of the board. To find a good match between patent request and referees, every member of the technical board submits a bid that classifies all requests that need to be reviewed into four categories depending on their expertise: EXPERT, KNOWLEDGEABLE, FAMILIAR or INEXPERT
The goal is to write a program to automated this process to help the head of the board. Using a list of bids, indicating the level of expertise for each patent request and board member, it should assign each submitted patent request to a specific number of n members of the technical board such that
- the workloads of the technical board members are approximately equal, that is, do not differ by more than m;
- no member of the technical board is required to review a submission that is placed in the INEXPERT category;
- no member of the technical board is required to review more than k submissions from the FAMILIAR category;
- the total number of cases when a submission is assigned to a member who placed it in the EXPERT category is as large as possible.
The parameters n, m and k are arguments set when calling the program.
Task 1: Write a functional or logic program (in Haskell or ASP) which finds all solutions to the problem, given n, m, k and the list of bids in a suitable format. Make sure you document your code so it is clear how it should be used and what the approach to solving the problem is. Also include your name and student id in the comments. Note, there is no 'correct' programming paradigm to solve this problem. The representation of the problem can be specific to the programming language used.
Task 2: Write a short report on logic vs. functional programming related to the problem:
1. Provide, in up to 300 words, two arguments for and two arguments against using logic programming to solve the problem.
2. Provide, in up to 300 words, two arguments for and two arguments against using functional programming to solve the problem.
3. Justify, in up to 300 words, your choice of programming paradigm, based on your previous arguments.
The word limits are an upper limit, not a target length. Text longer than the word limit for each point will be ignored. Clearly mark each argument in your answer and indicate if it is for and against. Only provide two arguments for and against for the first two points; additional arguments will be ignored.