Computing the Edit-Distance between a Regular Language and a Context-Free Language

Author(s):  
Yo-Sub Han ◽  
Sang-Ki Ko ◽  
Kai Salomaa
2013 ◽  
Vol 24 (07) ◽  
pp. 1067-1082 ◽  
Author(s):  
YO-SUB HAN ◽  
SANG-KI KO ◽  
KAI SALOMAA

The edit-distance between two strings is the smallest number of operations required to transform one string into the other. The distance between languages L1and L2is the smallest edit-distance between string wi∈ Li, i = 1, 2. We consider the problem of computing the edit-distance of a given regular language and a given context-free language. First, we present an algorithm that finds for the languages an optimal alignment, that is, a sequence of edit operations that transforms a string in one language to a string in the other. The length of the optimal alignment, in the worst case, is exponential in the size of the given grammar and finite automaton. Then, we investigate the problem of computing only the edit-distance of the languages without explicitly producing an optimal alignment. We design a polynomial time algorithm that calculates the edit-distance based on unary homomorphisms.


Author(s):  
Arturo Carpi ◽  
Flavio D’Alessandro

The problem of the commutative equivalence of context-free and regular languages is studied. Conditions ensuring that a context-free language of exponential growth is commutatively equivalent with a regular language are investigated.


2018 ◽  
Vol 0 (0) ◽  
Author(s):  
Meng-Che Ho

Abstract The word problem of a group {G=\langle\Sigma\rangle} can be defined as the set of formal words in {\Sigma^{*}} that represent the identity in G. When viewed as formal languages, this gives a strong connection between classes of groups and classes of formal languages. For example, Anīsīmov showed that a group is finite if and only if its word problem is a regular language, and Muller and Schupp showed that a group is virtually-free if and only if its word problem is a context-free language. Recently, Salvati showed that the word problem of {\mathbb{Z}^{2}} is a multiple context-free language, giving the first example of a natural word problem that is multiple context-free, but not context-free. We generalize Salvati’s result to show that the word problem of {\mathbb{Z}^{n}} is a multiple context-free language for any n.


10.37236/1944 ◽  
2005 ◽  
Vol 12 (1) ◽  
Author(s):  
Michael H. Albert ◽  
Steve Linton ◽  
Nik Ruškuc

We introduce the insertion encoding, an encoding of finite permutations. Classes of permutations whose insertion encodings form a regular language are characterized. Some necessary conditions are provided for a class of permutations to have insertion encodings that form a context free language. Applications of the insertion encoding to the evaluation of generating functions for classes of permutations, construction of polynomial time algorithms for enumerating such classes, and the illustration of bijective equivalence between classes are demonstrated.


2007 ◽  
Vol 18 (06) ◽  
pp. 1293-1302 ◽  
Author(s):  
MARTIN KUTRIB ◽  
ANDREAS MALCHER

We investigate the intersection of Church-Rosser languages and (strongly) context-free languages. The intersection is still a proper superset of the deterministic context-free languages as well as of their reversals, while its membership problem is solvable in linear time. For the problem whether a given Church-Rosser or context-free language belongs to the intersection we show completeness for the second level of the arithmetic hierarchy. The equivalence of Church-Rosser and context-free languages is Π1-complete. It is proved that all considered intersections are pairwise incomparable. Finally, closure properties under several operations are investigated.


2014 ◽  
Vol 577 ◽  
pp. 917-920
Author(s):  
Long Pang ◽  
Xiao Hong Su ◽  
Pei Jun Ma ◽  
Ling Ling Zhao

The pointer alias is indispensable for program analysis. Comparing to point-to set, it’s more efficient to formulate the alias as the context free language (CFL) reachability problem. However, the precision is limited to flow-insensitivity. To solve this problem, we propose a flow sensitive, demand-driven analysis algorithm for answering may-alias queries. First the partial single static assignment is used to discriminate the address-taken pointers. Then the order of control flow is encoded in the level linearization code to ease comparison. Finally, the query of alias in demand driven is converted into the search of CFL reachability with feasible flows. The experiments demonstrate the effectiveness of the proposed approach.


Sign in / Sign up

Export Citation Format

Share Document