JPS62154024A - Tree structure data processing system - Google Patents

Tree structure data processing system

Info

Publication number
JPS62154024A
JPS62154024A JP60292634A JP29263485A JPS62154024A JP S62154024 A JPS62154024 A JP S62154024A JP 60292634 A JP60292634 A JP 60292634A JP 29263485 A JP29263485 A JP 29263485A JP S62154024 A JPS62154024 A JP S62154024A
Authority
JP
Japan
Prior art keywords
cell
field
argument
tree structure
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP60292634A
Other languages
Japanese (ja)
Inventor
Tadashi Hirose
広瀬 正
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP60292634A priority Critical patent/JPS62154024A/en
Publication of JPS62154024A publication Critical patent/JPS62154024A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To efficiently express even a specific binary tree (list structure) in terms of memory by setting to each cell a bit field giving meanings equivalent to denoting the function element of list structure. CONSTITUTION:The titled system relates to a data expression system when a tree structure storage program 414 stores data of tree structure in a data part 420. Memory composed of 32 bits, called a 'cell', comprises the data part, and the target tree structure is expressed by said cell group. If a name identifier field 35 expresses a function name identifier, that is, when a name identification field 34 is '01', a cell following the cell concerned denotes the argument of the function. In the cell expressing the argument, a list bit field 32 is used for showing whether continuously an argument cell exists or not. '1' and '0' show that the following cell is an argument cell and that it is not an argument cell, respectively. The former means that the cell concerned is a finals argument cell.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、木構造データの処理方式に係り、特にn進木
構造の表現が可能であり、かつ特定の2進木構造をメモ
リ効率良く表現し処理するに好適な木構造データ処理方
式に関する。
[Detailed Description of the Invention] [Field of Application of the Invention] The present invention relates to a processing method for tree-structured data, and in particular, it is capable of expressing an n-ary tree structure and expresses a specific binary tree structure with memory efficiency. This invention relates to a tree structure data processing method suitable for processing data.

〔発明の背景〕[Background of the invention]

従来のn連木構造データ表現方式は、たとえば2種のセ
ル種別(FunetorセルとReferenceセル
)を設け、n進水のm引数ノードを連続したm+1個の
セルで表わし、ノード間の関係はReferenceセ
ルを用いて表わす方式であった。n進木構造データf 
(a、g (b)、c)をこの方式で表わした例を第1
図(a)に示す。
In the conventional n-linked tree structure data representation method, for example, two types of cells (Funetor cell and Reference cell) are provided, and n-launched m-argument nodes are represented by m+1 consecutive cells, and the relationship between the nodes is defined as Reference. It was a system that used cells to represent it. n-ary tree structure data f
The first example of expressing (a, g (b), c) using this method is
Shown in Figure (a).

n進木構造データの中でも、特にデータの並らびを表わ
すために使用される特定の2進木構造(リスト構造)は
頻度高く使用される。しかし、従来方式ではこの点への
配慮がなく、Q個のデータの並らびを表現する場合、3
12個のセルが必要であった。3個のデータa、b、 
Cの並らびに従来方式で表わした場合の例を第1図(b
)に示す。
Among the n-ary tree structure data, a specific binary tree structure (list structure) used to represent an arrangement of data is frequently used. However, the conventional method does not take this point into account, and when expressing a sequence of Q pieces of data, 3
Twelve cells were required. Three pieces of data a, b,
Figure 1 (b
).

ここで「・」はリスト構造の関数名称、rN I LJ
は、並らびの最後を表わすリスト構造特有のデータであ
る。
Here, "・" is the function name of the list structure, rN I LJ
is data unique to the list structure that indicates the end of the sequence.

リスト構造の効率良い表現方式としてcdrcodiB
方式が知られている0水力式は各セルに2ビツトの付加
情報を持たせ、CAR,CDR,NEXT、NILの4
種のセル種別を設けることにより、Q個のデータの並ら
びをQ個のセルで表現する方式である。
cdrcodiB as an efficient representation method for list structures
The 0-hydro type, which is a known method, has 2 bits of additional information in each cell, and has 4 bits of information: CAR, CDR, NEXT, and NIL.
By providing different cell types, Q data arrays are expressed by Q cells.

第1図(b)のリスト構造は第2図の様に表わし得る。The list structure of FIG. 1(b) can be expressed as shown in FIG.

しかし、本方式を用いて、n進木構造で表現すると、リ
スト構造を効率良く表現するというcdrcoding
方式の特徴が失なわれる。たとえば、第1図(a)に示
したn進水を表現する場合、第3図(a)に示す様に2
進木に変換せざるを得ない、つまり、cdrcodin
g方式の表わす意味を変えねばならない、このとき、第
2図の構造はa(b。
However, if this method is used to express the list structure as an n-ary tree structure, cdrcoding can efficiently express the list structure.
The characteristics of the method are lost. For example, when expressing n launches as shown in Figure 1(a), 2 launches as shown in Figure 3(a).
It has to be converted to Shinki, that is, cdrcodin
The meaning expressed by the g method must be changed. In this case, the structure in FIG. 2 is a(b).

C)を表わすと見なさざるを得す、したがって3つのデ
ータa、b、cの並らびを表わすには、第3図(b)の
ごとく、9個のセルを使用しなければならなくなる。
Therefore, to represent the sequence of three data a, b, and c, nine cells must be used as shown in FIG. 3(b).

cdrcodingについてはたとえばグリーンブラッ
ト他著゛′ザ・リスプマシン”エム・アイ・ティー人工
知能研究所、1979年(Green blatt、R
ichartetal、  ”The  Li5p  
Machine” 阿IT  ArtificialI
ntelligence Laboratory 19
79)等の文献で知られている。
Regarding cdrcoding, for example, see Greenblatt et al., "The Lisp Machine," MIT Artificial Intelligence Research Institute, 1979 (Green blatt, R.
ichartetal, “The Li5p
Machine” IT ArtificialI
intelligence Laboratory 19
79), etc.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、n連木データ構造が表現可能があり、
かつ特定の2進水(リスト構造)についてもメモリ効率
良く表現することのできるn進木構造データを可能した
木構造データ処理方式を提供することにある。
An object of the present invention is to be able to express an n-chained data structure,
Another object of the present invention is to provide a tree-structured data processing method that enables n-ary tree-structured data that can express specific binary data (list structure) with high memory efficiency.

〔発明の概要〕[Summary of the invention]

上述の目的を達成するため、本発明は各セルに、リスト
構造の関数子を表わすに等しい意味を持たせるビットフ
ィールドを設定する。
To achieve the above object, the present invention sets a bit field in each cell to have a meaning equivalent to representing a function of a list structure.

これは、cdrcoding方式の様にリストの最後を
表わすためのビットフィールドを持たせないという点で
、 cdrcoding方式と異なっている。またセル
内に「リストビットフィールド」なるものを設定した点
で従来のn進木構造表現方式と異なっている。
This differs from the cdrcoding method in that it does not have a bit field to represent the end of the list, unlike the cdrcoding method. It also differs from the conventional n-ary tree structure representation method in that a "list bit field" is set within the cell.

結果的に、本方式はcdrcoding方式および従来
のn進水表現方式の中間的なメモリ効率特性が実現され
得る様になった。リスト構造以外のn進水の表現に関す
る限り、「リストビットフィールド」の分だけ、従来の
n進木構造よりもメモリ効率が悪いが、リスト構造はメ
モリ効率良く表現できる。
As a result, this method can achieve memory efficiency characteristics intermediate between the cdrcoding method and the conventional n-launch representation method. As far as n-ary launches other than list structures are concerned, memory efficiency is lower than conventional n-ary tree structures due to the "list bit field," but list structures can be expressed with memory efficiency.

リスト構造だけを表現する場合は、「リストの最後を表
わすセルが必要となる分だけ、cdrcoding方式
よりメモリ効率が悪いが1水力式ではn進水も表現でき
る。したがって、n進木構造とリスト構造とが混在する
場合、従来の2方式のいずれよりもメモリ効率よく、そ
れらの本構造を表現し得る方式と云える。
When expressing only a list structure, "The memory efficiency is lower than the cdrcoding method because it requires a cell to represent the end of the list, but the 1-hydro method can also represent n launches. Therefore, the n-ary tree structure and the list When structures coexist, it can be said that this method can express these structures with more memory efficiency than either of the two conventional methods.

さらに、「リストビットフィールド」は、n進水のノー
ドを表現する場合、そのノードの引数の最後を示すこと
にも利用できるので、n進木構造表現におけるメモリ効
率の悪化は、実質的に各セル1ビツトよりも少ない。
Furthermore, when representing an n-ary node, the "list bit field" can also be used to indicate the end of the argument for that node, so the memory efficiency deterioration in the n-ary tree structure representation is substantially reduced by each Less than 1 bit per cell.

〔発明の実施例〕[Embodiments of the invention]

以下、本発明の実施例を図により詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.

本発明が実施例として簡単な木構造操作表示システムを
示す。第4図(a)は本システムのハードウェア構成を
示すもので、中央演算装置41、記憶装@42、入出力
管理装置43がデータバス44で結合されておりCRT
表示装置45およびキー人力装置46がX出力管理装置
43と別のデ−タバス47で結合されている・ 第4図(b)は本システムのソフトウェア構成を示すも
ので、モニタプログラム411、入力促進表示プログラ
ム412、入力木構造解析プログラム413、木構造格
納プログラム414、木構造検索プログラム415、お
よび木構造表示プログラム416から構成されるプログ
ラム部410と、木構造データを記憶するデータ部42
0から構成される。
The present invention shows a simple tree structure operation display system as an embodiment. FIG. 4(a) shows the hardware configuration of this system, in which a central processing unit 41, a storage device @42, an input/output management device 43 are connected by a data bus 44, and a CRT
A display device 45 and a key input device 46 are connected to the X output management device 43 by another data bus 47. FIG. 4(b) shows the software configuration of this system, including a monitor program 411, an input prompt A program section 410 consisting of a display program 412, an input tree structure analysis program 413, a tree structure storage program 414, a tree structure search program 415, and a tree structure display program 416, and a data section 42 that stores tree structure data.
Consists of 0.

第5図に本システムにおける処理の流れを示す。Figure 5 shows the flow of processing in this system.

これは、モニタプログラム411の動作内容に相当する
部分である。システムが起動されると、入力促進表示プ
ログラム412を起動し、(51)、CRT表示装置4
5の上に入力促進記号を表示する、次にオペレータから
の入力データ(木構造)を読み込み解析する入力木構造
解析プログラム413を起動しく52)、入力されたデ
ータの値を判断して(53)、木構造格納プログラム4
14あるいは木構造検索プログラム415を起動しく5
4.55)データ部420に木構造データを格納、ある
いは格納されている木構造データを検索する0次に木構
造表示プログラム416を起動しく56)、格納した木
構造データ、あるいは検索した木構造データをCR7表
示装置上に表示する。
This part corresponds to the operation content of the monitor program 411. When the system is started, the input prompting display program 412 is started (51), and the CRT display device 4
Display an input prompt symbol above 5, then start the input tree structure analysis program 413 that reads and analyzes input data (tree structure) from the operator (52), and determines the value of the input data (53). ), tree structure storage program 4
14 or start the tree structure search program 415.
4.55) Store the tree structure data in the data section 420, or start the zero-order tree structure display program 416 that searches the stored tree structure data.56) Store the stored tree structure data or search the tree structure data. Display the data on a CR7 display.

本発明は、木構造格納プログラム414がデータ部42
0に木構造データを格納する場合のデータ表現方式に関
するものである。データ部は1′セル″と呼ぶ32ビツ
トから成るメモリ単位から構成し、目的とする木構造は
この“セル″の集まりで表現する。以下セルの構造を詳
細に説明する。
In the present invention, the tree structure storage program 414
This relates to a data representation method when storing tree-structured data in 0. The data section consists of a memory unit consisting of 32 bits called 1' cell, and the target tree structure is expressed by a collection of these "cells".The structure of the cell will be explained in detail below.

第6図(a)に示す如く、32ビツトを1つのセル(3
0)とし、その下位2ビツトをそれぞれポインタビット
フィールド(31)、リストビットフィールド(32)
とする。残りの30ビツトは内容フィールド(33)と
呼ぶ。
As shown in Figure 6(a), 32 bits are stored in one cell (3
0), and the lower two bits are respectively a pointer bit field (31) and a list bit field (32).
shall be. The remaining 30 bits are called the content field (33).

リストビットフィールド(32)は、当該セルがリスト
構造に属し、しかもその第1引数が内容フィールドとポ
インタビットフィールドで表わされており、さらに続く
セルがリスト構造の第2引数であるとき、l(I I+
、さもなければ“OI+とする。
List bit field (32) is used when the cell belongs to a list structure, its first argument is represented by a content field and a pointer bit field, and the following cell is the second argument of the list structure. (I I+
, otherwise it is set as “OI+”.

ポインタビットフィールド(31)は当該セルの内容フ
ィールドが他のセルを指すポインタを表わしているとき
′″1″、さもなければ“0″とする。
The pointer bit field (31) is set to ``1'' when the content field of the cell in question represents a pointer pointing to another cell, otherwise it is set to ``0''.

ポインタビットフィールド(31)が“0″のとき、す
なわち、内容フィールド(33)が他のセルを指すポイ
ンタでないとき、内容フィールド(33)は、さらに、
第6図(b)に示す如く、名称識別子フィールド(35
)と名称種別フィールド(34)とから構成する。
When the pointer bit field (31) is "0", that is, when the content field (33) is not a pointer pointing to another cell, the content field (33) further contains:
As shown in Figure 6(b), the name identifier field (35
) and a name type field (34).

名称種別フィールド(34)は、名称識別子フィールド
(35)が定数名称識別子を表わすとき” o o ’
″、関数名称識別子を表わすときLg O11+とする
The name type field (34) is "o o' when the name identifier field (35) represents a constant name identifier.
'', when representing a function name identifier, use Lg O11+.

名称識別子フィールド(35)が関数名称識別子を表わ
すとき、すなわち名称種別フィールド(34)が“01
″のとき、当該セルに続くセルがその関数の引数を表わ
す。引数を表わすセルにおいて、リストビットフィール
ド(32)は、続いて引数セルが存在するか否かを表わ
すための使用され、′1”は続くセルも引数セルである
ことを、パ0′″はそうでないこと、すなわち当該セル
が最後の引数セルであることを示す、なお、リストピッ
シフイールドが“1″、ポインタビットフィールドが“
0”、さらに名称種別フィールドが“01”という表現
の組み合わせは許さない。
When the name identifier field (35) represents a function name identifier, that is, the name type field (34) is “01”.
'', the cell following the cell represents the argument of the function. In the cell representing the argument, the list bit field (32) is used to indicate whether the argument cell is present or not; '1 ” indicates that the following cell is also an argument cell, and par 0' indicates that it is not, that is, the cell in question is the last argument cell. Note that the list pici field is "1" and the pointer bit field is "
The combination of expressions "0" and "01" in the name type field is not allowed.

本実施例において、第1図(a)に示したn通水構造デ
ータf (a、g (b) 、c)は第3図(c)の如
く6個のセルで表現できる。また、第1図(b)に示し
た3個のデータa、b、cの並らびを表わすリスト構造
を第6図(d)に示す如く4個のセルで表現できる。
In this embodiment, the n water flow structure data f (a, g (b), c) shown in FIG. 1(a) can be expressed by six cells as shown in FIG. 3(c). Further, the list structure representing the arrangement of three data items a, b, and c shown in FIG. 1(b) can be expressed by four cells as shown in FIG. 6(d).

〔発明の効果〕〔Effect of the invention〕

本発明によれば、n連木構造を従来のn連木構造と同等
のセル数で表現でき、しかも特定の2進木構造(リスト
構造)を、その構造の表現するデータの並らび個数かQ
の場合、R+1個のセルが表わすことができる。
According to the present invention, an n-tree structure can be expressed with the same number of cells as a conventional n-tree structure, and a specific binary tree structure (list structure) can be expressed by the number of data items expressed by that structure. Q
, then R+1 cells can be represented.

従来のn進木構造表現方式(n方式)と、cdrcod
ing方式(cdr方式)と、n進水を表現するcdr
coding方式(yl−cdr方式)と、本発明方式
のそれぞれの方式で、に個のノードを持ちかつ、各ノー
ドの引数個数がnlであるn進木構造と、a個のデータ
の並らびを表わすリスト構造とを表現する時、必要とす
るセル数は、次表の通りでありその効果が明白である。
The conventional n-ary tree structure representation method (n method) and cdrcod
ing method (cdr method) and cdr expressing n launch
In each of the coding method (yl-cdr method) and the method of the present invention, an n-ary tree structure has n nodes and the number of arguments for each node is nl, and an arrangement of a pieces of data. When expressing a list structure representing

【図面の簡単な説明】[Brief explanation of drawings]

第1図(a)、(b)は従来のn連木データ表現方式の
例を示す説明図、第2図、第3図(a)。 (b)は従来の2進水デ一タ表現方式(cdrcodi
ng方式)の例を示す説明図、第4図(a)は本発明の
ハードウェア構成を示すブロック図、第4図(b)は本
発明のソフI・ウェア構成を示す構成図、第5図は本発
明のフローを示すフロー図、第6図(a)〜(d)は本
発明によるn進水データ表現およびリスト構造データ表
現の例を示す説明図である。 30・・・セル、31・・・ポインタビットフィールド
、32・・・リストビットフィールド、33・・・内容
フィールド、34・・・名称識別子フィールド、35・
・・名菓 1 図 (どしり (b) ¥J Z 図 13  図 (幻 (シ) 劣 〆 図 (b) <C) Cd)
FIGS. 1(a) and 3(b) are explanatory diagrams showing an example of a conventional n-tree data representation method, and FIGS. 2 and 3(a). (b) is the conventional binary water data representation method (cdrcodi).
ng method), FIG. 4(a) is a block diagram showing the hardware configuration of the present invention, FIG. 4(b) is a block diagram showing the software I/ware configuration of the present invention, and FIG. 6 is a flowchart showing the flow of the present invention, and FIGS. 6(a) to 6(d) are explanatory diagrams showing examples of n-launch data expression and list structure data expression according to the present invention. 30... Cell, 31... Pointer bit field, 32... List bit field, 33... Content field, 34... Name identifier field, 35...
... Famous confectionery 1 Figure (Doshiri (b) ¥J Z Figure 13 Figure (phantom (shi) inferior 〆 Figure (b) <C) Cd)

Claims (1)

【特許請求の範囲】 1、木構造データ表現のための基本単位となる所定数の
ワードから成る記憶素子群(セル)を、内容フィールド
とリストビットフィールドとポインタビットフィールド
を含み、上記リストビットフィールドは該セルが、特定
の2進木構造(リスト構造)の第1引数を表わし、且つ
、記憶装置上において連続した部分に占められていると
見做せるセルが該リスト構造の第2引数を表わすものか
否かを示すフィールドであり、上記「ポインタビットフ
ィールド」は「当該セルの内容フィールドが他のセルへ
のポインタを表わす」のか否かを示すフィールドである
ことを特徴とする木構造データ処理方式。 2、上記内容フィールドが他セルへのポインタを表す状
態でないことがポインタビットフィールドにより示され
ている時、上記内容フィールドを、さらに、名称識別子
フィールドと、名称種別フィールドとから構成し、上記
名称種別子フィールドは、該セルの名称識別子フィール
ドが定数名称を表わすのか、それとも関数名称を表わす
のかの区別を示し、さらに、名称識別子フィールドが関
数名称を表わす状態であることが上記名称種別子フィー
ルドにより示されている時、その関数の引数を記憶装置
上において連続した部分に占められていると見做せる1
つ以上のセルで表わすることを特徴とする木構造データ
処理方式。
[Scope of Claims] 1. A storage element group (cell) consisting of a predetermined number of words serving as a basic unit for representing tree-structured data, including a content field, a list bit field, and a pointer bit field; indicates that the cell represents the first argument of a specific binary tree structure (list structure), and that the cell that can be considered to occupy a continuous portion on the storage device represents the second argument of the list structure. The tree-structured data is a field that indicates whether or not the cell is a pointer, and the "pointer bit field" is a field that indicates whether or not the content field of the cell represents a pointer to another cell. Processing method. 2. When the pointer bit field indicates that the content field does not represent a pointer to another cell, the content field is further composed of a name identifier field and a name type field, and the name type is The child field indicates whether the name identifier field of the cell represents a constant name or a function name, and further, the name type field indicates that the name identifier field represents a function name. 1, the arguments of the function can be considered to occupy a contiguous portion of the storage device.
A tree-structured data processing method characterized by representing data using two or more cells.
JP60292634A 1985-12-27 1985-12-27 Tree structure data processing system Pending JPS62154024A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60292634A JPS62154024A (en) 1985-12-27 1985-12-27 Tree structure data processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60292634A JPS62154024A (en) 1985-12-27 1985-12-27 Tree structure data processing system

Publications (1)

Publication Number Publication Date
JPS62154024A true JPS62154024A (en) 1987-07-09

Family

ID=17784328

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60292634A Pending JPS62154024A (en) 1985-12-27 1985-12-27 Tree structure data processing system

Country Status (1)

Country Link
JP (1) JPS62154024A (en)

Similar Documents

Publication Publication Date Title
US4153932A (en) Data processing apparatus for highly parallel execution of stored programs
US4575798A (en) External sorting using key value distribution and range formation
US4794528A (en) Pattern matching method for tree structured data
JPH0276034A (en) Method of forming knowledge base-system
JPH01501261A (en) Binary tree structure parallel processing device
JP2003044267A (en) Data sorting method, data sorting device and data sorting program
WO2003091872A1 (en) Parallel merge/sort processing device, method, and program
Ordóñez et al. Genetic Approach for Optimizing Ensembles of Classifiers.
JP2752634B2 (en) Sorting device
US10769099B2 (en) Devices for time division multiplexing of state machine engine signals
JPS62154024A (en) Tree structure data processing system
Li et al. The power of the queue
Demuth Electronic data sorting
JPH073655B2 (en) Organizing / editing processor
Spears A NN algorithm for hard satisfiability problems
Herley A note on the token distribution problem
JPH06149927A (en) Processing method for conjuncture normal form
JPS6346537A (en) Method for deciding retrieving condition of retrieving processor
Bernhard Bounds on the performances of message routing heuristics
RU2037215C1 (en) Storage device
JPS59123048A (en) Sorting processor
Haverly Integer programming: enumeration-complete and implicit
JPS63149728A (en) Index forming device
JPH0773202A (en) Digraph reconstituting method
JPS60173678A (en) Conversational type picture converting system