Originally posted by: GodlessAstronomer
I don't understand the question. Which are terminal/non-terminal? In my classes we used capital letters for non-terminals and small letters for terminals, eg.
As -> sAss
Originally posted by: txrandom
Originally posted by: GodlessAstronomer
I don't understand the question. Which are terminal/non-terminal? In my classes we used capital letters for non-terminals and small letters for terminals, eg.
As -> sAss
Oops,
they are both non-terminals, so it should be :
IJ => IIJJJ
IK => IIJJK
Originally posted by: GodlessAstronomer
Originally posted by: txrandom
Originally posted by: GodlessAstronomer
I don't understand the question. Which are terminal/non-terminal? In my classes we used capital letters for non-terminals and small letters for terminals, eg.
As -> sAss
Oops,
they are both non-terminals, so it should be :
IJ => IIJJJ
IK => IIJJK
In that case the answer seems to be ambiguous, I'm not sure how you'd answer the question. If you wanted to simplify the rule set you could have ambiguous results, like
I -> IIJ
J -> JJ
or
I -> II
J -> JJJ
It's been a few months since I've done these things, maybe my thinking is all wrong, but I don't think the problem is solvable unambiguously. Have you posted all of the CFG rules?
Edit - to answer the question in the OP, I believe you are allowed to have multiple non-terminals on the LHS as long as the rule set can be simplified such that each rule has a single non-terminal on the LHS.
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
Originally posted by: txrandom
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
Formal Language
CFG
Originally posted by: AstroManLuca
Originally posted by: txrandom
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
Formal Language
CFG
Well maybe this should be in programming or something then.
Originally posted by: txrandom
Originally posted by: GodlessAstronomer
Originally posted by: txrandom
Originally posted by: GodlessAstronomer
I don't understand the question. Which are terminal/non-terminal? In my classes we used capital letters for non-terminals and small letters for terminals, eg.
As -> sAss
Oops,
they are both non-terminals, so it should be :
IJ => IIJJJ
IK => IIJJK
In that case the answer seems to be ambiguous, I'm not sure how you'd answer the question. If you wanted to simplify the rule set you could have ambiguous results, like
I -> IIJ
J -> JJ
or
I -> II
J -> JJJ
It's been a few months since I've done these things, maybe my thinking is all wrong, but I don't think the problem is solvable unambiguously. Have you posted all of the CFG rules?
Edit - to answer the question in the OP, I believe you are allowed to have multiple non-terminals on the LHS as long as the rule set can be simplified such that each rule has a single non-terminal on the LHS.
S -> IJK | e
I -> ab
J -> a
K-> b
IJ -> IIJJJ
IK -> IIJJK
JK -> KK | JJ
I'm trying to model the language (ab)^i a^j b^k where 2i = j + k. I'm mainly having trouble with figure out how to make sure the a^j and b^k stay in order (a's followed by b's).
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
I think the concepts are used in yacc...Originally posted by: GodlessAstronomer
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
:laugh: It's not really programming, it's esoteric computer science stuff. It's the kind of thing you learn, pass an exam then never touch again in most cases. I'm glad I passed that exam and never have to deal with them.
Originally posted by: GodlessAstronomer
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
:laugh: It's not really programming, it's esoteric computer science stuff. It's the kind of thing you learn, pass an exam then never touch again in most cases. I'm glad I passed that exam and never have to deal with them.
Originally posted by: txrandom
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
Formal Language
CFG
Originally posted by: fulltilt39
Originally posted by: GodlessAstronomer
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
:laugh: It's not really programming, it's esoteric computer science stuff. It's the kind of thing you learn, pass an exam then never touch again in most cases. I'm glad I passed that exam and never have to deal with them.
oohhhh...like calculus!! i get it.
Originally posted by: AstroManLuca
Seriously, what the fuck are you guys talking about? Is this some sort of programming thing that I will never in a million years understand? Is this entire thread some joke that I'm not getting?
