From regular expressions to DFA's using compressed NFA's

被引:28
|
作者
Chang, CH
Paige, R
机构
[1] NYU,COURANT INST MATH SCI,NEW YORK,NY 10012
[2] ACAD SINICA,INST INFORMAT SCI,TAIPEI,TAIWAN
关键词
D O I
10.1016/S0304-3975(96)00140-5
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
There are two principal methods for turning regular expressions into NFA's - one due to McNaughton and Yamada and another due to Thompson. Unfortunately, both have drawbacks. Given a regular expression R of length r and with s occurrences of alphabet symbols, Chang and Paige (1992) and Bruggemann-Klein(1993) gave Theta(m+r) time and O(r) spate algorithms to produce a Theta(m) space representation of McNaughton and Yamada's NFA with s+1 states and in transitions. The problem with this NFA is that m=Theta(s(2)) in the worst case. Thompson's method takes Theta(r) time and space to construct a Theta(r) space NFA with Theta(r) states and Theta(r) transitions. The problem with this NFA is that r can be arbitrarily larger than s. We overcome drawbacks of both methods with a Theta(r) time Theta(s) space algorithm to construct an O(s) space representation of McNaughton and Yamada's NFA. Given any set V of NFA states, our representation can be used to compute the set U of states one transition away from the states in V in optimal time O(\V\+\U\). McNaughton and Yamada's NFA requires Theta(\V\x\U\) time in the worst case. Using Thompson's NFA, the equivalent calculation requires Theta(r) time in the worst case. Comparative benchmarks show that an implementation of our method outperforms implementations of competing methods with respect to time for NFA construction, NFA accepting testing, and NFA-to-DFA conversion by subset construction. Throughout this paper program transformations are used to design algorithms and derive programs. A transformation of special importance is a form of finite differencing used previously by Douglas Smith to improve the efficiency of functional programs.
引用
收藏
页码:1 / 36
页数:36
相关论文
共 50 条
  • [21] Revising Antimirov's partial derivatives for fuzzy regular expressions
    Garhwal, Sunita
    Jiwari, Ram
    Tomasiello, Stefania
    2017 INTERNATIONAL CONFERENCE ON HIGH PERFORMANCE COMPUTING & SIMULATION (HPCS), 2017, : 477 - 482
  • [22] Proof of correctness of a direct construction of DFA from regular expression
    Babu, SR
    Sanyal, A
    Venkatesh, G
    INTERNATIONAL JOURNAL OF COMPUTER MATHEMATICS, 1997, 64 (3-4) : 191 - 210
  • [23] Text Manipulation Using Regular Expressions
    Biswas, S.
    Sengupta, D.
    Bhattacharjee, R.
    Handique, M.
    2016 IEEE 6TH INTERNATIONAL CONFERENCE ON ADVANCED COMPUTING (IACC), 2016, : 62 - 67
  • [24] Construction of Deterministic Finite Automata (DFA) from regular expression
    Kamal, AHM
    CCCT 2003, VOL 5, PROCEEDINGS: COMPUTER, COMMUNICATION AND CONTROL TECHNOLOGIES: II, 2003, : 85 - 87
  • [25] Real time QRS complex detection using DFA and regular grammar
    Salah Hamdi
    Asma Ben Abdallah
    Mohamed Hedi Bedoui
    BioMedical Engineering OnLine, 16
  • [26] From regular expressions to smaller NFAs
    Garcia, Pedro
    Lopez, Damian
    Ruiz, Jose
    Alvarez, Gloria I.
    THEORETICAL COMPUTER SCIENCE, 2011, 412 (41) : 5802 - 5807
  • [27] FROM REGULAR EXPRESSIONS TO DETERMINISTIC AUTOMATA
    BERRY, G
    SETHI, R
    THEORETICAL COMPUTER SCIENCE, 1986, 48 (01) : 117 - 126
  • [28] From regular expressions to finite automata
    Champarnaud, JM
    Ponty, JL
    Ziadi, D
    INTERNATIONAL JOURNAL OF COMPUTER MATHEMATICS, 1999, 72 (04) : 415 - 431
  • [29] REGULAR EXPRESSIONS FROM SEQUENTIAL CIRCUITS
    BRZOZOWSKI, JA
    IEEE TRANSACTIONS ON ELECTRONIC COMPUTERS, 1964, EC13 (06): : 741 - +
  • [30] Real time QRS complex detection using DFA and regular grammar
    Hamdi, Salah
    Ben Abdallah, Asma
    Bedoui, Mohamed Hedi
    BIOMEDICAL ENGINEERING ONLINE, 2017, 16 : 31