Question about formal languages, quotient operator $L_1/L_2$.

632 Views Asked by At

I come across this problem:
Consider the following regular languages:

$L_1= a^*b^*c^*$ over the alphabet $A=\{a,b,c\}$ and

$L_2= ( a b | b b | a )^*$ over the same alphabet as above.

Find the shortest strings (length $<5$) belonging to the regular language $L_3= L_1/L_2 (L_1-L_2)$.

I'd try this way:

  1. find all the shortest $L_2$ strings.

  2. find all the shortest $L_1$ string which suffix belongs to $L_2$.

  3. erase the suffix from $L_1$ strings at point 2.

Performing this algorithm, do I find all the $L_1/L_2$ strings ?
Thanks.

1

There are 1 best solutions below

1
On

If the length is < 5, then you can just enumerate all the strings consisting of a, b and c and for each,

  1. check if it is in L1
  2. if yes, check if it is in L2
  3. if no, it belongs in to L3.

suffixes don't enter the question here.