JPS60160444A - List processing method - Google Patents
List processing methodInfo
- Publication number
- JPS60160444A JPS60160444A JP1516584A JP1516584A JPS60160444A JP S60160444 A JPS60160444 A JP S60160444A JP 1516584 A JP1516584 A JP 1516584A JP 1516584 A JP1516584 A JP 1516584A JP S60160444 A JPS60160444 A JP S60160444A
- Authority
- JP
- Japan
- Prior art keywords
- list
- elements
- associative memory
- key
- route
- 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
Links
Abstract
Description
【発明の詳細な説明】
〔発明の利用分野〕
本発明はリスト構造をしたデータのリスト処理方法に関
する。DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to a list processing method for list-structured data.
リストの構造は、例えば、「リスト処理とアーキテクチ
ャ」、情報処理学会、VOL、23、NO,8に示され
ている。姓名9年令、性別からなる第1図のリストは、
第2図の如き構造をもって表わすことができる。とれを
2進木で表現すると第3図のようになる。いま、第1図
のリストにおいて第2番目の要素の中の第3番目の要素
、即ち「男」をアクセスするとする。この時、従来方式
では、メモリ上におかれたセルを順次a、b。The structure of the list is shown, for example, in "List Processing and Architecture", Information Processing Society of Japan, Vol. 23, No. 8. The list in Figure 1 consists of name, 9 years of age, and gender.
It can be represented by a structure as shown in FIG. If the tore is expressed as a binary tree, it will look like Figure 3. Now, assume that the third element among the second elements in the list of FIG. 1, ie, "man" is to be accessed. At this time, in the conventional method, the cells placed on the memory are sequentially transferred to a and b.
g+J’と辿って「男」に達する。このため、セルを5
回読み出さなければならず、要素の読み出しに階間を要
するという欠点がある。Follow g+J' to reach "man". For this reason, 5 cells
It has the disadvantage that it has to be read out twice, and it takes time to read out the elements.
本発明の目的は、上記欠点を解決するために、リスト要
素のアクセスを高速で行うリスト処理方法を提供するこ
とにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a list processing method for accessing list elements at high speed in order to solve the above-mentioned drawbacks.
上記目的を達成するためには、目的の要素を直接アクセ
スして、アクセスに要する時間を著しく減らす必要があ
る。通常のメモリの場合、アドレスによってアクセスさ
れるため、セルを辿っていかなければならないが、計算
機のなかでも特に高速性を要する処理部分では、目的の
要素に対応する数字又は文字列によって直接アクセスが
可能な連想メモリが使われている。In order to achieve the above objective, it is necessary to directly access the target element and significantly reduce the time required for access. Normal memory is accessed by address, so cells must be traced, but in the processing parts of computers that require particularly high speed, it is possible to directly access the desired element by numbers or character strings. Associative memory is used.
記号処理等におけるリストの処理では、同一のリストを
繰シ返し操作することが頻繁に生ずるため、最初にリス
ト操作し、複数のセルを辿っである要素をアクセスした
ときに、その過程で経由した全セルの要素を連想メモリ
に格納し、次回以降に経路上の要素をアクセスする際、
これを連想メモリから直接アクセスすることを特徴とす
る。When processing lists in symbolic processing, etc., the same list is often manipulated repeatedly, so when you first manipulate the list and access an element by tracing multiple cells, When storing the elements of all cells in associative memory and accessing the elements on the route from next time onwards,
This is characterized by direct access from associative memory.
以下、本発明の一実施例を図面を用いて詳細に説明する
。Hereinafter, one embodiment of the present invention will be described in detail using the drawings.
第4図は、連想メモリを有する計算機の一実施例を示す
構成図である。記号処理においては、Li sp等の言
語で記述されたプログラムが、第4図で示される計算機
によって実行される。第1図のリストは、第4図に示さ
れている主記憶(MS)1上に、第2図の構造を用いて
格納されている。FIG. 4 is a configuration diagram showing an embodiment of a computer having an associative memory. In symbolic processing, a program written in a language such as Lisp is executed by the computer shown in FIG. The list shown in FIG. 1 is stored on the main memory (MS) 1 shown in FIG. 4 using the structure shown in FIG. 2.
いま、例えば、第1図のリストを操作して、第2番目の
要素の中の第2番目の要素qを読み出すとする。第1図
のリストは、第3図の2進木で表わされ、2進木をらる
ノードから右に進む場合を1″、左に進む場合を@0″
で表わし、この要素q1即ち「36オ」は、「11#→
10#→11#→″″0”」略して@1010”の数字
列で表わすことができる。したがって、この要素q「3
6オ」は、”1010″パターンをキーとして、第5図
のように連想メモ!J(AS)2上に表わすことができ
る。For example, suppose that the list in FIG. 1 is manipulated to read out the second element q among the second elements. The list in Figure 1 is represented by the binary tree in Figure 3, with 1'' when proceeding to the right from a node in the binary tree, and @0'' when proceeding to the left.
This element q1, that is, "36o" is expressed as "11#→
10#→11#→““0”” (abbreviated as @1010”). Therefore, this element q “3
6o" is an associative memo as shown in Figure 5 using the "1010" pattern as the key! J(AS)2.
第1図のリストの第2番目の要素の中の第2番目の要素
qを、連想メモリに対して1010″のキーを用いてア
クセスし、このキーに対応するデータが登録されていな
かった場合には、従来方法と同様に、主記憶(MS)1
上に格納されている第2図のセルをa −+ b −+
g −+ h −) qと辿って、目的の要素qアク
セスする。このように、主記憶上のセルを順次辿っであ
る要素を初めてアクセスした場合に、この要素を第3図
の2進木の経路を示す記号パターンをキーとして、連想
メモリに書き込む。(要素q「36オ」では、’101
0″をキーとして書き込む。)
この辿シの際、経路上のセルから反対方向に進んで辿シ
つける要素prsJをも、その経路を数字列20″10
0″をキーとして同時に連想メモリに格納する。When the second element q in the second element of the list in Figure 1 is accessed using the key 1010'' in the associative memory, and data corresponding to this key is not registered. As in the conventional method, main memory (MS) 1
The cells in Figure 2 stored above are a −+ b −+
g −+ h −) q to access the target element q. In this way, when a certain element is accessed for the first time by sequentially tracing the cells in the main memory, this element is written into the associative memory using the symbol pattern indicating the path of the binary tree shown in FIG. 3 as a key. (For element q "36o", '101
0" is used as a key.) During this tracing, the element prsJ that can be traced by going in the opposite direction from the cell on the route is also written with the number string 20"10.
0'' as a key and stored in the associative memory at the same time.
その後、第1図のリストを再び操作して、第2番目の要
素の中の第1番目の要素pを読み出す場合には、従来方
法では再び主記憶(MS)1上のセルを辿らなければな
らないのに対し、第5図で水子ように、”100″をキ
ーとして連想メモリよシ直ちに要素prSJを29とし
て取シ出ずことができる。なお、要素q「36オ」とい
う要素が連想メモリよシ読み出せることは言うまでもな
い。After that, when the list in FIG. 1 is operated again to read out the first element p among the second elements, in the conventional method, the cells in the main memory (MS) 1 must be traced again. On the other hand, as shown in Mizuko in FIG. 5, the element prSJ can be immediately retrieved as 29 from the associative memory using "100" as a key. It goes without saying that the element q "36o" can be read out from the associative memory.
第1図のリストの第2番目の要素の中の第2番目の要素
q「36オ」を読み出した際に、第6図に示すように、
経路からはずれたノードCおよびノードiへのポインタ
をも連想メモリに格納し、経路上にない要素へのアクセ
スに対して経路上の同一部分を辿る必要をなくして、読
み出し時間を短縮することができる。When reading out the second element q "36o" in the second element of the list in Figure 1, as shown in Figure 6,
Pointers to nodes C and i that have deviated from the route are also stored in the associative memory, eliminating the need to trace the same part of the route when accessing elements that are not on the route, thereby reducing read time. can.
いま、例えば、数字列3o”1100”に対応する要素
5rKJをアクセスする場合を示す。数字列30 ”1
100’ を、”1”、”101”、’100”。Now, for example, a case will be shown in which the element 5rKJ corresponding to the number string 3o"1100" is accessed. Number string 30 ”1
100', "1", "101", '100'.
”1010″ と左から比較して、最長の一致が得られ
た#1#に対応する、セルCへのポインタ39が、連想
メモリ(AS)2から出力される。これを得て、セルC
から、0″→″0“と辿って要素rKJに達することが
できる。A pointer 39 to cell C, which corresponds to #1# with the longest match when compared from the left with "1010", is output from the content addressable memory (AS) 2. Obtaining this, cell C
From there, element rKJ can be reached by tracing 0''→''0''.
本発明によれば、一度アクセスした要素への経路上の全
要素と、経路からはずれたセルへのポインタが連想メモ
リに格納されているため、同一リストの要素の再読み出
しに対して、その処理時間を短縮するという効果がある
。例えば、n個の要素からなるリストの最終リストを読
み出して、全要素を連想メモリに格納し、その後全要素
を読み出したとすると、全処理時間は、1セルの読み出
っていた時間(2n−1)tに短縮される。そのAccording to the present invention, all elements on the route to the element once accessed and pointers to cells that have deviated from the route are stored in the associative memory, so that when rereading the elements of the same list, the processing This has the effect of shortening time. For example, if you read the final list of a list consisting of n elements, store all elements in an associative memory, and then read all elements, the total processing time will be the time it takes to read one cell (2n- 1) It is shortened to t. the
第1図はリストの一例ケ示す図、第2図は第1図のリス
ト構造を示す図、第3図は第2図のリストを2進水で表
現した図、第4図は連想メモリを有する計算機の一実施
例を示す構成図、第5図。
第6図は連想メモリにおけるキーと出力結果の関係を説
明するだめの図である。
B −−A・・・セル、mzu・・・要素、N工L・・
・空リスト、1・・・主記憶(MS)、2・・・連想メ
モ!J(As)、3・・・演算処理装置(BPu)、4
・・・チャネル制御(CI−I C) 、訃・・チャネ
ル(CH)、6・・・入出力装ft(Ilo)、7・・
・コンソールサービスグロセ第 1 図
(丁 41才 男)(536オ男)(Kl’i才なり¥
53図
第1頁の続き
@発明者岩崎 正量
@発明者井門 徳安
国分寺市東恋ケ窪1丁目28幡地 株式会社日立製作所
中央研究所内
国分寺市東恋ケ窪1丁目28幡地 株式会社日立製作所
中央研究所内Figure 1 is a diagram showing an example of a list, Figure 2 is a diagram showing the list structure of Figure 1, Figure 3 is a diagram of the list in Figure 2 expressed in two launches, and Figure 4 is an associative memory. FIG. 5 is a configuration diagram showing an example of a computer having the computer. FIG. 6 is a diagram for explaining the relationship between keys and output results in the associative memory. B--A...Cell, mzu...Element, N engineering L...
・Empty list, 1... Main memory (MS), 2... Associative memo! J (As), 3... Arithmetic processing unit (BPu), 4
... Channel control (CI-I C), ... Channel (CH), 6 ... Input/output device ft (Ilo), 7 ...
・Console Service Grosse Figure 1 (41 year old male) (536 year old male) (Kl'i year old ¥
Figure 53 Continuation of page 1 @ Inventor Masaaki Iwasaki @ Inventor Imon Tokuan, Hitachi, Ltd. Central Research Laboratory, 1-28 Hata, Higashi-Koigakubo, Kokubunji City, Hitachi, Ltd., Hitachi, Ltd.
Claims (1)
の要素を読み出すリスト処理方法において、リストのめ
る要素の最初のアクセス時に、該要素に到る経路上の全
要素を連想メモリに格納し、リストの要素の読み出しに
際して、該要素に到る2進木上の分岐構造を表わす記号
列を、既に連想メモリ上に格納されている要素に対する
2進木上の分岐構造と比較し、最初に不一致の見られた
ノードからリストの辿シを開始することを特徴とするリ
スト処理方法。1.2 In a list processing method in which elements of a list are read out using a symbol string representing a branching structure on a launch, when an element to be included in a list is accessed for the first time, all elements on the path leading to the element are stored in an associative memory, and the list is When reading an element, the symbol string representing the branching structure on the binary tree leading to the element is compared with the branching structure on the binary tree for the element already stored in the associative memory, and first the unmatched A list processing method characterized by starting traversal of a list from a viewed node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1516584A JPS60160444A (en) | 1984-02-01 | 1984-02-01 | List processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1516584A JPS60160444A (en) | 1984-02-01 | 1984-02-01 | List processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS60160444A true JPS60160444A (en) | 1985-08-22 |
Family
ID=11881183
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP1516584A Pending JPS60160444A (en) | 1984-02-01 | 1984-02-01 | List processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS60160444A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6361335A (en) * | 1986-09-01 | 1988-03-17 | Matsushita Electric Ind Co Ltd | Data processor |
JPS6365523A (en) * | 1986-09-05 | 1988-03-24 | Matsushita Electric Ind Co Ltd | Data processor |
-
1984
- 1984-02-01 JP JP1516584A patent/JPS60160444A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS6361335A (en) * | 1986-09-01 | 1988-03-17 | Matsushita Electric Ind Co Ltd | Data processor |
JPS6365523A (en) * | 1986-09-05 | 1988-03-24 | Matsushita Electric Ind Co Ltd | Data processor |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5519840A (en) | Method for implementing approximate data structures using operations on machine words | |
US3737864A (en) | Method and apparatus for bypassing display register update during procedure entry | |
US5379407A (en) | Error handling in a state-free system | |
US4280177A (en) | Implicit address structure and method for accessing an associative memory device | |
JPS60160444A (en) | List processing method | |
JP3242161B2 (en) | Data processor | |
JP3284064B2 (en) | Digital search device | |
JPS583033A (en) | Tree structure retrieval processor | |
Kollias | An estimate of seek time for batched searching of random or index sequential structured files | |
JPH04308B2 (en) | ||
JPS6049931B2 (en) | Information search method | |
Forsythe | Algorithms for scientific computation | |
SU1206810A1 (en) | Information retrieval device | |
JPS5918731B2 (en) | Kanji-mixed sentence creation device | |
JPS59144949A (en) | Retreiving device | |
Perlis | A new policy for algorithms? | |
JP2975529B2 (en) | Electronic dictionary search device | |
JPH0333978A (en) | Retrieving device for filing system | |
Haynes | The architecture of an ALGOL 60 computer implemented with distributed processors | |
JPH0612550B2 (en) | Data retrieval method | |
JPH0550078B2 (en) | ||
JPS63118958A (en) | Index file memory device | |
Monien | Relationships between pushdown automata with counters and complexity classes | |
JPS62217495A (en) | Associative memory device | |
WO2000031729A2 (en) | A digital memory structure and device, and methods for the management thereof |