Understanding Grammar #2: Ambiguity, Elimination, and Boolean Expressions

AI Thread Summary
The discussion revolves around two grammars: the first generates strings like (a,a) and (a,(a,a)), while the second defines boolean expressions with constructs like "or," "and," and "not." Participants question the ambiguity of the second grammar and seek methods to eliminate it, as well as ways to prove it generates all boolean expressions. Clarifications are requested regarding notation, such as the use of symbols for logical operations and the meaning of parentheses in programming. The conversation emphasizes understanding the definitions of ambiguity and terminals in the context of grammar rules.
magneeto
Messages
6
Reaction score
0
what langugage??

grammar #1:

S->(L)|a
L->L,S|S

what language does this grammar generate? some strings generated by this grammar r (a,a), (a,(a,a))...

grammmar #2:

bexpr->bexpr or bterm| bterm
bterm-> bterm and bfactor| bfactor
bfactor-> not bfactor| (bexpr) | true | false

is this grammar ambiguous? if so then why?
is there any way to eliminate ambiguity?
how do i show that this grammmar generates all boolean expressions? i can see it but how do i proceed to prove it?
 
Computer science news on Phys.org
when you type L,S do you mean LS
and when you type or and and are you using the booleans | and &
(|| and &&,the hat and the v whichever notation you like )
what do teh brackets () normally represent in programming
ask your self what is an ambiguity and what are "terminals"
what do the rules bexpr and bterm attempt represent
how does one normally write boolean logic?? or concatenate sets of booleans
 
",","()","a" are all terminals and "|" is not the logical or . it is the or for regular expressions(either expr1 or expr2)
 
Thread 'Urgent: Physically repair - or bypass - power button on Asus laptop'
Asus Vivobook S14 flip. The power button is wrecked. Unable to turn it on AT ALL. We can get into how and why it got wrecked later, but suffice to say a kitchen knife was involved: These buttons do want to NOT come off, not like other lappies, where they can snap in and out. And they sure don't go back on. So, in the absence of a longer-term solution that might involve a replacement, is there any way I can activate the power button, like with a paperclip or wire or something? It looks...
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Back
Top