Swi-Prolog argument order convention for mother facts

  • Context: Comp Sci 
  • Thread starter Thread starter r0bHadz
  • Start date Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 2K views
r0bHadz
Messages
194
Reaction score
17
Homework Statement
Using Donald Trump’s family tree, write a prolog program ( a collection of facts
and rules) to answer the following queries about the relationships within Donald
trump’s family tree.
• Who is the mother of Ivanka trump
Relevant Equations
none
From what I know, we can write a fact, such as mother('Ivana Trump', 'Ivanka Trump').

But I am lost. Is there suppose to be some convention, which states which one comes first? Does the mother or the child come first?

Basically, I have no clue what the answer to this question is suppose to look like. It seems simple enough. I've email my professor but she hasn't replied, and I really want to get a head start on this homework
 
Physics news on Phys.org
r0bHadz said:
Homework Statement: Using Donald Trump’s family tree, write a prolog program ( a collection of facts
and rules) to answer the following queries about the relationships within Donald
trump’s family tree.
• Who is the mother of Ivanka trump
Homework Equations: none

From what I know, we can write a fact, such as mother('Ivana Trump', 'Ivanka Trump').

But I am lost. Is there suppose to be some convention, which states which one comes first? Does the mother or the child come first?

Basically, I have no clue what the answer to this question is suppose to look like. It seems simple enough. I've email my professor but she hasn't replied, and I really want to get a head start on this homework
The rules you write (predicates, I believe they are called in Prolog) are how you define them. In your example, the meaning would be 'Ivana Trump' is the mother of 'Ivanka Trump'. As long as you keep the same interpretation for these predicates, you should be fine.