Warning:
This wiki has been archived and is now read-only.

BLD Syntax Table

From RIF
Jump to: navigation, search


This page is for example/discussion of possible syntax changes.


Translation of the RIF-BLD Condition Language

The translation between the presentation syntax and the XML syntax of the RIF-BLD Condition Language is specified by the table below. Since the presentation syntax of RIF-BLD is context sensitive, the translation must differentiate between the terms that occur in the position of the individuals from terms that occur as atomic formulas. To this end, in the translation table, the positional and named argument terms that occur in the context of atomic formulas are denoted by the expressions of the form pred(...) and the terms that occur as individuals are denoted by expressions of the form func(...).

The prime symbol (for instance, variable') indicates that the translation function defined by the table must be applied recursively (i.e., to variable in our example).

Presentation Syntax Draft XML Syntax Rigid RDF Concise
And (
  conjunct1
  . . .
  conjunctn
    )
<And>
  <formula>conjunct1'</formula>
   . . .
  <formula>conjunctn'</formula>
</And>
same
<And>
  conjunct1'
   . . .
  conjunctn'
</And>
Or (
  disjunct1
  . . .
  disjunctn
   )
<Or>
  <formula>disjunct1'</formula>
   . . .
  <formula>disjunctn'</formula>
</Or>
... ...
Exists
  variable1
  . . .
  variablen (
             body
            )
<Exists>
  <declare>variable1'</declare>
   . . .
  <declare>variablen'</declare>
  <formula>body'</formula>
</Exists>
pred (
  argument1
  . . .
  argumentn
     )
<Atom>
  <op>pred'</op>
  <arg>argument1'</arg>
   . . .
  <arg> argumentn'</arg>
</Atom>
External (
  atomicexpr
         )
<External>
  <content>atomicexpr'</content>
</External>
func (
  argument1
  . . .
  argumentn
     )
<Expr>
  <op>func'</op>
  <arg>argument1'</arg>
   . . .
  <arg> argumentn'</arg>
</Expr>
pred (
  unicodestring1 -> filler1
  . . .
  unicodestringn -> fillern
     )
<Atom>
  <op>pred'</op>
  <slot>
    <Prop>
      <key><Name>unicodestring1</Name></key>
      <val>filler1'</val>
    </Prop>
  </slot>
   . . .
  <slot>
    <Prop>
      <key><Name>unicodestringn</Name></key>
      <val>fillern'</val>
    </Prop>
  </slot>
</Atom>
func (
  unicodestring1 -> filler1
  . . .
  unicodestringn -> fillern
     )
<Expr>
  <op>func'</op>
  <slot>
    <Prop>
      <key><Name>unicodestring1</Name></key>
      <val>filler1'</val>
    </Prop>
  </slot>
   . . .
  <slot>
    <Prop>
      <key><Name>unicodestringn</Name></key>
      <val>fillern'</val>
    </Prop>
  </slot>
</Expr>
inst [
  key1 -> filler1
  . . .
  keyn -> fillern
     ]
<Frame>
  <object>inst'</object>
  <slot>
    <Prop>
      <key>key1'</key>
      <val>filler1'</val>
    </Prop>
  </slot>
   . . .
  <slot>
    <Prop>
      <key>keyn'</key>
      <val>fillern'</val>
    </Prop>
  </slot>
</Frame>
inst # class
<Member>
  <lower>inst'</lower>
  <upper>class'</upper>
</Member>
sub ## super
<Subclass>
  <lower>sub'</lower>
  <upper>super'</upper>
</Subclass>
left = right
<Equal>
  <side>left'</side>
  <side>right'</side>
</Equal>
unicodestring^^space
<Const type="space">unicodestring</Const>

If space is rif:iri:

<Const>
  <rdf:value rdf:datatype="space">unicodestring</rdf:value>
</Const>

If space is rif:text:

...

All other spaces:

...
?unicodestring
<Var>unicodestring</Var>

Translation of the RIF-BLD Rule Language

The translation between the presentation syntax and the XML syntax of the RIF-BLD Rule Language is given by the table below, which extends the translation table of Section Translation of RIF-BLD Condition Language.


Presentation Syntax XML Syntax
Group (
  clause1
   . . .
  clausen
      )
<Group>
  <sentence>clause1'</sentence>
   . . .
  <sentence>clausen'</sentence>
</Group>
Group metaframe (
                  clause1
                   . . .
                  clausen
                )
<Group>
  <meta>metaframe'</meta>
  <sentence>clause1'</sentence>
   . . .
  <sentence>clausen'</sentence>
</Group>
Forall
  variable1
   . . .
  variablen (
             rule
            )
<Forall>
  <declare>variable1'</declare>
   . . .
  <declare>variablen'</declare>
  <formula>rule'</formula>
</Forall>
conclusion :- condition
<Implies>
  <if>condition'</if>
  <then>conclusion'</then>
</Implies>