Parameterized pattern matching: Algorithms and applications

被引:95
|
作者
Baker, BS
机构
[1] AT and T Bell Laboratories, Murray Hill, NJ 07974
关键词
D O I
10.1006/jcss.1996.0003
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
The problem of finding sections of code that either are identical or are related by the systematic renaming of variables or constants can be modeled in terms of parameterized strings (p-strings) and parameterized matches (p-matches). P-strings are strings over two alphabets, one of which represents parameters. Two p-strings are a parameterized match (p-match) if one p-string is obtained by renaming the parameters of the other by a one-to-one function. In this paper, we investigate parameterized pattern matching via parameterized suffix trees (p-suffix trees). We give two algorithms for constructing p-suffix trees: one (eager) that runs in linear time for fixed alphabets, and another that uses auxiliary data structures and runs in O(n log(n)) time for Variable alphabets, where n is input length. We show that using a p-suffix tree for a pattern p-string P, it is possible to search for all p-matches of P within a text p-string Tin space linear in \P\ and time linear in \T\ for fixed alphabets, or O(\T\ log(min( \P\, sigma)) time and O(\P\) space for variable alphabets, where sigma is the sum of the alphabet sizes. The simpler p-suffix tree construction algorithm eager has been implemented, and experiments show it to be practical. Since it runs faster than predicted by the above worst-case bound, we reanalyze the algorithm and show that eager runs in time O(min(t\S\ + m(t, S) \ t>0) log sigma)), where for an input p-string S, m(t, S) is the number of maximal p-matches of length at least t that occur within S, and sigma is the sum of the alphabet sizes. Experiments with the author's program dup (B. Baker, in ''Comput. Sci. Statist.,'' Vol. 24, 1992) for finding all maximal p-matches within a p-string have found mt t, S) to be less than \S\ in practice unless t is small. (C) 1996 Academic Press, Inc.
引用
收藏
页码:28 / 42
页数:15
相关论文
共 50 条
  • [21] A Parameterized Study of Maximum Generalized Pattern Matching Problems
    Sebastian Ordyniak
    Alexandru Popa
    Algorithmica, 2016, 75 : 1 - 26
  • [22] Sharp Separation and Applications to Exact and Parameterized Algorithms
    Fomin, Fedor V.
    Lokshtanov, Daniel
    Grandoni, Fabrizio
    Saurabh, Saket
    LATIN 2010: THEORETICAL INFORMATICS, 2010, 6034 : 72 - +
  • [23] Parameterized Algorithms for Matching and Ranking Web Services (Short Paper)
    Gmati, Fatma Ezzahra
    Yacoubi-Ayadi, Nadia
    Chakhar, Salem
    ON THE MOVE TO MEANINGFUL INTERNET SYSTEMS: OTM 2014 CONFERENCES, 2014, 8841 : 784 - 791
  • [24] Sharp Separation and Applications to Exact and Parameterized Algorithms
    Fomin, Fedor V.
    Grandoni, Fabrizio
    Lokshtanov, Daniel
    Saurabh, Saket
    ALGORITHMICA, 2012, 63 (03) : 692 - 706
  • [25] Sharp Separation and Applications to Exact and Parameterized Algorithms
    Fedor V. Fomin
    Fabrizio Grandoni
    Daniel Lokshtanov
    Saket Saurabh
    Algorithmica, 2012, 63 : 692 - 706
  • [26] Fragmentary pattern matching: Complexity, algorithms and applications for analyzing classic literary works
    Hori, H
    Shimozono, S
    Takeda, M
    Shinohara, A
    ALGORITHMS AND COMPUTATION, PROCEEDINGS, 2001, 2223 : 719 - 730
  • [27] Parallel Algorithms for Combinatorial Pattern Matching
    Brimkov, Valentin E.
    COMBINATORIAL IMAGE ANALYSIS, IWCIA 2014, 2014, 8466 : 8 - 16
  • [28] A STUDY OF PATTERN-MATCHING ALGORITHMS
    PIRKLBAUER, K
    STRUCTURED PROGRAMMING, 1992, 13 (02): : 89 - 98
  • [29] Complexity of sequential pattern matching algorithms
    Régnier, M
    Szpankowski, W
    RANDOMIZATION AND APPROXIMATION TECHNIQUES IN COMPUTER SCIENCE, 1998, 1518 : 187 - 199
  • [30] EFFICIENT PATTERN MATCHING ALGORITHMS IN IDS
    Salve, Vandana B.
    Savalkar, Vishwayogita
    Mhatre, Sonali
    PROCEEDINGS OF THE 2ND INTERNATIONAL CONFERENCE ON INVENTIVE SYSTEMS AND CONTROL (ICISC 2018), 2018, : 1083 - 1089