Copyright © Bill Wilson, 1998 - 2012 | Contact Info |
You should use The AI Dictionary to clarify or revise concepts that you have already met. The AI Dictionary is not a suitable way to begin to learn about AI. Further information on AI can be found in the class notes page lecture notes section.
Other related dictionaries:
The Prolog Dictionary -
URL: http://www.cse.unsw.edu.au/~billw/prologdict.html
The Machine Learning Dictionary -
URL: http://www.cse.unsw.edu.au/~billw/mldict.html
The NLP Dictionary (Natural Language Processing) -
URL: http://www.cse.unsw.edu.au/~billw/nlpdict.html
Other places to find out about artificial intelligence include the AAAI (American Association for Artificial Intelligence) AI Reference Shelf
The URL of this AI Dictionary is http://www.cse.unsw.edu.au/~billw/dictionaries/aidict.html
ako | backward chaining | best first search | breadth first search | certainty factor | condition-action rule | conflict resolution | default | demon | if added | if removed | if replaced | if needed | if new | range | help demon | cache | multi_valued | depth first search | edge | expert system | facet | fire | forward chaining | frame | generic frame | goal state | graph | directed acyclic graphs | trees | binary trees | adjacency matrices | graph search algorithms | heuristic | inference engine | inheritance | initial state | instance frame | isa | match-resolve-act cycle | node | operator | state | initial state | goal state | path | procedural attachment | ripple down rules (RDR) | rule-based system | search | semantic network | slot | vertex | working memory
A
"ako" acts like an operator in the iProlog frame implementation.
For example, assuming that a furniture frame already
existed, chair ako furniture with ... would have the effect of
creating a new generic frame with all the
slots of the furniture generic frame,
together with whatever extra slots were specified after the with.
"ako" should be contrasted with isa.
One needs to know which possible conclusions of the system
one wishes to test for. Suppose, for example, in a medical
diagnosis expert system, that one wished to know if the
data on the patient supported the conclusion that the
patient had some particular disease, D.
In backward-chaining, the goal (initially) is to find evidence
for disease D. To achieve this, one would search for all rules whose
action-part included a conclusion that the patient had
disease D. One would then take each such rule and examine,
in turn, the condition part of the rule. To support the
disease D hypothesis, one has to show that these conditions
are true. Thus these conditions now become the goals of the
backward-chaining production system. If the conditions are not
supported directly by the contents of working memory, we need
to find rules whose action-parts include these conditions as
their conclusions. And so on, until either we have established
a chain of reasoning demonstrating that the patient has disease D,
or until we can find no more rules whose action-parts include
conditions that are now among our list of goals.
Backward-chaining is to be contrasted with
forward chaining.
A complete breadth first search traverses every node of the
tree or graph, starting from the root node or starting node,
first processing, checking, or inspecting the root/starting
node. In future we'll just say it "processes" the node. Next
it processes the neighbours of the root/starting node (in some
order), and then the neighbours of the neighbours, and so on,
until all the nodes have been processed.
In the case of a tree, no node will be visited twice - this is
a property of trees. In the case of a graph, whether a
directed acyclic graph or a general graph,
some nodes will be visited twice. On the second and
subsequent visits, the node and its neighbours should be
ignored. Thus a breadth-first algorithm on such graphs needs
to mark each node as visited when it first encounters
it, and check each node it comes to process to see if it has
already been visited.
For the tree shown below, the order of visiting for a
breadth first search would be: A B C D E F G H I J
A certainty factor of 1 means that the fact (or proposition) is highly
certain. A certainty factor of 0 means no information about whether the
proposition is true or not.
A certainty factor of -1 means that the proposition is certainly false.
A certainty factor of 0.7 means that the proposition is quite likely
to be true, and so on.
The certainty factors of
conditions are associated with facts held in
working memory. Certainty factors for actions are stored as
part of the rules.
Rules for manipulating certainty factors are given in the lecture notes on
uncertain
reasoning.
However, here is a simple example. Suppose that there is a rule
The knowledge of many expert systems is principally stored in their
collections of rules.
See also inference engine.
Here is a list of the demon types supported by the
iProlog frame implementation:
The following are not demons but demon-related slots in a frame.
For examples, see the lecture notes.
A complete depth first search traverses every node of the
tree or graph, starting from the root node or starting node,
first processing, checking, or inspecting the root/starting
node. In future we'll just say it "processes" the node.
Next it considers (but does not yet process) the neighbours
of the root/starting node. The neighbours should be ordered
in some way. Suppose that the first neighbour is called F1.
Depth-first search proceeds to search first the subtree or subgraph
composed of the neighbours of F1. Suppose that the first of F1's
neighbours is F2. Depth-first search proceeds by searching the
subtree or subgraph composed of the neighbours of F2. And so
on, until the bottom of the tree/graph is reached. Thus the
algorithm can be expressed
recursively as follows
(for a tree):
For the tree shown below, the order of first visiting for a
depth first search would be: A B D H E C F I G J
Compare breadth first search.
Knowledge representation methods include production
rules, frames, ripple-down
rules, semantic networks.
Many or most expert systems are rule-based systems.
For more details of this method of using rules, see
inference engine.
Forward-chaining is to be contrasted with
backward chaining.
Demons in frames differ from methods in a Java class in that a demon
is associated with a particular slot, whereas a Java method is not so
linked to a particular variable.
Technically, a
(directed) graph is a set V of vertices or nodes, together
with a set E of directed edges, which are ordered pairs of vertices.
Graphs are widely used in computer science as a modelling tool. A simple
example of a graph would be V = {1, 2, 3} and E = {(1,2), (3,1)}, which
could be drawn as: It is also possible to
have undirected graphs, in which the edges are not ordered but rather
unordered pairs. Consider the possibility of edges from a node to itself -
sometimes these could be useful, sometimes not. A directed cycle in
a directed graph is a sequence of edges (v1, v2), (v2, v3), ..., (vn, v1)
such that the second vertex of the final edge is the same as the first vertex
of the first edge. Here is a simple example:
Directed acyclic graphs are graphs with no directed
cycles.
Trees are a special kind of directed graph, in
which there is a special vertex, called the root, and which has
in-degree 0, and every other vertex has in-degree 1.
Binary trees are a special kind of tree, in
which every node has out-degree at most 2.
Graphs can be
represented in a variety of ways. One can represent them directly as lists or
other collections of (directed) edges:
0 0 1 0
The structures represented using graphs in Artificial Intelligence (and
elsewhere) frequently need to be searched. There are a number of graph search algorithms for this purpose.
In the case of a semantic network, if I try to use the network
to retrieve, say, the number of legs of a node (with name "Dumbo")
the system will first look to see if the "Dumbo" node has an explicit
"legs" link. If so, it is followed. If not, inheritance is applied,
and, since "Dumbo" is an object rather than a type, the
isa link is followed. Assuming "Dumbo" isa
elephant, we then check the "elephant" node to see if
it has a link labelled "legs". If so, we use it. If not, we
look to see if "elephant" has a ako
link, perhaps to "mammal". If mammal has a link labelled "legs"
then we use it. If not, then we look for further "ako" links from
either "elephant" or "mammal", and so on, until we either find
the "legs" or run out of semantic network to search.
In the case of a frame, the effect is the same, but the details
are different - an "elephant" frame would have been constructed
using the information in a "mammal" frame, since elephant ako
mammal. The "Dumbo" instance frame
will have been constructed using the "elephant"
generic frame since Dumbo isa elephant. Thus
elephant inherits all the properties of mammal and
Dumbo inherits all the properties of elephant.
At each stage, there is an opportunity to change e.g. the number of
legs if Dumbo should happen to an aberrant elephant in the matter
of legs.
"isa" acts like an operator in the iProlog frame implementation.
For example, X isa dog with ... would have the effect of binding
X to a new instance frame with all the
slots of the dog generic frame,
together with whatever extra information (such as slot values)
was provided after the with.
"isa" should be contrasted with ako.
The sequence of states and operators (or sometimes just the states)
that lead from the initial state to the goal state is referred to
as a path.
The trick lies in choosing operators that do
in fact lie along a path, and preferably a short or cheap path
towards the or a goal state. Sometimes it is possible to navigate
intelligently through state space, but sometimes blind
backtracking
search through state space is the only possibility.
In most cases, it is necessary to check, at each state, which
operators are feasible at this particular point. If, for example,
the states were physical positions in some real or simulated terrain,
the operators moved one in different physical directions, it would
be necessary to check for example that there were no barriers in
some directions, or that there were no bad consequences for steps
in certain directions. For example, a step to the West might land
lead to a state which could not be escaped from with any of the
available operators.
Particular kinds of search are described under the headings
breadth-first search,
depth-first search,
and
best-first search
Here is a larger fragment of a semantic net,
showing 4 labelled nodes (Fifi, cat, mammal, milk) and three labelled edges
(isa, ako, likes) between them.
The term "working memory" is also used in cognitive psychology, where
it refers to the limited store of "chunks" (roughly, items in
memory) available at the same time for conscious processing.
B
C
A
/ \
/ \
B C
/ \ / \
D E F G
/ \ \
H I J
Compare depth first search.
D
(i) X is a dog and X likes cheese and X chases cars
(ii) X is a dog and X likes cheese
Then (i) is more specific than (ii) so under specificity ordering, you would
use (i).
(ii) X is a dog and X likes cheese
(iii) X is a dog and X bites postmen and X chases cars and X has rabies
Then (iii) is has larger size (i.e. more conditions) than (ii) so under
size ordering, you would use (iii). Note that neither rule is more
specific than the other, so this is different from specificity ordering,
which can be viewed as a special case of size ordering.
Size ordering will work in cases where specificity ordering will not.
Conflict resolution by size ordering can of course fail if there is
tie for the satisfied rule with the most conditions.
E
to depthFirstSearch a tree with root R
if tree is empty
then % we're finished
else
let N1, N2, ..., Nk be the neighbours of R
depthFirstSearch the subtree with root N1
depthFirstSearch the subtree with root N2
...
depthFirstSearch the subtree with root Nk
In the case of a tree, no node will be visited twice - this is
a property of trees. In the case of a graph, whether a
directed acyclic graph or a general graph,
some nodes will be visited twice. On the second and
subsequent visits, the node and its neighbours should be
ignored. Thus a depth-first algorithm on such graphs needs
to mark each node as visited when it first encounters
it, and check each node it comes to process to see if it has
already been visited.
A
/ \
/ \
B C
/ \ / \
D E F G
/ \ \
H I J
In the case of binary trees there are 3 common
variants of depth-first search called pre-order, in-order, and post-order
traversal. The variants distinguish between
first visiting a node, and processing that node, i.e.
doing something with the data stored in the node (e.g. printing out
the name of the node). There are six possible orders for three objects,
of which the three orders commonly used are as follows:
F
G
H
1 ------> 3
^ |
| |
| v
2 <------ 4
The in-degree of a vertex v in a directed graph is the number of
directed edges (u, v) such that v is the second vertex of the edge. In the
following example, vertex b has in-degree 2 and the other vertices have
in-degree 0. In the example above, all vertices have in-degree 1.
a
|
|
v
b <------ c
The out-degree of a vertex u in a directed graph is the number of
directed edges (u, v) such that u is the first vertex of the edge. In the
example above, vertex b has out-degree 0 and the other vertices have
out-degree 1.
edge(1, 3).
edge(3, 4).
edge(4, 2).
edge(2, 1).
or
[[1, 3], [3, 4], [4, 2], [2, 1]]
It is also possible to use adjacency matrices,
a representation using a matrix of 0s and 1s:
1 0 0 0 .... the 1 in the (2,1)-position tells us (2,1) is an edge
0 0 0 1
0 1 0 0
J
K
L
M
N
loop
1. match all condition parts of condition-action rules
against working memory and collect all the rules that match;
2. if more than one match, resolve which to use;
3. perform the action for the chosen rule
until action is STOP or no conditions match
Step 2 is called conflict resolution. There
are a number of conflict resolution strategies.
P
Q
R
T
U
V
Y
Z