Example of Non-Linear, UnAmbiguous and Non-Deterministic CFL?

前端 未结 1 2039
無奈伤痛
無奈伤痛 2020-11-29 10:04

In the Chomsky classification of formal languages, I need some examples of Non-Linear, Unambiguous and also Non-Deterministic Context-Free-Language(N-CFL)?

相关标签:
1条回答
  • 2020-11-29 10:31

    "IN CONTEXT OF CHOMSHY CLASSIFICATION OF FORMAL LANGUAGE"

    (1) L3 = {wwR | w ∈ {a, b}* }

    • Language L3 is a Non-Deterministic Context Free Language, its also Unambiguous and Liner language.

    (2) Lp is language of parenthesis matching. There are two terminal symbols "(" and ")".
    Grammar for Lp is:

    S → SS
    S → (S)
    S → ()   
    
    • This language is nonlinear, deterministic and unambiguous too.

    Language L that is union of Lp and L3 is unambiguous, nonlinear (due to Lp), and non-deterministic (due to L3) (Assuming language symbols for both languages are different).

    This Language is an example of language in Venn-diagram for which I marked ??.

    Also the correct diagram is below:

    An ambiguous context free language also be a liner context free

    dcf

    0 讨论(0)
提交回复
热议问题