KR101583979B1 - Method and Apparatus for generating automata - Google Patents

Method and Apparatus for generating automata Download PDF

Info

Publication number
KR101583979B1
KR101583979B1 KR1020140116840A KR20140116840A KR101583979B1 KR 101583979 B1 KR101583979 B1 KR 101583979B1 KR 1020140116840 A KR1020140116840 A KR 1020140116840A KR 20140116840 A KR20140116840 A KR 20140116840A KR 101583979 B1 KR101583979 B1 KR 101583979B1
Authority
KR
South Korea
Prior art keywords
automata
regular expression
binary tree
partially generated
generating
Prior art date
Application number
KR1020140116840A
Other languages
Korean (ko)
Inventor
한요섭
고상기
Original Assignee
연세대학교 산학협력단
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 연세대학교 산학협력단 filed Critical 연세대학교 산학협력단
Priority to KR1020140116840A priority Critical patent/KR101583979B1/en
Application granted granted Critical
Publication of KR101583979B1 publication Critical patent/KR101583979B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees

Landscapes

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

Abstract

Disclosed are an apparatus and a method for generating automata. The apparatus for generating automata includes: a binary tree conversion unit for converting a regular expression into a binary tree corresponding to the regular expression; and an automata generation unit for generating automata corresponding to the regular expression by using the binary tree of the regular expression. The automata generation unit searches for the binary tree from a leaf node to partially generates the automata, and generates an automata corresponding to the regular expression by extending the partially generated automata multiple times. If an operator is located in a parent node of a node corresponding to the partially generated automata in the binary tree, the partially generated automata is extended and the automata is merged by using the partially generated automata and the operator.

Description

오토마타 생성 장치 및 방법{Method and Apparatus for generating automata}TECHNICAL FIELD The present invention relates to a method and apparatus for generating automata,

본 발명의 실시예들은 완성된 오토마타가 생성되기 전에 오토마타 병합을 수행하여 메모리 상에 오토마타가 차지하는 메모리 양을 효과적으로 줄일 수 있는 오토마타 생성 장치 및 방법에 관한 것이다. Embodiments of the present invention relate to an apparatus and method for generating automata that can reduce the amount of memory occupied by an automata on a memory by performing an automata merge before a completed automata is created.

정규 표현식(Regular Expression)은 각종 검색 엔진, 바이오 인포매틱스, 운영체제 명령어, 문서 편집기, 네트워크 보안 등과 같이 주로 텍스트 패턴 매칭에 활용되고 있으며, 검색할 패턴을 기술하는 표현식을 의미한다. 대부분의 어플리케이션은 정규 표현식을 활용하고 있으며, 학문적으로도 컴퓨터 과학의 거의 모든 분야에서 정규 표현식을 활용하고 있다. Regular expressions are used mainly in text pattern matching such as various search engines, bioinformatics, operating system commands, text editors, network security, etc., and express expressions describing patterns to be searched. Most applications use regular expressions, and academically, they use regular expressions in almost every area of computer science.

정규 표현식은 표 1와 같은 문법의 조합으로 정의되는 문자열의 집합을 의미한다. 일례로서, 정규 표현식 "(fa|mo|b?o)ther"는 "father", "mother", "bother", "other"를 나타낸다.
A regular expression is a set of strings defined by a combination of grammars as shown in Table 1. As an example, the regular expression "(fa | mo | b? O) ther" indicates "father", "mother", "bother", "other".

expression 기능function 설명Explanation .. 문자text 1개의 문자와 일치한다. 단일행 모드에서는 새줄 문자를 제외한다.Matches one character. Single-line mode excludes newline characters. \\ 이스케이프Escape 특수 문자를 식에 문자 자체로 포함한다.Include special characters in expressions as characters themselves. || 선택Selection 여러 식 중에서 하나를 선택한다. 예를 들어, "abc|adc"는 abc와 adc 문자열을 모두 포함한다.Select one of several expressions. For example, "abc | adc" contains both abc and adc strings. ^^ 부정denial 문자 클래스 안의 문자를 제외한 나머지를 선택한다. 예를 들면 [^abc]d는 ad, bd, cd는 포함하지 않고 ed, fd 등을 포함한다. [^a-z]는 알파벳 소문자로 시작하지 않는 모든 문자를 의미한다.Select the rest of the characters except for the characters in the character class. For example, [^ abc] d does not include ad, bd, or cd, but includes ed, fd, and so on. [^ a-z] means any character that does not begin with a lowercase alphabet. [][] 문자 클래스Character classes "["과 "]" 사이의 문자 중 하나를 선택한다. "|"를 여러 개 쓴 것과 같은 의미이다. 예를 들면 [abc]d는 ad, bd, cd를 뜻한다. 또한, "-" 기호와 함께 쓰면 범위를 지정할 수 있다. "[a-z]"는 a부터 z까지 중 하나, "[1-9]"는 1부터 9까지 중의 하나를 의미한다.Select one of the characters between "[" and "]". It has the same meaning as "|". For example, [abc] d means ad, bd, cd. You can also specify a range with the "-" sign. "[a-z]" means one of a to z, and "[1-9]" means one of 1 to 9. ()() 하위식Sub-expression 여러 식을 하나로 묶을 수 있다. "abc|adc"와 "a(b|d)c"는 같은 의미를 가진다.Multiple expressions can be grouped together. "abc | adc" and "a (b | d) c" have the same meaning. ** 0회 이상0 times or more 0개 이상의 문자를 포함한다. "a*b"는 "b", "ab", "aab", "aaab"를 포함한다.Contains zero or more characters. "a * b" includes "b", "ab", "aab", and "aaab". ++ 1회 이상More than once "a+b"는 "ab", "aab", "aaab"를 포함하지만 "b"는 포함하지 않는다."a + b" includes "ab", "aab", "aaab" but not "b" ?? 0 또는 1회0 or 1 time "a?b"는 "b", "ab"를 포함한다."a? b" includes "b" and "ab". {m}{m} m회m times "a{3}b"는 "aaab"만 포함한다."a {3} b" contains only "aaab". {m,}{m,} m회 이상More than m times "a{2,}b"는 "aab", "aaab", "aaaab"를 포함한다. "ab"는 포함되지 않는다."a {2,} b" includes "aab", "aaab", and "aaaab". "ab" is not included. {m,n}{m, n} m회 이상 n회 이하m times or more and n times or less "a{1,3}b"는 "ab", "aab", "aaab"를 포함하지만, "b"나 "aaaab"는 포함하지 않는다."a {1,3} b" includes "ab", "aab", "aaab" but not "b" or "aaaab"

정규 표현식은 검색에 있어 대단히 강력한 도구로 활용되는데, 이는 특정 키워드가 아닌 다양한 패턴의 다중 검색어에 대해 효율적인 패턴 매칭을 수행하여 패턴 검색의 효율을 높일 수 있기 때문이다. Regular expressions are very powerful tools for searching because they can improve the efficiency of pattern searching by performing efficient pattern matching on multiple search terms of various patterns rather than specific keywords.

검색하고자 하는 정규 표현식이 복수인 경우에는 어떤 방식에 따라 검색을 수행하느냐에 따라 검색 시간과 메모리 사용량이 크게 달라지기 때문에, 복수의 정규 표현식을 이용하여 문자열을 효율적으로 검색하기 위한 방법에 대한 연구가 활발하게 이루어지고 있다. 이 중에서, 오토마타를 이용하여 복수의 정규 표현식을 순차적으로 선택하여 검색하는 방법이 사용되고 있다. When there are a plurality of regular expressions to be searched, search time and memory usage are greatly changed depending on how the search is performed according to a certain method. Therefore, researches on a method for efficiently searching a string using a plurality of regular expressions are active . Among them, a method is used in which a plurality of regular expressions are successively selected and searched using an automata.

한편, 정규 표현식을 활용하기 위해서는 대응되는 오토마타로 변환하는 과정이 필요하다. 이 과정에서 오토마타의 크기를 줄이는 알고리즘에 대한 연구들이 많이 진행되어 왔다. 왜냐하면 오토마타의 크기가 최대한 작아야 정규 표현식 매칭 속도가 향상되고 관련 응용 프로그램의 효율적인 메모리 활용이 가능해지기 때문이다. 이 때, 오토마타의 상태가 병합된 이후에도 이전과 똑같은 정규 표현식을 처리할 수 있어야 한다. On the other hand, in order to use regular expressions, it is necessary to convert them to corresponding automata. In this process, many algorithms have been developed to reduce the size of automata. This is because the size of the automata must be as small as possible to improve the regular expression matching speed and enable efficient memory utilization of related applications. At this point, you should be able to handle the same regular expressions as before, even after the state of the automata has been merged.

이미 기존에 오토마타의 상태를 병합하는 알고리즘들이 제시되어 왔고 이에 따라 정규 표현식에서 얻어진 오토마타에 대해 상태 병합을 수행하여 오토마타의 크기를 줄이는 방식이 시도되어 왔다. Algorithms have already been proposed that merge the state of the existing automata and have been attempted to reduce the size of the automata by performing state merging on the automata obtained from the regular expressions.

상기한 바와 같은 종래기술의 문제점을 해결하기 위해, 본 발명에서는 완성된 오토마타가 생성되기 전에 오토마타 병합을 수행하여 메모리 상에 오토마타가 차지하는 메모리 양을 효과적으로 줄일 수 있는 오토마타 생성 장치 및 방법을 제안하고자 한다. In order to solve the problems of the prior art as described above, the present invention proposes an apparatus and method for generating an automata that can effectively reduce the amount of memory occupied by an automata on a memory by performing an automata merging process before a completed automata is created .

본 발명의 다른 목적들은 하기의 실시예를 통해 당업자에 의해 도출될 수 있을 것이다.Other objects of the invention will be apparent to those skilled in the art from the following examples.

상기한 목적을 달성하기 위해 본 발명의 바람직한 일 실시예에 따르면, 정규 표현식을 상기 정규 표현식에 상응하는 이진 트리로 변환하는 이진 트리 변환부; 및 상기 정규 표현식의 이진 트리를 이용하여 상기 정규 표현식에 상응하는 오토마타를 생성하는 오토마타 생성부;를 포함하되, 상기 오토마타 생성부는, 상기 이진 트리를 잎 노드(leaf node)에서부터 탐색하여 오토마타를 부분적으로 생성하고, 상기 부분적으로 생성된 오토마타를 복수회 확장하여 상기 정규 표현식에 상응하는 오토마타를 생성하되, 상기 이진 트리 내에서 상기 부분적으로 생성된 오토마타에 대응되는 노드의 부모 노드에 상기 연산자가 위치하는 경우, 상기 부분적으로 생성된 오토마타를 확장함과 함께 상기 부분적으로 생성된 오토마타 및 상기 연산자를 이용하여 오토마타의 병합을 수행하는 것을 특징으로 하는 오토마타 생성 장치가 제공된다. According to an aspect of the present invention, there is provided a binary tree transforming unit for transforming a regular expression into a binary tree corresponding to the regular expression. And an automata generation unit for generating an automata corresponding to the regular expression using the binary tree of the regular expression, wherein the automata generation unit searches the binary tree from a leaf node to generate an automata partly And generating an automata corresponding to the regular expression by expanding the partially generated automata a plurality of times, wherein when the operator is located at a parent node of a node corresponding to the partially generated automata in the binary tree An automaton generating unit for performing the merging of the automata using the partially generated automata and the operator while extending the partially generated automata.

상기 오토마타의 병합은, 오토마타에 상태를 최종 상태 집합과 비최종 상태 집합으로 구분하되, 상기 최종 상태 집합에 포함되는 상태는 상기 최종 상태 집합에 포함되는 다른 상태와만 병합되고, 상기 비최종 상태 집합에 포함되는 상태는 상기 비최종 상태 집합에 포함되는 다른 상태와만 병합될 수 있다. The merging of the automata is performed by dividing the state into a final state set and a non-final state set in the automata, wherein the states included in the final state set are merged only with other states included in the final state set, The included state can be merged only with other states included in the non-final state set.

또한, 본 발명의 다른 실시예에 따르면, 정규 표현식을 상기 정규 표현식에 상응하는 이진 트리로 변환하는 단계; 및 상기 정규 표현식의 이진 트리를 이용하여 상기 정규 표현식에 상응하는 오토마타를 생성하는 단계;를 포함하되, 상기 오토마타를 생성하는 단계는, 상기 이진 트리를 잎 노드에서부터 탐색하여 오토마타를 부분적으로 생성하고, 상기 부분적으로 생성된 오토마타를 복수회 확장하여 상기 정규 표현식에 상응하는 오토마타를 생성하되, 상기 이진 트리 내에서 상기 부분적으로 생성된 오토마타에 대응되는 노드의 부모 노드에 상기 연산자가 위치하는 경우, 상기 부분적으로 생성된 오토마타를 확장함과 함께 상기 부분적으로 생성된 오토마타 및 상기 연산자를 이용하여 오토마타의 병합을 수행하는 것을 특징으로 하는 오토마타 생성 방법이 제공된다. According to another embodiment of the present invention, there is provided a method of converting a regular expression into a binary tree corresponding to the regular expression; And generating an automata corresponding to the regular expression using the binary tree of the regular expression, wherein the generating the automata comprises: generating the automata by searching the leaf node from the leaf node, If the operator is located at a parent node of a node corresponding to the partially generated automata in the binary tree, generating the automata corresponding to the regular expression by expanding the partially generated automata a plurality of times, And the automaton is merged by using the partially generated automata and the operator.

본 발명에 따르면, 완성된 오토마타가 생성되기 전에 오토마타 병합을 수행하여 메모리 상에 오토마타가 차지하는 메모리 양을 효과적으로 줄일 수 있게 된다. According to the present invention, automata merging can be performed before a completed automata is generated, effectively reducing the amount of memory occupied by the automata on the memory.

도 1는 본 발명의 일 실시예에 따른 오토마타 생성 장치의 개략적인 구성을 도시한 도면이다.
도 2는 본 발명의 일 실시예에 따른 이진 트리 변환 개념을 도시하고 있다.
도 3는 이전 트리로부터 오토마타를 생성하는 과정을 정리한 표를 도시한 도면이다.
도 4는 종래의 방식에 따른 오토마타가 완성된 후의 상태 병합의 개념을 설명하기 위한 도면이다.
도 5는 본 발명의 일 실시예에 따른 완성된 오토마타 생성 전의 상태 병합의 개념을 설명하기 위한 도면이다.
도 6는 본 발명의 일 실시예에 따른 오토마타 생성 방법의 흐름도를 도시한 순서도이다.
FIG. 1 is a view showing a schematic configuration of an automata generating apparatus according to an embodiment of the present invention.
FIG. 2 illustrates a binary tree transformation concept according to an embodiment of the present invention.
FIG. 3 is a table showing a process of generating an automata from a previous tree.
4 is a view for explaining the concept of state merging after the completion of the automata according to the conventional method.
5 is a view for explaining the concept of state merging before the completion of the automata according to an embodiment of the present invention.
6 is a flowchart illustrating a method of generating an automata according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.

이하에서, 본 발명에 따른 실시예들을 첨부된 도면을 참조하여 상세하게 설명한다.
Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

도 1는 본 발명의 일 실시예에 따른 오토마타 생성 장치의 개략적인 구성을 도시한 도면이다. FIG. 1 is a view showing a schematic configuration of an automata generating apparatus according to an embodiment of the present invention.

도 1를 참조하면, 본 발명의 일 실시예에 따른 오토마타 생성 장치는 이진 트리 변환부(110) 및 오토마타 생성부(120)를 포함한다. 이하, 각 구성요소 별로 그 기능을 상세하게 설명한다. Referring to FIG. 1, an automata generating apparatus according to an embodiment of the present invention includes a binary tree transforming unit 110 and an automata generating unit 120. Hereinafter, the function of each component will be described in detail.

이진 트리 변환부(110)는 정규 표현식을 상응하는 이진 트리로 변환한다. The binary tree transforming unit 110 transforms the regular expression into a corresponding binary tree.

도 2는 본 발명의 일 실시예에 따른 이진 트리 변환 개념을 도시하고 있다. 즉, 도 2를 참조하면, 정규 표현식 "(a+b)*c(a+b)"를 이진 트리로 변환하는 일례를 설명하고 있다. 이 때, 각 노드에는 문자(literal) 및 연산자(operator)가 위치할 수 있다.FIG. 2 illustrates a binary tree transformation concept according to an embodiment of the present invention. That is, referring to Fig. 2, an example of converting the regular expression "(a + b) * c (a + b)" into a binary tree is described. At this time, each node can have a literal and an operator.

정규 표현식을 이진 트리로 변환하는 개념은 당업자에게 자명한 것이므로, 이에 대한 설명은 생략하기로 한다. The concept of converting a regular expression into a binary tree is obvious to those skilled in the art, so a description thereof will be omitted.

다음으로, 오토마타 생성부(120)는 정규 표현식의 이진 트리를 이용하여 정규 표현식에 상응하는 오토마타를 생성한다. 도 3는 이전 트리로부터 오토마타를 생성하는 과정을 정리한 표를 도시하고 있다. Next, the automata generation unit 120 generates an automata corresponding to the regular expression using the binary tree of the regular expression. FIG. 3 shows a table summarizing a process of generating an automata from the previous tree.

이 때, 오토마타 생성부(120)는 이진 트리를 잎 노드(leaf node)에서부터 탐색하여, 문자들을 하나의 오토마타로 구성한다. 그리고, 각 오토마타들은, 그들의 부모 노드가 갖는 연산자 종류에 따라 적절히 연결되어 하나의 새로운 오토마타를 형성하며, 그것들은 다시 이진 트리의 부모 노드에 있는 연산자를 만나서 더 큰 오토마타로 확장된다. 이진 트리의 루트 노드까지 탐색이 완료되면 최종적인 결과물인 오토마타가 생성된다. 즉, 이진 트리를 잎 노드에서부터 탐색하여 오토마타를 부분적으로 생성하고, 부분적으로 생성된 오토마타를 복수회 확장하여 정규 표현식에 상응하는 오토마타를 생성한다. At this time, the automata generation unit 120 searches the binary tree from the leaf node, and constructs the characters as one automata. Each automaton is then linked appropriately according to the type of operator it has in its parent node, forming a new automaton, which in turn expands to a larger automaton by meeting the operator at the parent node of the binary tree. When the search is completed up to the root node of the binary tree, the final result, the automata, is generated. That is, the automaton is partially generated by searching the binary tree from the leaf node, and the partially generated automata is expanded a plurality of times to generate the automata corresponding to the regular expression.

이 때, 본 발명의 일 실시예에 따르면, 이진 트리 내에서 부분적으로 생성된 오토마타에 대응되는 노드의 부모 노드에 연산자가 위치하는 경우, 부분적으로 생성된 오토마타를 확장함과 함께 상기 부분적으로 생성된 오토마타 및 연산자를 이용하여 오토마타의 병합을 수행할 수 있다. According to an embodiment of the present invention, when an operator is located at a parent node of a node corresponding to a partially generated automata in a binary tree, the operator may extend the partially generated automata, Automata can be merged using automata and operators.

즉, 오토마타 상태 병합의 목적은 오토마타의 크기를 줄여 보다 적은 메모리를 점유하면서 정규 표현식 연산을 수행하기 위함이며, 정규 표현식을 이진 트리로 구성하여 잎 노드에서부터 오토마타의 최소 단위를 구성하여 전체 오토마타를 생성한다. 이 때, 종래의 오토마타 상태 병합 알고리즘은 완성된 오토마타에 대해서 수행되지만, 본 발명의 경우 오토마타의 최소 단위에서부터 연산자에 의해 더 큰 오토마타가 생성될 때마다 오토마타 상태 병합 알고리즘을 수행한다. In other words, the purpose of merging the state of the automata is to reduce the size of the automata, to perform regular expression operations while occupying less memory, and to construct a minimum unit of automata from leaf nodes by constructing regular expressions as binary trees do. In this case, the conventional automata state merging algorithm is performed on the completed automata, but in the case of the present invention, the automata state merging algorithm is executed whenever a larger automata is generated by the operator from the minimum unit of the automata.

본 발명이 일 실시예에 따르면, 오토마타의 병합은, 오토마타에 상태를 최종 상태 집합과 비최종 상태 집합으로 구분하되, 최종 상태 집합에 포함되는 상태는 최종 상태 집합에 포함되는 다른 상태와만 병합되고, 비최종 상태 집합에 포함되는 상태는 비최종 상태 집합에 포함되는 다른 상태와만 병합될 수 있다. According to an embodiment of the present invention, the merging of an automata is performed by dividing a state into a final state set and a final state set in the automata, the states included in the final state set are merely merged with other states included in the final state set, A state contained in a non-final state set may merge only with other states included in the non-final state set.

즉, 임의의 상태 p와 q에 대해서, 문자열 w를 읽고 p가 만약 최종 상태로 가고 q가 만약 최종 상태로 가지 않는다면 두 상태는 병합될 수 없다. 이 때, 병합될 수 없는 상태의 짝이 더 이상 발생하지 않을 때까지 3번의 과정을 반복하여 상태를 병합한다. That is, for any of the states p and q, the two states can not be merged if the string w is read and p goes to the final state and q does not go to the final state. At this time, the state is merged by repeating the process three times until the pair of the state that can not be merged no longer occurs.

이하, 도 4 및 도 5를 참조하여, 본 발명의 일 실시예에 따른 오토마타 병합의 일례를 상세하게 설명한다. Hereinafter, an example of automata merging according to an embodiment of the present invention will be described in detail with reference to FIGS. 4 and 5. FIG.

도 4는 종래의 방식에 따른 오토마타가 완성된 후의 상태 병합의 개념을 설명하기 위한 도면이다. 4 is a view for explaining the concept of state merging after the completion of the automata according to the conventional method.

도 4를 참조하면, 종래의 방식에 따른 오토마타 상태 병합의 경우, 순차적으로 도시된 도 4의 (a) 내지 (e)와 같이 오토마타가 완성하고, 그 이후에 상태 병합을 수행한다. 따라서, 만약 초기의 오토마타의 크기가 엄청 큰 경우, 상태 병합의 수행 시간이 긴 단점이 존재한다. Referring to FIG. 4, in the case of the automata state merging according to the conventional method, the automata is completed as shown in FIG. 4 (a) to (e) sequentially, and thereafter, the state merging is performed. Therefore, if the size of the initial automata is very large, the execution time of the state merge is long.

도 5는 본 발명의 일 실시예에 따른 완성된 오토마타 생성 전의 상태 병합의 개념을 설명하기 위한 도면이다. 5 is a view for explaining the concept of state merging before the completion of the automata according to an embodiment of the present invention.

도 5를 참조하면, 본 발명에 따른 오토마타 상태 병합의 경우, 순차적으로 도 5의 (a) 내지 (e)와 같이 오토마타 상태 병합이 수행된다. 특히, 도 5의 (c), (d), (e)에서와 같이, 이진 트리 내에서 부분적으로 생성된 오토마타에 대응되는 노드의 부모 노드에 연산자가 위치하는 경우, 부분적으로 생성된 오토마타를 확장함과 함께 오토마타의 상태 병합이 수행된다. Referring to FIG. 5, in the case of the automata state merging according to the present invention, the automata state merging is sequentially performed as shown in FIGS. 5 (a) to 5 (e). Particularly, as shown in (c), (d), and (e) of FIG. 5, when the operator is located at the parent node of the node corresponding to the partially generated automata in the binary tree, And the state merging of the automata is performed.

즉, 본 발명과 같이 최소 단위에서부터 상태 병합을 수행하면서 오토마타 변환을 하게 된다면 메모리 상에서 오토마타가 차지하는 메모리 양을 효과적으로 줄일 수 있는 효과가 있다. That is, if the automata conversion is performed while performing the state merge from the minimum unit as in the present invention, the amount of memory occupied by the automata in the memory can be effectively reduced.

도 6는 본 발명의 일 실시예에 따른 오토마타 생성 방법의 흐름도를 도시한 순서도이다. 이하, 각 단계별로 수행되는 과정을 설명한다. 6 is a flowchart illustrating a method of generating an automata according to an embodiment of the present invention. Hereinafter, a process performed in each step will be described.

단계(610)에서는 정규 표현식을 상응하는 이진 트리로 변환한다. In step 610, the regular expression is transformed into a corresponding binary tree.

단계(620)에서는 정규 표현식의 이진 트리를 이용하여 정규 표현식에 상응하는 오토마타를 생성한다. In step 620, an automata corresponding to the regular expression is generated using the binary tree of regular expressions.

본 발명의 일 실시예에 따르면, 단계(620)에서는 이진 트리를 잎 노드에서부터 탐색하여 오토마타를 부분적으로 생성하고, 부분적으로 생성된 오토마타를 복수회 확장하여 정규 표현식에 상응하는 오토마타를 생성한다. 이 때, 이진 트리 내에서 부분적으로 생성된 오토마타에 대응되는 노드의 부모 노드에 연산자가 위치하는 경우, 부분적으로 생성된 오토마타를 확장함과 함께 상기 부분적으로 생성된 오토마타 및 연산자를 이용하여 오토마타의 병합을 수행할 수 있다. According to one embodiment of the present invention, in step 620, the automaton is partially generated by searching the binary tree from the leaf node, and the partially generated automata is expanded a plurality of times to generate an automata corresponding to the regular expression. In this case, if the operator is located at the parent node of the node corresponding to the partially generated automata in the binary tree, the partially generated automata is expanded and the merged automata using the partially generated automata and the operator Can be performed.

지금까지 본 발명에 따른 오토마타 생성 방법의 실시예들에 대하여 설명하였고, 앞서 도 1 내지 도 5에서 설명한 오토마타 생성 장치(100)에 관한 구성이 본 실시예에도 그대로 적용 가능하다. 이에, 보다 상세한 설명은 생략하기로 한다.The embodiments of the automata generating method according to the present invention have been described and the configuration relating to the automata generating apparatus 100 described with reference to Figs. 1 to 5 can be applied to this embodiment as it is. Hereinafter, a detailed description will be omitted.

또한, 본 발명의 실시예들은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 본 발명을 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 본 발명의 일 실시예들의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.In addition, embodiments of the present invention may be implemented in the form of program instructions that can be executed through various computer means and recorded on a computer readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions recorded on the medium may be those specially designed and configured for the present invention or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Examples of program instructions, such as magneto-optical and ROM, RAM, flash memory and the like, can be executed by a computer using an interpreter or the like, as well as machine code, Includes a high-level language code. The hardware devices described above may be configured to operate as one or more software modules to perform operations of one embodiment of the present invention, and vice versa.

이상과 같이 본 발명에서는 구체적인 구성 요소 등과 같은 특정 사항들과 한정된 실시예 및 도면에 의해 설명되었으나 이는 본 발명의 전반적인 이해를 돕기 위해서 제공된 것일 뿐, 본 발명은 상기의 실시예에 한정되는 것은 아니며, 본 발명이 속하는 분야에서 통상적인 지식을 가진 자라면 이러한 기재로부터 다양한 수정 및 변형이 가능하다. 따라서, 본 발명의 사상은 설명된 실시예에 국한되어 정해져서는 아니되며, 후술하는 특허청구범위뿐 아니라 이 특허청구범위와 균등하거나 등가적 변형이 있는 모든 것들은 본 발명 사상의 범주에 속한다고 할 것이다.As described above, the present invention has been described with reference to particular embodiments, such as specific elements, and limited embodiments and drawings. However, it is to be understood that the present invention is not limited to the above- Various modifications and variations may be made thereto by those skilled in the art to which the present invention pertains. Accordingly, the spirit of the present invention should not be construed as being limited to the embodiments described, and all of the equivalents or equivalents of the claims, as well as the following claims, belong to the scope of the present invention .

Claims (5)

정규 표현식을 상기 정규 표현식에 상응하는 이진 트리로 변환하는 이진 트리 변환부; 및
상기 정규 표현식의 이진 트리를 이용하여 상기 정규 표현식에 상응하는 오토마타를 생성하는 오토마타 생성부;를 포함하되,
상기 오토마타 생성부는,
상기 이진 트리를 잎 노드(leaf node)에서부터 탐색하여 오토마타를 부분적으로 생성하고, 상기 부분적으로 생성된 오토마타를 복수회 확장하여 상기 정규 표현식에 상응하는 오토마타를 생성하되,
상기 이진 트리 내에서 상기 부분적으로 생성된 오토마타에 대응되는 노드의 부모 노드에 연산자가 위치하는 경우, 상기 부분적으로 생성된 오토마타를 확장함과 함께 상기 부분적으로 생성된 오토마타 및 상기 연산자를 이용하여 오토마타의 병합을 수행하며,
상기 오토마타의 병합은, 오토마타에 상태를 최종 상태 집합과 비최종 상태 집합으로 구분하되, 상기 최종 상태 집합에 포함되는 상태는 상기 최종 상태 집합에 포함되는 다른 상태와만 병합되고, 상기 비최종 상태 집합에 포함되는 상태는 상기 비최종 상태 집합에 포함되는 다른 상태와만 병합되는 것을 특징으로 하는 오토마타 생성 장치.
A binary tree transform unit for transforming the regular expression into a binary tree corresponding to the regular expression; And
And an automata generator for generating an automata corresponding to the regular expression using the binary tree of the regular expression,
Wherein the automata-
Searching the binary tree from a leaf node to partially generate an automata and extending the partially generated automata a plurality of times to generate an automata corresponding to the regular expression,
And if the operator is located in the parent node of the node corresponding to the partially generated automata in the binary tree, expanding the partially generated automata and using the partially generated automata and the operator Performs the merge,
The merging of the automata is performed by dividing the state into a final state set and a non-final state set in the automata, wherein the states included in the final state set are merged only with other states included in the final state set, Wherein the included state is merged only with other states included in the non-final state set.
삭제delete 정규 표현식을 상기 정규 표현식에 상응하는 이진 트리로 변환하는 단계; 및
상기 정규 표현식의 이진 트리를 이용하여 상기 정규 표현식에 상응하는 오토마타를 생성하는 단계;를 포함하되,
상기 오토마타를 생성하는 단계는, 상기 이진 트리를 잎 노드에서부터 탐색하여 오토마타를 부분적으로 생성하고, 상기 부분적으로 생성된 오토마타를 복수회 확장하여 상기 정규 표현식에 상응하는 오토마타를 생성하되, 상기 이진 트리 내에서 상기 부분적으로 생성된 오토마타에 대응되는 노드의 부모 노드에 연산자가 위치하는 경우, 상기 부분적으로 생성된 오토마타를 확장함과 함께 상기 부분적으로 생성된 오토마타 및 상기 연산자를 이용하여 오토마타의 병합을 수행하며,
상기 오토마타의 병합은, 오토마타에 상태를 최종 상태 집합과 비최종 상태 집합으로 구분하되, 상기 최종 상태 집합에 포함되는 상태는 상기 최종 상태 집합에 포함되는 다른 상태와만 병합되고, 상기 비최종 상태 집합에 포함되는 상태는 상기 비최종 상태 집합에 포함되는 다른 상태와만 병합되는 것을 특징으로 하는 오토마타 생성 방법.
Transforming the regular expression into a binary tree corresponding to the regular expression; And
Generating an automata corresponding to the regular expression using the binary tree of the regular expression,
Wherein the step of generating the automata includes generating an automata corresponding to the regular expression by partially generating an automata by searching the binary tree from a leaf node and expanding the partially generated automata a plurality of times to generate an automata corresponding to the regular expression, If the operator is located at the parent node of the node corresponding to the partially generated automata, extending the partially generated automata and performing the merging of the automata using the partially generated automata and the operator ,
The merging of the automata is performed by dividing the state into a final state set and a non-final state set in the automata, wherein the states included in the final state set are merged only with other states included in the final state set, Wherein the included state is merged only with other states included in the non-final state set.
삭제delete 제3항의 방법을 수행하는 프로그램을 기록한 컴퓨터 판독 가능 기록 매체.A computer-readable recording medium recording a program for performing the method of claim 3.
KR1020140116840A 2014-09-03 2014-09-03 Method and Apparatus for generating automata KR101583979B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020140116840A KR101583979B1 (en) 2014-09-03 2014-09-03 Method and Apparatus for generating automata

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020140116840A KR101583979B1 (en) 2014-09-03 2014-09-03 Method and Apparatus for generating automata

Publications (1)

Publication Number Publication Date
KR101583979B1 true KR101583979B1 (en) 2016-01-12

Family

ID=55170236

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020140116840A KR101583979B1 (en) 2014-09-03 2014-09-03 Method and Apparatus for generating automata

Country Status (1)

Country Link
KR (1) KR101583979B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220096706A (en) * 2020-12-31 2022-07-07 한국기술교육대학교 산학협력단 Apparatus and method of learn of simulation model based on actual infection data

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101382787B1 (en) 2013-03-21 2014-04-08 경기대학교 산학협력단 State reduction method for memory-efficient deterministic finite automata

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101382787B1 (en) 2013-03-21 2014-04-08 경기대학교 산학협력단 State reduction method for memory-efficient deterministic finite automata

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20220096706A (en) * 2020-12-31 2022-07-07 한국기술교육대학교 산학협력단 Apparatus and method of learn of simulation model based on actual infection data
KR102467746B1 (en) 2020-12-31 2022-11-16 한국기술교육대학교 산학협력단 Apparatus and method of learn of simulation model based on actual infection data

Similar Documents

Publication Publication Date Title
JP5381710B2 (en) Nondeterministic finite automaton generation system, method and program without ε transition
WO2009107315A1 (en) Frequently-appearing change pattern extracting device
US11080317B2 (en) Context-aware sentence compression
KR101589621B1 (en) Method of establishing lexico semantic pattern knowledge for text analysis and response system
US20140040313A1 (en) System and Method of Record Matching in a Database
KR101583979B1 (en) Method and Apparatus for generating automata
KR101222486B1 (en) Method, server, terminal, and computer-readable recording medium for selectively eliminating nondeterministic element of nondeterministic finite automata
Lemoudden et al. A binary-based mapreduce analysis for cloud logs
KR101645890B1 (en) Method and Device for Reducing NFA
KR101583978B1 (en) Method and Apparatus for controlling form of automata arrangement
JP5022252B2 (en) Expression template generation apparatus, method and program thereof
KR101714270B1 (en) Xml schema transformation method and device
KR101645874B1 (en) Method and System for Detecting Malicious/Character Sequence Packet Using Regular Expression
US9122494B2 (en) Method and apparatus for code size reduction
JP2017059216A (en) Query calibration system and method
KR101488615B1 (en) Automata encoding device and method
JP6310532B1 (en) Generating device, generating method, and generating program
JP7307784B2 (en) Automata Processing Apparatus and Method for Regular Expression Engine Utilizing Glushkov Automata Generation and Hybrid Matching
KR20200094977A (en) Apparatus and method for computing incrementally infix probabilities based on automata
KR102422439B1 (en) Knowledge graph generation method and apparatus using seed
JP2016099726A (en) Specification generation method, specification generation device, and program
KR102682299B1 (en) Automata processing method and apparatus for regular expression engines using glushkov automata generation and hybrid matching
KR102066022B1 (en) Apparatus and method for generating function signature on executable code
JP2009230606A (en) Source code template generator
KR101080898B1 (en) Method and apparatus for indexing character string

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee