JPWO2008081932A1 - Finite automaton generation system for character string matching, generation method thereof, and generation program - Google Patents

Finite automaton generation system for character string matching, generation method thereof, and generation program Download PDF

Info

Publication number
JPWO2008081932A1
JPWO2008081932A1 JP2008552183A JP2008552183A JPWO2008081932A1 JP WO2008081932 A1 JPWO2008081932 A1 JP WO2008081932A1 JP 2008552183 A JP2008552183 A JP 2008552183A JP 2008552183 A JP2008552183 A JP 2008552183A JP WO2008081932 A1 JPWO2008081932 A1 JP WO2008081932A1
Authority
JP
Japan
Prior art keywords
finite automaton
matrix
nfa
characters
conversion
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
JP2008552183A
Other languages
Japanese (ja)
Other versions
JP5169837B2 (en
Inventor
則夫 山垣
則夫 山垣
清久 市野
清久 市野
聡史 神谷
聡史 神谷
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2008552183A priority Critical patent/JP5169837B2/en
Publication of JPWO2008081932A1 publication Critical patent/JPWO2008081932A1/en
Application granted granted Critical
Publication of JP5169837B2 publication Critical patent/JP5169837B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本発明は、1文字遷移の有限オートマトンの状態数を増加させることなく、任意の文字数で遷移条件を記述する有限オートマトンへの変換を可能にするシステム、方法、プログラムを提供する。NFA変換手段21は、入力装置1から同時並列処理文字数を受け取り、NFA記述行列記憶部31に記憶されている1文字遷移の有限オートマトンの記述行列と、NFA変換結果行列記憶部32に記憶された途中の変換結果である記述行列を用いて、同時並列処理文字数での遷移条件をもつ有限オートマトンへ変換処理を行う。NFA変換手段21は、途中結果を逐次NFA変換結果行列記憶部32へ結果を記憶させる。変換が完了すれば、結果出力手段22は、結果のNFA記述行列をNFA変換結果行列記憶部32から読み出し、出力装置4へ出力する。The present invention provides a system, method, and program that enable conversion to a finite automaton that describes a transition condition with an arbitrary number of characters without increasing the number of states of the finite automaton for one character transition. The NFA conversion means 21 receives the number of characters simultaneously processed in parallel from the input device 1, and is stored in the NFA conversion matrix storage unit 32 and the one-character transition finite automaton description matrix stored in the NFA description matrix storage unit 31. Using the description matrix that is the result of the conversion in the middle, conversion processing is performed to a finite automaton having a transition condition with the number of characters processed in parallel. The NFA conversion means 21 stores the results in the NFA conversion result matrix storage unit 32 sequentially. When the conversion is completed, the result output means 22 reads the resulting NFA description matrix from the NFA conversion result matrix storage unit 32 and outputs it to the output device 4.

Description

[関連出願の記載]
本発明は、日本国特許出願:特願2006−355533号(2006年12月28月日出願)の優先権主張に基づくものであり、同出願の全記載内容は引用をもって本書に組み込み記載されているものとする。
[Description of related applications]
The present invention is based on the priority claim of Japanese patent application: Japanese Patent Application No. 2006-355533 (filed on Dec. 28, 2006), the entire contents of which are incorporated herein by reference. It shall be.

本発明は、文字列照合用有限オートマトン生成技術に関し、特に複数文字列の同時並列入力による文字列照合ができる文字列照合用有限オートマトン生成システム、方法、及び生成プログラムに関する。   The present invention relates to a finite automaton generation technique for character string collation, and more particularly to a finite automaton generation system, method, and generation program for character string collation that can perform character string collation by simultaneous parallel input of a plurality of character strings.

従来、文字列照合(パターンマッチ)用の有限オートマトン(Finite Automaton)として、ある1つの状態から同じ文字に対して複数の遷移先を許す非決定性有限オートマトン(NFA: Non−deterministic Finite Automaton)を用いる方法、もしくは、それを許さない決定性有限オートマトン(DFA: Deterministic Finite Automaton)を用いる方法がある。   Conventionally, a non-deterministic finite automaton (NFA) that allows a plurality of transition destinations for the same character from one state is used as a finite automaton for character string matching (pattern matching). There is a method or a method using a deterministic finite automaton (DFA) that does not allow it.

例えば、特許文献1、非特許文献1に記載されているように、NFAは、与えられた正規表現等の検索対象条件から構文木を構築し、これに基づいて生成することができる。また、DFAはNFAを用いて生成することができる。   For example, as described in Patent Literature 1 and Non-Patent Literature 1, the NFA can construct a syntax tree from search target conditions such as a given regular expression and generate the syntax tree based on the syntax tree. The DFA can be generated using NFA.

一般的に、ソフトウェアにおけるパターンマッチング処理では、NFAやDFA等の状態をメモリに保存し、状態が遷移する度に、状態に関する情報をメモリから取り出しながらパターンマッチングを行う。この際、NFAではある入力文字に対するある状態からの遷移先として複数の状態が存在するため、どの状態へ遷移すれば正しい結果が得られるか判断できず、ひとまずどれかの状態へ遷移して処理を進め、失敗した場合にバックトラック法を用いて別の状態へ遷移するという処理が必要になる。   In general, in pattern matching processing in software, states such as NFA and DFA are stored in a memory, and each time the state transitions, pattern matching is performed while extracting information about the state from the memory. At this time, since there are a plurality of states as transition destinations from a certain state to a certain input character in NFA, it is not possible to determine to which state a correct result can be obtained. In the case of failure, a process of transitioning to another state using the backtracking method is required when it fails.

一方、DFAではある入力文字に対するある状態からの遷移先が1つしかないことから、NFAよりも高速に処理が可能であるという利点がある反面、NFAよりも状態数が増加し、多くのメモリ容量が必要となるという欠点がある。   On the other hand, DFA has only one transition destination for a certain input character from a certain state, so that there is an advantage that processing can be performed at a speed higher than that of NFA. There is a disadvantage that capacity is required.

こうしたソフトウェアにおけるパターンマッチング処理の問題を解決するため、近年、ハードウェア回路にNFAを直接組み込むことにより、その並列動作による高速性を活かし、NFAを用いた高速なパターンマッチングを行う方法がある(非特許文献2)。また、1クロックサイクルにおける入力文字数を増加させることで、より検索スループットの向上を目指す方法もある(非特許文献3)。さらに、NFAの状態遷移条件を複数文字によって行うことにより、同時に複数文字の文字列入力を行うことで検索スループットの向上を図る方法も提案されてきている(非特許文献4,非特許文献5)。   In order to solve the problem of pattern matching processing in such software, in recent years, there is a method of performing high-speed pattern matching using NFA by taking advantage of high speed due to the parallel operation by directly incorporating NFA into a hardware circuit (non- Patent Document 2). There is also a method that aims to further improve the search throughput by increasing the number of input characters in one clock cycle (Non-patent Document 3). Furthermore, a method for improving the search throughput by inputting a character string of a plurality of characters at the same time by performing an NFA state transition condition with a plurality of characters has been proposed (Non-patent Documents 4 and 5). .

特開2003−242179号公報(第20−34段落、図1〜図9)JP 2003-242179A (paragraph 20-34, FIGS. 1 to 9) 定本Cプログラマのためのアルゴリズムとデータ構造(第297−330頁、近藤嘉雪、1998年)Algorithm and data structure for C-programmers (pages 297-330, Yoshiyuki Kondo, 1998) Proceedings of the 9th Annual IEEE Symposium on Field-Programmable Custom Computing Machines(第227―238頁、Reetinder Sidhu,Viktor K. Prasanna、2001年)Proceedings of the 9th Annual IEEE Symposium on Field-Programmable Custom Computing Machines (pp. 227-238, Reetinder Sidhu, Viktor K. Prasanna, 2001) Proceedings of 2004 IEEE International Conference on Field-Programmable Technology(第25―32頁、Peter Sutton、2004年)Proceedings of 2004 IEEE International Conference on Field-Programmable Technology (pages 25-32, Peter Sutton, 2004) Proceedings of the 12th Annual IEEE Symposium on Field-Programmable Custom Computing Machines(第249頁−257頁、Christopher R. Clark、David E. Schimmel、2004年)Proceedings of the 12th Annual IEEE Symposium on Field-Programmable Custom Computing Machines (Pages 249-257, Christopher R. Clark, David E. Schimmel, 2004) 情報処理学会論文誌:コンピューティングシステム Vol.46、No.SIG12(ACS11)(第120−128頁、片下敏宏,前田敦司,小野正人,戸田賢二, 山口喜教、2005年)IPSJ Transactions: Computing System Vol.46, No.SIG12 (ACS11) (Pages 120-128, Toshihiro Katashita, Junji Maeda, Masato Ono, Kenji Toda, Yoshinori Yamaguchi, 2005)

以上の特許文献1、非特許文献1乃至5の開示事項は、本書に引用をもって繰り込み記載されているものとする。以下に本発明による関連技術の分析を与える。上記したように、ハードウェアにNFAを直接組み込んでパターンマッチングを行う方法には、以下のような複数の問題点があった。   The disclosures of Patent Document 1 and Non-Patent Documents 1 to 5 are incorporated herein by reference. The following is an analysis of the related art according to the present invention. As described above, the method of performing pattern matching by directly incorporating NFA into hardware has the following problems.

第1の問題点は、正規表現等から生成したNFAを組み込むだけでは、より一層の検索スループットの向上ができないことである。   The first problem is that the search throughput cannot be further improved only by incorporating an NFA generated from a regular expression or the like.

その理由は、組み込んだNFAの状態遷移条件は被検索対象文字列の入力1文字に対する条件であるため、1クロックサイクルあたり1文字の検索しか行うことができないためである。   The reason is that since the state transition condition of the incorporated NFA is a condition for one input character of the character string to be searched, only one character can be searched per clock cycle.

第2の問題点は、上記のような1文字遷移のNFAは変化させず、1クロックサイクルあたりでの検索文字数を増加させるだけでは、検索スループットの向上に直接結びつかないことである。   The second problem is that merely increasing the number of search characters per clock cycle without changing the NFA of one character transition as described above does not directly lead to an improvement in search throughput.

その理由は、1クロックサイクルあたりでの検索文字数を増加させただけでは、同時に処理を行う文字数だけパスが長くなるため、クロックサイクルの周期が増加し、結果的に動作周波数が低下してしまうためである。つまり、仮に文字数が4倍になっても、動作周波数が1/4以下になってしまう可能性もある。   The reason is that simply increasing the number of search characters per clock cycle increases the path by the number of characters to be processed at the same time, increasing the cycle of the clock cycle and consequently lowering the operating frequency. It is. In other words, even if the number of characters is quadrupled, there is a possibility that the operating frequency will be 1/4 or less.

第3の問題点は、NFAの状態遷移条件を複数文字によって行う現在の方法では、正規表現のような柔軟な文字列検索ができないことである。   The third problem is that a flexible character string search like a regular expression cannot be performed by the current method in which the state transition condition of NFA is performed by a plurality of characters.

その理由は、正規表現から構成されるループを含むようなNFAではなく、それを展開し、ループをなくした単純な文字列検索(厳密一致:Exact Match)しか考慮されていないためである。   The reason is not an NFA that includes a loop composed of regular expressions, but only a simple character string search (exact match) that expands the loop and eliminates the loop is considered.

第4の問題点は、NFAの状態遷移条件を複数文字に拡張する際に状態数が増加してしまうことである。   The fourth problem is that the number of states increases when the NFA state transition condition is extended to a plurality of characters.

その理由は、同時処理を行う文字数におけるオフセットを考慮し、処理する文字数分だけNFAを生成するためである。   The reason is that NFA is generated for the number of characters to be processed in consideration of the offset in the number of characters to be processed simultaneously.

従って、本発明が解決しようとする第1の課題は、正規表現等による柔軟な文字列検索を高速に行うための有限オートマトンの生成システム、生成方法、および生成プログラムを提供することにある。   Accordingly, a first problem to be solved by the present invention is to provide a finite automaton generation system, a generation method, and a generation program for performing flexible character string search using a regular expression or the like at high speed.

さらに、本発明が解決しようとする第2の課題は、1文字で遷移するNFAが構築できるような検索対象を、同時並列処理を行う任意の文字数に合わせた有限オートマトンに生成するシステム、生成方法、および生成プログラムを提供することにある。   Furthermore, a second problem to be solved by the present invention is a system and a generation method for generating a search target that can construct an NFA that transitions by one character into a finite automaton that matches an arbitrary number of characters for simultaneous parallel processing. And providing a generation program.

さらに、本発明が解決しようとする第3の課題は、1文字で遷移するNFAの状態数を増加させずに同時並列処理を行う文字数に合わせた有限オートマトンを生成するシステム、生成方法、および生成プログラムを提供することにある。   Furthermore, a third problem to be solved by the present invention is a system, a generation method, and a generation method for generating a finite automaton that matches the number of characters for which parallel processing is performed without increasing the number of NFA states that transition by one character. To provide a program.

本発明によれば、固定文字数の遷移条件から成る有限オートマトンの遷移条件の文字数を、任意に指定する文字数に増加させる有限オートマトン生成システム(方法、プログラム)が提供される。前記有限オートマトンは行列形式で記述されている。本発明おいて、前記増加させる手段は、元の有限オートマトンの状態数を変化させない。あるいは、本発明において、前記増加させる手段は、予め定義された演算規則をもった行列演算に従う。あるいは、本発明において、前記増加させる手段は、予め定義された演算規則を複数の部分行列を用いた行列演算に適用する。本発明において、前記複数の部分行列を用いた行列演算は、演算を行う度に部分行列を生成し、使用する。あるいは、本発明において、前記複数の部分行列を用いた行列演算は、予め部分行列を生成しておき、前記部分行列を使用するようにしてもよい。   According to the present invention, there is provided a finite automaton generation system (method, program) that increases the number of characters in a transition condition of a finite automaton composed of transition conditions of a fixed number of characters to an arbitrarily designated number of characters. The finite automaton is described in a matrix format. In the present invention, the increasing means does not change the number of states of the original finite automaton. Alternatively, in the present invention, the increasing means follows a matrix operation having a predefined operation rule. Alternatively, in the present invention, the increasing means applies a predetermined calculation rule to a matrix calculation using a plurality of partial matrices. In the present invention, the matrix calculation using the plurality of partial matrices generates and uses a partial matrix every time the calculation is performed. Alternatively, in the present invention, the matrix calculation using the plurality of partial matrices may be performed by generating a partial matrix in advance and using the partial matrix.

本発明の第1の側面に係る有限オートマトン生成システムは、1文字遷移のNFAを記述する行列を予め記憶しておくNFA記述行列記憶部(図1の31)と、1文字遷移のNFA記述行列又はp文字遷移のNFA記述行列を必要に応じて、NFA記述行列記憶部(図1の31)又はNFA変換結果行列記憶部(図1の32)からそれぞれ読み出し、生成した行列を再びNFA変換結果行列記憶部(図1の32)へ記憶させることを繰り返すことで、指定された同時並列処理文字数のNFAに変換するNFA変換手段(図1の21)と、変換後のNFA記述行列を記憶するNFA変換結果行列記憶部(図1の32)と、変換後のNFAを出力するための結果出力手段(図1の22)とを有する。
本発明の第2の側面に係る有限オートマトン生成システムは、1文字遷移のNFAを記述する行列を予め記憶しておくNFA記述行列記憶部(図6の31)と、変換後のNFA記述行列を記憶するNFA変換結果行列記憶部(図6の32)と、NFA変換手段(図6の23)と、結果出力手段(図6の22)とを有し、NFA変換手段(図6の23)は1文字遷移のNFA記述行列又はp文字遷移のNFA記述行列を必要に応じて、NFA記述行列記憶部(図6の31)又はNFA変換結果行列記憶部(図6の32)からそれぞれ読み出し、これらを複数の部分行列に分割してk文字遷移のNFA記述行列を生成し、生成した行列を再びNFA変換結果行列記憶部(図6の32)へ記憶させることを繰り返すことで、指定された同時並列処理文字数のNFAを生成する。
本発明の第3の側面に係る有限オートマトン生成システムは、前記NFA記述行列記憶部(図9の31)に記憶されている有限オートマトンを記述した行列を、複数の部分行列に分割するNFA記述行列分割手段(図9の24)と、前記分割された複数の部分行列を用いて、元の有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換手段(図9の25)と、前記NFA変換手段による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶部(図9の32)と、前記NFA変換手段による変換途中の有限オートマトン記述行列の複数の部分行列を記憶させるNFA変換結果部分行列記憶部(図9の33)と、前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトン記述行列を出力する結果出力手段(図9の22)と備えている。
本発明の第1乃至第3の有限オートマトン生成システムは、このような構成を採用し、1文字遷移のNFA記述行列を、行列演算により変換することで、第1から第3の課題を解決することができる。
The finite automaton generation system according to the first aspect of the present invention includes an NFA description matrix storage unit (31 in FIG. 1) that stores in advance a matrix describing an NFA of one character transition, and an NFA description matrix of one character transition. Alternatively, the NFA description matrix of the p-character transition is read from the NFA description matrix storage unit (31 in FIG. 1) or the NFA conversion result matrix storage unit (32 in FIG. 1) as necessary, and the generated matrix is again the NFA conversion result. By repeatedly storing the data in the matrix storage unit (32 in FIG. 1), NFA conversion means (21 in FIG. 1) for converting the NFA into the specified number of simultaneously processed characters and the converted NFA description matrix are stored. An NFA conversion result matrix storage unit (32 in FIG. 1) and a result output means (22 in FIG. 1) for outputting the converted NFA.
The finite automaton generation system according to the second aspect of the present invention includes an NFA description matrix storage unit (31 in FIG. 6) that stores in advance a matrix describing an NFA of one-character transition, and an NFA description matrix after conversion. An NFA conversion result matrix storage unit (32 in FIG. 6), an NFA conversion means (23 in FIG. 6), and a result output means (22 in FIG. 6) are stored, and an NFA conversion means (23 in FIG. 6). Reads an NFA description matrix for one-character transition or an NFA description matrix for p-character transition from the NFA description matrix storage unit (31 in FIG. 6) or the NFA conversion result matrix storage unit (32 in FIG. 6), as necessary. The NFA description matrix of k-character transition is generated by dividing these into a plurality of sub-matrices, and the generated matrix is stored again in the NFA conversion result matrix storage unit (32 in FIG. 6). Parallel processing statement To generate a number of NFA.
A finite automaton generation system according to a third aspect of the present invention is an NFA description matrix that divides a matrix describing a finite automaton stored in the NFA description matrix storage unit (31 in FIG. 9) into a plurality of sub-matrices. Dividing means (24 in FIG. 9), NFA converting means (25 in FIG. 9) for performing conversion for increasing the number of characters of the transition condition of the original finite automaton using the plurality of divided partial matrices, and the NFA An NFA conversion result matrix storage unit (32 in FIG. 9) for storing a finite automaton description matrix being converted by the conversion means, and an NFA conversion result for storing a plurality of partial matrices of the finite automaton description matrix being converted by the NFA conversion means A submatrix storage unit (33 in FIG. 9) and a finite automaton description matrix in which the number of characters in the transition condition is increased to an arbitrarily designated number of characters is output. Result output means (22 in FIG. 9).
The first to third finite automaton generation systems according to the present invention adopt such a configuration and convert the NFA description matrix of one-character transition by matrix operation, thereby solving the first to third problems. be able to.

また、本発明の第4の側面に係る有限オートマトン生成システムは、第1または第2または第3の有限オートマトン生成システムの構成に加え、入力された正規表現からNFA記述行列を生成するNFA記述行列生成手段(図12の26)を有する。このような構成を採用し、予め1文字遷移のNFA記述行列を得ていなくても、1文字で遷移するNFAが構築できるような検索対象であればそのNFAを生成することにより、同時並列処理文字数のNFAに変換することができる。なお、上記各括弧内の図面の参照番号は、本発明と実施形態と構成との対応を分かりやすくするためのものであり、本発明を限定するためのものでないことは勿論である。   The finite automaton generation system according to the fourth aspect of the present invention includes an NFA description matrix that generates an NFA description matrix from an input regular expression in addition to the configuration of the first, second, or third finite automaton generation system. It has a generating means (26 in FIG. 12). By adopting such a configuration, even if the NFA description matrix for one character transition is not obtained in advance, if it is a search target that can construct an NFA that transitions by one character, the NFA is generated, thereby performing simultaneous parallel processing. It can be converted to NFA of characters. The reference numerals in the drawings in the parentheses are for the purpose of making the correspondence between the present invention, the embodiment and the configuration easier to understand, and of course are not for limiting the present invention.

第1の効果は、予め記憶された1文字遷移の有限オートマトンを、複数文字の同時並列処理による文字列検索において利用することができる有限オートマトンに変換できることにある。   A first effect is that a one-character transition finite automaton stored in advance can be converted into a finite automaton that can be used in a character string search by simultaneous parallel processing of a plurality of characters.

その理由は、1文字遷移の有限オートマトンを所定の行列で記述することにより、NFA変換手段によって、同時並列処理を行う文字数での遷移条件をもつ有限オートマトンに変換した後、NFA変換結果行列記憶部に記憶するためである。   The reason is that, by describing a finite automaton with one character transition in a predetermined matrix, the NFA conversion means converts the finite automaton having a transition condition with the number of characters to be subjected to simultaneous parallel processing into an NFA conversion result matrix storage unit. It is for memorizing.

第2の効果は、1文字遷移の有限オートマトンを所定の行列で記述することにより、変換処理が容易になり、常に同様の処理を行うことができることにある。   The second effect is that the conversion process is facilitated by describing a finite automaton with one character transition by a predetermined matrix, and the same process can always be performed.

その理由は、1文字遷移の有限オートマトンに関して、その初期状態や終了状態を含めて行列で記述し、NFA変換手段によって行列演算を行うことができるためである。また、NFA変換手段によって、行列演算の特性を活かした変換を行うことで、目的の同時並列処理を行う文字数での遷移条件をもつ有限オートマトンに変換できるまで処理を逐次的に繰り返す必要もないためである。   This is because a finite automaton with one character transition can be described in a matrix including its initial state and end state, and matrix operation can be performed by the NFA conversion means. In addition, since conversion using the characteristics of matrix operation is performed by the NFA conversion means, it is not necessary to repeat the processing sequentially until it can be converted into a finite automaton having a transition condition with the number of characters for which the desired simultaneous parallel processing is performed. It is.

第3の効果は、変換可能な検索対象に対する制限を大幅になくし、正規表現などの1文字遷移の有限オートマトンが生成できる検索対象であれば、必ず目的の同時並列処理を行う文字数での遷移条件をもつ有限オートマトンに変換できることにある。   The third effect is that the restriction on the search target that can be converted is greatly eliminated, and if the search target can generate a one-character transition finite automaton such as a regular expression, the transition condition with the number of characters for which the desired simultaneous parallel processing is always performed. It can be converted to a finite automaton with.

その理由は、NFA記述行列生成手段により、正規表現を必ず1文字遷移のNFAに変換でき、また、変換を行うNFA変換手段では、検索対象の正規表現を考慮せず、あくまで行列として記述された有限オートマトンに対して変換を行うためである。   The reason is that the NFA description matrix generation means can always convert a regular expression to an NFA with a single character transition, and the NFA conversion means for conversion is described as a matrix without considering the regular expression to be searched. This is because conversion is performed on a finite automaton.

本発明の第1の実施の形態の構成を示すブロック図The block diagram which shows the structure of the 1st Embodiment of this invention 本発明の第1の実施の形態の動作を示す流れ図The flowchart which shows the operation | movement of the 1st Embodiment of this invention. 本発明の1文字遷移のNFA記述行列を説明するための図The figure for demonstrating the NFA description matrix of 1 character transition of this invention 本発明の第1の実施の形態の動作を示す流れ図におけるステップA3を示す流れ図The flowchart which shows step A3 in the flowchart which shows the operation | movement of the 1st Embodiment of this invention. 本発明の4文字遷移のNFA記述行列を説明するための図The figure for demonstrating the NFA description matrix of 4 character transition of this invention 本発明の第2の実施の形態の構成を示すブロック図The block diagram which shows the structure of the 2nd Embodiment of this invention. 本発明の第2の実施の形態の動作を示す流れ図The flowchart which shows the operation | movement of the 2nd Embodiment of this invention. 本発明の第2の実施の形態の動作を示す流れ図におけるステップA6を示す流れ図The flowchart which shows step A6 in the flowchart which shows the operation | movement of the 2nd Embodiment of this invention. 本発明の第3の実施の形態の構成を示すブロック図The block diagram which shows the structure of the 3rd Embodiment of this invention. 本発明の第3の実施の形態の動作を示す流れ図The flowchart which shows the operation | movement of the 3rd Embodiment of this invention. 本発明の第3の実施の形態の動作を示す流れ図におけるステップA9を示す流れ図The flowchart which shows step A9 in the flowchart which shows the operation | movement of the 3rd Embodiment of this invention. 本発明の第4の実施の形態の構成を示すブロック図The block diagram which shows the structure of the 4th Embodiment of this invention. 本発明の第4の実施の形態の動作を示す流れ図The flowchart which shows the operation | movement of the 4th Embodiment of this invention.

符号の説明Explanation of symbols

1 入力装置
2 データ処理装置
3 記憶装置
4 出力装置
5 データ処理装置
6 データ処理装置
7 記憶装置
8 データ処理装置
21 NFA変換手段
22 結果出力手段
23 NFA変換手段
24 NFA記述行列分割手段
25 NFA変換手段
26 NFA記述行列生成手段
31 NFA記述行列記憶部
32 NFA変換結果行列記憶部
33 NFA変換結果部分行列記憶部
A1 m文字遷移のNFA記述行列 M生成準備ステップ
A2 同時並列処理文字数 m の NFA に変換できたかをチェックするステップ
A3 k 文字遷移のNFA記述行列Mk への変換ステップ
A4 同時並列処理文字数 m の NFA 記述行列を整形するステップ
A5 結果を出力するステップ
A6 k 文字遷移のNFA記述行列Mk への変換ステップ
A7 NFA記述行列Sを部分行列へ分割するステップ
A8 m文字遷移のNFA記述行列 M生成準備ステップ
A9 k 文字遷移のNFA記述行列Mk への変換ステップ
A10 正規表現からNFA記述行列S への生成ステップ
B1 k を増加させるステップ
B2 NFA記述行列 Mk-p、Mp を読み込むステップ
B3 Mk の算出を行うステップ
B4 Mk の算出が完了したかをチェックするステップ
B5 部分行列を求めるステップ
B6 Mk の部分行列を算出するステップ
B7 部分行列の和をとり Mk を求めるステップ
B8 NFA記述行列 Mk-p、Mp とそれらの部分行列を読み込むステップ
DESCRIPTION OF SYMBOLS 1 Input device 2 Data processing device 3 Storage device 4 Output device 5 Data processing device 6 Data processing device 7 Storage device 8 Data processing device 21 NFA conversion means 22 Result output means 23 NFA conversion means 24 NFA description matrix division means 25 NFA conversion means 26 NFA description matrix generating means 31 NFA description matrix storage unit 32 NFA conversion result matrix storage unit 33 NFA conversion result submatrix storage unit A1 NFA description matrix for m character transition M m generation preparation step A2 Convert to NFA of m characters for simultaneous parallel processing step A3 k character transition NFA description matrix conversion step A4 NFA description matrix of step A6 k character transition for outputting the step A5 results shaping the NFA description matrix of simultaneous parallel processing number m M k to M k to check or not Step A7 for converting the NFA description matrix S into sub-matrices -Up A8 m characters NFA description matrix M m generation preparation step A9 k characters NFA description matrix conversion step A10 Step B2 NFA description increase the production steps B1 k from the regular expression to NFA description matrix S to M k of the transition of the transition matrix M kp, step B7 submatrix calculating step B6 M k submatrix seeking step B5 submatrix to check the calculation of step B4 M k to calculate the step B3 M k to read M p is complete Step B8 of calculating the sum Mk and reading the NFA description matrices M kp and M p and their sub-matrices

次に、本発明の実施の形態について図面を参照して詳細に説明する。   Next, embodiments of the present invention will be described in detail with reference to the drawings.

図1は、本発明を実施するための第1の実施の形態の構成を示すブロック図である。   FIG. 1 is a block diagram showing the configuration of the first embodiment for carrying out the present invention.

図1を参照すると、本発明の第1の実施の形態は、キーボード等の入力装置1と、プログラム制御により動作するデータ処理装置2と、情報を記憶する記憶装置3と、ディスプレイ装置や印刷装置等の出力装置4とを含む。   Referring to FIG. 1, the first embodiment of the present invention includes an input device 1 such as a keyboard, a data processing device 2 that operates under program control, a storage device 3 that stores information, a display device, and a printing device. And the like.

記憶装置3は、NFA記述行列記憶部31と、NFA変換結果行列記憶部32とを備えている。   The storage device 3 includes an NFA description matrix storage unit 31 and an NFA conversion result matrix storage unit 32.

NFA記述行列記憶部31は、正規表現等から構築された1文字遷移NFAをNFA記述行列Sの形で予め記憶している。   The NFA description matrix storage unit 31 stores in advance a one-character transition NFA constructed from regular expressions or the like in the form of an NFA description matrix S.

NFA変換結果行列記憶部32は、NFA変換手段において1文字遷移のNFA記述行列Sから変換されたk文字遷移のNFAの記述行列Mk を記憶する。The NFA conversion result matrix storage unit 32 stores an NFA description matrix M k of k character transitions converted from the NFA description matrix S of one character transition in the NFA conversion means.

データ処理装置2は、NFA変換手段21と、結果出力手段22を備えている。   The data processing device 2 includes an NFA conversion unit 21 and a result output unit 22.

NFA変換手段21は、1文字遷移のNFA記述行列S 、もしくは、p文字遷移のNFA記述行列Mp を必要に応じて、NFA記述行列記憶部31、もしくは、NFA変換結果行列記憶部32からそれぞれ読み出し、それらを用いてk文字遷移のNFA記述行列Mk を生成し、生成した行列Mkを再びNFA変換結果行列記憶部32へ記憶させる。このような処理を、入力装置1から入力された同時並列処理文字数m の値に従い、m 文字遷移のNFA記述行列M が生成されるまで処理を繰り返す。The NFA conversion means 21 receives the NFA description matrix S for single character transition or the NFA description matrix M p for p character transition from the NFA description matrix storage unit 31 or the NFA conversion result matrix storage unit 32 as required. The NFA description matrix M k of k character transition is generated by using the read data, and the generated matrix M k is stored in the NFA conversion result matrix storage unit 32 again. Such processing is repeated until an NFA description matrix M m of m character transitions is generated according to the value of the number m of simultaneous parallel processing characters input from the input device 1.

結果出力手段22は、m 文字遷移のNFA記述行列をNFA変換結果行列記憶部32から読み出し、NFA記述行列、又はそれを状態遷移図に変換して出力装置4へ出力する。NFA変換手段21、結果出力手段22はデータ処理装置2上で実行されるプログラムによりその処理・機能を実現するようにしてもよいことは勿論である。   The result output means 22 reads the NFA description matrix of m character transitions from the NFA conversion result matrix storage unit 32, converts the NFA description matrix or the state transition diagram into a state transition diagram, and outputs it to the output device 4. It goes without saying that the NFA conversion means 21 and the result output means 22 may realize their processing and functions by a program executed on the data processing device 2.

次に、図1及び図2を参照して本発明を実施するための第1の実施の形態の動作について詳細に説明する。   Next, the operation of the first embodiment for carrying out the present invention will be described in detail with reference to FIG. 1 and FIG.

入力装置1から与えられた同時並列処理文字数 m はNFA変換手段21に供給される。NFA変換手段21は、まず、目的となるm文字遷移のNFA記述行列Mmの生成準備として、変数 k を1に、NFA記述行列記憶部31から読み出した1文字遷移のNFA記述行列Sを行列M1とし、行列M1をNFA変換結果行列記憶部32へ記憶させる(ステップA1)。The number m of simultaneous parallel processing characters given from the input device 1 is supplied to the NFA conversion means 21. The NFA converting means 21 first sets the variable k to 1 and the NFA description matrix S of one character transition read from the NFA description matrix storage unit 31 as a matrix in preparation for generating the target m character transition NFA description matrix M m. M 1 is stored, and the matrix M 1 is stored in the NFA conversion result matrix storage unit 32 (step A1).

ここで、n個の状態をもつNFAに対する1文字遷移のNFA記述行列S = { sij } (i = 1,…,n、j = 1,…, n)、k文字遷移のNFA記述行列Mk = { mkij}(i = 1,…,n、j = 1,…, n)について以下に説明する。まず、NFA記述行列の行i (i = 1,…, n)、又は列i(i = 1,…, n)は、NFAのn個の状態のそれぞれ1つに対応付けられ、各要素sij 、mkij は、行i、列iに対応付けられた状態から、行j、列jに対応付けられた状態への遷移条件である文字、または文字列の集合を表すものとする。このとき、“+”を用いて複数の条件を表し、任意の文字を表す記号として、以下では“*”を用いる。Here, an NFA description matrix S = {s ij } (i = 1,..., N, j = 1,..., N) for a one-character transition for an NFA having n states, an NFA description matrix M for a k-character transition k = {mk ij } (i = 1,..., n, j = 1,..., n) will be described below. First, a row i (i = 1,..., N) or a column i (i = 1,..., N) of the NFA description matrix is associated with one of n states of the NFA, and each element s ij and mk ij represent characters or a set of character strings that are transition conditions from the state associated with row i and column i to the state associated with row j and column j. At this time, “+” is used to represent a plurality of conditions, and “*” is used below as a symbol representing an arbitrary character.

さらに、行 i 、又は列 iに対応付けられた状態が初期状態である場合には要素sii に is を、行i 、又は列 iに対応付けられた状態が終了状態である場合には、要素sii に fs を持つものとする。例えば、正規表現“a(bc)*(d|e)”の NFA として図3のような状態0から状態4をもつNFAが構築され、状態i (i = 0,…, 4)を行i+1に対応付けた場合、記述行列Sは[式1]のように表される。Furthermore, if the state associated with row i or column i is the initial state, i s is assigned to element s ii, and if the state associated with row i or column i is the end state , Element s ii has f s . For example, an NFA having the state 0 to the state 4 as shown in FIG. 3 is constructed as the NFA of the regular expression “a (bc) * (d | e)”, and the state i (i = 0,. When associated with +1, the description matrix S is expressed as [Equation 1].

[式1]

Figure 2008081932
[Formula 1]
Figure 2008081932

NFA変換手段21で、上記の処理(ステップA1)を行うと、続いて変数 k と同時並列処理文字数 m の大小比較を行う(ステップA2)。変数 k よりも同時並列処理文字数m が大きな場合、まだ目的とする m 文字遷移のNFAへ変換できていないと判断し、k文字遷移のNFAへの変換処理を行う(ステップA3)。   When the above-described processing (step A1) is performed by the NFA converting means 21, the size of the variable k and the number m of simultaneous parallel processing characters is subsequently compared (step A2). If the number m of simultaneously parallel processed characters is larger than the variable k, it is determined that conversion to NFA of the target m character transition has not been performed yet, and conversion processing of k character transition to NFA is performed (step A3).

図4に、ステップA3におけるより詳細な動作の流れ図を示す。NFA変換手段21は、ステップA3において、まず変数k を増加させる(ステップB1)。この増加の方法として、変数k ×2が同時並列処理文字数 m 以下であれば、k = k×2、そうでなければ k = k + 1 として増加させる。続いて、NFA変換結果行列記憶部32から、既に記憶されているNFA記述行列 Mk-p と Mp を読み出す(ステップB2)。FIG. 4 shows a more detailed flowchart of the operation in step A3. In step A3, the NFA converting means 21 first increases the variable k (step B1). As an increase method, if the variable k × 2 is equal to or less than the number m of simultaneous parallel processing characters, k = k × 2, otherwise k = k + 1. Subsequently, the already stored NFA description matrices M kp and M p are read from the NFA conversion result matrix storage unit 32 (step B2).

ここで、変数pは1以上kより小さな整数とし、読み出す Mk-p と Mp はそれらの行列が既に算出されていれば、制限はない。これらの行列を用いて、k文字遷移のNFA記述行列Mk を行列Mk-p と Mpの積を取ることで算出する。この算出においては、以下のような定義を設け、この定義に従って算出を行う。Here, the variable p is an integer greater than or equal to 1 and smaller than k, and M kp and M p to be read are not limited as long as their matrices have already been calculated. Using these matrices, an NFA description matrix M k for k-character transition is calculated by taking the product of the matrices M kp and M p . In this calculation, the following definition is provided, and the calculation is performed according to this definition.

a、bは、is、fsを含む文字、又は文字列とし、0は空集合とした場合、各要素の演算において、以下のように定義する。When a and b are characters or character strings including i s and f s and 0 is an empty set, they are defined as follows in the calculation of each element.

[定義1]: a × b = ab ≠ ba
[定義2]: a × 0 = 0 × a = 0
[定義3]: is × a = is a、 a ×is = 0、is ×is = is is
[定義4]: a ×fs = a fs、fs × a = 0、fs ×fs = fs fs
[Definition 1]: a x b = ab ≠ ba
[Definition 2]: a × 0 = 0 × a = 0
[Definition 3]: i s × a = i s a, a × i s = 0, i s × i s = i s i s
[Definition 4]: a × f s = af s, f s × a = 0, f s × f s = f s f s

[式1]の1文字遷移のNFA記述行列S = M1を用いてM2 = M1×M1 = { m2ij }(i = 1,…, 5、j = 1,…,5、k = 2、p = 1)を算出する場合、例えば要素m215 は[式2]で求められる。M 2 = M 1 × M 1 = {m2 ij } (i = 1,..., 5, j = 1,..., 5, k, using the NFA description matrix S = M 1 of the one-character transition of [Formula 1] = 2, p = 1)), for example, the element m2 15 is obtained by [Expression 2].

[式2]

Figure 2008081932
[Formula 2]
Figure 2008081932

上記と同様にして、M2 の各要素を算出し、全要素の算出が完了できたことを判断する(ステップB4)と、M2 は[式3]のように算出され、NFA変換手段21は2文字遷移のNFA記述行列M2 をNFA変換結果行列記憶部32に記憶させる。Similarly to the above, when each element of M 2 is calculated and it is determined that the calculation of all elements has been completed (step B4), M 2 is calculated as in [Equation 3], and the NFA converting means 21 Stores the two-character transition NFA description matrix M 2 in the NFA conversion result matrix storage unit 32.

[式3]

Figure 2008081932
[Formula 3]
Figure 2008081932

さらに、同時並列処理文字数 m が4であるとした場合、4文字遷移のNFA記述行列M4 を算出するには、2文字遷移のNFA記述行列M2 を用いて、M4 =M2 ×M2 を算出し(k = 4 、p= 2)、[式4]に示す4文字遷移のNFA記述行列M4 を得ることができる。Further, assuming that the number m of simultaneous parallel processing characters is 4, in order to calculate the NFA description matrix M 4 of the 4- character transition, M 4 = M 2 × M using the NFA description matrix M 2 of the 2-character transition. 2 is calculated (k = 4, p = 2), and an NFA description matrix M 4 of four-character transition shown in [Equation 4] can be obtained.

[式4]

Figure 2008081932
[Formula 4]
Figure 2008081932

NFA変換手段21では、目的のm文字遷移のNFA記述行列までを得る(ステップA2)と、得た行列Mm の整形を行う(ステップA4)。ここでは、行列の各要素に存在するis、fs を任意の文字を表す“*”で置き換える。その結果、例えば[式4]で示す4文字遷移のNFA記述行列M4 は、[式5]のように整形する。The NFA converting means 21, to obtain up to NFA description matrix of m characters transition object (step A2), it performs shaping of the resulting matrix M m (step A4). Here, i s and f s existing in each element of the matrix are replaced with “*” representing an arbitrary character. As a result, for example, the NFA description matrix M 4 of 4 character transition shown in [Expression 4] is shaped as [Expression 5].

[式5]

Figure 2008081932
[Formula 5]
Figure 2008081932

NFA変換手段21は、目的のm文字遷移のNFA記述行列Mm を得ると、結果出力手段22に結果を得たことを通知し、結果出力手段22は、NFA変換結果行列記憶部32からMm を読み出し、出力装置4を通じて結果を出力する。この際、結果出力手段22では、出力フォームがNFA記述行列であれば行列形式を、NFAであればNFA 記述行列 Mmから状態遷移図を作成して出力装置4に提供する。例えば、[式5]に示す4文字遷移のNFA記述行列M4 の状態遷移図は図5のようになる。但し、状態0から状態0、状態4から状態4への遷移条件“****”は初期状態、終了状態における任意の文字列を意味し、このような入力文字列は意味をなさない。このため、図中では表していない。このように、前述の[定義1]から[定義4]に示される予め定められた演算規則に従って、式2から式5に見られる行列演算処理が行われる。When the NFA conversion unit 21 obtains the NFA description matrix M m of the target m character transition, the NFA conversion unit 21 notifies the result output unit 22 that the result has been obtained, and the result output unit 22 stores the MFA from the NFA conversion result matrix storage unit 32. Read m and output the result through the output device 4. At this time, the result output unit 22, an output form provides a matrix form if NFA description matrix, the NFA description matrix M m create and output device state transition diagram of four if NFA. For example, the state transition diagram of the NFA description matrix M 4 of the four character transition shown in [Formula 5] is as shown in FIG. However, the transition condition “****” from state 0 to state 0 and from state 4 to state 4 means an arbitrary character string in the initial state and the end state, and such an input character string does not make sense. For this reason, it is not shown in the figure. In this way, the matrix calculation processing shown in Expressions 2 to 5 is performed according to the predetermined calculation rules shown in [Definition 1] to [Definition 4].

上記第1の実施の形態においては、NFA変換に行列を用いることにより、元々の1文字遷移のNFAの状態数を変化させることなく、同時並列処理文字数遷移のNFAに変換することができる。更に、NFA変換の途中結果の行列のみをNFA変換結果行列記憶部32に記憶させることにより、少ない記憶容量でNFA変換することができる。加えて、変換途中に現在の得ているk文字遷移のNFA記述行列の k と同時並列処理文字数mにより k を増加させることで、k が同時並列処理文字数に達するまで逐次的に k 文字遷移のNFA記述行列を算出する必要が無く、また、最後にm文字遷移のNFA記述行列の整形処理を行うため、任意の文字を表す“*”が is、fs のどちらから生成されているかの判断が不要となる。従って、行列演算に関する処理が簡単になり、生成速度を向上させることができる。In the first embodiment, by using a matrix for NFA conversion, conversion to NFA with simultaneous parallel processing character number transition can be performed without changing the number of original NFA states with one character transition. Furthermore, by storing only the matrix of the intermediate result of NFA conversion in the NFA conversion result matrix storage unit 32, it is possible to perform NFA conversion with a small storage capacity. In addition, by increasing k by the current k character transition NFA description matrix k and the number of simultaneous parallel processing characters m during conversion, k character transitions are sequentially increased until k reaches the number of simultaneous parallel processing characters. There is no need to calculate the NFA description matrix, and since the NFA description matrix with m-character transition is finally formatted, “*” representing an arbitrary character is generated from either i s or f s Judgment becomes unnecessary. Therefore, processing related to matrix calculation is simplified, and the generation speed can be improved.

尚、上記実施例では、変数 k の増加方法を同時並列処理数 m との比較によって決定しているが、常に k = k+ 1 として変数kを増加させる方法をとっても良い。   In the above embodiment, the method of increasing the variable k is determined by comparison with the number m of simultaneous parallel processing, but a method of increasing the variable k by always setting k = k + 1 may be used.

また、非決定性有限オートマトン(NFA)だけでなく、決定性有限オートマトン(DFA)に対しても、本実施の形態と同様の構成を適用することができる。   In addition to the nondeterministic finite automaton (NFA), the same configuration as that of the present embodiment can be applied to the deterministic finite automaton (DFA).

次に、本発明を実施するための第2の実施の形態について図面を参照して詳細に説明する。   Next, a second embodiment for carrying out the present invention will be described in detail with reference to the drawings.

図6は、本発明を実施するための第2の実施の形態の構成を示すブロック図である。   FIG. 6 is a block diagram showing the configuration of the second embodiment for carrying out the present invention.

図6を参照すると、本発明の第2の実施の形態に係わるデータ処理装置5は、図1に示された第1の実施の形態におけるデータ処理装置2の構成において、NFA変換手段21がNFA変換手段23に置き換わった構成になる。その他の点は第1の実施の形態と同じである。   Referring to FIG. 6, the data processing apparatus 5 according to the second embodiment of the present invention is the same as that of the data processing apparatus 2 in the first embodiment shown in FIG. The conversion means 23 is replaced. Other points are the same as those in the first embodiment.

データ処理装置5は、NFA変換手段23と、結果出力手段22を備えている。   The data processing device 5 includes an NFA conversion unit 23 and a result output unit 22.

NFA変換手段23は、1文字遷移のNFA記述行列S 、もしくは、p文字遷移のNFA記述行列Mp を必要に応じて、NFA記述行列記憶部31、もしくは、NFA変換結果行列記憶部32からそれぞれ読み出し、それらを3つの部分行列に分割してk 文字遷移のNFA記述行列Mk を生成し、生成した行列Mkを再びNFA変換結果行列記憶部32へ記憶させる。ここで、3つの分割行列として、1文字遷移のNFA記述行列Sの部分行列をS’、Si、Sa、k 文字遷移のNFA記述行列Mk をM’k、Mik、Makとする。このような処理を、入力装置1から入力された同時並列処理文字数m の値に従い、 m 文字遷移の NFA が生成されるまで処理を繰り返す。結果出力手段22は、第1の実施の形態と同じであるため、説明は省略する。NFA変換手段23、結果出力手段22は、データ処理装置5上で実行されるプログラムによりその処理・機能を実現するようにしてもよいことは勿論である。The NFA conversion means 23 receives the NFA description matrix S for single character transition or the NFA description matrix M p for p character transition from the NFA description matrix storage unit 31 or the NFA conversion result matrix storage unit 32 as required. Read, divide them into three sub-matrices to generate an NFA description matrix M k with k-character transition, and store the generated matrix M k in the NFA conversion result matrix storage unit 32 again. Here, as three divided matrices, the partial matrix of the first character transition NFA description matrix S S to ', Si, Sa, NFA description matrix M k to M k-character transition' k, Mi k, and Ma k. Such processing is repeated according to the value of the number m of simultaneously processed parallel characters input from the input device 1 until an NFA of m character transitions is generated. Since the result output means 22 is the same as that of the first embodiment, description thereof is omitted. It goes without saying that the NFA conversion means 23 and the result output means 22 may realize their processing and functions by a program executed on the data processing device 5.

次に、図6及び図7を参照して本発明を実施するための第2の実施の形態の動作について詳細に説明する。   Next, the operation of the second embodiment for carrying out the present invention will be described in detail with reference to FIG. 6 and FIG.

入力装置1から与えられた同時並列処理文字数 m はNFA変換手段23に供給される。NFA変換手段23は、まず、目的となるm文字遷移のNFA記述行列Mmの生成準備として、変数 k を 1に、NFA記述行列記憶部31から読み出した1文字遷移のNFA記述行列Sを行列 M1 とし、行列M1 をNFA変換結果行列記憶部32へ記憶させる(ステップA1)。NFA記述行列S、M1の意味は、第1の実施の形態と同じあるため、説明は省略する。The number m of simultaneous parallel processing characters given from the input device 1 is supplied to the NFA conversion means 23. First, the NFA converting means 23 sets the variable k to 1 and the 1-character transition NFA description matrix S read from the NFA description matrix storage unit 31 as a matrix in preparation for generating the target m-character transition NFA description matrix M m. M 1 is stored, and the matrix M 1 is stored in the NFA conversion result matrix storage unit 32 (step A1). Since the meanings of the NFA description matrices S and M 1 are the same as those in the first embodiment, description thereof is omitted.

NFA変換手段23で、上記の処理(ステップA1)を行うと、続いて変数 k と同時並列処理文字数 m の大小比較を行う(ステップA2)。変数 k よりも同時並列処理文字数m が大きな場合、まだ目的とする m 文字遷移のNFAへ変換できていないと判断し、k文字遷移のNFAへの変換処理を行う(ステップA6)。   When the above-described processing (step A1) is performed by the NFA conversion means 23, the variable k and the number m of simultaneously parallel processed characters m are subsequently compared (step A2). If the number m of simultaneous parallel processing characters is larger than the variable k, it is determined that conversion to NFA of the target m character transition has not been performed yet, and conversion processing of k character transition to NFA is performed (step A6).

図8に、ステップA6におけるより詳細な動作の流れ図を示す。NFA変換手段23は、ステップA6において、まず変数k を増加させ(ステップB1)、NFA変換結果行列記憶部32から、既に記憶されているNFA記述行列 Mk-p と Mp とを読み出す(ステップB2)。これらの方法は第1の実施の形態と同じあるため、説明は省略する。FIG. 8 shows a more detailed flowchart of the operation in step A6. In step A6, the NFA conversion means 23 first increases the variable k (step B1), and reads out the already stored NFA description matrices M kp and M p from the NFA conversion result matrix storage unit 32 (step B2). . Since these methods are the same as those in the first embodiment, description thereof is omitted.

続いて、これらの行列Mk-p と Mpとから、それぞれの部分行列M’k-p、Mik-p、Mak-p、M’p、Mip、Mapを求める(ステップB5)。Subsequently, from these matrices M kp and M p, each subarray M 'kp, Mi kp, Ma kp, M' p, Mi p, seek Ma p (step B5).

ここで、k文字遷移の NFA 記述行列 Mkの部分行列 M’k、Mik 、Mak を以下のように定義する。まず、k = 1 の場合のNFA 記述行列 Mk =S の部分行列 M’1、Mi1 、Ma1を次のように定義する。Here, NFA description matrix Mk submatrix M 'k of k characters transition, Mi k, the Ma k is defined as follows. First, the sub-matrices M ′ 1 , Mi 1 , and Ma 1 of the NFA description matrix M k = S when k = 1 are defined as follows.

[定義5]: 部分行列 M’1 は、各要素共にis、fs 以外の要素のみをもつ行列。[Definition 5]: The submatrix M ′ 1 is a matrix in which each element has only elements other than i s and f s .

[定義6]: 部分行列Mi1 は、is のみを要素にもち、このis は任意の文字を表す“*”に置き換える。[Definition 6]: The submatrix Mi 1 has only i s as an element, and this i s is replaced with “*” representing an arbitrary character.

[定義7]: 部分行列Ma1 は、fs のみを要素にもち、このfsは任意の文字を表す“*”に置き換える。[Definition 7]: The submatrix Ma 1 has only f s as an element, and this f s is replaced with “*” representing an arbitrary character.

[定義8]: M1 = M’1 + Mi1 + Ma1 [Definition 8]: M 1 = M ′ 1 + Mi 1 + Ma 1

例えば、記述行列Sが[式1]のように表されるとき、M’1、Mi1 、Ma1 、M1 は[式6]のように表す。For example, when the description matrix S is expressed as [Equation 1], M ′ 1 , Mi 1 , Ma 1 , and M 1 are expressed as [Equation 6].

[式6]

Figure 2008081932

Figure 2008081932
[Formula 6]
Figure 2008081932

Figure 2008081932

また、k が 1 より大きい場合のNFA記述行列 Mk の部分行列 M’k 、Mik 、Mak は以下の定義によって表す。The partial matrix M 'k of NFA description matrix M k where k is greater than 1, Mi k, Ma k is represented by the following definitions.

[定義9]: 部分行列 M’kは、各要素共に最後に“*” を持たない行列。つまり、 “**a…” のような要素はあっていいが、“…a**” のような要素は持たない。[Definition 9]: The submatrix M ′ k is a matrix in which each element does not have “*” at the end. In other words, there can be elements like “** a…”, but there are no elements like “… a **”.

[定義10]: 部分行列 Mikは、各要素共に初期状態を示すisから置き換えられた“*”の積である “**…” のような要素しか持たない。[Definition 10]: submatrix Mi k has only elements such as the product of a "** ..." replaced "*" from the i s indicating the initial state to the element both.

[定義11]: 部分行列 Makは、各要素共に最後に “*” を持つものだけで構成される行列。つまり、“…a**” のような要素のみを持つ。[Definition 11]: The sub-matrix Ma k is a matrix composed of only elements having “*” at the end of each element. In other words, it has only elements such as “… a **”.

NFA変換手段23は、上記のような部分行列を用いて、k文字遷移のNFA記述行列Mk の部分行列M’k、Mik、Mak を求める。このときの算出には、第1の実施の形態でも定義した定義1から定義4を用いる。ここで、Mk = Mk-p×Mp を定義1から定義4を用いて算出すると、[式7]を得る。NFA converting means 23 uses the submatrices as described above, partial matrix M 'k of NFA description matrix M k of k characters transition, Mi k, seek Ma k. For the calculation at this time, definitions 1 to 4 defined in the first embodiment are used. Here, when M k = M kp × M p is calculated using definitions 1 to 4, [Equation 7] is obtained.

[式7]

Figure 2008081932
[Formula 7]
Figure 2008081932

定義3、4より、M’k-p×Mip = 0、Mak-p×M’p =0、Mak-p×Mip = 0 となるので、[式7]は[式8]で表される。By definition 3,4, since the M 'kp × Mi p = 0 , Ma kp × M' p = 0, Ma kp × Mi p = 0, represented by [Equation 7] [Equation 8].

[式8]

Figure 2008081932
[Formula 8]
Figure 2008081932

定義9、10、11と[式8]とにより、k文字遷移のNFA記述行列Mk の部分行列M’k、Mik、Mak は[式9]のように定義できる。なお、[式9]の演算では、任意の文字を表す“*”は通常の文字として扱い、計算を行う。
By definition 9, 10 and 11 and [Expression 8], NFA description matrix M k submatrix M 'k of k characters transition, Mi k, Ma k can be defined as [Equation 9]. In the calculation of [Equation 9], “*” representing an arbitrary character is treated as a normal character and calculation is performed.

[式9]

Figure 2008081932
[Formula 9]
Figure 2008081932

NFA変換手段23は、NFA変換結果行列記憶部32から読み込んだ行列Mk-p と Mpとから、それぞれの部分行列M’k-p、Mik-p、Mak-p、M’p、Mip、Mapを求める(ステップB5)と、上記の[式9]よりM’k、Mik、Mak を求める(ステップB6)。それらの和を取ることで、k文字遷移の NFA 記述行列 Mkを算出し(ステップB7)、全要素の算出が完了できたことを判断する(ステップB4)と、NFA変換手段23はk文字遷移のNFA記述行列Mk をNFA変換結果行列記憶部32に記憶させる。NFA converting means 23, the read and matrices M kp and M p from NFA conversion result matrix storage unit 32, obtains each subarray M 'kp, Mi kp, Ma kp, M' p, Mi p, the Ma p (Step B5) and M ′ k , Mi k , and Mak are obtained from the above [Equation 9] (Step B6). The NFA description matrix M k of k character transition is calculated by taking the sum of them (step B7), and when it is determined that the calculation of all the elements has been completed (step B4), the NFA conversion means 23 uses k characters. The NFA description matrix M k of the transition is stored in the NFA conversion result matrix storage unit 32.

例えば、図3に示す正規表現“a(bc)*(d|e)”の1文字遷移のNFA記述行列S = M1(式6)の部分行列を用いてM2 の部分行列、及びその和を求めると[式10]のようになる。For example, the sub-matrix of M 2 using the sub-matrix of the NFA description matrix S = M 1 (Equation 6) of the one-character transition of the regular expression “a (bc) * (d | e)” shown in FIG. When the sum is obtained, [Formula 10] is obtained.

[式10]

Figure 2008081932
[Formula 10]
Figure 2008081932

さらに、同時並列処理文字数 m が4であるとした場合、4文字遷移のNFA記述行列M4 を算出するには、2文字遷移のNFA記述行列M2 の部分行列を用いて、M4 を算出し(k = 4 、p= 2)、[式11]に示す4文字遷移のNFA記述行列M4 の部分行列、及びM4 を得ることができる。Furthermore, if concurrent parallel processing number m is set to be 4, 4 to calculate the the NFA description matrix M 4 character transitions, using 2 character transition NFA description matrix M 2 submatrix, calculated M 4 (K = 4, p = 2), the sub-matrix of the 4-character transition NFA description matrix M 4 shown in [Equation 11] and M 4 can be obtained.

[式11]

Figure 2008081932
[Formula 11]
Figure 2008081932

NFA変換手段23では、目的のm文字遷移のNFA記述行列までを得る(ステップA2)と、結果出力手段22に結果を得たことを通知し、その後の動作は第1の実施の形態と同じあるため、説明は省略する。   When the NFA conversion means 23 obtains the NFA description matrix of the desired m-character transition (step A2), it notifies the result output means 22 that the result has been obtained, and the subsequent operation is the same as in the first embodiment. Therefore, the description is omitted.

上記第2の実施の形態においては、第1の実施の形態と同様、NFA変換に行列を用いることにより、元々の1文字遷移のNFAの状態数を変化させることなく、同時並列処理文字数遷移のNFAに変換することができる。また、NFA変換手段における行列演算において、既に定義1から定義4が考慮されているため、演算途中において各要素をチェックする必要がない。このため、各部分行列の生成が必要となるものの、分岐等の処理が不要となり、生成速度を向上させることができる。   In the second embodiment, as in the first embodiment, by using a matrix for NFA conversion, the number of simultaneous parallel processing character number transitions can be changed without changing the number of NFA states of the original one-character transition. Can be converted to NFA. Further, since the definition 1 to the definition 4 are already taken into account in the matrix calculation in the NFA conversion means, it is not necessary to check each element during the calculation. For this reason, although generation of each partial matrix is required, processing such as branching is not required, and the generation speed can be improved.

なお、上記実施例では、第1の実施例と同様、変数 k の増加方法を同時並列処理数 m との比較によって決定しているが、常に k = k + 1 として増加させても良い。また、非決定性有限オートマトン(NFA)だけでなく、決定性有限オートマトン(DFA)に対しても同様の実施の形態で適用することができる。   In the above embodiment, as in the first embodiment, the method for increasing the variable k is determined by comparison with the simultaneous parallel processing number m, but it may be always increased as k = k + 1. Further, not only a nondeterministic finite automaton (NFA) but also a deterministic finite automaton (DFA) can be applied in the same embodiment.

次に、本発明を実施するための第3の実施の形態について図面を参照して詳細に説明する。   Next, a third embodiment for carrying out the present invention will be described in detail with reference to the drawings.

図9は、本発明を実施するための第3の実施の形態の構成を示すブロック図である。   FIG. 9 is a block diagram showing the configuration of the third exemplary embodiment for carrying out the present invention.

図9を参照すると、本発明の第3の実施の形態に係わるデータ処理装置6は、図6に示された第2の実施の形態におけるデータ処理装置5の構成において、NFA変換手段23がNFA変換手段25に置き換わり、かつ、NFA記述行列分割手段24を備え、記憶装置7は、図6に示された第2の実施の形態における記憶装置3において、NFA変換結果部分行列記憶部33を備えている。その他の点は第2の実施の形態と同じである。   Referring to FIG. 9, in the data processing apparatus 6 according to the third embodiment of the present invention, in the configuration of the data processing apparatus 5 in the second embodiment shown in FIG. The conversion unit 25 is replaced with an NFA description matrix division unit 24. The storage device 7 includes an NFA conversion result submatrix storage unit 33 in the storage device 3 in the second embodiment shown in FIG. ing. The other points are the same as in the second embodiment.

データ処理装置6は、NFA記述行列分割手段24と、NFA変換手段25と、結果出力手段22を備えている。   The data processing device 6 includes an NFA description matrix dividing unit 24, an NFA converting unit 25, and a result output unit 22.

NFA記述行列分割手段24は、1文字遷移のNFA記述行列S をNFA記述行列記憶部31から読み出し、部分行列S’、Si、Saに分割し、1文字遷移のNFA記述行列Sと共にそれらの行列をNFA変換手段25へと提供する。   The NFA description matrix dividing means 24 reads the NFA description matrix S of one character transition from the NFA description matrix storage unit 31, divides it into partial matrices S ′, Si, Sa, and those matrices together with the NFA description matrix S of one character transition. Is provided to the NFA converting means 25.

NFA変換手段25は、NFA記述行列分割手段24からのNFA記述行列S、及びその部分行列S’、Si、Saを1文字遷移のNFA記述行列M1、及び、その部分行列M’1、Mi1、Ma1として受け取り、M1をNFA変換結果行列記憶部32に、部分行列M’1、Mi1、Ma1をNFA変換結果部分行列記憶部33に記憶させる。NFA変換手段25は、既に変換され、NFA変換結果行列記憶部32とNFA変換結果部分行列記憶部33に記憶されているk-p文字遷移のNFA記述行列Mk-pとその部分行列M’k-p、Mik-p、Mak-p、また、p文字遷移のNFA記述行列Mp とその部分行列M’p、Mip、Mapを必要に応じて読み出し、それらを使ってk文字遷移のNFA記述行列Mkの部分行列M’k、Mik、Makを生成し、それらの和をとることでMk を生成し、生成したそれらの行列を再びNFA変換結果行列記憶部32、NFA変換結果部分行列記憶部33へ記憶させる。ここで、各種の行列の意味と結果出力手段22は、第2の実施の形態と同じであるため、説明を省略する。The NFA converting means 25 converts the NFA description matrix S from the NFA description matrix dividing means 24 and its partial matrices S ′, Si, Sa into an NFA description matrix M 1 of one-character transition and its partial matrices M ′ 1 , Mi 1 , Ma 1 , and M 1 is stored in the NFA conversion result matrix storage unit 32, and the partial matrices M ′ 1 , Mi 1 , and Ma 1 are stored in the NFA conversion result submatrix storage unit 33. The NFA conversion means 25 converts the KFA character transition NFA description matrix M kp and its partial matrices M ′ kp , Mi kp already converted and stored in the NFA conversion result matrix storage unit 32 and the NFA conversion result submatrix storage unit 33. , Ma kp also,, NFA description matrix of p character transition M p and its partial matrix M 'p, Mi p, read as needed Ma p, part of the NFA description matrix M k of k characters transitions with them matrix M 'k, Mi k, generates Ma k, generates a M k by taking their sum, they generated their matrix again NFA conversion result matrix storage unit 32, NFA conversion result sub-matrix storage unit 33 Remember me. Here, the meanings of the various matrices and the result output means 22 are the same as those in the second embodiment, and a description thereof will be omitted.

記憶装置7は、NFA記述行列記憶部31と、NFA変換結果行列記憶部32と、NFA変換結果部分行列記憶部33を備えている。   The storage device 7 includes an NFA description matrix storage unit 31, an NFA conversion result matrix storage unit 32, and an NFA conversion result submatrix storage unit 33.

NFA変換結果部分行列記憶部33は、k 文字遷移のNFA記述行列Mk の部分行列である M’k、Mik、Makを記憶する。NFA記述行列記憶部31と、NFA変換結果行列記憶部32については、第2の実施の形態と同じであるため、説明を省略する。本実施例において、NFA記述行列分割手段24と、NFA変換手段25と、結果出力手段22は、データ処理装置6上で実行されるプログラムによりその処理・機能を実現するようにしてもよいことは勿論である。NFA conversion result sub-matrix storage unit 33 is a submatrix of the NFA description matrix M k of k characters transitions M 'k, Mi k, stores Ma k. Since the NFA description matrix storage unit 31 and the NFA conversion result matrix storage unit 32 are the same as those in the second embodiment, description thereof will be omitted. In the present embodiment, the NFA description matrix dividing unit 24, the NFA converting unit 25, and the result output unit 22 may realize their processing and functions by a program executed on the data processing device 6. Of course.

次に、図9及び図10を参照して本発明を実施するための第3の実施の形態の動作について詳細に説明する。   Next, the operation of the third embodiment for carrying out the present invention will be described in detail with reference to FIG. 9 and FIG.

入力装置1から与えられた同時並列処理文字数 m はNFA変換手段25に供給される。NFA記述行列分割手段24は、NFA記述行列記憶部31から読み出した1文字遷移のNFA記述行列Sを部分行列S’、Si、Sa に分割する(ステップA7)。NFA記述行列分割手段24は、それらの行列をNFA変換手段25に提供し、NFA変換手段25は、NFA記述行列分割手段24から受け取ったそれぞれの行列を、1文字遷移のNFA記述行列M1、及びその部分行列M’1、Mi1、Ma1として、M1をNFA変換結果行列記憶部32に、部分行列M’1、Mi1、Ma1をNFA変換結果部分行列記憶部33に記憶させる(ステップA8)。The number m of simultaneous parallel processing characters given from the input device 1 is supplied to the NFA conversion means 25. The NFA description matrix dividing means 24 divides the NFA description matrix S of one character transition read from the NFA description matrix storage unit 31 into partial matrices S ′, Si, Sa (step A7). The NFA description matrix dividing unit 24 provides these matrices to the NFA converting unit 25, and the NFA converting unit 25 converts each of the matrices received from the NFA description matrix dividing unit 24 into an NFA description matrix M 1 of one character transition, and 'a 1, Mi 1, Ma 1, the M 1 to NFA conversion result matrix storage unit 32, the partial matrix M' the sub-matrix M to store 1, Mi 1, Ma 1 to NFA conversion result sub-matrix storage unit 33 (Step A8).

なお、NFA記述行列S、M1の意味、及びそれら部分行列の意味は、第2の実施の形態と同じであるため、説明を省略する。Note that the meanings of the NFA description matrices S and M 1 and the meanings of these sub-matrices are the same as those in the second embodiment, and thus description thereof is omitted.

NFA変換手段25で上記の処理(ステップA8)を行うと、続いて変数 k と同時並列処理文字数 m の大小比較を行う(ステップA2)。変数 k よりも同時並列処理文字数m が大きな場合、まだ目的とする m 文字遷移のNFAへ変換できていないと判断し、k文字遷移のNFAへの変換処理を行う(ステップA9)。   When the above-described processing (step A8) is performed by the NFA conversion means 25, the variable k and the number m of simultaneously parallel processed characters m are subsequently compared (step A2). If the number m of simultaneous parallel processing characters is larger than the variable k, it is determined that conversion to NFA of the target m character transition has not been performed yet, and conversion processing of k character transition to NFA is performed (step A9).

図11に、ステップA9におけるより詳細な動作の流れ図を示す。NFA変換手段25は、ステップA9において、まず変数k を増加させ(ステップB1)、NFA変換結果行列記憶部32から、既に記憶されているNFA記述行列 Mk-p と Mpを、NFA変換結果部分行列記憶部33から、NFA記述行列Mk-p と Mp の部分行列M’k-p、Mik-p、Mak-p、M’p、Mip、Mapを読み出す(ステップB8)。その後の動作としては、算出したk文字遷移の NFA 記述行列 MkをNFA変換結果行列記憶部32に記憶させるだけでなく、その部分行列 M’k、Mik 、Mak をNFA変換結果部分行列記憶部33に記憶させること以外は、第2の実施の形態と同じであるため、説明は省略する。FIG. 11 shows a more detailed flowchart of the operation in step A9. In step A9, the NFA conversion means 25 first increases the variable k (step B1), and the NFA description matrix M kp and M p already stored from the NFA conversion result matrix storage unit 32 are used as the NFA conversion result submatrix. from the storage unit 33, reads NFA submatrix M of description matrix M kp and M p 'kp, Mi kp, Ma kp, M' p, Mi p, the Ma p (step B8). The subsequent operation, as well as to store the NFA description matrix M k of the calculated k character transitions in NFA conversion result matrix storage unit 32, the partial matrix M 'k, Mi k, Ma k the NFA conversion result sub-matrix Since it is the same as that of 2nd Embodiment except memorize | storing in the memory | storage part 33, description is abbreviate | omitted.

上記第3の実施の形態においては、NFA変換手段における行列演算において、変換したk文字遷移の NFA 記述行列 Mkだけでなく、その部分行列M’k、Mik 、Mak もNFA変換結果部分行列記憶部33に記憶させるため、NFA変換手段で変換を繰り返す度に部分行列への分割を行う必要がない。このため、k文字遷移のNFA記述行列の生成速度を向上させることができる。In the above-described third embodiment, the matrix operation in NFA converting means, not only the NFA description matrix M k the converted k character transition, the partial matrix M 'k, Mi k, Ma k also NFA conversion result part Since the data is stored in the matrix storage unit 33, it is not necessary to divide the matrix into sub-matrices every time the NFA conversion unit repeats conversion. For this reason, the generation speed of the NFA description matrix of k character transition can be improved.

なお、上記実施例では、第1、第2の実施例と同様、変数 k の増加方法を同時並列処理数 m との比較によって決定しているが、常に k = k + 1 として増加させても良い。また、非決定性有限オートマトン(NFA)だけでなく、決定性有限オートマトン(DFA)に対しても同様の実施の形態で適用することができる。   In the above embodiment, as in the first and second embodiments, the method for increasing the variable k is determined by comparison with the simultaneous parallel processing number m. However, even if it is always increased as k = k + 1. good. Further, not only a nondeterministic finite automaton (NFA) but also a deterministic finite automaton (DFA) can be applied in the same embodiment.

次に、本発明を実施するための第4の実施の形態について図面を参照して詳細に説明する。   Next, a fourth embodiment for carrying out the present invention will be described in detail with reference to the drawings.

図12は、本発明を実施するための第4の実施の形態の構成を示すブロック図である。   FIG. 12 is a block diagram showing the configuration of the fourth embodiment for carrying out the present invention.

図12を参照すると、本発明の第4の実施の形態に係わるデータ処理装置8は、図9に示された第3の実施の形態におけるデータ処理装置6の構成において、NFA記述行列生成手段26を備え、その他の点は第3の実施の形態と同じである。   Referring to FIG. 12, the data processing apparatus 8 according to the fourth embodiment of the present invention has an NFA description matrix generating means 26 in the configuration of the data processing apparatus 6 in the third embodiment shown in FIG. The other points are the same as those of the third embodiment.

データ処理装置8は、NFA記述行列生成手段26と、NFA記述行列分割手段24と、NFA変換手段25と、結果出力手段22を備えている。   The data processing apparatus 8 includes an NFA description matrix generation unit 26, an NFA description matrix division unit 24, an NFA conversion unit 25, and a result output unit 22.

NFA記述行列生成手段26は、入力装置1から正規表現そのものを提供される。NFA記述行列生成手段26は、正規表現を提供されると、正規表現から構文木を構築し、その構文木から1文字遷移のNFAを生成する。生成したNFAからNFA記述行列S を生成し、NFA記述行列記憶部31へと記憶させる。本実施例において、NFA記述行列生成手段26と、NFA記述行列分割手段24と、NFA変換手段25と、結果出力手段22は、データ処理装置8上で実行されるプログラムによりその処理・機能を実現するようにしてもよいことは勿論である。   The NFA description matrix generating means 26 is provided with the regular expression itself from the input device 1. When provided with a regular expression, the NFA description matrix generation means 26 constructs a syntax tree from the regular expression and generates an NFA of one-character transition from the syntax tree. An NFA description matrix S is generated from the generated NFA and stored in the NFA description matrix storage unit 31. In this embodiment, the NFA description matrix generation means 26, the NFA description matrix division means 24, the NFA conversion means 25, and the result output means 22 realize their processing and functions by a program executed on the data processing device 8. Of course, you may make it do.

次に、図12及び図13を参照して本発明を実施するための第4の実施の形態の動作について詳細に説明する。   Next, the operation of the fourth embodiment for carrying out the present invention will be described in detail with reference to FIGS.

入力装置1から与えられた同時並列処理文字数 m はNFA変換手段25に供給される。また、入力装置1からは正規表現そのものがNFA記述行列生成手段26に供給される。[非特許文献1]に記載されているような正規表現を元に構文木を構築し、その構文木から1文字遷移のNFAを生成する。一般的に、このような方法を用いた正規表現からNFAを構築する方法では、各状態からの遷移先状態、及びその遷移条件を保持したリストがあるため、そのリストからNFA記述行列S を生成し、NFA記述行列記憶部31へと記憶させる(ステップA10)。その後の処理は、第3の実施の形態と同じであるため、詳細な説明は省略する。   The number m of simultaneous parallel processing characters given from the input device 1 is supplied to the NFA conversion means 25. Further, the regular expression itself is supplied from the input device 1 to the NFA description matrix generation means 26. A syntax tree is constructed based on a regular expression as described in [Non-Patent Document 1], and an NFA of one-character transition is generated from the syntax tree. In general, in the method of constructing an NFA from a regular expression using such a method, there is a list that holds the transition destination state from each state and its transition condition, so an NFA description matrix S is generated from the list. Then, it is stored in the NFA description matrix storage unit 31 (step A10). Since the subsequent processing is the same as that of the third embodiment, detailed description thereof is omitted.

上記第4の実施の形態においては、予めNFA記述行列がNFA記述行列記憶部31に記憶されていない場合において、正規表現を入力することで既存のNFA構築手法を用いてNFAを構築し、そのNFA記述行列Sを生成することができる。このため、柔軟に与えられた正規表現を用いて同時並列処理文字数で遷移するNFA記述行列を生成することができる。   In the fourth embodiment, when an NFA description matrix is not stored in the NFA description matrix storage unit 31 in advance, an NFA is constructed using an existing NFA construction method by inputting a regular expression. An NFA description matrix S can be generated. For this reason, it is possible to generate an NFA description matrix that transitions by the number of simultaneously processed parallel characters using a regular expression that is flexibly given.

なお、上記第4の実施の形態は、第3の実施の形態の構成にNFA記述行列生成手段26を備えた形態であるが、第1の実施の形態、及び第2の実施の形態においても同様のNFA記述行列生成手段26を備えることで、与えられた正規表現から、指定された同時並列処理文字数で遷移するNFA記述行列を生成することができる。   The fourth embodiment is a form in which the NFA description matrix generation means 26 is provided in the configuration of the third embodiment, but also in the first embodiment and the second embodiment. By providing the same NFA description matrix generation means 26, it is possible to generate an NFA description matrix that transitions with a specified number of simultaneously processed characters from a given regular expression.

上記第1から第4の実施の形態では、処理装置及び記憶装置の各部をハードウェアで構成したが、各部の一部または全部をプログラムとして情報処理装置に機能させるようにすることもできる。   In the first to fourth embodiments, each unit of the processing device and the storage device is configured by hardware. However, a part or all of each unit can be caused to function as a program in the information processing apparatus.

本発明の活用例として、ネットワークサービスに対する攻撃や侵入を検知する侵入検知システム(IDS:Intrusion Detection System)や侵入防止システム(IPS:Intrusion Prevention System)における攻撃・侵入ルールのパターンマッチング処理を高速に実現するためのオートマトンを生成するためのプログラムといった用途に適用できる。また、パソコンやワークステーションに搭載されているソフトウェアベースでのパターンマッチング処理におけるオートマトン生成にも適用できる。
本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態ないし実施例の変更・調整が可能である。また、本発明の請求の範囲の枠内において種々の開示要素の多様な組み合わせないし選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。
As an example of use of the present invention, pattern matching processing of attack / intrusion rules in an intrusion detection system (IDS: Intrusion Detection System) and intrusion prevention system (IPS: Intrusion Prevention System) for detecting attacks and intrusions on network services is realized at high speed. It can be applied to a use such as a program for generating an automaton for the purpose. It can also be applied to automaton generation in software-based pattern matching processing installed in personal computers and workstations.
Within the scope of the entire disclosure (including claims) of the present invention, the embodiments and examples can be changed and adjusted based on the basic technical concept. Various combinations and selections of various disclosed elements are possible within the scope of the claims of the present invention. That is, the present invention of course includes various variations and modifications that could be made by those skilled in the art according to the entire disclosure including the claims and the technical idea.

Claims (42)

固定文字数の遷移条件から成る有限オートマトンの遷移条件の文字数を、任意に指定する文字数に増加させる手段を有することを特徴とする有限オートマトン生成システム。   A finite automaton generation system comprising means for increasing the number of characters of a transition condition of a finite automaton composed of transition conditions of a fixed number of characters to an arbitrarily designated number of characters. 前記有限オートマトンは、行列形式で記述されていることを特徴とする請求項1に記載の有限オートマトン生成システム。   The finite automaton generation system according to claim 1, wherein the finite automaton is described in a matrix format. 前記増加させる手段は、元の有限オートマトンの状態数を変化させないことを特徴とする請求項1または請求項2に記載の有限オートマトン生成システム。   The finite automaton generation system according to claim 1 or 2, wherein the increasing means does not change the number of states of the original finite automaton. 前記増加させる手段は、予め定義された演算規則をもった行列演算に従うように構成されていることを特徴とする請求項2または請求項3に記載の有限オートマトン生成システム。   4. The finite automaton generation system according to claim 2, wherein the increasing means is configured to follow a matrix operation having a predetermined operation rule. 前記増加させる手段は、予め定義された演算規則を複数の部分行列を用いた行列演算に適用するように構成されていることを特徴とする請求項2または請求項3に記載の有限オートマトン生成システム。   4. The finite automaton generation system according to claim 2, wherein the increasing means is configured to apply a predetermined operation rule to a matrix operation using a plurality of sub-matrices. . 前記複数の部分行列を用いた行列演算は、演算を行う度に部分行列を生成し、使用することを特徴とする請求項5に記載の有限オートマトン生成システム。   6. The finite automaton generation system according to claim 5, wherein the matrix calculation using the plurality of partial matrices generates and uses a partial matrix every time the calculation is performed. 前記複数の部分行列を用いた行列演算は、予め部分行列を生成しておき、前記部分行列を使用することを特徴とする請求項5に記載の有限オートマトン生成システム。   6. The finite automaton generation system according to claim 5, wherein the matrix operation using the plurality of partial matrices generates a partial matrix in advance and uses the partial matrix. 予め行列の形式で記述された固定文字数の遷移条件を有する有限オートマトンを記憶するNFA記述行列記憶手段と、
前記NFA記述行列記憶手段に記憶されている行列で記述された有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換手段と、
前記NFA変換手段による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶手段と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力手段と
を備えたことを特徴とする有限オートマトン生成システム。
NFA description matrix storage means for storing a finite automaton having a transition condition of a fixed number of characters previously described in the form of a matrix;
NFA conversion means for performing conversion for increasing the number of characters of the transition condition of the finite automaton described by the matrix stored in the NFA description matrix storage means;
NFA conversion result matrix storage means for storing a finite automaton description matrix being converted by the NFA conversion means;
A finite automaton generation system comprising: a result output unit that outputs a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
前記NFA変換手段は、1文字遷移の有限オートマトン記述行列又はp文字遷移の有限オートマトン記述行列を、前記NFA記述行列記憶手段又は前記NFA変換結果行列記憶手段からそれぞれ読み出し、前記読み出した有限オートマトン記述行列を複数の部分行列に分割してk文字遷移の有限オートマトン記述行列を生成し、生成した前記k文字遷移の有限オートマトン記述行列を前記NFA変換結果行列記憶手段へ記憶させる処理を繰り返すことで、指定された同時並列処理文字数の有限オートマトンを生成する、ことを特徴とする請求項8に記載の有限オートマトン生成システム。   The NFA conversion means reads a finite automaton description matrix of one character transition or a finite automaton description matrix of p character transition from the NFA description matrix storage means or the NFA conversion result matrix storage means, respectively, and the read finite automaton description matrix Is divided into a plurality of sub-matrices to generate a k-character transition finite automaton description matrix, and the process of storing the generated k-character transition finite automaton description matrix in the NFA conversion result matrix storage means is repeated. 9. The finite automaton generation system according to claim 8, wherein a finite automaton having the number of simultaneously processed parallel characters is generated. 予め行列の形式で記述された固定文字数の遷移条件を有する有限オートマトンを記憶するNFA記述行列記憶手段と、
前記NFA記述行列記憶手段に記憶されている有限オートマトンを記述した行列を、複数の部分行列に分割するNFA記述行列分割手段と、
前記分割された複数の部分行列を用いて、元の有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換手段と、
前記NFA変換手段による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶手段と、
前記NFA変換手段による変換途中の有限オートマトン記述行列の複数の部分行列を記憶させるNFA変換結果部分行列記憶手段と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力手段と
を備えたことを特徴とする有限オートマトン生成システム。
NFA description matrix storage means for storing a finite automaton having a transition condition of a fixed number of characters previously described in the form of a matrix;
NFA description matrix dividing means for dividing the matrix describing the finite automaton stored in the NFA description matrix storage means into a plurality of partial matrices;
NFA conversion means for performing conversion for increasing the number of characters of the transition condition of the original finite automaton using the plurality of divided sub-matrices;
NFA conversion result matrix storage means for storing a finite automaton description matrix being converted by the NFA conversion means;
NFA conversion result partial matrix storage means for storing a plurality of partial matrices of a finite automaton description matrix being converted by the NFA conversion means;
A finite automaton generation system comprising: a result output unit that outputs a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
前記増加させる手段は、入力された正規表現を、1文字の遷移条件をもつ有限オートマトンに変換し、変換された有限オートマトンの遷移条件の文字数を任意に増加させることを特徴とする請求項1から請求項3のいずれかに記載の有限オートマトン生成システム。   The means for increasing converts the input regular expression into a finite automaton having a transition condition of one character, and arbitrarily increases the number of characters in the transition condition of the converted finite automaton. The finite automaton generation system according to claim 3. 入力された正規表現を、1文字の遷移条件をもつ有限オートマトンを記述する行列に変換するNFA記述行列生成手段と、
前記NFA記述行列生成手段による変換後の行列を記憶するNFA記述行列記憶手段と、
前記NFA記述行列記憶手段に記憶されている行列で記述された有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換手段と、
前記NFA変換手段による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶手段と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力手段と
を備えたことを特徴とする有限オートマトン生成システム。
NFA description matrix generating means for converting the input regular expression into a matrix describing a finite automaton having a one-character transition condition;
NFA description matrix storage means for storing the matrix after conversion by the NFA description matrix generation means;
NFA conversion means for performing conversion for increasing the number of characters of the transition condition of the finite automaton described by the matrix stored in the NFA description matrix storage means;
NFA conversion result matrix storage means for storing a finite automaton description matrix being converted by the NFA conversion means;
A finite automaton generation system comprising: a result output unit that outputs a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
入力された正規表現を、1文字の遷移条件をもつ有限オートマトンを記述する行列に変換するNFA記述行列生成手段と、
前記NFA記述行列生成手段による変換後の行列を記憶するNFA記述行列記憶手段と、
前記NFA記述行列記憶手段に記憶されている有限オートマトンを記述した行列を複数の部分行列に分割するNFA記述行列分割手段と、
前記分割された複数の部分行列を用いて、元の有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換手段と、
前記NFA変換手段による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶手段と、
前記NFA変換手段による変換途中の有限オートマトン記述行列の複数の部分行列を記憶させるNFA変換結果部分行列記憶手段と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力手段と
を備えたことを特徴とする有限オートマトン生成システム。
NFA description matrix generating means for converting the input regular expression into a matrix describing a finite automaton having a one-character transition condition;
NFA description matrix storage means for storing the matrix after conversion by the NFA description matrix generation means;
NFA description matrix dividing means for dividing a matrix describing the finite automaton stored in the NFA description matrix storage means into a plurality of partial matrices;
NFA conversion means for performing conversion for increasing the number of characters of the transition condition of the original finite automaton using the plurality of divided sub-matrices;
NFA conversion result matrix storage means for storing a finite automaton description matrix being converted by the NFA conversion means;
NFA conversion result partial matrix storage means for storing a plurality of partial matrices of a finite automaton description matrix being converted by the NFA conversion means;
A finite automaton generation system comprising: a result output unit that outputs a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
前記結果出力手段は、前記任意に指定する文字数に増加させた有限オートマトンを、行列形式及び/又は状態遷移図で、出力することを特徴とする請求項8、9、10、12、13のいずれか一に記載の有限オートマトン生成システム。   14. The result output means outputs the finite automaton increased to the arbitrarily designated number of characters in a matrix form and / or a state transition diagram. A finite automaton generation system according to claim 1. 固定文字数の遷移条件から成る有限オートマトンの遷移条件の文字数を、任意に指定する文字数に増加させることを特徴とする有限オートマトン生成方法。   A method for generating a finite automaton, wherein the number of characters in a transition condition of a finite automaton composed of transition conditions of a fixed number of characters is increased to an arbitrarily designated number of characters. 前記有限オートマトンは、行列形式で記述されていることを特徴とする請求項15に記載の有限オートマトン生成方法。   The finite automaton generation method according to claim 15, wherein the finite automaton is described in a matrix format. 元の有限オートマトンの状態数を変化させないことを特徴とする請求項15または請求項16に記載の有限オートマトン生成方法。   The finite automaton generation method according to claim 15 or 16, wherein the number of states of the original finite automaton is not changed. 予め定義された演算規則をもった行列演算に従って、有限オートマトンの遷移条件の文字数を増加させることを特徴とする請求項16または請求項17に記載の有限オートマトン生成方法。   18. The method of generating a finite automaton according to claim 16, wherein the number of characters of the transition condition of the finite automaton is increased according to a matrix operation having a predefined operation rule. 予め定義された演算規則を複数の部分行列を用いた行列演算に適用することで、有限オートマトンの遷移条件の文字数を増加させることを特徴とする請求項16または請求項17に記載の有限オートマトン生成方法。   18. The finite automaton generation according to claim 16 or 17, wherein the number of characters of the transition condition of the finite automaton is increased by applying a predefined operation rule to a matrix operation using a plurality of sub-matrices. Method. 前記複数の部分行列を用いた行列演算は、演算を行う度に部分行列を生成し、使用することを特徴とする請求項19に記載の有限オートマトン生成方法。   The finite automaton generation method according to claim 19, wherein the matrix operation using the plurality of submatrices generates and uses a submatrix every time the operation is performed. 前記複数の部分行列を用いた行列演算は、予め部分行列を生成しておき、前記部分行列を使用することを特徴とする請求項19に記載の有限オートマトン生成方法。   The finite automaton generation method according to claim 19, wherein the matrix calculation using the plurality of partial matrices generates a partial matrix in advance and uses the partial matrix. 予め行列の形式で記述された固定文字数の遷移条件を有する有限オートマトンを記憶しておき、
前記記憶されている行列で記述された有限オートマトンの遷移条件の文字数を増加させる変換を行い、
変換途中の有限オートマトン記述行列を記憶し、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力することを特徴とする有限オートマトン生成方法。
Store a finite automaton having a transition condition of a fixed number of characters described in advance in the form of a matrix,
Performing a conversion to increase the number of characters of the transition condition of the finite automaton described by the stored matrix,
Memorize the finite automaton description matrix in the middle of conversion,
A finite automaton generation method comprising outputting a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
予め記憶されている1文字遷移の有限オートマトン記述行列又はp文字遷移の有限オートマトン記述行列を読み出し、前記読み出した有限オートマトン記述行列を複数の部分行列に分割してk文字遷移の有限オートマトン記述行列を生成し、生成した前記k文字遷移の有限オートマトン記述行列を記憶させる処理を繰り返すことで、指定された同時並列処理文字数の有限オートマトンを生成する、ことを特徴とする請求項22記載の有限オートマトン生成方法。   Read a finite automaton description matrix of one character transition or a p character transition finite automaton description matrix stored in advance, and divide the read finite automaton description matrix into a plurality of sub-matrices to obtain a k character transition finite automaton description matrix. 23. The finite automaton generation according to claim 22, wherein a finite automaton having a specified number of simultaneously processed characters is generated by repeating the process of generating and storing the generated finite automaton description matrix of the k character transition. Method. 予め行列の形式で記述された固定文字数の遷移条件を有する有限オートマトンを記憶しておき、
前記記憶されている有限オートマトンを記述した行列を複数の部分行列に分割し、
前記分割された複数の部分行列を用いて元の有限オートマトンの遷移条件の文字数を増加させる変換を行い、
変換途中の有限オートマトン記述行列を記憶し、
変換途中の有限オートマトン記述行列の複数の部分行列を記憶し、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力することを特徴とする有限オートマトン生成方法。
Store a finite automaton having a transition condition of a fixed number of characters described in advance in the form of a matrix,
Dividing the matrix describing the stored finite automaton into a plurality of sub-matrices;
Performing conversion to increase the number of characters of the transition condition of the original finite automaton using the plurality of divided sub-matrices,
Memorize the finite automaton description matrix in the middle of conversion,
Memorize multiple sub-matrices of finite automaton description matrix in the middle of conversion,
A finite automaton generation method comprising outputting a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
入力された正規表現を、1文字の遷移条件をもつ有限オートマトンに変換し、
変換された有限オートマトンの遷移条件の文字数を、任意に増加させることを特徴とする請求項15から請求項17のいずれかに記載の有限オートマトン生成方法。
Convert the input regular expression into a finite automaton with a one-character transition condition,
The finite automaton generation method according to any one of claims 15 to 17, wherein the number of characters in the transition condition of the converted finite automaton is arbitrarily increased.
入力された正規表現を、1文字の遷移条件をもつ有限オートマトンを記述する行列に変換し、
変換後の行列を記憶しておき、
前記記憶されている行列で記述された有限オートマトンの遷移条件の文字数を増加させる変換を行い、
変換途中の有限オートマトン記述行列を記憶し、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力することを特徴とする有限オートマトン生成方法。
Convert the input regular expression into a matrix describing a finite automaton with a one-character transition condition,
Remember the transformed matrix,
Performing a conversion to increase the number of characters of the transition condition of the finite automaton described by the stored matrix,
Memorize the finite automaton description matrix in the middle of conversion,
A finite automaton generation method comprising outputting a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
入力された正規表現を、1文字の遷移条件をもつ有限オートマトンを記述する行列に、変換し、
変換後の行列を記憶しておき、
前記変換後の行列を複数の部分行列に分割し、
前記分割された複数の部分行列を用いて、元の有限オートマトンの遷移条件の文字数を増加させる変換を行い、
変換途中の有限オートマトン記述行列を記憶し、
変換途中の有限オートマトン記述行列の複数の部分行列を記憶し、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力することを特徴とする有限オートマトン生成方法。
Convert the input regular expression into a matrix describing a finite automaton with a one-character transition condition,
Remember the transformed matrix,
Dividing the transformed matrix into a plurality of sub-matrices;
Using the plurality of divided sub-matrices, performing a conversion to increase the number of characters of the transition condition of the original finite automaton,
Memorize the finite automaton description matrix in the middle of conversion,
Memorize multiple sub-matrices of finite automaton description matrix in the middle of conversion,
A finite automaton generation method comprising outputting a finite automaton in which the number of characters of the transition condition is increased to an arbitrarily designated number of characters.
前記任意に指定する文字数に増加させた有限オートマトンを、行列形式及び/又は状態遷移図で、出力することを特徴とする請求項22、23、24、26、27のいずれか一に記載の有限オートマトン生成方法。   The finite automaton increased to the arbitrarily specified number of characters is output in a matrix format and / or a state transition diagram, and the finite number according to any one of claims 22, 23, 24, 26, and 27. Automaton generation method. 固定文字数の遷移条件から成る有限オートマトンの遷移条件の文字数を、任意に指定する文字数に増加させる処理をコンピュータに実行させることを特徴とする有限オートマトン生成プログラム。   A finite automaton generation program that causes a computer to execute a process of increasing the number of characters of a transition condition of a finite automaton composed of transition conditions of a fixed number of characters to an arbitrarily designated number of characters. 前記有限オートマトンは、行列形式で記述されていることを特徴とする請求項29に記載の有限オートマトン生成プログラム。   30. The finite automaton generation program according to claim 29, wherein the finite automaton is described in a matrix format. 前記増加させる処理において、元の有限オートマトンの状態数を変化させないことを特徴とする請求項29または請求項30に記載の有限オートマトン生成プログラム。   The finite automaton generation program according to claim 29 or 30, wherein, in the increasing process, the number of states of the original finite automaton is not changed. 前記増加させる処理において、予め定義された演算規則をもった行列演算処理をコンピュータに実行させることを特徴とする請求項30または請求項31に記載の有限オートマトン生成プログラム。   32. The finite automaton generation program according to claim 30, wherein, in the increasing process, the computer executes a matrix operation process having a predetermined operation rule. 前記増加させる処理において、予め定義された演算規則を複数の部分行列を用いた行列演算に適用する処理をコンピュータに実行させることを特徴とする請求項30または請求項31に記載の有限オートマトン生成プログラム。   32. The finite automaton generation program according to claim 30, wherein, in the increasing process, a computer is caused to execute a process of applying a predetermined operation rule to a matrix operation using a plurality of partial matrices. . 前記複数の部分行列を用いた行列演算は、演算を行う度に部分行列を生成し、使用することを特徴とする請求項33に記載の有限オートマトン生成プログラム。   34. The finite automaton generation program according to claim 33, wherein the matrix calculation using the plurality of partial matrices generates and uses a partial matrix each time the calculation is performed. 前記複数の部分行列を用いた行列演算は、予め部分行列を生成しておき、前記部分行列を使用することを特徴とする請求項33に記載の有限オートマトン生成プログラム。   34. The finite automaton generation program according to claim 33, wherein the matrix calculation using the plurality of partial matrices generates a partial matrix in advance and uses the partial matrix. 予め行列の形式で記述された固定文字数の遷移条件を有する有限オートマトンを記憶するNFA記述行列記憶処理と、
前記NFA記述行列記憶処理により記憶されている行列で記述された有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換処理と、
前記NFA変換処理による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶処理と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力処理と
をコンピュータに実行させることを特徴とする有限オートマトン生成プログラム。
An NFA description matrix storage process for storing a finite automaton having a transition condition of a fixed number of characters previously described in a matrix format;
NFA conversion processing for performing conversion to increase the number of characters of the transition condition of the finite automaton described by the matrix stored by the NFA description matrix storage processing;
An NFA conversion result matrix storage process for storing a finite automaton description matrix in the middle of conversion by the NFA conversion process;
A finite automaton generation program that causes a computer to execute a result output process for outputting a finite automaton in which the number of characters in the transition condition is increased to an arbitrarily designated number of characters.
前記NFA変換処理は、前記NFA記述行列記憶処理又は前記NFA変換結果行列記憶処理で記憶された、1文字遷移の有限オートマトン記述行列又はp文字遷移の有限オートマトン記述行列をそれぞれ読み出し、前記読み出した有限オートマトン記述行列を複数の部分行列に分割してk文字遷移の有限オートマトン記述行列を生成し、生成した前記k文字遷移の有限オートマトン記述行列を記憶させる処理を繰り返すことで、指定された同時並列処理文字数の有限オートマトンを生成する、ことを特徴とする請求項36記載の有限オートマトン生成プログラム。   The NFA conversion process reads out the one-character transition finite automaton description matrix or p-character transition finite automaton description matrix stored in the NFA description matrix storage process or the NFA conversion result matrix storage process, respectively, and reads the read finite By dividing the automaton description matrix into a plurality of sub-matrices and generating a finite automaton description matrix of k-character transitions, and repeating the process of storing the generated finite automaton description matrix of k-character transitions, the specified simultaneous parallel processing The finite automaton generation program according to claim 36, wherein a finite automaton having a number of characters is generated. 予め行列の形式で記述された固定文字数の遷移条件を有する有限オートマトンを記憶するNFA記述行列記憶処理と、
前記記憶された有限オートマトンの記述行列を複数の部分行列に分割するNFA記述行列分割処理と、
前記分割された複数の部分行列を用いて、元の有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換処理と、
前記NFA変換処理による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶処理と、
前記NFA変換処理による変換途中の有限オートマトン記述行列の複数の部分行列を記憶させるNFA変換結果部分行列記憶処理と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力処理と
をコンピュータに実行させることを特徴とする有限オートマトン生成プログラム。
An NFA description matrix storage process for storing a finite automaton having a transition condition of a fixed number of characters previously described in a matrix format;
An NFA description matrix dividing process for dividing the stored finite automaton description matrix into a plurality of sub-matrices;
NFA conversion processing for performing conversion to increase the number of characters of the transition condition of the original finite automaton using the plurality of divided sub-matrices;
An NFA conversion result matrix storage process for storing a finite automaton description matrix in the middle of conversion by the NFA conversion process;
NFA conversion result partial matrix storage processing for storing a plurality of partial matrices of a finite automaton description matrix being converted by the NFA conversion processing;
A finite automaton generation program that causes a computer to execute a result output process for outputting a finite automaton in which the number of characters in the transition condition is increased to an arbitrarily designated number of characters.
前記増加させる処理において、入力された正規表現を、1文字の遷移条件をもつ有限オートマトンに変換し、
変換された有限オートマトンの遷移条件の文字数を、任意に増加させる処理をコンピュータに実行させることを特徴とする請求項29から請求項31のいずれかに記載の有限オートマトン生成プログラム。
In the increasing process, the input regular expression is converted into a finite automaton having a one-character transition condition;
32. The finite automaton generation program according to claim 29, further causing a computer to execute a process of arbitrarily increasing the number of characters of the converted finite automaton transition condition.
入力された正規表現を、1文字の遷移条件をもつ有限オートマトンを記述する行列に変換するNFA記述行列生成処理と、
前記NFA記述行列生成処理による変換後の行列を記憶するNFA記述行列記憶処理と、
前記NFA記述行列記憶処理により記憶されている行列で記述された有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換処理と、
前記NFA変換処理による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶処理と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力処理と
をコンピュータに実行させることを特徴とする有限オートマトン生成プログラム。
An NFA description matrix generation process for converting the input regular expression into a matrix describing a finite automaton having a transition condition of one character;
An NFA description matrix storage process for storing a matrix after conversion by the NFA description matrix generation process;
NFA conversion processing for performing conversion to increase the number of characters of the transition condition of the finite automaton described by the matrix stored by the NFA description matrix storage processing;
An NFA conversion result matrix storage process for storing a finite automaton description matrix in the middle of conversion by the NFA conversion process;
A finite automaton generation program that causes a computer to execute a result output process for outputting a finite automaton in which the number of characters in the transition condition is increased to an arbitrarily designated number of characters.
入力された正規表現を、1文字の遷移条件をもつ有限オートマトンを記述する行列に変換するNFA記述行列生成処理と、
前記NFA記述行列生成処理による変換後の行列を記憶するNFA記述行列記憶処理と、
前記NFA記述行列記憶処理により記憶されている有限オートマトンを記述した行列を複数の部分行列に分割するNFA記述行列分割処理と、
前記分割された複数の部分行列を用いて元の有限オートマトンの遷移条件の文字数を増加させる変換を行うNFA変換処理と、
前記NFA変換処理による変換途中の有限オートマトン記述行列を記憶させるNFA変換結果行列記憶処理と、
前記NFA変換処理による変換途中の有限オートマトン記述行列の複数の部分行列を記憶させるNFA変換結果部分行列記憶処理と、
前記遷移条件の文字数を、任意に指定する文字数に増加させた有限オートマトンを出力する結果出力処理と
をコンピュータに実行させることを特徴とする有限オートマトン生成プログラム。
An NFA description matrix generation process for converting the input regular expression into a matrix describing a finite automaton having a transition condition of one character;
An NFA description matrix storage process for storing a matrix after conversion by the NFA description matrix generation process;
An NFA description matrix division process for dividing a matrix describing a finite automaton stored by the NFA description matrix storage process into a plurality of sub-matrices;
NFA conversion processing for performing conversion to increase the number of characters of the transition condition of the original finite automaton using the plurality of divided sub-matrices;
An NFA conversion result matrix storage process for storing a finite automaton description matrix in the middle of conversion by the NFA conversion process;
NFA conversion result partial matrix storage processing for storing a plurality of partial matrices of a finite automaton description matrix being converted by the NFA conversion processing;
A finite automaton generation program that causes a computer to execute a result output process for outputting a finite automaton in which the number of characters in the transition condition is increased to an arbitrarily designated number of characters.
前記結果出力処理は、前記任意に指定する文字数に増加させた有限オートマトンを、行列形式及び/又は状態遷移図で出力する、ことを特徴とする請求項36、37、38、40、41のいずれか一に記載の有限オートマトン生成プログラム。   42. The result output process outputs the finite automaton increased to the arbitrarily designated number of characters in a matrix format and / or a state transition diagram, wherein any one of claims 36, 37, 38, 40 and 41 is provided. A finite automaton generation program according to any one of the above.
JP2008552183A 2006-12-28 2007-12-28 Finite automaton generation system for character string matching, generation method thereof, and generation program Expired - Fee Related JP5169837B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008552183A JP5169837B2 (en) 2006-12-28 2007-12-28 Finite automaton generation system for character string matching, generation method thereof, and generation program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2006355533 2006-12-28
JP2006355533 2006-12-28
PCT/JP2007/075286 WO2008081932A1 (en) 2006-12-28 2007-12-28 System for generating character-string matching finite automaton, its generating method, and generating program
JP2008552183A JP5169837B2 (en) 2006-12-28 2007-12-28 Finite automaton generation system for character string matching, generation method thereof, and generation program

Publications (2)

Publication Number Publication Date
JPWO2008081932A1 true JPWO2008081932A1 (en) 2010-04-30
JP5169837B2 JP5169837B2 (en) 2013-03-27

Family

ID=39588612

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008552183A Expired - Fee Related JP5169837B2 (en) 2006-12-28 2007-12-28 Finite automaton generation system for character string matching, generation method thereof, and generation program

Country Status (3)

Country Link
US (1) US8612376B2 (en)
JP (1) JP5169837B2 (en)
WO (1) WO2008081932A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008084594A1 (en) * 2007-01-12 2008-07-17 Nec Corporation Pattern matching device and method
JP5381710B2 (en) * 2007-08-02 2014-01-08 日本電気株式会社 Nondeterministic finite automaton generation system, method and program without ε transition
JP5321589B2 (en) * 2008-08-13 2013-10-23 日本電気株式会社 Finite automaton generating device, pattern matching device, finite automaton circuit generating method and program
US8725671B2 (en) 2009-03-19 2014-05-13 Nec Corporation Pattern matching appratus
WO2015084360A1 (en) * 2013-12-05 2015-06-11 Hewlett-Packard Development Company, L.P. Regular expression matching
US9875045B2 (en) * 2015-07-27 2018-01-23 International Business Machines Corporation Regular expression matching with back-references using backtracking
JP6737117B2 (en) * 2016-10-07 2020-08-05 富士通株式会社 Encoded data search program, encoded data search method, and encoded data search device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2745710B2 (en) * 1989-08-23 1998-04-28 株式会社日立製作所 String search method and apparatus therefor
US7185081B1 (en) * 1999-04-30 2007-02-27 Pmc-Sierra, Inc. Method and apparatus for programmable lexical packet classifier
JP3852757B2 (en) 2002-02-05 2006-12-06 インターナショナル・ビジネス・マシーンズ・コーポレーション Character string matching method, document processing apparatus and program using the same

Also Published As

Publication number Publication date
US8612376B2 (en) 2013-12-17
WO2008081932A1 (en) 2008-07-10
US20100325157A1 (en) 2010-12-23
JP5169837B2 (en) 2013-03-27

Similar Documents

Publication Publication Date Title
JP5169837B2 (en) Finite automaton generation system for character string matching, generation method thereof, and generation program
US10990616B2 (en) Fast pattern discovery for log analytics
WO2009116646A1 (en) Finite automaton generating system for checking character string for multibyte processing
JP5321589B2 (en) Finite automaton generating device, pattern matching device, finite automaton circuit generating method and program
JPWO2009017131A1 (en) Nondeterministic finite automaton generation system, method and program without ε transition
Tian et al. When multi-level meets multi-interest: A multi-grained neural model for sequential recommendation
Zygelman et al. Computare Errare Est: Quantum Error Correction
Sarkar et al. An algorithm for DNA read alignment on quantum accelerators
Blum et al. A comprehensive comparison of metaheuristics for the repetition-free longest common subsequence problem
CN110009048B (en) Method and equipment for constructing neural network model
Xu et al. Adversarial attacks on text classification models using layer‐wise relevance propagation
JPWO2018167885A1 (en) Information processing apparatus, information processing method, and information processing program
Yeh et al. Molecular solutions to the binary integer programming problem based on DNA computation
WO2018135515A1 (en) Information processing device, neural network design method, and recording medium
JP5301411B2 (en) Similarity calculation device, similarity calculation method, similarity calculation program, and similarity analysis device
JP5429164B2 (en) Finite automaton generation system
JP5736336B2 (en) Matrix vector product computing device, matrix vector product computing method, and matrix vector product computing program
Kociumaka et al. Faster recovery of approximate periods over edit distance
Ramanujan et al. Control languages associated with tissue P systems
Anderson et al. Crafting adversarial attacks on recurrent neural networks
WO2023175680A1 (en) Encoding device, encoding method, and program
CN116227607B (en) Quantum circuit classification method, quantum circuit classification device, electronic equipment, medium and product
JP7310933B2 (en) Data classification device, data classification method, and program
JP7430274B2 (en) Computer system and character recognition method
Touzet On the Levenshtein Automaton and the Size of the Neighbourhood of a Word

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101104

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120911

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121112

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121204

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121217

R150 Certificate of patent or registration of utility model

Ref document number: 5169837

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees