Page 221 - DCAP506_ARTIFICIAL_INTELLIGENCE
P. 221

Unit 14: Prolog




          18.  You should ...................... a current stream only if you desire to consequently use it frequently  Notes
               for input or output.

          14.11 Summary


              Prolog is a logical and a declarative programming language. The name itself, Prolog, is
               short for PROgramming in LOGic.
              In ProLog, facts describe the relationships between different objects and are independent
               of each other.
              In ProLog, rules are used in the process of decision-making and can deduce new facts from
               existing ones.

              Proposing a query means demanding Prolog  to attempt to prove that the statement(s)
               implied  by the query can be prepared true given  the right  variable instantiations  are
               prepared.
              An atom is a general-purpose name with no inherent meaning. It is composed of a sequence
               of characters that is parsed by the Prolog reader as a single unit.
              Variables are denoted by a string consisting of letters, numbers and underscore characters,
               and beginning with an uppercase letter or underscore.

              A compound term is composed of an atom called a functor and a number of “arguments”,
               which are again terms.
              The predicate repeat functions  in the traditional manner,  i.e., whenever backtracking
               reaches it, execution continues forward again via the same clauses as if another substitute
               had been found.

              Two terms are defined to match if they are either indistinguishable or if they can be made
               indistinguishable by variable instantiation.
              The backtracking predicate provides an alternative path for a program when the current
               path fails.

          14.12 Keywords

          Atom: An atom is a general-purpose name with no inherent meaning. It is composed of  a
          sequence of characters that is parsed by the Prolog reader as a single unit.
          Backtracking: The backtracking predicate provides an alternative path for a program when the
          current path fails.

          Compound Term: A compound term is composed of an atom called a functor and a number of
          "arguments", which are again terms.
          Facts: In ProLog, facts describe the relationships between different objects and are independent
          of each other.
          Matching: Two terms are defined to match if they are either indistinguishable or if they can be
          made indistinguishable by variable instantiation.

          Prolog: Prolog is a logical and a declarative programming language. The name itself, Prolog, is
          short for PROgramming in LOGic.
          Repeat: The predicate repeat functions in the traditional manner, i.e., whenever backtracking
          reaches it, execution continues forward again via the same clauses as if another substitute had
          been found.


                                           LOVELY PROFESSIONAL UNIVERSITY                                   215
   216   217   218   219   220   221   222   223   224