Can You Convert a Context-Free Grammar to a Deterministic One?

  • Context: MHB 
  • Thread starter Thread starter evinda
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the conversion of a context-free grammar into a deterministic grammar. Participants are examining a specific context-free grammar and attempting to propose modifications to achieve determinism.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant presents a context-free grammar and their attempt at converting it to a deterministic grammar, asking for feedback on its correctness.
  • Another participant acknowledges that the proposed conversion is "almost right" but questions whether certain strings, like "cdadd," are allowed in the modified grammar.
  • A subsequent reply seeks clarification on the proposed changes and reiterates the concern about the original language's restrictions compared to the modified version.
  • There is a challenge regarding the acceptance of specific strings in the original versus the modified grammar, indicating potential flaws in the conversion process.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correctness of the proposed grammar modifications, and there is disagreement regarding the acceptance of certain strings in the original and modified grammars.

Contextual Notes

The discussion highlights the complexities involved in ensuring that the modified grammar accurately reflects the constraints of the original language, particularly regarding string acceptance.

evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Blush)

I have a context-free grammar,that I want to convert in a deterministic one.

This is the context-free grammar:

I -> cdaX|cdbY, X-> XXX |d , Y -> I | X

That's what I have tried:



I -> cdK , K ->aX | bY
X -> dM, M -> d M |N, N-> dN | ∅
Y ->cdK| dM

Is it right? Or have I done something wrong? (Thinking)
 
Last edited:
Technology news on Phys.org
evinda said:
Hello! (Blush)

I have a context-free grammar,that I want to convert in a deterministic one.

This is the context-free grammar:

I -> cdaX|cdbY, X-> XXX |d , Y -> I | X

That's what I have tried:



I -> cdK , K ->aX | bY
X -> dM, M -> d M |N, N-> dN | ∅
Y ->cdK| dM

Is it right? Or have I done something wrong? (Thinking)

Hi!

It is almost right. (Worried)

Is for instance [m]cdadd[/m] allowed? (Wondering)
 
I like Serena said:
Hi!

It is almost right. (Worried)

Is for instance [m]cdadd[/m] allowed? (Wondering)

Do you mean that it should be like that?

I -> cdK , K ->aX | bY
X -> dM, M -> d M | ∅
Y ->cdK| dM

?
(Thinking)
 
evinda said:
Do you mean that it should be like that?

I -> cdK , K ->aX | bY
X -> dM, M -> d M | ∅
Y ->cdK| dM

?
(Thinking)

No... my point was that the original language does not allow [m]cdadd[/m], while your languages both do. (Doh)
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 119 ·
4
Replies
119
Views
16K