![]() ![]() We can define a brother relationship as follows −īrother(X,Y) :- parent(Z,X), parent(Z,Y),male(X), male(Y) A rule can find out about a relationship even if the relationship is not defined explicitly as a fact. There are various kinds of relationships, of which some can be rules as well. If we ask a question, “Does Amit own a bike?”, we are actually trying to find out about one relationship. Suppose, there’s a statement, “Amit has a bike”, then we are actually declaring the ownership relationship between two objects - one is Amit and the other is bike. In Prolog programs, it specifies relationship between objects and properties of the objects. We will create the knowledge base by creating facts and rules, and play query on them. After that we will see about the family relationships, how we can express family based relationships in Prolog, and also see the recursive relationships of the family. ![]() These relationships can be expressed as facts and rules. Relationship is one of the main features that we have to properly mention in Prolog. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |