首页    期刊浏览 2024年12月05日 星期四
登录注册

文章基本信息

  • 标题:Checking Time Linearity of Regular Expression Matching Based on Backtracking
  • 本地全文:下载
  • 作者:Satoshi Sugiyama ; Yasuhiko Minamide
  • 期刊名称:Information and Media Technologies
  • 电子版ISSN:1881-0896
  • 出版年度:2014
  • 卷号:9
  • 期号:3
  • 页码:222-232
  • DOI:10.11185/imt.9.222
  • 出版社:Information and Media Technologies Editorial Board
  • 摘要:Most implementations of regular expression matching in programming languages are based on backtracking. With this implementation strategy, matching may not be achieved in linear time with respect to the length of the input. In the worst case, it may take exponential time. In this paper, we propose a method of checking whether or not regular expression matching runs in linear time. We construct a top-down tree transducer with regular lookahead that translates the input string into a tree corresponding to the execution steps of matching based on backtracking. The regular expression matching then runs in linear time if the tree transducer is of linear size increase. To check this property of the tree transducer, we apply a result of Engelfriet and Maneth. We implemented the method in OCaml and conducted experiments that checked the time linearity of regular expressions appearing in several popular PHP programs. Our implementation showed that 47 of 393 regular expressions were not linear.
  • 关键词:regular expression;tree transducer;linear size increase
国家哲学社会科学文献中心版权所有