Some of the basic elements of Prolog are:
- Fact statements
- 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.
- 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.