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

  • Comp Sci
  • Thread starter r0bHadz
  • Start date
In summary, the conversation discusses writing a fact about the relationship between 'Ivana Trump' and 'Ivanka Trump' in a prolog program, and the question of whether the mother or the child should come first in the fact. The speaker is unsure of the answer and has reached out to their professor for clarification.
  • #1
r0bHadz
194
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
  • #2
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.
 

FAQ: Not sure how this swi-Prolog problem is suppose to be answered

What is swi-Prolog?

swi-Prolog is a free and open-source Prolog programming language implementation. Prolog is a logic programming language commonly used in artificial intelligence and computational linguistics.

How do I solve a problem in swi-Prolog?

To solve a problem in swi-Prolog, you need to define the problem using facts and rules, and then query the program to find solutions. You can also use built-in predicates and libraries to help with problem-solving.

What is the difference between swi-Prolog and other Prolog implementations?

swi-Prolog is one of the most popular Prolog implementations and is known for its fast and efficient execution. It also has a large library of built-in predicates and is constantly updated with new features.

Can swi-Prolog be used for real-world applications?

Yes, swi-Prolog can be used for real-world applications such as natural language processing, expert systems, and database querying. It is a powerful and flexible programming language that can handle complex problem-solving tasks.

Is swi-Prolog difficult to learn?

The difficulty of learning swi-Prolog depends on your previous experience with programming and logic. For those who are new to Prolog, it may take some time to get used to the syntax and logic-based approach. However, with practice and resources such as tutorials and documentation, it can be a rewarding language to learn.

Similar threads

Replies
1
Views
781
Replies
1
Views
3K
Replies
1
Views
2K
Replies
1
Views
1K
Replies
56
Views
6K
Replies
54
Views
5K
Back
Top