W3C home > Mailing lists > Public > public-rif-wg@w3.org > April 2008

Re: ISSUE-51: Another possible compromise for metadata syntax

From: Christian de Sainte Marie <csma@ilog.fr>
Date: Mon, 28 Apr 2008 15:24:49 +0200
Message-ID: <4815D021.8000905@ilog.fr>
To: Chris Welty <cawelty@gmail.com>
CC: Sandro Hawke <sandro@w3.org>, Jos de Bruijn <debruijn@inf.unibz.it>, public-rif-wg@w3.org
All,

Since I like diagrams, esp. when it comes to compare designs, I tried 
and translated all these syntaxes into UML-like diagrams (which leads me 
to propose a new solution, in the end).

The rule part of BLD as it was published in WD2 is diagram-1 (I put ??? 
when the XML syntax does not give the role a name).

Chris Welty wrote:
> 
> The current BLD draft shows:
> 
>   Document  ::= 'Document' '(' IRIMETA? DIRECTIVE* Group? ')'
>   Group     ::= 'Group' IRIMETA? '(' (RULE | Group)* ')'

Shown on diagram 2 (without the DIRECTIVE, which I leave out in all the 
folowwing diagrams as well).

> [ChrisW] suggest[s] something like:
> 
>   Document  ::= 'Document' '(' IRIMETA? DIRECTIVE* (Group | Rule)* ')'
>   Group     ::= 'Group' IRIMETA? '(' (RULE | Group)* ')'
>   Rule      ::= 'Rule' IRIMETA? '(' RULE ')'

Diagram 3. On the diagram, I had to make explicit the abstract class 
that is common to Group and Rule; I called it ITEM. So, what the diagram 
really show is (I attached the 'meta' association to the abstract ITEM 
to make for readibility purposes):

   Document ::= 'Document' '(' IRIMETA? DIRECTIVE* ITEM* ')'
   ITEM     ::= [ Rule | Group ]
   Group    ::= 'Group' IRIMETA? ITEM*
   Rule     ::= 'Rule' IRIMETA? '(' RULE ')'
   RULE     ::= [ 'Forall' Var+ '(' CLAUSE ')' | CLAUSE ]

> Also, *as a different point*, if we keep this I would suggest modifiying 
> the Group production so that you don't have to type 'Group' for every 
> repeated rule within a group, something like:
> 
>   Group     ::= 'Group' IRIMETA? '(' (RULE* | Group)* ')'

I do not understand this: your initial production allows 0 to many RULEs 
in a Group without having to loop through the Group construct (and, 
thus, without having to type 'Group' for each new RULE?

However, your proposal raises two questions:

1. do we really want some implementation to produce a RIF document where 
the RULEs are all 'Forall' or CLAUSE 'sentence's in a 'Group', whereas 
another implementation, for the same set of rules, would produce a 
document where the would all be 'Rules' directly 'contain'ed in the 
Document (e.g. in the case where there are no subgrouping of rules in 
the original set)?

2. do we want all facts (heads without a body - was the Talking Heads 
group about facts, btw?) to have to be labelled 'Rule'? After all, that 
was why CLAUSEs where introduced: to separate rules properly said from facts

One way to avoid both would be to allow Groups to contain ITEMs, not 
RULEs or other FORMULAs directly (diagram 4):

   Document ::= 'Document' '(' IRIMETA? DIRECTIVE* ITEM* ')'
   ITEM     ::= [ Rule | Fact | Group ]
   Group    ::= 'Group' IRIMETA? ITEM*
   Rule     ::= 'Rule' IRIMETA? '(' RULE ')'
   RULE     ::= [ 'Forall' Var+ '(' Implies ')' | Implies ]
   Fact     ::= ATOMIC

Wouldn't that last version satisfy everybody? And we can even get rid of 
the CLAUSE production :-)

(NB: if we want to all universally quantified facts, we only need to 
associate Fact to a new abstract FACT as a formula, instead of ATOMIC 
directly, where FACT ::= [ 'Forall' Var+ '(' ATOMIC ')' | ATOMIC ])

Cheers,

Christian



Diagram_1__BLD_RULE_.jpg
(image/jpeg attachment: Diagram_1__BLD_RULE_.jpg)

Diagram_2__BLD_cum_documento_.jpg
(image/jpeg attachment: Diagram_2__BLD_cum_documento_.jpg)

Diagram_3__ChrisW_.jpg
(image/jpeg attachment: Diagram_3__ChrisW_.jpg)

Diagram_4__BLD_with_Rule_and_Fact_.jpg
(image/jpeg attachment: Diagram_4__BLD_with_Rule_and_Fact_.jpg)

Received on Monday, 28 April 2008 13:26:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:33:48 GMT