JPH0573618A - Retrieval method for structural body - Google Patents

Retrieval method for structural body

Info

Publication number
JPH0573618A
JPH0573618A JP3258670A JP25867091A JPH0573618A JP H0573618 A JPH0573618 A JP H0573618A JP 3258670 A JP3258670 A JP 3258670A JP 25867091 A JP25867091 A JP 25867091A JP H0573618 A JPH0573618 A JP H0573618A
Authority
JP
Japan
Prior art keywords
term
codeword
search
code word
terms
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.)
Granted
Application number
JP3258670A
Other languages
Japanese (ja)
Other versions
JPH0738196B2 (en
Inventor
Kohaku Morita
幸伯 森田
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.)
National Institute of Advanced Industrial Science and Technology AIST
Original Assignee
Agency of Industrial Science and Technology
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 Agency of Industrial Science and Technology filed Critical Agency of Industrial Science and Technology
Priority to JP3258670A priority Critical patent/JPH0738196B2/en
Publication of JPH0573618A publication Critical patent/JPH0573618A/en
Publication of JPH0738196B2 publication Critical patent/JPH0738196B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To reduce the probability of fail drop by expanding the kings of functional elements capable of identification and to reduce a rate that an item which cannot be simplified is included in a candidate with can be simplified. CONSTITUTION:In the case of retrieving a simplified retrieval item to at least one inquiry item from the set of the retrieval items, a minimum element consisting of two or more bits is set for a code word generated in the algorithm to the retrieval item and the inquiry item. At the time of generating the code word, it is not divided into less than the minimum element and the code words of the divided elements are decided. Then, a simplified candidate is selected in the logic operation of the code words of the minimum elements in the retrieval items and the inquiry items.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、構造を持ったデータを
対象とした情報検索を行う構造体の検索方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for searching a structure for searching information having structured data.

【0002】[0002]

【従来の技術】人工知能等、知識を利用した計算機処理
などでは、構造を持ったデータがその知識やデータの表
現の基本要素として多く用いられている。大量の知識や
データを必要とする、より高度で大規模な知識処理の応
用を考えた場合、構造を持ったデータの高速な検索方法
が重要である。
2. Description of the Related Art In computer processing using knowledge such as artificial intelligence, data having a structure is often used as a basic element for expressing the knowledge and data. Considering the application of more advanced and large-scale knowledge processing that requires a large amount of knowledge and data, a fast retrieval method for structured data is important.

【0003】演繹データベース、知識データベース等の
システムでは、通常、変数を含む項が知識表現の基本要
素として用いられることが多く、それらの演算として単
一化演算が基本演算として必須である。知識の規模が大
きくなるにつれ、大量の項に対する単一化可能な項の高
速演算(検索機構)が必須である。そこで、何等かの高
速化手法が必要であるが、項は定数と異なり、構造を持
ち、しかもその構造が可変であるため、B−treeやハッ
シュ法等の従来の高速技法を適用することができない。
In a system such as a deductive database or a knowledge database, terms including variables are often used as basic elements of knowledge representation, and unification operations are essential as basic operations. As the scale of knowledge grows, a fast operation (search mechanism) of unifiable terms for a large number of terms is essential. Therefore, some kind of speed-up technique is required, but since the term has a structure different from a constant and the structure is variable, it is possible to apply a conventional high-speed technique such as B-tree or hash method. Can not.

【0004】そこで、各項に対し符号語を割り当て、そ
の符号語に対して簡単な演算を施すことにより、予め単
一化可能な候補を選択する手法が提案されている。その
一つとして、例えば、Wise, M. J. & Poerts, D. M. W.
“Indexing Prolog via Superimposed Code Word and F
ield Encoded Words”.International Conference on L
ogic Programming, IEEE Computer Society Press, pp2
03-210, Feb, 1984 に記載されたFEW(フィールド・
エンコーデッド・ワード:Field Encorded Word )法が
知られている。
Therefore, a method has been proposed in which a code word is assigned to each term and a simple operation is performed on the code word to select a candidate that can be unified in advance. As one of them, for example, Wise, MJ & Poerts, DMW
“Indexing Prolog via Superimposed Code Word and F
ield Encoded Words ”.International Conference on L
ogic Programming, IEEE Computer Society Press, pp2
03-210, Feb, 1984 FEW (field
Field Encorded Word) method is known.

【0005】以下、上記のFEW法について説明する。
先ず、最初に、項を定義する。項は、以下のように再帰
的に定義される。 (1) 変数及び0引数関数子は項である(0引数関数子は
定数)。 (2) n引数関数子(項1、項2、…、項n)は項であ
る。 そして、この項に対して、変数に適当な項を割り当てた
場合、同一の項となる(単一化可能な)項を検索する。
例えば、以下、大文字を変数として、f(X,b,g
(X))とf(a,Y,g(a))は、Xにaを、Yに
bを代入することにより、どちらもf(a,b,g
(a))となるため、単一化可能である。逆に、f
(X,b,g(X))とf(a,Y,g(b))は、単
一化不可能である。また、単一化はProlog等で用
いられ、論理型言語を中心とした知識表現で多く用いら
れる。
The above-mentioned FEW method will be described below.
First, terms are defined. The terms are defined recursively as follows. (1) Variables and 0-argument function elements are terms (0-argument function elements are constants). (2) The n-argument function (term 1, term 2, ..., Term n) is a term. Then, when an appropriate term is assigned to a variable for this term, a term that becomes the same term (unification possible) is searched.
For example, in the following, f (X, b, g
(X)) and f (a, Y, g (a)) are both f (a, b, g) by substituting a for X and b for Y.
(A)), it is possible to unify. Conversely, f
(X, b, g (X)) and f (a, Y, g (b)) cannot be unified. Further, unification is used in Prolog and the like, and is often used in knowledge representation centered on a logic language.

【0006】しかし、変数の代入操作が含まれるため、
例えば、想定される質問(項)に対して、該当するデー
タ(単一化可能な項)を全て連続したように予め並べる
連続可能性のような性質すらなく、大量のデータに対し
て、従来の索引付けの方法、即ち、非構造体に関する方
法の適用が困難である。
However, since the variable substitution operation is included,
For example, with respect to an envisaged question (term), there is not even a property such as continuity in which all corresponding data (unification-possible terms) are arranged in advance so as to be continuous. It is difficult to apply the indexing method, that is, the method for non-structure.

【0007】FEW法の処理方法は以下のように行われ
る。検索対象となる項集合中の全ての項および問い合わ
せである項に対して符号語を生成する。即ち、n−ビッ
トの符号語に対して、項が、 (1) 0−引数関数子(定数)である場合、ハッシュ関数
を用いてnビットの符号を生成する。 (2) m−引数関数子である場合、符号語をm+1個の部
分に分割し、最初の部分語にm−引数関数子のハッシュ
値を、残りのm個に各引数の項の分割された符号語に対
する符号を生成する。 (3) 変数の場合、格納される項に対しては、全てのビッ
トが1である符号を、また、問い合わせの項に対して
は、全てのビットが0である符号を生成する。
The processing method of the FEW method is performed as follows. Codewords are generated for all terms in the term set to be searched and for terms that are queries. That is, for an n-bit codeword, if the term is (1) 0-argument functor (constant), an n-bit code is generated using a hash function. (2) If it is an m-argument functor, the codeword is divided into m + 1 parts, the hash value of the m-argument functor is divided into the first subword, and the remaining m are divided into terms of each argument. Generate a code for the selected codeword. (3) In the case of a variable, generate a code in which all bits are 1 for the stored term and a code in which all bits are 0 for the query term.

【0008】そして、検索対象となる項集合中の全ての
項の符号語と問い合わせである項の符号語を比較するこ
とで、単一化可能な候補項を抽出する。即ち、検索対象
となる項の符号語をS、問い合わせの項の符号語をQと
すると、Q∧S=Qを満足する項が候補項である。但し
∧はビット毎の論理積を表す。次いで、候補項に関して
問い合わせの項と単一化可能かどうかを調べる。
Then, by comparing the codewords of all the terms in the term set to be searched with the codewords of the term that is the inquiry, unification possible candidate terms are extracted. That is, if the codeword of the term to be searched is S and the codeword of the query term is Q, the term satisfying Q∧S = Q is a candidate term. However, ∧ represents the logical product of each bit. Then, it is checked whether the candidate term can be unified with the term of the query.

【0009】図2に項集合の例を、図3に符号化の例を
示す。例えば、検索対象となる項を図2の(1) 〜(5) 、
問い合わせの項を図2の(a)として与えた場合の検索
処理は以下のようになる。先ず、検索対象の項集合の各
項に対して、図3の例のように符号語を割り当てる。符
号語は、上述した規則に従い、定数や変数の場合は、そ
の符号をハッシュ関数ψによって求める。m−引数関数
の場合は、適当な関数を用いて符号語をm+1個の符号
語に分割し、最初の符号語に関数子のハッシュ値を、残
りのm個には各引数の符号を同様に与える。引数がまた
m−引数であった場合には、更に分割が行われる。これ
以上分割ができない(割り当てられた符号語が短過ぎ
る)場合分割を行わず、例えば関数子のハッシュ値をそ
の符号とする。但し、検索対象となる項に存在する変数
については、全ビット1を与える。また、問い合わせで
ある項についても、同様に符号語を作成する。但し、問
い合わせの項に存在する変数については、全ビット0を
与える。
FIG. 2 shows an example of the term set, and FIG. 3 shows an example of encoding. For example, if the terms to be searched are (1) to (5) in FIG.
The search process when the inquiry item is given as (a) in FIG. 2 is as follows. First, a codeword is assigned to each term of the term set to be searched as in the example of FIG. In the case of a constant or a variable, the code word is obtained by the hash function ψ according to the above-mentioned rules. In the case of the m-argument function, the codeword is divided into m + 1 codewords using an appropriate function, the hash value of the functor is assigned to the first codeword, and the code of each argument is assigned to the remaining m. Give to. If the argument is also the m-argument, further division is performed. If further division is not possible (the assigned codeword is too short), division is not performed and, for example, the hash value of the functor is used as the code. However, all the bits 1 are given to the variables existing in the term to be searched. In addition, a code word is similarly created for an item that is an inquiry. However, all the bits 0 are given to the variables existing in the inquiry term.

【0010】図4に、検索候補の選定処理の説明図を示
す。ここで、図4(a)は、質問項とその符号語を示
し、図4(b)は検索処理を示している。図4(a)に
示すように、問い合わせである項(質問項)にも符号語
Qが与えられる。そして、検索対象の符号語をS、問い
合わせの符号語Qにおいて、Q∧S=Qを満足する項が
検索候補であり、この場合は検索候補として項(1) およ
び(4) が挙げられ(図4(b)参照)、そのうち項(4)
が単一化可能な項である。しかしながら、Q∧S=Qを
満足しても、単一化可能でない場合がある。これをfail
s drop(フェイルス・ドロップ)と呼び、図4(b)に
おける(1) がこれに相当する。また、この場合、Q∧S
=Qを満たさない項については単一化できないことが知
られているので、単一化を試みる必要がなくその分の検
索時間の短縮が図れる。
FIG. 4 shows an explanatory diagram of the search candidate selection process. Here, FIG. 4A shows a question term and its codeword, and FIG. 4B shows a search process. As shown in FIG. 4A, the code word Q is also given to a term (question term) that is an inquiry. Then, in the codeword to be searched, S, and in the codeword Q of the query, terms satisfying Q∧S = Q are search candidates. In this case, the search candidates include terms (1) and (4) ( Figure 4 (b)), of which item (4)
Is a term that can be unified. However, even if Q∧S = Q is satisfied, unification may not be possible. Fail this
This is called s drop (fails drop), and (1) in FIG. 4B corresponds to this. In this case, Q ∧ S
Since it is known that the term that does not satisfy = Q cannot be unified, it is not necessary to attempt the unification, and the search time can be shortened accordingly.

【0011】一方、上記のFEW法と同種の方法として
知られるCCW(Concatinated Code Word)法では、予
め定められた構造に従って、項の内部の各関数子および
変数の符号化したもの(要素符号語)を結合したものを
符号語として用いる。この場合、ハッシュ値の比較に
は、各(要素)符号語が等しいかどちらかが変数である
かを調べ、全てそうであれば、候補とする方式をとる。
On the other hand, in the CCW (Concatinated Code Word) method, which is known as a method similar to the above-mentioned FEW method, each function element and variable inside the term are encoded according to a predetermined structure (element code word). ) Is used as a code word. In this case, for comparison of hash values, it is checked whether or not each (element) codeword is equal or either is a variable, and if all are the same, a method of selecting a candidate is adopted.

【0012】[0012]

【発明が解決しようとする課題】しかしながら、上記の
FEW法では、比較演算として、いわゆる重ね合わせ符
号(SCW)の方式を踏襲しているため、nビットの符
号語で高々Com(n,n/2)種類の関数子しか識別
できず、分解能(符号語により識別可能なデータの種
類)が低下するという問題点を有していた。尚、ここ
で、Com(n,n/2)とは、n個の中からn/2個
取出す組合せの数を示す。一方、上記のCCW法は、各
nビットの要素符号語に対して2n−1種類の識別が行
えるが、構造を予め定める必要があり、構造に合わない
場合は、その符号語が無駄になるといる問題点を有して
いた。本発明は、上記従来の問題点を解決するためにな
されたもので、符号化の分解能(精度)を向上させるこ
とのできる構造体の検索方法を提供することを目的とす
る。
However, in the FEW method described above, a so-called superposition code (SCW) method is followed as a comparison operation, and therefore, at most Com (n, n / 2) Only the types of functors can be identified and the resolution (the type of data that can be identified by the code word) is reduced. Here, Com (n, n / 2) indicates the number of combinations for extracting n / 2 out of n. On the other hand, the above CCW method can identify 2n-1 types of element codewords of n bits each, but it is necessary to determine the structure in advance, and if the structure does not match, the codeword becomes useless. I had a problem. The present invention has been made to solve the above conventional problems, and an object of the present invention is to provide a method for searching a structure capable of improving the resolution (accuracy) of encoding.

【0013】[0013]

【課題を解決するための手段】本発明の構造体の検索方
法は、項を用いたデータ表現を行う計算機システムにお
いて、検索項の集合から、少なくとも一つの質問項に対
し、該質問項と単一化する検索項を検索する構造体の検
索方法において、前記検索項および質問項に対して、該
項内の各関数子および変数に対し、そのアルゴリズムで
該項の符号語を生成する符号語生成手段と、前記符号語
生成手段で生成された質問項の符号語と、前記検索項の
符号語との論理演算結果により、単一化の可能性のある
項を判定する判定手段とを備え、前記符号語生成手段
は、符号語に2ビット以上からなる最小要素を設定し、
前記符号語の生成の際、該最小要素以下には分割せず、
かつ分割された各符号語の符号を定め、前記判定手段
は、前記検索項および質問項の最小要素同士の符号語の
論理演算に基づき単一化の候補を選択することを特徴と
するものである。
According to the method of searching a structure of the present invention, in a computer system that performs data representation using terms, at least one question term from a set of retrieval terms is simply combined with the question term. In a structure search method for searching for a search term to be unified, a codeword for generating a codeword of the term by the algorithm for each of the function and variable in the search term and the query term And a determination unit that determines a term that has a possibility of unification based on a logical operation result of the codeword of the query term generated by the codeword generation section and the codeword of the search term. , The code word generating means sets a minimum element of 2 bits or more in the code word,
When the codeword is generated, it is not divided into the minimum element or less,
Further, the code of each divided code word is determined, and the determination means selects a candidate for unification based on a logical operation of the code words of the minimum elements of the search term and the query term. is there.

【0014】[0014]

【作用】本発明の構造体の検索方法においては、検索項
の集合から、少なくとも一つの質問項に対して単一化す
る検索項を検索する場合、先ず、検索項および質問項に
対して、そのアルゴリズムで生成した符号語に2ビット
以上からなる最小要素を設定し、かつ符号語生成の際、
最小要素以下には分割せず、また、分割された各符号語
の符号を定める。次に、検索項および質問項の最小要素
同士の符号の論理演算で、単一化の候補を選択する。従
って、識別できる関数子の種類が広がり、フェイルス・
ドロップの確率を削減することができる。その結果、単
一化可能な候補に単一化不可能な項が入る率を減少させ
ることができる。
In the structure search method of the present invention, when searching a search term that unifies at least one question term from a set of search terms, first, for the search term and the question term, When the minimum element consisting of 2 bits or more is set in the codeword generated by the algorithm and the codeword is generated,
No division is made below the minimum element, and the code of each divided codeword is determined. Next, a candidate for unification is selected by a logical operation of codes between the minimum elements of the search term and the question term. Therefore, the types of functors that can be identified are expanded,
The drop probability can be reduced. As a result, it is possible to reduce the ratio of non-unification terms into the unification candidates.

【0015】[0015]

【実施例】以下、本発明の実施例を図面を用いて詳細に
説明する。先ず、本発明では、検索対象となる項の集合
(データベース)から、各項の特徴を抽出した符号語を
予め用意する。また、検索の問い合わせに対しても、そ
の質問項もしくは、質問項の集合に対して符号語を同様
に作成し、符号語の比較により検索対象の絞り込みを行
い、絞り込まれた検索対象の項とだけ質問項との単一化
処理を行う。単一化の処理に比べ、符号語の比較演算は
極めて高速に行えるため、全ての検索対象に対して単一
化処理を行った場合と比較して高速な処理が期待でき
る。
Embodiments of the present invention will be described in detail below with reference to the drawings. First, in the present invention, a codeword in which the characteristics of each term are extracted is prepared in advance from a set (database) of terms to be searched. In addition, for search inquiries, codewords are similarly created for the question term or a set of question terms, and the search target is narrowed down by comparing the codewords. Only the unification process with the question item is performed. Compared to the unification process, the comparison operation of the codewords can be performed at extremely high speed, and therefore high-speed processing can be expected as compared with the case where the unification process is performed on all search targets.

【0016】即ち、本発明の単一化検索の処理概要は、
以下のように構成されている。 (1) 検索対象となる項の集合の各項に対して、符号語を
作成する(尚、この符号語は通常索引ファイルと呼ばれ
るファイルに格納される)。 (2) 検索対象に対する検索指示が与えられたら、その検
索条件を表現する項である質問項もしくは、その項集合
に対しても、各項に対する符号語を作成する。 (3) 検索対象の符号語と質問項の符号語により、単一化
の可能性のある組合せを抽出する。 (4) 上記(3) で絞り込まれた組合せに対して単一化処理
を行う。 更に、検索対象に対する問い合わせがある場合は、(2)
から(4) を繰り返す。これにより、前処理として、(1)
のオーバヘッドを削減することができる。
That is, the processing outline of the unified search according to the present invention is as follows.
It is configured as follows. (1) A codeword is created for each term in the set of terms to be searched (this codeword is usually stored in a file called an index file). (2) When a search instruction for a search target is given, a codeword for each term is created for a question term that is a term expressing the search condition or a term set thereof. (3) Extract combinations that have the possibility of unification by using the codeword to be searched and the codeword of the query term. (4) Perform unification processing for the combinations narrowed down in (3) above. Furthermore, if there is an inquiry for the search target, (2)
Repeat steps (4) to (4). As a result, (1)
Overhead can be reduced.

【0017】本発明の特徴は、上記(1) および(2) にお
ける索引化の方法にある。このような索引方法では、短
い符号語を用いていかに検索対象の語の情報を表現する
かが問題となり、その結果が(3) における絞り込みの率
となり、全体の処理時間に影響を与える。単一化検索の
ための索引法であるFEWでは、符号語の対する符号化
の方式として重ね合わせ符号による符号化を用いてい
る。これは、オア演算を行うために符号語を2進語で表
現した時の1の現れるビット数と0の現れるビット数が
等しくなるように符号化した時に最も選択効率が良くな
ることが知られている。
The feature of the present invention resides in the indexing method in the above (1) and (2). In such an indexing method, the problem is whether to express the information of the search target word by using a short code word, and the result becomes the narrowing rate in (3), which affects the entire processing time. FEW, which is an indexing method for unifying search, uses coding by a superposition code as a coding method for codewords. It is known that the selection efficiency is highest when the code word is encoded so that the number of bits in which 1 appears and the number of bits in which 0 appears are the same when the code word is expressed by a binary word to perform the OR operation. ing.

【0018】本発明では、符号語は、2ビット以上の分
割単位を持っていると考える。符号語の分割では、分割
単位を単位として行い、分割単位を更に分割することは
できない。本発明では、符号語の与え方として以下の方
法を用いる。 (1) 与えられた項が定数のとき、その符号語に対するハ
ッシュ値を演算し、その符号語の符号とする。 (2) 与えられた項が変数であるとき、その符号語に対す
る値は0とする。 (3) 与えられた項が、m−引数関数で表現されていると
きは、符号語をm+1個に分割して、各分割された符号
語に対して、 最初の分割された符号語には、関数名のハッシュ値を
符号とし、 残りの符号語には各引数の項に対する符号語を本アル
ゴリズムを再帰的に適用することにより計算する。 この時、分割できなければ、関数名のハッシュ値を符号
語全体の符号語とする。
In the present invention, the codeword is considered to have a division unit of 2 bits or more. The code word is divided into units, and the unit cannot be further divided. In the present invention, the following method is used to give the codeword. (1) When the given term is a constant, the hash value for that codeword is calculated and used as the code of that codeword. (2) When the given term is a variable, the value for that codeword is 0. (3) When the given term is expressed by the m-argument function, the codeword is divided into m + 1 pieces, and for each divided codeword, the first divided codeword is , The hash value of the function name is used as a code, and the remaining codewords are calculated by recursively applying this codeword for each argument term. At this time, if it cannot be divided, the hash value of the function name is used as the codeword of the entire codeword.

【0019】図1に、従来技術の項で説明したFEW法
の例と同様の項に対する符号語の構成を示す。この実施
例では、最小分割単位を4ビットにとっており、一つの
符号語は8個の分割要素からなっている。尚、符号化を
行う項は、f(a,h(X,c))である。
FIG. 1 shows the structure of code words for terms similar to the example of the FEW method described in the section of the prior art. In this embodiment, the minimum division unit is 4 bits, and one codeword is composed of 8 division elements. The term to be encoded is f (a, h (X, c)).

【0020】ここで、この項のトップレベルは、2引数
fであるので、この符号語を3つに分割する。この場
合、最初の2要素を関数記号fに割り当て、残りの3要
素ずつを2つの引数に割り当てる。即ち、最初の2要素
は、fの8ビットへのハッシュ関数値を用いて、「01
010101」となる。その後の3要素については、第
1引数であるaによって決定されるが、これは定数であ
るため、その12ビットへのハッシュ値を計算して、
「100110100101」となる。最後の3要素に
ついては、第2引数のh(X,c)の符号語を計算する
が、これは2引数関数hであるので、更に分割し、最初
の要素がhの4ビットへのハッシュ値で「0010」、
2番目は変数のため「000」、最後がcで「100
0」となる。この場合、最小要素より細かくなるような
分割は行わない。例えば、fの第2引数が3引数関数で
あった場合には、分割をせずにその関数記号のハッシュ
値とするか、最初の2引数と関数記号を用いたハッシュ
値を用いるかなどの方法を取る。これらは、対象となる
項の集合や質問の特性から決定することができる。
Here, since the top level of this term has two arguments f, this codeword is divided into three. In this case, the first two elements are assigned to the function symbol f, and the remaining three elements are assigned to the two arguments. That is, the first two elements are "01" using the hash function value of f to 8 bits.
010101 ". The subsequent three elements are determined by the first argument a, but since this is a constant, calculate the hash value to that 12 bits,
It becomes "100110100101". For the last three elements, the codeword of the second argument h (X, c) is calculated. Since this is a two-argument function h, it is further divided, and the first element is a hash of h to 4 bits. The value is "0010",
The second is a variable, so "000", and the last is "100".
It becomes "0". In this case, division that does not become finer than the minimum element is not performed. For example, when the second argument of f is a three-argument function, whether to use the hash value of the function symbol without dividing it or use the hash value using the first two arguments and the function symbol. Take the way. These can be determined from the set of target terms and the characteristics of the question.

【0021】一方、上記の符号語に対する検索は、以下
のようになる。全ての最小要素に対して、「その最小要
素に対して符号語が全く同じであるか、どちらかが0で
ある」という条件が成立すれば候補である。即ち、各符
号語の最小要素毎に、その値が0であれば、それを変数
として扱う。変数が現れる場所には、どのような値がき
ても候補となる。図5に、符号語の比較を示す。例え
ば、図5(a)に示す場合は、比較する符号語の2要素
目がどちらも0でなく、かつ等しくないため、候補には
ならない。反対に、図5(b)に示す場合では、全ての
要素が等しいか、どちらかが0になっているため、候補
として残ることになる。
On the other hand, the search for the above codeword is as follows. It is a candidate if all the minimum elements satisfy the condition that "the codeword is the same for the minimum element or one of them is 0". That is, if the value of each minimum element of each codeword is 0, it is treated as a variable. No matter what value comes to the place where the variable appears, it becomes a candidate. FIG. 5 shows a comparison of code words. For example, in the case shown in FIG. 5A, since the second elements of the codewords to be compared are neither 0 nor equal, they are not candidates. On the other hand, in the case shown in FIG. 5B, all the elements are equal or one of them is 0, so that they remain as candidates.

【0022】この際、従来のFEW法のように、S∧Q
=Qのような判定ではなく、比較は通常の比較であるた
め、最小要素のビット幅をmビットとすると、nビット
の符号語に対して変数の符号を除いた図5(c)中の式
(1) の種類の記号を識別することができる。例えば、最
小要素が4ビットの場合、8ビットの符号語に対して、
従来のFEW法では、Com(8,4)=70通りの符
号が用いられるが、本実施例では式(2) に示すように、
225通りの符号を用いることができる。
At this time, as in the conventional FEW method, S∧Q
Since the comparison is not a judgment such as = Q but a normal comparison, assuming that the bit width of the smallest element is m bits, the code of the variable is removed from the code word of n bits in FIG. formula
You can identify symbols of the type (1). For example, when the minimum element is 4 bits, for an 8-bit codeword,
In the conventional FEW method, Com (8,4) = 70 different codes are used, but in the present embodiment, as shown in Expression (2),
225 different codes can be used.

【0023】尚、上記実施例では、符号語による候補の
選定をプログラムで構成するようにしたが、これは、ハ
ードウェアで構成することも可能である。図6に、ハー
ドウェアで構成した判定手段の例を示す。ここで、図6
(a)は判定手段の全体回路図、図6(b)は各判定回
路A、Bの内部回路図である。このように、判定回路A
と判定回路Bには、それぞれ符号語の各1ビットずつが
入力されるよう構成されており、また、各判定回路A、
B、…、の出力がアンド回路に入力され、その論理積を
演算するようになっている。また、各判定回路A、B
は、符号語同士の各ビットをそれぞれ入力するエクスク
ルーシブ−ノア(EX −NOR)回路1、2、3、4
と、それぞれの符号語の各ビットを入力するノア回路
5、6と、各エクスクルーシブ−ノア回路1、2、3、
4の出力を入力するアンド回路7と、アンド回路7の出
力とノア回路5、6の出力を入力するオア回路8とから
構成されている。
In the above embodiment, the selection of the candidate by the code word is constituted by the program, but it can be constituted by the hardware. FIG. 6 shows an example of the determination means configured by hardware. Here, FIG.
6A is an overall circuit diagram of the determination means, and FIG. 6B is an internal circuit diagram of the determination circuits A and B. In this way, the determination circuit A
And the decision circuit B are configured so that each 1 bit of the code word is inputted, and each decision circuit A,
The outputs of B, ... Are input to an AND circuit, and the logical product of them is calculated. In addition, each determination circuit A, B
Is an exclusive-NOR (EX-NOR) circuit 1, 2, 3, 4 for inputting each bit of codewords.
And NOR circuits 5 and 6 for inputting each bit of each codeword, and each exclusive-NOR circuit 1, 2, 3,
It is composed of an AND circuit 7 for inputting the output of 4 and an OR circuit 8 for inputting the output of the AND circuit 7 and the outputs of the NOR circuits 5 and 6.

【0024】また、上記実施例では、構造体として項の
場合を例にとって説明したが、一般の、プログラム言語
等で用いられる構造体は、通常、その構造定義とデータ
が分離されているが、このような構造体を項の形で表現
することも可能であり、従って、そのような構造体にお
いても項表現に変換することで、本発明を適用すること
が可能である。更に、上記実施例では、最小分割単位を
4ビットで構成したが、これに限定されるものではな
く、2ビット以上であれば、上記実施例と同様の効果を
奏する。
Further, in the above-mentioned embodiment, the case of the term as the structure has been described as an example, but a structure used in a general programming language or the like usually has its structure definition and data separated, It is possible to represent such a structure in the form of a term, and therefore the present invention can be applied by converting such a structure into a term expression. Further, in the above-mentioned embodiment, the minimum division unit is composed of 4 bits, but the present invention is not limited to this, and if it is 2 bits or more, the same effect as that of the above-mentioned embodiment is obtained.

【0025】[0025]

【発明の効果】以上説明したように、本発明の構造体の
検索方法によれば、検索による候補項の選定を、検索項
および質問項の2ビット以上からなる最小要素同士の論
理演算により行うようにしたので、例えば、mビットの
最小要素を有するnビットの符号語に対して識別できる
関数子の種類が、Com(n,n/2)から図5(c)
の式(1) にまで広がり、単一化の候補の選択により、フ
ェイルス・ドロップの確率を削減することができる。従
って、単一化可能な候補に単一化不可能な項の入る率を
減少させることができ、その結果、項の数を増加させ、
項の単一化による高速な検索が可能となる。
As described above, according to the structure search method of the present invention, the selection of the candidate term by the search is performed by the logical operation of the minimum elements of 2 bits or more of the search term and the question term. Thus, for example, the types of functors that can be identified with respect to the n-bit codeword having the m-bit minimum element are from Com (n, n / 2) to FIG.
It is possible to reduce the probability of the Fails drop by expanding to the expression (1) and selecting the unification candidate. Therefore, it is possible to reduce the rate of entry of non-unification terms into unification candidates, and as a result, increase the number of terms,
High-speed search is possible by unifying terms.

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

【図1】本発明の構造体の検索方法の説明図である。FIG. 1 is an explanatory diagram of a structure search method of the present invention.

【図2】項集合の説明図である。FIG. 2 is an explanatory diagram of a term set.

【図3】従来の構造体の検索方法における符号化の一例
を示す説明図である。
FIG. 3 is an explanatory diagram showing an example of encoding in a conventional structure search method.

【図4】従来の構造体の検索方法における検索候補の選
定処理の説明図である。
FIG. 4 is an explanatory diagram of search candidate selection processing in the conventional structure search method.

【図5】本発明の構造体の検索方法における符号語の比
較処理の説明図である。
FIG. 5 is an explanatory diagram of codeword comparison processing in the structure search method of the present invention.

【図6】本発明の構造体の検索方法における判定手段の
他の実施例を示す構成図である。
FIG. 6 is a configuration diagram showing another embodiment of the determination means in the structure search method of the present invention.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 項を用いたデータ表現を行う計算機シス
テムにおいて、検索項の集合から、少なくとも一つの質
問項に対し、該質問項と単一化する検索項を検索する構
造体の検索方法において、 前記検索項および質問項に対して、該項内の各関数子お
よび変数に対し、そのアルゴリズムで該項の符号語を生
成する符号語生成手段と、 前記符号語生成手段で生成された質問項の符号語と、前
記検索項の符号語との論理演算結果により、単一化の可
能性のある項を判定する判定手段とを備え、 前記符号語生成手段は、符号語に2ビット以上からなる
最小要素を設定し、前記符号語の生成の際、該最小要素
以下には分割せず、かつ分割された各符号語の符号を定
め、 前記判定手段は、前記検索項および質問項の最小要素同
士の符号語の論理演算に基づき単一化の候補を選択する
ことを特徴とする構造体の検索方法。
1. A method for retrieving a structure for retrieving a search term that unifies with at least one question term from a set of search terms in a computer system that performs data representation using terms , For the search term and the question term, for each functor and variable in the term, a codeword generation means for generating a codeword of the term by the algorithm, and a question generated by the codeword generation means A code word of the term, and a determination means for determining a term having a possibility of unification based on a logical operation result of the code word of the search term, wherein the code word generation means has two or more bits in the code word. Is set, and when the codeword is generated, the codeword is not divided below the minimum element, and the code of each of the divided codewords is determined. For logical operation of codewords between minimum elements Search method of a structure and selects the Hazuki unification candidate.
JP3258670A 1991-09-11 1991-09-11 Structure search method Expired - Lifetime JPH0738196B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3258670A JPH0738196B2 (en) 1991-09-11 1991-09-11 Structure search method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3258670A JPH0738196B2 (en) 1991-09-11 1991-09-11 Structure search method

Publications (2)

Publication Number Publication Date
JPH0573618A true JPH0573618A (en) 1993-03-26
JPH0738196B2 JPH0738196B2 (en) 1995-04-26

Family

ID=17323471

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3258670A Expired - Lifetime JPH0738196B2 (en) 1991-09-11 1991-09-11 Structure search method

Country Status (1)

Country Link
JP (1) JPH0738196B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01232436A (en) * 1988-03-14 1989-09-18 Agency Of Ind Science & Technol Selecting device for unifying candidate term
JPH01232426A (en) * 1988-03-14 1989-09-18 Agency Of Ind Science & Technol Index generating device for unifying candidate selection
JPH01276237A (en) * 1988-04-27 1989-11-06 Agency Of Ind Science & Technol Selector for candidate term to be unified

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01232436A (en) * 1988-03-14 1989-09-18 Agency Of Ind Science & Technol Selecting device for unifying candidate term
JPH01232426A (en) * 1988-03-14 1989-09-18 Agency Of Ind Science & Technol Index generating device for unifying candidate selection
JPH01276237A (en) * 1988-04-27 1989-11-06 Agency Of Ind Science & Technol Selector for candidate term to be unified

Also Published As

Publication number Publication date
JPH0738196B2 (en) 1995-04-26

Similar Documents

Publication Publication Date Title
Falkoff Algorithms for parallel-search memories
Stephen String searching algorithms
US7536399B2 (en) Data compression method, program, and apparatus to allow coding by detecting a repetition of a matching character string
US8095526B2 (en) Efficient retrieval of variable-length character string data
JP6160259B2 (en) Character string search method, character string search device, and character string search program
JPH07297728A (en) Method and system for searching coincidence of patterns
JPH02109167A (en) Character string search method and device
KR20100116595A (en) Managing an archive for approximate string matching
JP2008299867A (en) Computer representation of data structure and encoding/decoding methods associated with the same
JPH0573618A (en) Retrieval method for structural body
Parberry A computer assisted optimal depth lower bound for sorting networks with nine inputs
KR102146625B1 (en) Apparatus and method for computing incrementally infix probabilities based on automata
CN109299260B (en) Data classification method, device and computer readable storage medium
Kurniawan et al. A new string matching algorithm based on logical indexing
EP0638187B1 (en) Categorizing strings in character recognition
JP2007233554A (en) Search method for high-speed pattern matching device
JP2590698B2 (en) Character string data retrieval device
KR102271489B1 (en) Apparatus and method of constructing Aho-Corasick automata for detecting regular expression pattern
JP2005242668A (en) Pattern matching apparatus and method, and program
JPH09293066A (en) Vector arithmetic device and vector arithmetic method
JPH10177582A (en) Longest match search method and apparatus
JP3018579B2 (en) Name search processor
JP3104893B2 (en) Information retrieval method
JPH01276237A (en) Selector for candidate term to be unified
JPH1115836A (en) Table for searching character string, generation method therefor and character string searching method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term