Thopson NFA Presenter: Yuen-Shuo Li Date: 2014/5/7 Department of Computer Science and Information Engineering National Cheng Kung University, Taiwan R.O.C.

Slides:



Advertisements
Similar presentations
Optimizing Regular Expression Matching with SR-NFA on Multi-Core Systems Authors : Yang, Y.E., Prasanna, V.K. Yang, Y.E. Prasanna, V.K. Publisher : Parallel.
Advertisements

1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
1 The scanning process Goal: automate the process Idea: –Start with an RE –Build a DFA How? –We can build a non-deterministic finite automaton (Thompson's.
Languages, grammars, and regular expressions
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
Topics Automata Theory Grammars and Languages Complexities
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Dept. of Computer Science & IT, FUUAST Automata Theory 2 Automata Theory III Languages And Regular Expressions Construction of FA’s for given languages.
Sampling Techniques to Accelerate Pattern Matching in Network Intrusion Detection Systems Author: Domenico Ficara, Gianni Antichi, Andrea Di Pietro, Stefano.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA to regular.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CS-5800 Theory of Computation II PROJECT PRESENTATION By Quincy Campbell & Sandeep Ravikanti.
Theory of Languages and Automata
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
Lecture # 3 Chapter #3: Lexical Analysis. Role of Lexical Analyzer It is the first phase of compiler Its main task is to read the input characters and.
Automata, Computability, & Complexity by Elaine Rich ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Slides provided by author Slides edited for.
SI-DFA: Sub-expression Integrated Deterministic Finite Automata for Deep Packet Inspection Authors: Ayesha Khalid, Rajat Sen†, Anupam Chattopadhyay Publisher:
A Regular Expression Matching Algorithm Using Transition Merging Department of Computer Science and Information Engineering National Cheng Kung University,
1 Introduction to Regular Expressions EELS Meeting, Dec Tom Horton Dept. of Computer Science Univ. of Virginia
1 Computability Five lectures. Slides available from my web page There is some formality, but it is gentle,
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
COMP3190: Principle of Programming Languages DFA and its equivalent, scanner.
Pattern-Based DFA for Memory- Efficient and Scalable Multiple Regular Expression Matching Author: Junchen Jiang, Yang Xu, Tian Pan, Yi Tang, Bin Liu Publisher:IEEE.
String Matching of Regular Expression
Lesson No.6 Naveen Z Quazilbash. Overview Attendance and lesson plan sharing Assignments Quiz (10 mins.). Some basic ideas about this course Regular Expressions.
StriD 2 FA: Scalable Regular Expression Matching for Deep Packet Inspection Author: Xiaofei Wang, Junchen Jiang, Yi Tang, Bin Liu, and Xiaojun Wang Publisher:
1 Optimization of Regular Expression Pattern Matching Circuits on FPGA Department of Computer Science and Information Engineering National Cheng Kung University,
Deterministic Finite Automaton for Scalable Traffic Identification: the Power of Compressing by Range Authors: Rafael Antonello, Stenio Fernandes, Djamel.
Memory-Efficient Regular Expression Search Using State Merging Author: Michela Becchi, Srihari Cadambi Publisher: INFOCOM th IEEE International.
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
Brian Mitchell - Drexel University MCS680-FCS 1 Patterns, Automata & Regular Expressions int MSTWeight(int graph[][], int size)
Theory of Computing CSCI 356/541 Lab Session. Outline Lab 1: Finite Automata  Construct and Run Construct and Run  Manipulating Transitions Manipulating.
Finite Automata Chapter 1. Automatic Door Example Top View.
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
TFA: A Tunable Finite Automaton for Regular Expression Matching Author: Yang Xu, Junchen Jiang, Rihua Wei, Yang Song and H. Jonathan Chao Publisher: ACM/IEEE.
Finite Automata & Regular Languages Sipser, Chapter 1.
A Fast Regular Expression Matching Engine for NIDS Applying Prediction Scheme Author: Lei Jiang, Qiong Dai, Qiu Tang, Jianlong Tan and Binxing Fang Publisher:
LaFA Lookahead Finite Automata Scalable Regular Expression Detection Authors : Masanori Bando, N. Sertac Artan, H. Jonathan Chao Masanori Bando N. Sertac.
using Deterministic Finite Automata & Nondeterministic Finite Automata
Overview of Previous Lesson(s) Over View  A token is a pair consisting of a token name and an optional attribute value.  A pattern is a description.
Automata. ‘ ’
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
Conversions Regular Expression to FA FA to Regular Expression.
1 Introduction to the Theory of Computation Regular Expressions.
LOP_RE: Range Encoding for Low Power Packet Classification Author: Xin He, Jorgen Peddersen and Sri Parameswaran Conference : IEEE 34th Conference on Local.
SRD-DFA Achieving Sub-Rule Distinguishing with Extended DFA Structure Author: Gao Xia, Xiaofei Wang, Bin Liu Publisher: IEEE DASC (International Conference.
Series DFA for Memory- Efficient Regular Expression Matching Author: Tingwen Liu, Yong Sun, Li Guo, and Binxing Fang Publisher: CIAA 2012( International.
Set, Alphabets, Strings, and Languages. The regular languages. Clouser properties of regular sets. Finite State Automata. Types of Finite State Automata.
Deterministic Finite Automata Nondeterministic Finite Automata.
CS412/413 Introduction to Compilers Radu Rugina Lecture 3: Finite Automata 25 Jan 02.
Topic 3: Automata Theory 1. OutlineOutline Finite state machine, Regular expressions, DFA, NDFA, and their equivalence, Grammars and Chomsky hierarchy.
Theory of Languages and Automata By: Mojtaba Khezrian.
Reorganized and Compact DFA for Efficient Regular Expression Matching
CS314 – Section 5 Recitation 2
Finite automate.
2018/6/26 An Energy-efficient TCAM-based Packet Classification with Decision-tree Mapping Author: Zhao Ruan, Xianfeng Li , Wenjun Li Publisher: 2013.
CSE 105 theory of computation
CS314 – Section 5 Recitation 3
REGULAR LANGUAGES AND REGULAR GRAMMARS
COSC 3340: Introduction to Theory of Computation
Regular Expressions
Memory-Efficient Regular Expression Search Using State Merging
A New String Matching Algorithm Based on Logical Indexing
Principles of Computing – UFCFA3-30-1
Chapter 1 Regular Language
2019/5/3 A De-compositional Approach to Regular Expression Matching for Network Security Applications Author: Eric Norige Alex Liu Presenter: Yi-Hsien.
Presenter: Yu Hao, Tseng Date: 2014/8/25
Lexical Analysis Uses formalism of Regular Languages
Presentation transcript:

Thopson NFA Presenter: Yuen-Shuo Li Date: 2014/5/7 Department of Computer Science and Information Engineering National Cheng Kung University, Taiwan R.O.C.

Introduction A regular expression (regex or regexp for short) is a special text string for describing a search pattern. National Cheng Kung University CSIE Computer & Internet Architecture Lab 2

Introduction Regular expression grammar National Cheng Kung University CSIE Computer & Internet Architecture Lab 3 SyntaxExample Any character except[\^$.|?*+()a matches a.. matches x or (almost) any other character | (abc|def|xyz) matches abc, defor xyz * “ab*c" matches “ac“, “abc“, “abbc”, “abbbc”,... + “a+" matches “a“, “aa“, “aaa”, “aaa”,... ?abc? matches abc or ab [][abc] matches a, b or c {n} a{3} matches aaa {n,m}{n,m} where n >= 0 and m >= n

Introduction In automata theory, a nondeterministic finite automaton (NFA), or nondeterministic finite state machine, is a finite state machine that does not require input symbols for state transitions is capable of transitioning to zero or two or more states for a given start state and input symbol. National Cheng Kung University CSIE Computer & Internet Architecture Lab 4 ε a a ε

Introduction Thompson's Construction Algorithm (TCA) derives a nondeterministic finite automaton (NFA) from any regular expression by splitting it into its constituent subexpressions, from which the NFA will be constructed using a set of rules. National Cheng Kung University CSIE Computer & Internet Architecture Lab 5

The expression ε is converted to National Cheng Kung University CSIE Computer & Internet Architecture Lab 6 ε e.g. A? => (A|ε)

A symbol a of the input alphabet is converted to National Cheng Kung University CSIE Computer & Internet Architecture Lab 7 a

The union expression RE1|RE2 is converted to National Cheng Kung University CSIE Computer & Internet Architecture Lab 8 a ε RE1 ε ε RE2 ε

The concatenation expression RE1 . RE2 is converted to National Cheng Kung University CSIE Computer & Internet Architecture Lab 9 a RE1 RE2

The concatenation expression RE1 . RE2 is converted to National Cheng Kung University CSIE Computer & Internet Architecture Lab 10 a RE1 RE2 or

The Kleene star expression RE* is converted to National Cheng Kung University CSIE Computer & Internet Architecture Lab 11 ε RE ε ε ε

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 12 A

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 13 A B

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 14 A B AB

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 15 AB

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 16 AB CD

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 17 AB CD ε ε ε ε

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 18 A B C D ε ε ε ε

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 19 A B C D ε ε ε ε ε ε ε ε E

(AB|CD)E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 20 A B C D ε ε ε ε ε ε ε ε E

National Cheng Kung University CSIE Computer & Internet Architecture Lab 21 . | * . . A B C D E (AB|CD) E* RegexParse TreeNFA

National Cheng Kung University CSIE Computer & Internet Architecture Lab 22 . | * . . A B C D E

National Cheng Kung University CSIE Computer & Internet Architecture Lab 23 . | * . . A B C D E

A National Cheng Kung University CSIE Computer & Internet Architecture Lab 24 . | * . . A B C D E

AB National Cheng Kung University CSIE Computer & Internet Architecture Lab 25 . | * . . A B C D E

AB . National Cheng Kung University CSIE Computer & Internet Architecture Lab 26 . | * . . A B C D E

AB . C National Cheng Kung University CSIE Computer & Internet Architecture Lab 27 . | * . . A B C D E

AB . CD National Cheng Kung University CSIE Computer & Internet Architecture Lab 28 . | * . . A B C D E

AB . CD . National Cheng Kung University CSIE Computer & Internet Architecture Lab 29 . | * . A B C D E

AB . CD . | National Cheng Kung University CSIE Computer & Internet Architecture Lab 30 . | * . A B C D E

AB . CD . |E National Cheng Kung University CSIE Computer & Internet Architecture Lab 31 . | * . A B C D E

AB . CD . |E* National Cheng Kung University CSIE Computer & Internet Architecture Lab 32 . | * . A B C D E

AB . CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 33 . | * . . A B C D E

AB . CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 34 . | * . . A B C D E postfix notation

AB . CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 35

AB . CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 36 stack

B . CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 37 stack A

B . CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 38 stack A A

B . CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 39 stack A

. CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 40 stack A B

. CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 41 stack A B B

. CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 42 stack A B

CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 43 stack A B .

CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 44 stack A . B

CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 45 stack . B A

CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 46 stack BA

CD . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 47 stack B A

D . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 48 stack B A C

D . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 49 stack B A C C

D . |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 50 stack B A C

. |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 51 stack B A C D D

. |E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 52 stack B A C D

|E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 53 stack B A C D .

|E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 54 stack B A C . D

|E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 55 stack B A . D C

|E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 56 stack B A DC

|E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 57 stack B A D C

E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 58 stack B A D C |

E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 59 stack B A | DC

E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 60 stack | DC BA

E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 61 stack A B C D ε ε ε ε

E* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 62 stack A B C D ε ε ε ε

* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 63 stack A B C D ε ε ε ε E

* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 64 stack A B C D ε ε ε ε E E

* . National Cheng Kung University CSIE Computer & Internet Architecture Lab 65 stack A B C D ε ε ε ε E

. National Cheng Kung University CSIE Computer & Internet Architecture Lab 66 stack A B C D ε ε ε ε E *

. National Cheng Kung University CSIE Computer & Internet Architecture Lab 67 stack A B C D ε ε ε ε * E

. National Cheng Kung University CSIE Computer & Internet Architecture Lab 68 stack A B C D ε ε ε ε * ε ε ε ε E

. National Cheng Kung University CSIE Computer & Internet Architecture Lab 69 stack A B C D ε ε ε ε * ε ε ε ε E

National Cheng Kung University CSIE Computer & Internet Architecture Lab 70 A B C D ε ε ε ε ε ε ε ε E

Regular Expression to NFA DFA nfa-dfa nfa-dfa National Cheng Kung University CSIE Computer & Internet Architecture Lab 71