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

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

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