D
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.
depth first search
Depth-first search is best understood with respect to a tree, though it can be applied to graphs in general, provided a starting node is nominated.
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):
to depthFirstSearch a tree with root R if tree is empty then % we're finished elselet 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.
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
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:
Compare breadth first search.
directed acyclic graph
see graph
directed graph
see graph
E
Knowledge representation methods include production rules, frames, ripple-down rules, semantic networks. Many or most expert systems are rule-based systems.