asn06 take 2 (Abstract Syntax as a kind of ontology?)

Thinking more about the abstract syntax question, I find myself
wondering how an abstract syntax is really different from an ontology.
Is there any practical difference between an ontology of Horn rules and
an abstract syntax for Horn rules?  My sense is that an abstract syntax
is a kind of ontology which is not very thoroughly axiomatized,
providing pretty much just subclass, domain, range, and cardinality
information.

If this is true, then OWL is a probably a good way to write down our
abstract syntax for RIF.

To recap the earlier discussion, the motivations I saw for using asn06
instead of BNF were:

  1. BNF imposes an order on the symbols in each production.

     You can work around this with disjunction (alternates):

         a ::= b c | c b

     but this gets very clumsy, obscuring the real design and purpose
     of the grammar.   Of course BNF can be extended to include some
     kind of "order doesn't matter" operator like

         a ::= b & c

     but then we are moving away from normal BNF. 

     We may have to decide whether heads are transmitted before or
     after bodies, but the idea of an abstract syntax is to keep such
     decisions localized to a part of the specification which deals
     with concrete syntax issues.

  2. Normal BNF includes terminals like parentheses, keywords, and
     infix operators, since it is used to describe real languages --
     languages which one needs to be able to parse unambiguously.  

     These parts are irrelevant for an XML serialization, and for any
     non-xml concrete syntax they should be decisions localized to the
     specification of that particular concrete syntax.

     If we just use BNF "loosely" so it doesn't actually describe a
     real parsable language, we're likely to confuse people who are
     familiar with BNF, since we're misusing it.

  3. BNF obscures the differences between classes and properties.
     When is the name of a non-terminal the name of a class, and when
     is it the name of a role?

     An example [1]

          Rule ::=  Head :- Body
          Head ::=  expr
          Body ::=  expr

     shows "Rule" and "expr" being class names, but "Head" and "Body"
     being role names.  Again, BNF can be used this way, but it's
     cumbersome to introduce extra productions and it's imprecise
     because its not always clear the extra productions are given to
     provide role names.  It is possible to use uppercase names for
     classes and lowercase names for role (properties); it's also
     possible to "stripe" everything -- to always give role names --
     but it's still verbose.

  4. Extending the language described by a BNF grammar requires
     inserting a disjunction (alternate) into a production.  In the
     asn06 model, it requires adding a new production (subclass).
     Arguably it's simple to think of an extension as just adding
     things (in any order), rather than as changing something.

     To say that differently, when you're have a spot in the syntax
     where a "Foo" can go, do you want to say "a Foo can be a RedFoo,
     a BlueFoo, or a GreenFoo", or do you want to say "a RedFoo is a
     Foo, a BlueFoo is a Foo, and a GreenFoo is a Foo."  The latter
     form seems preferable when you're expecting new subclasses of Foo
     to come along -- it doesn't suggest we're done listing the
     subclasses.

Thinking over all this, I'm left with the conclusion that we can
just use OWL as the meta-language -- we can use OWL to declare what
parts a Horn rule has, etc.

To play with this idea, I've been playing with transcribing Harold's
EBNF into OWL [2] and then programmatically turning it into asn06 and
(for folks who still want to use it despite the above reservationse)
EBNF.  In other words, one can see asn06 as a concrete syntax for a
sublanguage of OWL.  (That makes it a much less important tool and one
that can easily use along side others.)

        - Sandro

[1] http://lists.w3.org/Archives/Public/public-rif-wg/2006Nov/0074
[2] http://www.w3.org/2006/11/rif-core#      (not done yet)

Received on Tuesday, 21 November 2006 06:46:31 UTC