Your task is to find the perfect table seating. You'll do this by declaring facts (things that are always true) and rules (things that are conditionally true).
Define the chatty fact to represent the chatty people.
The chatty fact takes a single argument: the chatty person's lowercase name.
chatty(gustavo).
true.Define the likes fact to represent who likes whom.
The likes fact takes two arguments:
likes(esteban, malena).
true.Define the pairing rule to be true when the two people both like each other.
The pairing rule takes two arguments:
pairing(malena, esteban).
true.Define the pairing rule to be true when (at least) one of the two people being paired is chatty.
pairing(valeria, jaime).
true.Define the seating rule to be true when all five pairs are good pairings.
The pairing rule takes fives arguments:
Use the just defined facts and rules to check the seating arrangement.
seating(esteban, jaime, gustavo, malena, valeria).
false.Your task is to find the perfect table seating. You'll do this by declaring facts (things that are always true) and rules (things that are conditionally true).
Define the chatty fact to represent the chatty people.
The chatty fact takes a single argument: the chatty person's lowercase name.
chatty(gustavo).
true.Define the likes fact to represent who likes whom.
The likes fact takes two arguments:
likes(esteban, malena).
true.Define the pairing rule to be true when the two people both like each other.
The pairing rule takes two arguments:
pairing(malena, esteban).
true.Define the pairing rule to be true when (at least) one of the two people being paired is chatty.
pairing(valeria, jaime).
true.Define the seating rule to be true when all five pairs are good pairings.
The pairing rule takes fives arguments:
Use the just defined facts and rules to check the seating arrangement.
seating(esteban, jaime, gustavo, malena, valeria).
false.