简体   繁体   English

非线性,非确定性和非确定性CFL的例子?

[英]Example of Non-Linear, UnAmbiguous and Non-Deterministic CFL?

In the Chomsky classification of formal languages, I need some examples of Non-Linear, Unambiguous and also Non-Deterministic Context-Free-Language(N-CFL)? 在形式语言的乔姆斯基分类中,我需要一些Non-Linear, Unambiguous and also Non-Deterministic上下文语言(N-CFL)的例子?

  1. Linear Language : For which Linear grammar is possible( ⊆ CFG) eg 线性语言可以使用线性语法 (⊆CFG),例如
    L 1 = {a n b n | L 1 = {a n b n | n ≥ 0 } n≥0}

  2. Deterministic Context Free Language(D-CFG) : For which Deterministic Push-Down-Automata(D-PDA) is possible eg 确定性上下文无关语言(D-CFG) :确定性下推自动机(D-PDA)是可能的,例如
    L 2 = {a n b n c m | L 2 = {a n b n c m | n ≥ 0, m ≥ 0 } n≥0,m≥0}
    L 2 is unambiguous. L 2是明确的。

A CF grammar that is not linear is nonlinear . 非线性的 CF语法是非线性的
L nl = {w: n a (w) = n b (w)} is also a Non-Linear CFG . L nl = {w:n a (w)= n b (w)}也是非线性CFG

-- 3. Non-Deterministic Context Free Language(N-CFG) : For which only Non-Deterministic Push-Down-Automata(N-PDA) is possible eg - 3. 非确定性上下文无关语言(N-CFG)only Non-Deterministic Push-Down-Automata(N-PDA)是可能的,例如
L 3 = {ww R | L 3 = {ww R | w ∈ {a, b} * } w∈{a,b} * }
L 3 is also Linear CFG. L 3也是线性CFG。

--4. --4。 Ambiguous CFL : CFL for which only ambiguous CFG is possible 模糊CFL :CFL only ambiguous CFG is possible
L 4 = {a n b n c m | L 4 = {a n b n c m | n ≥ 0, m ≥ 0 } U {a n b m c m | n≥0,m≥0} U {a n b m c m | n ≥ 0, m ≥ 0 } n≥0,m≥0}
L 4 is both non-linear and Ambiguous CFG And Every Ambigous CFL \\subseteq N-CFL. L 4既是非线性的又是模糊的CFG和每个Ambigous CFL \\ subseteq N-CFL。

My Question is: 我的问题是:
Whether all non-linear, Non-Deterministic CFL are Ambiguous? 是否所有非线性,非确定性CFL都是不明确的? If not then I need a example that is non-linear, non-deterministic CFL and also unambiguous? 如果没有那么我需要一个非线性,非确定性CFL的例子,也是明确的?

Given Venn-diagram below: 给出下面的维恩图:

在此输入图像描述

Also asked here 还问这里

"IN CONTEXT OF CHOMSHY CLASSIFICATION OF FORMAL LANGUAGE" “在形式语言的CHOMSHY分类的背景下”

(1) L 3 = {ww R | (1) L 3 = {ww R | w ∈ {a, b} * } w∈{a,b} * }

  • Language L 3 is a Non-Deterministic Context Free Language, its also Unambiguous and Liner language. 语言L 3是非确定性上下文自由语言,也是非明确和线性语言。

(2) L p is language of parenthesis matching. (2) L p是括号匹配的语言。 There are two terminal symbols "(" and ")". 有两个终端符号“(”和“)”。
Grammar for L p is: L p的语法是:

S → SS
S → (S)
S → ()   
  • This language is nonlinear, deterministic and unambiguous too. 这种语言也是非线性的,确定性的和明确的。

Language L that is union of L p and L 3 is unambiguous, nonlinear (due to L p ), and non-deterministic (due to L 3 ) (Assuming language symbols for both languages are different). 作为L p和L 3的并集的语言L是明确的,非线性的(由于L p ),并且是非确定性的(由于L 3 )(假设两种语言的语言符号不同)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM