Extension to CFG, what is it?

后端 未结 3 804
说谎
说谎 2021-01-05 08:17

Consider the following extension to context-free grammars that permits rules to have in the left-hand side, one (or more) terminal on the right side of the non-terminal. Tha

3条回答
  •  春和景丽
    2021-01-05 08:38

    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.

提交回复
热议问题