Abstract
A method and system are provided to support automated modification to a multiple node tree structure. Each clause and each logical operator are defined in the tree structure as nodes. In addition, each link emanating from a child node to a parent node is defined as a child link, and each link emanating from a parent node to a child node is defined as a parent link. The selection and location of an operator for placement in the tree structure will be automated in response to the position selected.
Claims
1. A method comprising: non-transitory computer readable storage media for storing a tree structure, the tree structure including multiple nodes, a type of each node selected from a group consisting of: a logical operator and a logical clause; classifying each node in the tree structure as a child node or a parent node, wherein the tree structure includes at least one parent node being an n-ary operator; classifying 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 defined as branches within the connection, the branches emanating from the child node, and the parent link defined as a trunk within the connection, the trunk emanating from the parent node; selecting a child link or parent link within the tree structure for adding a new node, wherein 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; and creating a new operator node on the selected parent link and a new clause node on a new child link within the selected connection if the selected link is classified as the parent link.
2. The method of claim 1, further comprising creating the new clause node on the new child link within the selected connection if the selected link is classified as the child link.
3. A system comprising: non-transitory computer readable storage media to store a tree structure, the tree structure including multiple nodes, a type of each node selected from a group consisting of: a logical operator and a logical clause; a classification manager to classify each node in the tree structure as a child node or as a parent node, wherein the tree structure includes at least one parent node being an n-ary operator; the classification manager 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 defined as branches within the connection, the branches emanating from the child node, and the parent link is defined as a trunk within the connection, the trunk emanating from the parent node; a selection manager to select a child link or parent link within the tree structure for adding a new node, wherein 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; and the selection manager to create a new operator node on the selected parent link and a new clause node on a new child link within the selected connection if the selected link is classified as the parent link.
4. The system of claim 3, further comprising the selection manager to create a new clause node on a new child link within the selected connection if the selected link is classified as a child link.
5. An article comprising: a non-transitory computer-readable storage medium, the storage medium including instructions for amending a node tree structure comprising, the instructions comprising: instructions to store the tree structure, the tree structure including multiple nodes, wherein the tree structure includes at least one parent node being an n-ary operator, and a type of each node selected from a group consisting of: a logical operator and a logical clause; instructions to classify each node in the tree structure as a child node or as a parent node; instructions 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 defined as branches within the connection, the branches emanating from the child node, and the parent link is defined as a trunk within the connection, the trunk emanating from the parent node; instructions to select a child link or parent link within the tree structure for adding a new node, wherein 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; and instructions to create a new operator node on the selected parent link and a new clause node on a new child link within the selected connection if the selected link is classified as the parent link.
6. The article of claim 5, further comprising instructions to create a new clause node on a new child link within the selected connection if the selected link is classified as a child link.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) FIG. 1 is a prior art diagram of a tree structure.
(2) FIGS. 2A 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.
(3) FIG. 3 is a block diagram of a modified tree structure following selection of a child link.
(4) FIG. 4 is a block diagram of a modified tree structure following selection of a parent link.
DESCRIPTION OF THE EMBODIMENTS
Overview
(5) 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.
Technical Details
(6) FIG. 1 is a block diagram (10) of a tree structure with four clauses (12), (14), (16), (18), represented as nodes, and three logical operators (20), (22), and (24). Each clause (12), (14), (16), and (18) is defined as a child node from the perspective of the logical operators (20) and (22). Similarly, each logical operator (20), (22), (24) is defined as a node, with logical operator.sub.1 node (20) and logical operator.sub.2 node (22) being parents nodes to clauses (12), (14), (16), and (18), and logical operator.sub.3 node (24) being a parent node to logical operator.sub.1 node (20) and logical operator.sub.2 node (22). Logical operator.sub.1 node (20) is a parent node to clause.sub.1 (12) and clause.sub.2 node (14), and logical operator.sub.2 node (22) is a parent node to clause.sub.3 node (16) and clause.sub.4 node (18). Although both logical operator.sub.1 node (20) and logical operator.sub.2 node (22) are parent nodes to the defined child node, they may be defined as child nodes to logical operator.sub.3 node (24). It is important to note that a logical operator can be a child node as well. However, in the example shown herein the logical operator nodes are parent nodes to the defined child nodes. A connection from the clause.sub.4 node (18) to the logical operator.sub.2 node (22) is defined as a child link (30), and a connection from clause.sub.3 node (16) to logical operator.sub.2 node (22) is also defined as a child link (32). Similarly, a connection from the clause.sub.2 node (14) to logical operator.sub.1 node (20) is defined as a child link (34), and a connection from the clause.sub.1 node (12) to logical operator.sub.1 node (20) is defined as child link (36). In addition to the child links as defined, parent links are the connections emanating from the parent node. A connection from logical operator.sub.1 node (20) to child links (34) and (36) is defined as parent link (40), and a connection from logical operator.sub.2 node (22) to child links (30) and (32) is defined as parent link (42). Accordingly, each node and each link connecting nodes are defined in the tree structure.
(7) Once each of the elements in the tree structure are defined, modification of the tree structure may be automated. FIGS. 2A and 2B are a flow chart (100) illustrating a process for automating selection and placement of a new node in a tree structure. Each clause in the tree structure is designated as a node (102), and each logical operator in the tree structure is designated as a node (104). Furthermore, each link near a child node among the links which connect a parent node and a child node, the portion of the branch, is defined as a child link (106), and each link near a parent node among the links which connect a parent node and a child node, the portion of the trunk, is defined as a parent link (108). Before initiating a change to the tree structure, a test is conducted to determine if the change requires adding a new node to the tree structure (110). A negative response to the test at step (110) is an indication that the change may be in the form of editing an existing node, whether it be one or more of the logical operators or one of more of the clauses in the tree structure. As such, the process of adding a new node to the existing tree structure ends (112). However, if the response to the test at step (110) is positive, a subsequent test is conducted to determine if the new node to be added to the tree structure is located on a child link in a multiple node supporting tree structure (114) as defined at step (106). A positive response to the test at step (114) will result in creation of a new logical operator and a new clause in the multiple node supporting tree structure (116). However, a negative response to the test at step (114) or following the completion of step (116) will result in another test to determine if the new node to be added to the tree structure is located on a parent link in a multiple node supporting tree structure (118) as define at step (108). If the response to the test at step (118) is negative, this is an indication that the modification of the tree structure does not include addition of a new node to the tree structure (120). However, a positive response to the test at step (118) will result in creation of a new clause in the form of a new child node using the logical operator type of the parent node (122). Following the creation of the new node at step (122), a final test is conducted to determine if there are any additional changes to be made to the tree structure (124). A positive response to the test at step (124) will result in a return to step (110) to determine the location and modification to be made to the tree structure. Similarly, a negative response to the test at step (124) will result in a conclusion of modifications to the tree structure (126). Accordingly, the process of determining the placement and category of a modification to a tree structure is automated based upon the specified location of the modification.
(8) As described in FIGS. 2A and 2B, each clause is defined as a node and each logical operator is defined as a node. In one embodiment, the logic shown in FIGS. 2A and 2B may be embodied into a tool that includes an interface to enable a user to intuitively modify a tree structure. The tool may be stored on a computer-readable storage medium as it is used to modify data in a machine readable format. The tool may include a requestor to determine the need for modifying the tree structure and to communicate with a manager to select the location and modification of the tree structure. The requestor and manager of the tool manager may be in the form of hardware elements within the computer system, or software elements in a computer-readable storage medium.
(9) FIG. 3 is a block diagram (150) of the modified tree structure of FIG. 1 after editing a binary operator on child link (34). As shown, there are four original clauses (152), (154), (156), and (158), and three original logical operator nodes (160), (162) and (164). Each clause node has a child link connected to a parent link of a logical operator node. Following the process of editing the binary operator on child link (34), a new clause.sub.NEW node (180) is created with a new child link (182) in communication a new parent link (184) of a new node, logical operator.sub.NEW (186). Similarly, clause.sub.1 node (152) retains child link (168) in communication with parent link (166) of logical operator.sub.1 node (160), clause.sub.2 node (154) obtains a new child link (170) in communication with new link (184) of a new logical operator.sub.NEW node (186), clause.sub.3 node (156) retains child link (190) in communication with parent link (194) of logical operator.sub.2 node (162), and clause.sub.4 node (158) retains child link (192) in communication with parent link (194) of logical operator.sub.2 node (162). Accordingly, the process of editing a child link to add a new logical operator in a tree structure that support multiple nodes results in creation of both a new child node having a new clause and a new parent node in the form of a logical operator.
(10) FIG. 4 is a block diagram (250) of the modified tree structure of FIG. 1 after editing a binary operator on parent link (40). As shown, there are four original clauses (252), (254), (256), and (258), and three original logical operator nodes (262), (264), and (266). Each clause node has a child link connected to a parent link of a logical operator node. Following the process of editing the binary operator on parent link (278), a new clause.sub.NEW node (260) is created with a new child link (272) in communication with the original parent link (278) of logical operator.sub.1 node (262). Similarly, clause.sub.1 node (252) has a child link (268) in communication with parent link (278) of logical operator.sub.1 node (262), clause.sub.2 node (254) has a child link (270) in communication with parent link (278) of logical operator.sub.1 node (262), clause.sub.3 (256) has a child link (274) in communication with parent link (280) of logical operator.sub.2 node (264), and clause.sub.4 (258) has a child link (276) in communication with parent link (280) of logical operator.sub.2 node (264). Accordingly, the process of editing a parent link to add a new logical operator in a tree structure that supports multiple nodes results in creation of a new clause with three or more child nodes (252), (254) and (260) all in communication with parent link (278).
Advantages Over the Prior Art
(11) 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.
Alternative Embodiments
(12) 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.