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)
 
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...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
i am customizing a Linux distro [arch] into love os which I am building to impress my crush. I had an idea to integrate an ai model into the Linux system so it can speak like me but romantically. but I don't know what or how to do. I don't know the basic concept of Linux but yet I am customizing my os purely relying on chat gpt and perplexity. when i ask chat gpt about this it said to fine tune an ai model and integrate to the Linux distro and my friend said for the data to be fed to the ai...
Back
Top