Extension to CFG, what is it?

后端 未结 3 783
说谎
说谎 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

    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.

提交回复
热议问题