Comp Sci Not sure how this swi-Prolog problem is suppose to be answered

  • Thread starter Thread starter r0bHadz
  • Start date Start date
AI Thread Summary
In swi-Prolog, the convention for defining relationships typically places the parent first, followed by the child, as in mother('Ivana Trump', 'Ivanka Trump'). This structure indicates that 'Ivana Trump' is the mother of 'Ivanka Trump'. Consistency in using this format is key to ensuring the program functions correctly. The user is encouraged to define their facts and rules clearly to represent Donald Trump's family tree accurately. Understanding this foundational structure will help in completing the homework assignment effectively.
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.
 

Similar threads

Back
Top