Trovare la massima fattorizzazione delle lingue normali


13

Consenti alla lingua LΣ essere regolare.

Una fattorizzazione di L è una coppia massima (X,Y) di insiemi di parole con

  • XYL
  • XY ,

dove XY={xy | xX,yY} .

(X,Y) è massimo se per ogni coppia(X,Y)(X,Y) conXYL oXX oYY .

Esiste una semplice procedura per scoprire quali coppie sono massime?

Esempio:

Sia L=ΣabΣ . L'insieme F={u,v,w} viene calcolato:

  • u=(Σ,ΣabΣ)

  • v=(ΣaΣ,ΣbΣ)

  • w=(ΣabΣ,Σ)

dove Σ={a,b} .

Un altro esempio:

Σ={a,b} eL=ΣaΣ Set di fattorizzazioneF={q,r,s,t} con

  • q=(Σ,L)

  • r=(Σa,Σ+L)

  • s=(Σaa,ϵ+Σ+L)

  • t=(L,ϵ+L)


4
Consiglio di leggere il seguente articolo (in particolare la sottosezione 4.1) di Jacques Sakarovitch: perso.telecom-paristech.fr/~jsaka/PUB/Files/TUA.pdf
Cornelius Brand

1
Mi chiedo se potresti voler essere più specifico sul problema, ovvero l'ultima frase della tua domanda? Ci viene dato e vogliamo verificare se ( X , Y ) è massimo? Il nostro compito è enumerare tutti ( X , Y ) che sono massimi? In quest'ultimo caso, è chiaro che questo elenco è finito o di dimensioni polinomiali? Probabilmente non ha senso chiedere un algoritmo per enumerare tutte le possibilità se ce ne sono molte in modo esponenziale. Inoltre, vuoi specificare come viene rappresentata la lingua L quando ci viene presentata e come X , YX,Y(X,Y)(X,Y)LX,Ysono rappresentati? (ad es. DFA, NFA, regexp)
DW

2
Non capisco i tuoi esempi. Are doveva essere tutte le coppie massime? v non sembra essere valido ...u,v,wv
Raffaello

1
L'esempio è tratto dal documento sopra citato. dovrebbero essere coppie massime. Anche io non capisco come v viene calcolata dal momento che non sembra essere necessariamente in L . Pubblicherò un altro esempio. u,v,wvL
Laura,

1
@Raphael, mi sembra che sia valido. Lasciare X = Σ a Σ , Y = Σ b Σ , ( X , Y ) è una fattorizzazione, poiché X Y = L (considera qualsiasi stringa che contiene una a , quindi qualsiasi sequenza di a e / o b 's, quindi alla fine a b : questa stringa deve avere un punto in cui appare la prima b , quindi è un punto in cui contiene unvX=ΣaΣY=ΣbΣ(X,Y)XY=Laabbb ). Non ho una prova che esso è massimo, ma non riesco a trovare alcuna più grande set di X ' , Y ' che sono una fattorizzazione di L . abX,YL
DW

Risposte:


8

Come suggerito nei commenti alla domanda, cercherò di dare una risposta (purtroppo parziale) alla domanda, almeno nella misura in cui ho capito il problema da solo (questo implica che potresti trovare degli errori e se trovi un modo per spiegare più brevemente o chiaramente uno dei seguenti punti, sentiti libero di modificare la risposta di conseguenza):

In primo luogo, si dovrebbe notare che in realtà non dobbiamo calcolare l'automa universale di una lingua se vogliamo calcolare le fattorizzazioni di una lingua.

Dal documento menzionato nel mio commento ¹, v'è una corrispondenza 1-1 tra fattori sinistra e destra di un linguaggio regolare, cioè, dato un fattore di sinistra della lingua, il corrispondente fattore di destra viene determinato e vice versa univocamente. Più precisamente, abbiamo quanto segue:

Let è una fattorizzazione di L . Quindi Y = x X x - 1 L , X = y Y L y - 1 , ovvero ogni fattore sinistro è un'intersezione dei quozienti giusti e qualsiasi fattore destro è un'intersezione dei quozienti sinistri. Viceversa, ogni intersezione dei quozienti sinistra di L è un fattore diritto di L e ogni intersezione dei quozienti destro di L è un fattore fianco di L .(X,Y)L

Y=xXx1L,X=yYLy1,
LLLL

Si noti che per un linguaggio regolare, c'è solo un insieme finito di quozienti a destra ea sinistra, e, quindi, o un problema si riduce a calcolare i quozienti a destra ea sinistra di una lingua, e quindi di calcolare la loro chiusura -STABLE, che è, un minimo superset dei quozienti chiusi sotto l'intersezione. Questi sono poi proprio i fattori di destra e di sinistra fattori, e quindi di solito è facile vedere quali coppie sono sottoinsiemi di L .L

Esempio

Per illustrare i punti di cui sopra, considera il primo esempio nella domanda (di cui penso anche che non sia corretto nel documento):

Sia . Ora, i quozienti sinistra della L sono insiemi x - 1 L per x Σ * , cioè quelle parole u in Σ * che può essere preceduto da x , cioè x u L . Quando è y - 1 L = x - 1 L per x distinto , y ? Questo è il caso se e solo se xL=ΣabΣLx1LxΣuΣxxuLy1L=x1Lx,yxe può essere aumentato alle parole in L con esattamente gli stessi suffissi. Ciò significa che, per dirla in termini più familiari, sono equivalenti a Nerode e i suffissi necessari per aggiungere parole in una classe Nerode sono esattamente i rispettivi quozienti a sinistra.yL

Per , vediamo che le nostre classi di equivalenza Nerode sonoL

  • , l'insieme di parole che non contiene a b come fattore e termina con a , N1aba
  • , l'insieme di parole che terminano con b e che non contengono a b come fattore, e N2bab
  • , l'insieme di parole contenenti a b come fattore, ovvero N 3 = LN3abN3=L

Possono essere aumentati con i seguenti insiemi (ovvero, questi sono i quozienti di sinistra delle parole nelle rispettive classi):

  • per x in N 1 è costituito da tutte le parole in L (qualsiasi parola può essere aumentata con una parola contenente una b come fattore e quindi diventa una parola in L ) e b Σ , ovvero S 1 = L b Σ S1=x1LxN1LabLbΣS1=LbΣ
  • S2=x1L for x in N2 is the language itself, that is, S2=L and
  • S3=x1L for x in N3 is obviously Σ. That is, we have found three right factors of L. As S2S1S3, their -stable closure is trivially S1,S2,S3, and those are then precisely the right factors.

Hence, our factorization set FL is of the form (P1,S1),(P2,S2),(P3,S3).

Now, for the left factors Pi, we use the equations of the beginning of this answer:

Pi=xSiLx1
.

For P1, this yields LΣa, for P2 we get Σ and for P3, we obtain L. You can see this by inspection (the most popular excuse for being too lazy to state a formal proof) or by explicitly computing the right quotients (which is fairly analogous, although not completely, to computing the left quotients). Our factorizations are thus given by FL=u,v,w where

  • u=(P1,S1)=(ΣabΣΣa,ΣabΣbΣ)
  • v=(P2,S2)=(Σ,ΣabΣ) and
  • w=(P3,S3)=(ΣabΣ,Σ)

Summary

To summarize (as you were asking for a simple procedure):

  • For computing the factorizations of a language L, first compute the left quotients of L.
  • You can do so, in the language of the paper, by constructing a minimal DFA A for L and then for each state q in A (corresponding, as a Nerode-equivalence class, to a left quotient) compute the future of q in A, thus obtaining one left quotient of the language for each state.
  • The collection of left quotients obtained in this way yields, in general, a subset SR of the right factors.
  • Compute then the -stable closure of SR, which can be done in practice by forming the intersection of any subset of SR and adding any subset obtained in this way to SR.
  • The set SR together with all the intersections from the previous step is then the set of right factors of L.
  • In order to obtain the left factors, we can compute the right quotients of L.
  • These are sets of the form Ly1, for yΣ. Now, these are again only finitely many, and for xy, we have Ly1=Lx1 if and only if for all uΣ, uxLuyL, that is they can be prefixed to words in the language with precisely the same set of strings.
  • To compute Lx1, consider those states q in A such that x is contained in the future of q. The union of the pasts of those states constitute one right quotient. Find all these quotients.
  • You know you are done when you have found as many left factors as you have right factors.
  • Find those pairs of left and right factors X,Y such that XYL. This is FL.

  1. The Universal Automaton by Lombardy and Sakarovitch (in Texts in Logic and Games, Vol 2: Logic and Automata: History and Perspectives, 2007)

3
Nice! Let's note that AB is decidable for regular languages and that these factors X, Y end up being regular due to closure properties. Hence we can not only effectively compute the last bullet in the summary, but we can also filter out the maximal pairs.
Raphael
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.