OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(slight correction) Re: Are we losing out because of grammars?



(Sorry, the rules I sent had a lot of errors, so I am sending them again. I
apologise for not being a robot.)

Off the top of my head,  grammars like
   ( a, (a |b)*, c, (a, b)+, b )+
are pretty hard to model completely.  One can easily infer the rules

  - there can only be a, b, c
        test="count(*) = count(a)+count(b)+count(c)"
     inferred by counting elements
  - there must be at least 1 c, at least 2 b, and at least 2 a
       test="c"  test="count(b) > 1" test="count(a) >1"
      inferred by counting required elements
  - it must start with a and end with a b
       test="*[1][self::a]"  test="b[not(next-sibling::*)]"
     inferred by looking at the start start and tracing from the end state
  - c must be followed by a
       test="count(c[next-sibling::a]) = count(c)"
    inferred by making lists of allowed following elements (is this
Warshall's closure?)
  - there must be a sequence of  cab and abb
       test="c[next-sibling::a[next-sibling::b]]"
       test="c[next-sibling::b[next-sibling::b]]"
    inferred by tracing required sequences.

Cheers
Rick Jelliffe