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)
 
Well, the date has now passed, and Windows 10 is no longer supported. Hopefully, the readers of this forum have done one of the many ways this issue can be handled. If not, do a YouTube search and a smorgasbord of solutions will be returned. What I want to mention is that I chose to use a debloated Windows from a debloater. There are many available options, e.g., Chris Titus Utilities (I used a product called Velotic, which also features AI to prevent your computer from overheating etc...
I have been idly browsing what Apple have to offer with their new iPhone17. There is mention of 'Vapour cooling' to deal with the heat generated. Would that be the same sort of idea that was used in 'Heat Pipes' where water evaporated at the processor end and liquid water was returned from the cool end and back along a wick. At the extreme high power end, Vapour Phase Cooling has been used in multi-kW RF transmitters where (pure) water was pumped to the Anode / or alternative Collector and...
Back
Top