The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 2 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
It is about prolog. Can someone help me with part b and c of the first question or give me some hint? I don't know how to think in prolog, especially about the database constraint.
b) Express the above bullet list as constraints, e.g., as below. You will have to fill-in the dots with the
corresponding Prolog logic.
constraintRoofer(player(N,O,S)) :-
Â
Université d’OttawaFaculté de génieÉcole de scienced’informatiqueet de génie électriqueUniversity of OttawaFaculty of EngineeringSchool of ElectricalEngineeringand Computer Science___Assignment 2CSI2120 Programming ParadigmsWinter 2016Due on February 23rd, 2016 before 11:00 pm in Virtual Campus[5 marks in total]Question 1.[3 marks]Five golfers, named Jules, Gilles, Jean, Joe and Ghislain often play a round of golf together (use smallcaps for the players’ names in your program). Their occupations are, not necessarily in this order,mason, plasterer, carpenter, tinsmith and roofer.They have played a round of golf but at the end their score cards don’t match. Their results were evennumbers between 64 and 84.•Ghislain played par with 72, beating the roofer by 2 strokes.•Gilles had a bad day, and has ended with 10 strokes above par, or 12 strokes more than themason.•The tinsmith has beaten Joe by 4 strokes and has won the round.•Jules has beaten the carpenter by 8 strokes, but did not win overall.Find the occupation and the score of each player.a)Design a predicate to enumerate all possible combinations for players where N is the name of theplayer, O is the occupation and S is the score.?-player(N,O,S).N = jules,O = carpenter,S = 64;N = jules,O = carpenter,S = 66and so on.b)Express the above bullet list as constraints, e.g., as below. You will have to fill-in the dots with thecorresponding Prolog logic.constraintRoofer(player(N,O,S)) :- …constraintMason( …