During the Middle Ages, to determine the successor to the throne of France, the
ID: 3550067 • Letter: D
Question
During the Middle Ages, to determine the successor to the throne of France, the French used the Salic
law. It is formulated as follows: the next to the throne is the living male descendant of the most direct
male royal. Male royal here means that we consider only male ancestors. The most direct descendant
means we prefer the one whose father is king to the one whose grandfather is king. In case of a tie, the
eldest takes precedence over his brothers.
a) Define the predicate Successor(Year) giving the solution as the first successor to the crown for
the year specified. To do this, use the predicates born(X, Year), died(X, Year), male(X).
Explanation / Answer
Successor(Year)
{
if male(X)
then
{
if not died(X, Year)
then
{
if born(X, Year)
then
{
return true;
}
}
}
}
Here I have assumed all predicates to be boolean functions.
male(X) returns true if male, otherwise false
died(X, Year) returns true if person is dead, else false
born(X, Year) returns true if person is born before current year, else false.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.