Formal algorithm that accepts two finite automatons and outputs finite automaton

121 Views Asked by At

Formally, I have

Language $L_1 \subseteq \{a,b,c\}^*$

Language $L2 \subseteq \{0,1\}^*$

and a function $bin: \{a,b,c\}^* \to \{0,1\}^*$ defined as follows $$bin(\epsilon) = \epsilon$$ $$bin(a) = 00$$ $$bin(b) = 01$$ $$bin(c) = 11$$

I am supposed to design and formally write down an algorithm that accepts two finite automatons (that may be non-deterministic) $M_1 = (Q_1, \{a,b,c\}, \delta_1, q_{01}, F_1)$ and $M_2 = (Q_2, \{0,1\}, \delta_2, q_{02}, F_2)$ and outputs one finite automaton $M_f$ where $L(M_f) = \{ w \mid w \in L(M_1) \wedge bin(w) \in L(M_2)\}$.

Where:

$w$ is string that is contained in language L, generated (or accepted?) by automaton $M_f$.

$\wedge$ stands for conjunction

What is the approach I apply for this task? I searched the internet for possible algorithms and I always end up empty handed, mainly because there is that $bin(.)$ function in the resulting $L(M_f)$ description.

Could anyone please hint me up on where to start with task like this?

1

There are 1 best solutions below

4
On BEST ANSWER

As @DanielV said, this is just an intersection. However it is a bit more complicated since the two automaton do not have the same input alphabet.

There are two possible strategies to answer your problem: The first is to directly build $M_f$ it can be messy but it is doable. The second strategy, a bit longer but easier is to compute an automaton $M_2'$ such that $L(M_2')=\{w\in\{a,b,c\}^*\mid bin(w)\in L(M_2)\}$. And then build $M_f$ as the intersection of $M_1$ and $M_2'$.

Do you think you can design such $M_2'$? If not please ask, I would give you some more hints.

Edit: Hint to build $M_2'$

Consider the automaton $M_2'=(Q_2\cup (Q_2\times\{0,1\}),\delta,q_{02},F_2)$ with: $\forall q\in Q_2$, $$\delta(q,\epsilon)=(\delta_2(q,0),0)$$ $$\delta(q,\epsilon)=(\delta_2(q,1),1)$$ $$\delta((q,0),a)=\delta_2(q,0)$$ $$\delta((q,0),b)=\delta_2(q,1)$$ $$\delta((q,1),c)=\delta_2(q,1)$$

Can you show that $L(M_2')=\{w\in\{a,b,c\}^*\mid bin(w)\in L(M_2)\}$?