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

  • Thread starter Thread starter evinda
  • Start date Start date
AI Thread Summary
The discussion centers on converting a context-free grammar into a deterministic one. The original grammar provided is I -> cdaX | cdbY, X -> XXX | d, Y -> I | X. The user attempts a conversion, proposing a new grammar structure with modifications. However, a participant points out that the proposed grammar allows strings like "cdadd," which are not permitted by the original grammar. The conversation highlights the importance of accurately preserving the language generated by the grammar during the conversion process. The need for careful consideration of the language's constraints is emphasized, as the proposed changes inadvertently broaden the language's 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)
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top