酷兔英语

章节正文

D

 

default
In frames, a default (value) is a value to be assigned to a particular slot in an instance frame if a specific value has not be assigned or added to that slot. The default is specified as part of the corresponding generic frame, and thus is inherited by the instance frame when the instance frame is created.
demon
if_added
A demon is a facet of a slot in a frame which causes some action to be taken when the frame is accessed in certain types of ways. For example, an if-needed demon is activated or triggered if the value of the slot is required and a value has not yet been stored in the slot, and it should calculate or otherwiseobtain a value for the slot, while a range demon is triggered if a new value is added to the slot, to check that the value added is permissible for this particular slot.

Here is a list of the demon types supported by the iProlog frame implementation:

 

demons are triggered when a new value is put into a slot.
if_removed
demons are triggered when a value is removed from a slot.
if_replaced
is triggered when a slot value is replaced.
if_needed
demons are triggered when there is no value present in an instance frame and a value must be computed from a generic frame.
if_new
is triggered when a new frame is created.
range
is triggered when a new value is added. The value must satisfy the range constraint specified for the slot.
help
is triggered when the range demon is triggered and returns false.

The following are not demons but demon-related slots in a frame.

 

cache
means that when a value is computed it is stored in the instance frame.
multi_valued
means that the slot may contain more than one value.

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:

 

  • process node, visit left subtree, visit right subtree. This variant is called pre-order traversal. In order traversal of the binary tree shown above processes the nodes in the order A B D H E C F I G J as for simple depth-first search.
  • visit left subtree, process node, visit right subtree. This variant is called in-order traversal. In order traversal of the binary tree shown above processes the nodes in the order H D B E A F I C G J.
  • visit left subtree, visit right subtree, process node. This variant is called post-order traversal. In order traversal of the binary tree shown above processes the nodes in the order H D E B I F J G C A.

Compare breadth first search.

 

directed acyclic graph

see graph

 

directed graph

see graph

 

E

 

edge
A component of a graph.
expert system
An expertsystem is a computersystem intended to perform at the level of a human expert in whateverdomain it aspires to deal with. Early expert systems included systems aimed at medical diagnosis. All expert systems must confront the issue of knowledge representation - that is, how the program will encode the knowledge of the human expert.

Knowledge representation methods include production rules, frames, ripple-down rules, semantic networks. Many or most expert systems are rule-based systems. 



文章标签:词典  

章节正文