Тёмный

Context-Free Grammar (CFG) Example: 0*1* 

Подписаться
Просмотров 2,9 тыс.
% 33

Here we create a context-free grammar for the language 0*1*; the purpose of this example is to show why more than one variable is sometimes needed. I realized after I recorded this video that in this case, we could modify the second rule to be S goes to S1, which will guarantee to make the 1s at the end, and does not interfere with the first rule. So another CFG for this would be S goes to 0S | S1 | epsilon. (What I made in the video is called a *regular grammar*, but since we only need to make a context-free grammar, we are not limited by any restriction of where terminals/variables/etc. are.)
Easy Theory Website: www.easytheory.org
Discord: discord.gg/SD4U3hs
If you like this content, please consider subscribing to my channel: ru-vid.com/show-UC3VY6RTXegnoSD_q446oBdg
▶ABOUT ME◀
I am a professor of Computer Science, and am passionate about it. I have taught many courses at several different universities, including several sections of undergraduate and graduate theory-level classes.
The views expressed in this video are not reflective of any of my current or former employers.

Опубликовано:

 

30 июл 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@Edigor100
@Edigor100 2 года назад
CFG videos a day before my exam, perfect! thank you
@EasyTheory
@EasyTheory 2 года назад
Best of luck!
@AdityaKumar-js6ye
@AdityaKumar-js6ye Год назад
really amazing and helpful, thanks
@ar3568row
@ar3568row Год назад
Anything wrong with S -> 0S | S1 | € ?