This is my homework.
Exercise 3: Find the correct grammar for the language L = { | n + m is an odd number}. Show how you get it.
Ask a question, how can I get an answer. So here is my explanation.
Build DFA From DFA, we got S → aA | bA A → aS | bS | null Therefore, the regular grammar is G = {V, T, S, P}, where V = {S, A} - T = {a, b} - P = {S → aA | bA, A → aS | bS | null}
However, the following question:
Build a DFA that accepts the grammar-generated language in Exercise 3. Simplify the built-in DFA, if possible.
, , DFA 3. , DFA. , .
.
DFA , grammar. , , , DFA, . DFA, , DFA .
, DFA : DFA a^n b^m, n+m odd. , , a b : ababa.
a^n b^m, n+m odd
a
b
ababa
:
S -> 'a' L2 -> 'b' B2 L1 -> 'a' L2 -> 'b' B2 L2 -> 'a' L1 -> 'b' B1 B1 -> 'b' B2 B2 -> \empty -> 'b' B1
S
L1
L2
B1
B2
DFA.
DFA - . , DFA, .
, DFA . - :
state s state' ------ - ------ even_a a odd_a even_a b odd_b odd_a a even_a odd_a b even_b even_b a dead even_b b odd_b odd_b a dead odd_b b even_b dead a dead dead b dead
. , "odd_a" "odd_b" .
Source: https://habr.com/ru/post/1614475/More articles:FastLanes Perform the sh action in the root folder of the Xcode project - iosGoogle OAuth в ASP.NET 5 MVC 6 - asp.netКак отобразить красивую пунктирную границу в таблице? - htmlIncluding jython github plugin in Wordpress - jqueryReactJS - reaction-router history receives warning - javascriptEntity Framework 7 and SQLite tables do not create - c #Тип Script: Array vs Object [] - javascriptSpecifying a file name as a variable in an infile statement - sasPostgreSQL: Capturing NOTIFICATIONS FROM USER CONNECTION from a client connection through ZeosLib / Lazarus - postgresqlIndented multi-line strings - ruby | fooobar.comAll Articles