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 条
  • [41] On the Hopcroft's minimization technique for DFA and DFCA
    Paun, Andrei
    Paun, Mihaela
    Rodriguez-Paton, Alfonso
    THEORETICAL COMPUTER SCIENCE, 2009, 410 (24-25) : 2424 - 2430
  • [42] Automatic Synthesis of Regular Expressions from Examples
    Bartoli, Alberto
    Davanzo, Giorgio
    De Lorenzo, Andrea
    Medvet, Eric
    Sorio, Enrico
    COMPUTER, 2014, 47 (12) : 72 - 80
  • [43] From regular weighted expressions to finite automata
    Champarnaud, JM
    Laugerotte, É
    Ouardi, F
    Ziadi, D
    IMPLEMENTATION AND APPLICATION OF AUTOMATA, PROCEEDINGS, 2003, 2759 : 49 - 60
  • [44] CONSTRUCTION OF TREE AUTOMATA FROM REGULAR EXPRESSIONS
    Kuske, Dietrich
    Meinecke, Ingmar
    RAIRO-THEORETICAL INFORMATICS AND APPLICATIONS, 2011, 45 (03): : 347 - 370
  • [45] DESIGN OF SEQUENTIAL MACHINES FROM THEIR REGULAR EXPRESSIONS
    OTT, G
    FEINSTEIN, NH
    JOURNAL OF THE ACM, 1961, 8 (04) : 585 - &
  • [46] Construction of Tree Automata from Regular Expressions
    Kuske, Dietrich
    Meinecke, Ingmar
    DEVELOPMENTS IN LANGUAGE THEORY, PROCEEDINGS, 2008, 5257 : 491 - 503
  • [47] From regular weighted expressions to finite automata
    Champarnaud, JM
    Laugerotte, É
    Ouardi, F
    Ziadi, D
    INTERNATIONAL JOURNAL OF FOUNDATIONS OF COMPUTER SCIENCE, 2004, 15 (05) : 687 - 700
  • [48] Learning regular expressions from noisy sequences
    Galassi, U
    Giórdana, A
    ABSTRACTION, REFORMULATION AND APPROXIMATION, PROCEEDINGS, 2005, 3607 : 92 - 106
  • [49] HIGH-SPEED REGULAR EXPRESSION MATCHING ENGINE USING MULTI-CHARACTER NFA
    Yamagaki, Norio
    Sidhu, Reetinder
    Kamiya, Satoshi
    2008 INTERNATIONAL CONFERENCE ON FIELD PROGRAMMABLE AND LOGIC APPLICATIONS, VOLS 1 AND 2, 2008, : 131 - +
  • [50] Optimizing regular path expressions using graph schemas
    Fernandez, M
    Suciu, D
    14TH INTERNATIONAL CONFERENCE ON DATA ENGINEERING, PROCEEDINGS, 1998, : 14 - 23