Answered step by step
Verified Expert Solution
Question
1 Approved Answer
One of the regulations of the International Rugby Board (IRB) states that for a player to be eligible to play for a given country,
One of the regulations of the International Rugby Board (IRB) states that for a player to be eligible to play for a given country, the player's father or mother or grandfather or grandmother must have been born in that country. Assume that there is a complete genealogical database consisting of Prolog clauses of the form person (P, B, F, M), where P is a person's name, B is the country of P's birth, F is their father's name and M is their mother's name. For example, the clause person(bruce, australia, rhodri, bronwyn). might appear in such a database. Further assume that names in the database are constructed so as to refer uniquely to individuals. Write Prolog clauses defining the predicate eligible such that goals of the form eligible(P,C) succeed if and only if person P is eligible to play for country C according to the above regulation. [10 marks] Given a list of players on a given country's team, define a predicate checkteam that will check each member of the team for eligibility according to the eligible predicate, and furthermore check that each player appears on the list only once. The checkteam goal will fail if any player is ineligible or if any player is listed more than once. [10 marks]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started