1. Technical Field
This invention relates to a method for modifying a logical expression. More specifically, the method automates placement of a new node to a parent node that supports at least three connecting nodes.
2. Description Of The Prior Art
Data structures in the form of trees are known as efficient tools for building tables and supporting searches beginning with a known prefix. A tree is a data structure accessed first at the root node. Each subsequent node can be either an internal node with further subsequent nodes or an external node with no further nodes existing under the node. An internal node refers to or has links to one or more descending or child nodes and is referred to as the parent of its child nodes, and external nodes are commonly referred to as leaves. The root node is usually depicted at the top of the tree structure and the external nodes are depicted at the bottom.
Tree structures are often defined by the characteristics of the tree. For example, a Binary Tree is a tree with at most two children for each node. A Digital Tree is a rooted tree where the leaves represent strings of digital symbols. The Patricia Tree is a Digital Tree with suppression of one way branching that prohibits keys which are strict prefixes of other branches. In general, a Patricia tree is always a digital tree, but only a binary tree when the symbol alphabet is binary. The internal nodes represent a common prefix to a set of strings, and each child of that node corresponds to a choice of the next symbol to follow the common prefix. A Patricia Tree can take the form of a Binary Tree and a Digital Tree where all internal nodes have at least two children.
Problems arise in adding leaves to the tree structure. In a Binary Tree where there is at most two children for each node, adding a leaf to the tree is straight forward. However, problems arise in a multiple node tree which supports more than two child nodes for each parent node. Prior art methods for modifying a tree structure that supports more than two children per node require a person to specify whether it is an operation to add a binary operator or to add a node to the tree. However, this method is time consuming as the person must select the location and operator for each child node to be added to the tree structure. Therefore, there is a need that supports automating placement of a new node in a tree structure that supports more than two children per node.
This invention comprises a method and system for automating modification of a multiple node supporting tree structure based upon selection of a location for addition of a new child node.
In one aspect, a method is provided to amend a multiple node tree structure. Data storage media is provided to store the tree structure, with the tree structure including multiple nodes. Each node type is in the form of a logical operator or a logical clause, and each node in the tree structure is classified as a child node or as a parent node. Links within each connection between each child node and each parent node are also classified. Each connection includes two or more child links and a parent link. The two or more child links are defined as branches within the connection, with the branches emanating from the child node. The parent link is defined as a trunk within the connection, with the trunk emanating from the parent node. To add a new node, a link within the tree structure is selected. A type of the new node to be added to the tree structure is defined by a classification of the selected link within a selected connection corresponding to the selected link.
In another aspect, a system is provided to amend a node tree structure. Data storage media is provided to store the tree structure, with the tree structure including multiple nodes. A type of each node is either a logical operator or a logical clause. A classification manager is provided to classify each node in the tree structure as a child node or as a parent node. The classification manager classifies links within each connection between each child node and each parent node. Each connection includes two or more child links and a parent link. The two or more child links are defined as branches within the connection, with the branches emanating from the child node. The parent link is defined as a trunk within the connection, with the trunk emanating from the parent node. A selection manager is provided to select a link within the tree structure to add a new node. A type of the new node to be added to the tree structure is defined by a classification of the selected link within a selected connection corresponding to the selected link.
In yet another aspect, an article is provided with a computer-readable storage medium having instructions to amend a node tree structure. Instructions are provided to store the tree structure, the tree structure including multiple nodes. A type of each node in the tree structure is either a logical operator or a logical clause. Instructions are provided to classify each node in the tree structure as a child node or as a parent node. Instructions are also provided to classify links within each connection between each child node and each parent node, wherein each connection includes two or more child links and a parent link. The two or more child links are defined as branches within the connection, with the branches emanating from the child node. The parent link is defined as a trunk within the connection, with the trunk emanating from the parent node. Instructions are provided to select a link within the tree structure for adding a new node. A type of the new node to be added to the tree structure is defined by a classification of the selected link within a selected connection corresponding to the selected link.
Other features and advantages of this invention will become apparent from the following detailed description of the presently preferred embodiment of the invention, taken in conjunction with the accompanying drawings.
a and 2b are flow charts illustrating a process for modifying a tree structure according to the preferred embodiment of this invention, and is suggested for printing on the first page of the issued patent.
Automating the process of modifying a binary tree structure in the form of adding a new node to a node that can only have two child nodes is known in the art. However, in a tree structure where each node can have three or more nodes, i.e. N-ary operators, automating the process of modifying the tree structure when a new node is added becomes complicated. In one embodiment of the invention, a distinction is made between a parent node and a child node, and connections near a child node, known as a child link, and connections near a parent node, known as a parent link.
Once each of the elements in the tree structure are defined, modification of the tree structure may be automated.
As described in
The classification of each node and each connection in a multiple node supporting tree structure supports automated editing of the tree structure. Each part of a link, whether it is a child link or a parent link, performs an operation related to a nearby node. The location of the proposed change to the tree structure automatically selects the type of node to be added to the tree structure. When the link selected for editing is associated with a multiple clause operator, a new child may be created to the node so that the node support three or more leaves. Accordingly, the tool supports automatically editing a multiple node tree structure based upon a selection of a link within the tree structure.
It will be appreciated that, although specific embodiments of the invention have been described herein for purposes of illustration, various modifications may be made without departing from the spirit and scope of the invention. In particular, the method and tool shown herein may be applied to a binary tree to support automated modifications to the tree structure. Accordingly, the scope of protection of this invention is limited only by the following claims and their equivalents.
This application is a continuation patent application claiming the benefit of the filing date of U.S. patent application Ser. No. 11/048,043 filed on Jan. 31, 2005 and titled “Method for Automatically Modifying A Tree Structure,” now pending, which is hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 11048043 | Jan 2005 | US |
Child | 13549595 | US |