Skip to main content

Introduction To Turbo Prolog By Carl Townsend Pdf Guide

// Define a rule sibling(X, Y) :- father(Z, X), father(Z, Y).

Here is an example of a simple Turbo Prolog program that defines a knowledge base and uses it to answer a query: INTRODUCTION TO TURBO PROLOG BY CARL TOWNSEND PDF

// Query the knowledge base ?- sibling(mary, X). This program defines a knowledge base that states that John is the father of Mary and David. It then defines a rule that states that two people are siblings if they have the same father. Finally, it queries the knowledge base to find out who Mary's sibling is. // Define a rule sibling(X, Y) :- father(Z, X), father(Z, Y)