Abstract
While the edit-distance neighborhood is useful for approximate pattern matching, it is not suitable for the negative lookahead feature for the practical regex matching engines. This motivates us to introduce a new operation. We define the edit-distance interior operation on a language L to compute the largest subset I(L) of L such that the edit-distance neighborhood of I(L) is in L. In other words, L includes the edit-distance neighborhood of the largest edit-distance interior language. Given an edit-distance value r, we show that the radius-r edit-distance interior operation is a weak inverse of the radius-r edit-distance neighborhood operation, and vice versa. In addition, we demonstrate that regular languages are closed under the edit-distance interior operation whereas context-free languages are not. Then, we characterize the edit-distance interior languages and present a proper hierarchy with respect to the radius of operations. The family of edit-distance interior languages is closed under intersection, but not closed under union, complement and catenation.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Aho, A.V., Peterson, T.G.: A minimum distance error-correcting parser for context-free languages. SAIM J. Comput. 1(4), 281–353 (1972)
Benedikt, M., Puppis, G., Riveros, C.: Bounded repairability of word languages. J. Comput. Syst. Sci. 79(8), 1302–1321 (2013)
Berglund, M., van der Merwe, B., van Litsenborgh, S.: Regular expressions with lookahead. J. Univ. Comput. Sci. 27(4), 324–340 (2021)
Bispo, J., Sourdis, I., Cardoso, J.M., Vassiliadis, S.: Regular expression matching for reconfigurable packet inspection. In: Proceedings of the 2006 IEEE International Conference on Field Programmable Technology (FPT), pp. 119–126 (2006)
Chakraborty, D., Das, D., Goldenberg, E., Koucký, M., Saks, M.: Approximating edit distance within constant factor in truly sub-quadratic time. J. ACM 67(6), 36:1–36:22 (2020)
Chapman, C., Stollee, K.T.: Exploring regular expression usage and context in Python. In: Proceedings of the 25th International Symposium on Software Testing and Analysis (ISSTA), pp. 282–293 (2016)
Cheon, H., Hahn, J., Han, Y.S., Ko, S.K.: Most pseudo-copy languages are not context-free. In: Proceedings of the 27th International Computing and Combinatorics Conference (COCOON), pp. 189–200 (2021)
Cheon, H., Han, Y.S.: Computing the shortest string and the edit-distance for parsing expression languages. In: Proceedings of the 24th International Conference on Developments in Language Theory (DLT), pp. 43–54 (2020)
Cormode, G., Muthukrishnan, S.: The string edit distance matching problem with moves. ACM Transactions on Algorithms 3(1), 2:1–2:19 (2007)
Ecma International: ECMA-262: ECMAScript(R) 2015 language specification. In: ECMA International (2015)
Ford, B.: Parsing expression grammars: A recognition-based syntactic foundation. In: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pp. 111–122 (2004)
Hamming, R.W.: Error detecting and error correcting codes. Bell Syst. Tech. J. 29(2), 147–160 (1950)
Han, Y.S., Ko, S.K.: Edit-distance between visibly pushdown languages. In: Proceedings of the 43rd International Conference on Current Trends in Theory and Practice of Computer Science (SOFSEM), pp. 196–207 (2017)
Han, Y.S., Ko, S.K., Salomaa, K.: The edit-distance between a regular language and a context-free language. Int. J. Found. Comput. Sci. 24(7), 1067–1082 (2013)
Hazel, P.: pcre2pattern man page, https://www.pcre.org/current/doc/html/pcre2pattern.html. Accessed 23 Feb 2023
Levenshtein, V.I.: Binary codes capable of correcting deletions, insertions, and reversals. Soviet Phy. Doklady 10(8), 707–710 (1966)
Microsoft and other contributors: Regular expression language–quick reference (2022). https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference. Accessed 25 Feb 2023
Mohri, M.: Edit-distance of weighted automata: General definitions and algorithms. Int. J. Found. Comput. Sci. 14(6), 957–982 (2003)
Ng, T., Rappaport, D., Salomaa, K.: State complexity of neighborhoods and approximate patern matching. Int. J. Found. Comput. Sci. 29(2), 315–329 (2018)
Okhotin, A., Salomaa, K.: Edit distance neighborhoods of input-driven pushdown automata. Theoret. Comput. Sci. 777, 417–430 (2019)
Salomaa, K., Schofield, P.: State complexity of additive weighted finite automata. Int. J. Found. Comput. Sci. 18(6), 1407–1416 (2007)
Shar, L.K., Tan, H.B.K.: Mining input sanitization patterns for predicting sql injection and cross site scripting vulnerabilities. In: Proceedings of the 34th International Conference on Software Engineering (ICSE), pp. 1293–1296 (2012)
Sipser, M.: Introduction to the Theory of Computation, 3rd edn. Cengage Learning, MA, USA (2013)
Wood, D.: Theory of Computation. Harper & Row, NY, USA (1987)
Acknowledgments
This research was supported by the NRF grant (RS-2023-00208094). We wish to thank the anonymous reviewers for their valuable suggestions.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Cheon, H., Han, YS. (2023). Weak Inverse Neighborhoods of Languages. In: Drewes, F., Volkov, M. (eds) Developments in Language Theory. DLT 2023. Lecture Notes in Computer Science, vol 13911. Springer, Cham. https://doi.org/10.1007/978-3-031-33264-7_6
Download citation
DOI: https://doi.org/10.1007/978-3-031-33264-7_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-33263-0
Online ISBN: 978-3-031-33264-7
eBook Packages: Computer ScienceComputer Science (R0)