Structure of Programs in Turbo Prolog


        Programs consist of procedures.
        Procedures consist of clauses.
        Each clause is a fact or a rule.
        Programs are executed by posing queries.

Facts:

  • Properties of objects, or relationships between objects;
  • "Dr Turing lectures in course 9020", is written in Prolog as: lectures (turing, 9020).

HERE:  lectures (Turing, 9020). is also called a predicate

Converting English to  Prolog  facts & rules:
 John is the father of Susan.    à father (john,susan).
 John is the husband of Martha. à  husband (john,martha).
 John eats pizza.  à eats(john, pizza).