F
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.
G
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:
1 ------> 3 ^ | | | | v 2 <------ 4The 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 <------ cThe 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.
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:
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:
0 0 1 0
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
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.