Basic elements of Prolog

BASIC ELEMENTS OF PROLOG

Some of the basic elements of Prolog are:
  1. Term
  2. Fact statements
  3. Rule statements

1. Term:  A Prolog term is a constant, a variable, or a structure.

A constant is either an atom or an integer.

Atoms are the symbolic values of Prolog and are similar to their counterparts in LISP. In particular, an atom is either a string of letters, digits, and underscores that begins with a lowercase letter or a string of any printable ASCII characters delimited by apostrophes.
2. Fact statements: A fact statement is simply a proposition that is assumed to be true.

For example:  
  • female(khushi). , it states Khushi is a female.
  • mother(varsha, khushi). , it states Varsha is Mother of Khushi.
3. Rule Statements: Rule statements state rules of implication between propositions.
For example: ancestor(varsha, khushi) :- mother(varsha, khushi)., it states that if Varsh is the mother of Khushi, then Varsha is an ancestor of  Khushi.


Principles of Programming Languages:

EasyExamNotes.com covered following topics in PPL.

Practicals:
Previous years solved papers:

A list of Video lectures

References:

  1. Sebesta,”Concept of programming Language”, Pearson Edu 
  2. Louden, “Programming Languages: Principles & Practices” , Cengage Learning 
  3. Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill. 
  4. E Horowitz, “Programming Languages”, 2nd Edition, Addison Wesley