Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

What langugage?

  1. Mar 9, 2006 #1
    what langugage??

    grammar #1:


    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?
  2. jcsd
  3. Mar 10, 2006 #2
    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
  4. Mar 10, 2006 #3
    ",","()","a" are all terminals and "|" is not the logical or . it is the or for regular expressions(either expr1 or expr2)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook