Re: languages



"jason_box" <cppisfun@xxxxxxxxx> writes:

Here is the grammar I came up with.

S-> aBa
B-> b | BB | S | lambda

for the gramma L = {a^nb*a^n : a >= 0 }

That is definitely wrong, as you can derive, e.g.:

S => aBa => aBBa => aSBa => aSSa => aaBaSa => aaBaaBaa
=> aabaaBaa => aabaabaa

which is not in the language.

The problem is the production B->S, so drop this and change the
production(s) for S to allow repeated a's.

Torben
.



Relevant Pages

  • Re: languages
    ... another hint. ... Try starting with this production. ... This generates the language ... S->aSa | lambda ...
    (comp.theory)
  • Re: languages
    ... Try starting with this production. ... This generates the language ... S->aSa | lambda ... So from this I know the langage is equal number of a's. ...
    (comp.theory)
  • Re: map/filter/reduce/lambda opinions and background unscientific mini-survey
    ... Python language, while "function" etc are not, but they are certainly ... Just as exposure to functional languages would make lambda very familiar. ... > a letter of the greek alphabet. ... There is nothing about the word "string" that especially brings to mind ...
    (comp.lang.python)
  • Re: Minimal keywords needed for constructing a full CL system
    ... whole universe using lambda ... Remember we're not talking about creating a new language here, ... rather than dumping an image you compile an executable, ... That probably helps a tree shaker very little. ...
    (comp.lang.lisp)
  • Re: Multiline lamba implementation in python.
    ... lot about lambda and found no one of the alternative proposals ... If he's actually interested in a language feature he fixes ... Python returns to the topic every once in a while. ... half of the Python community screamed in Perl Angst. ...
    (comp.lang.python)