178k views
4 votes
Find con-free grammars for the following languages (with n > 0, m0, k 20).

a) L = {n= m or m ≤ k}
b) L = {n = m or m ≠k}
c) L = {k = n + m}
d) L = { n + 2m = k}

User Thebitguru
by
8.0k points

1 Answer

2 votes

Final answer:

To find con-free grammars for the given languages, we can represent each language with a context-free grammar.

Step-by-step explanation:

To find con-free grammars for the given languages, let's go through each one:

a) L = {n = m or m ≤ k}

This language can be represented by the following context-free grammar:

  • S → n=M | M ≤ K

b) L = {n = m or m ≠ k}

This language can be represented by the following context-free grammar:

  • S → n=M | M ≠ K

c) L = {k = n + m}

This language can be represented by the following context-free grammar:

  • S → k = n + M

d) L = { n + 2m = k}

This language can be represented by the following context-free grammar:

  • S → n + 2M = k

User Yamira
by
7.1k points