Extension to CFG, what is it?

耗尽温柔 提交于 2019-11-30 19:44:15

Here's a partial answer:

The grammar is within type 0. A context-sensitive grammar (type-1) has rules of the form wAx -> wBx where w and x are strings of terminals and non-terminals, and B is not empty. Note that since B is not empty, |wAx| <= |wBx|. Your grammar has rules of the form Ax -> z where z is a string of terminals and non-terminals and can be empty, and x can be removed. This violates two principles of CSGs.

Unsatisfyingly, I did not answer two things:

  • Is the language generated by your grammar type-1? The grammar is type-0, but that does not mean the language cannot be type-1. For example, regular languages (type-3) can be described by CFGs (type-2).
  • Is the language recursive? This is important since, if so, the language is decidable (does not suffer from the halting problem).

    I'm currently attempting a proof for the second point, but it's probably beyond my ability.

Yup it's type 0 I think. Principle for first 3 types (3, 2 and 1) is that those can't perform reduction. Those are generative only types.

Here you can transform a terminal into epsilon so it's type 0.

To answer my question with respect to Prolog's DCG formalism, this extension is now called a semicontext. See N253 DIN Draft for DCGs 2014-04-08 - ISO/IEC WDTR 13211-3:2014-04-08

Given

a1, [b] --> ... .

a2, [b,b] --> ... .

The terminal-sequence [b] is now a semicontext, as well as the terminal-sequence [b,b].

Would the same terminal sequence now appear at the end of the rule, we would have a context:

a3, [b,b] --> ..., [b,b].

So "semi" means here "half" - similar to a semigroup where half of the algebraic properties of a group hold.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!