Presentation of Artificial Intelligence: Submitted By
Presentation of Artificial Intelligence: Submitted By
Artificial
Intelligence
For instance,
parents(charles,elizabeth,philip) is
written as
Another instance,
book(moby_dick,author(herman,melvill
e)) is written as
Lists
List is an ordered sequence of elements that can have
any length.
Here Ordered means order of the elements in the
sequence matters.
The elements of a list may be any term-constants,
variables, structures.
List can be represented as a special kind of tree.
A list is either an empty list ,having no elements or it is
a structure that has two components: head and tail.
Empty list is written as [].
The head and tail of a list are components of the
functor named .,which is a dot(called the period or
full stop).
Recursive Search
We frequently need to search inside a Prolog structure
to find some desired piece of information. When the
structure may have other structures as its
components ,this results in a recursive search task.
Suppose for example we have list of the names of
those horses sired by Coriander who all won horse
races in Great Britain in the year 1927