Missionaries and Cannibals
There are three missionaries and three cannibals on the left bank of a river.
They wish to cross over to the right bank using a boat that can only carry
two at a time.
The number of cannibals on either bank must never exceed the
"Production" in the title of these notes (or "production rule") is a synonym for "rule", i.e. for a
condition-action rule (see below). The term seems to have originated with the term used for
rewriting rules in theChomsky hierarchy of grammar
Common Sense Reasoning
However, rules are cumbersome as a way of encoding relational knowledge and knowledge
People have vast background knowledge to cope with everyday situations.
We don't have to be told everything explicitly because we c
The Cut Operator (!)
Sometimes we need a way to prevent Prolog finding all solutions, i.e. a way to stop
The cut operator, written !, is a built-in goal that prevents backtracking.
It turns Prolog from a nice declarativ
Understanding and Playing with the Code
You can also play with the code - e.g. by writing your own rules and facts, and running the
system with them.
To understand the code fully, you need to read up on some extra features of
Prolog: op, assert, retract,
Frames implement semantic networks.
They add procedural attachment.
A frame has slots and slots have values.
A frame may be generic, i.e. it describes a class of objects.
A frame may be an instance, i.e. it describes a particular object.
A production rule system consists of
a set of rules
working memory that stores temporary data
a forward chaining inference engine
The match-resolve-act cycle is what the inference engine does.
Working Memory So Far
Rules for Step 3
the step is pack-medium-items
there is a medium item to be packed
there is an empty bag or a bag wi
Overview of Solution
We follow a simple graph search procedure:
Start from an initial state
Find a neighbouring state
Check that the new state has not been visited before
Find a path from the neighbour to the goal.
The search terminates whe we hav
Example of execution of graph search algorithm
Below is a trace of the execution of the query
?- path(1, 6, , Path).
using the Prolog code for path given in lectures, and the edges given in lectures,
path(Node, Node, _, [Node]).
A "Theory" of Certainty
Certainty factors range from -1 to +1
As the certainty factor (CF) approaches 1 the evidence is stronger for a
As the CF approaches -1 the confidence against the hypothesis gets
A CF around 0 indicates that th