Why a rule markup language needs a rich syntax (looking in the RIF Core...)

Looking to the RIF Core Working Draft it is easy to discover that one of the goals is to be as general as possible.

But is this an advantage of the language?

Lets examine the Const element.

Const is designed to capture all symbols which logically are constants, predicate names and function names

Here is a fragment from the RIF Core document:

"The application of a symbol from Const to a sequence of terms is called Uniterm ("Universal term") since it can be used to play the role of a function term or an atomic formula depending on the syntactic context in which the application occurs." (Section Concrete Syntax)

But XML itself is designed to capture meaning. Then why not enrich the syntax to capture explicitely the meaning of different content?

The following example is from the RIF Core document (Example 2):

<Uniterm>
 <Const>purchase</Const>
 <Var>Buyer</Var>
 <Var>Seller</Var>
 <Uniterm>
  <Const>book</Const>
  <Var>Author</Var>
  <Const>LeRif</Const>
 </Uniterm>
 <Const>$49</Const>
</Uniterm>

Here Const capture all symbols predicate name, function name, constant name

From the document we read that Const has an optional attribute type which is supposed to encode the type of the content of Const. The types are explained in Section Multisorted Syntax and more or less is about some XML dataypes and the type URI.

What is the type of the content $49 ?

XML Schema datatpes does not define the type Currency since this is not a datatype therefore we can encode this may be as a number

 <Const type="xs:int">$49</Const>

Clearly this is a unusual encoding in business rules since does not capture the the meaning of Currency.

The solution is to specialize the Const construct in PredicateName, FunctionName, IndividualName and Literal even the content of these elements may overlap.

Recall that XML syntax is designed to capture meaning. But in the lack of syntax from the RIF Core make this almost impossible. Lets write some examples:

I guess (since syntax does not help me) the following construct is incorrect:

Example 1

<Uniterm>
 <Const type="xs:int">20</Const>
 <Var>Buyer</Var>
 <Var>Seller</Var>
<Uniterm>

If we specialize Const then such examples will be not possible.

I guess (again! ) that the following constructs are different:

Example 2

<Uniterm>
 <Const>purchase</Const>
 <Var>Buyer</Var>
 <Var>Seller</Var>
 <Uniterm>

<Uniterm>
 <Const>purchase</Const>
 <Var>Seller</Var>
 <Var>Buyer</Var>
 <Uniterm>

I guess is better to use role names to capture arguments i.e.

<Uniterm>
 <Const>purchase</Const>
 <arguments>
  <Var>Buyer</Var>
  <Var>Seller</Var>
 </arguments>
<Uniterm>

I don't know what is this construct:

Example 3

<Uniterm>
 <Var>Seller</Var>
 <Const>purchase</Const>
 <Var>Buyer</Var>
 <Uniterm>

May be if we use an attribute to capture the name of the Uniterm is better:

<Uniterm name="purchase" >
 <arguments>
  <Var>Buyer</Var>
  <Var>Seller</Var>
 </arguments>
 <Uniterm>

What is the type in Const in the example below? The type attribute is optional but not restricted by the syntax to be used.

Example 4

<Uniterm>
 <Const type="??????">purchase</Const>
 <Var>Buyer</Var>
 <Var>Seller</Var>
 <Uniterm>

I guess after the syntax improvements this is no longer possible since the XML datatypes can be attached just to literals.

Actual RIF syntax is too far to encode real rules in a proper manner and with low cost for the translators (as in its requirements)...