Page 202 - DCAP506_ARTIFICIAL_INTELLIGENCE
P. 202

Artificial Intelligence




                    Notes          In Prolog program is a description of data
                                   parent(pam, bob). % Pam is a parent of Bob
                                   parent(tom, bob).
                                   parent(tom, liz).

                                   parent(bob, ann).
                                   parent(bob, pat).
                                   parent(pat, jim)
                                                             Figure  14.1:  Program  in  Prolog























                                   Basic Notions

                                   There are following notions present in prolog:
                                      Predicates: parent

                                       –    describes a relation
                                       –    defined by facts, rules, collectively called clauses
                                      Constant (symbol)s: tom, bob, x, y
                                      Variables: X, Y, Tom

                                      Atoms (simple goals): parent (A, a)
                                      Queries....



                                     Did u know? In Prolog literature, constants are called atoms.

                                   Self Assessment

                                   Fill in the blanks:

                                   1.  Prolog is a logical and a declarative ...................... language.
                                   2.  Prolog is based upon ...................... principle (1965) together with mechanisms for extracting
                                       answers proposed by Green (1968).




          196                               LOVELY PROFESSIONAL UNIVERSITY
   197   198   199   200   201   202   203   204   205   206   207