Results 1 to 2 of 2
  1. #1
    dragstang86 is offline Member
    Join Date
    Jun 2011
    Posts
    46
    Rep Power
    0

    Default Pairwise disjointness test help

    Determine whether the following grammar is an LL grammar by performing the pairwise disjointness test, showing the FIRST sets of each RHS of each nonterminal:

    A -> aB | b | CBB
    B -> aB | bA | aBb
    C -> aaA | b | caB

    In the above productions upper case letters are nonterminals and lower case letters are terminal symbols.

    I am trying to get a better understand of how this works and not sure if I am completely understanding. What I am thinking...

    {a,b} and {a,b,a} and {a,b,c} and since all share the first two terminals they are not disjoint thus it fails the pairwise disjoint test and is not an LL grammar.

    Is this correct and for the reasons I think it is? I haven't been able to find an example/explanation that is clear to me. I'd like a better explanation of the rules so I better understand. Thanks for any help you all can offer!

  2. #2
    dragstang86 is offline Member
    Join Date
    Jun 2011
    Posts
    46
    Rep Power
    0

    Default Re: Pairwise disjointness test help

    actually after some more reading I think it should be:

    {a,b} and {a,b,a}
    {a,b,a}
    {a,b,c} and {a,b}

    I think this still fails because {a,b} is contained in A and C and {a,b,a} is contained in A and B. I am still unsure of all the rules and reasoning so any guidance would be greatly appreciated!

Similar Threads

  1. Is it possible to test for NaN?
    By AJArmstron@aol.com in forum New To Java
    Replies: 7
    Last Post: 05-07-2010, 02:22 AM
  2. Replies: 0
    Last Post: 04-05-2008, 12:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •