CFG

Soru: Aşağıda küme tanımı verilen dillere ait context free grammer leri elde edin.

Dillerin tanımlı olduğu alfabe={0,1}

a-) L1={w| w en az 3 tane 1 içerecek}

b-) L2={w|w uzunluğu tek ve ortadaki sembol 0 olacak}

Çözüm:

a-)

G=<Vn,Vt,P,S>

Vn={S,R}

Vt={0,1}

P:

    S –> R1R1R1R

    R –> 0R | 1R | e

e=epsilon

——————————–

b-)

G=<Vn,Vt,P,S>

Vn={S}

Vt={0,1}

P:

    S –> 0 | 0s0 | 0s1 | 1S0 | 1S1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.