Difference Analysis Generated by HtmlDiff on 2011-01-31 13:52  

 
<?xml version="1.0" encoding="UTF-8"?> 
 
<RuleML xmlns="http://www.ruleml.org/0.9/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ruleml.org/0.9/xsd http://www.ruleml.org/0.9/xsd/hornlogeq.xsd"><Assert mapClosure="universal"> 
<RuleML
xmlns="http://www.ruleml.org/0.9/xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ruleml.org/0.9/xsd
http://www.ruleml.org/0.9/xsd/hornlogeq.xsd">

<!--
The function symbol "owner" could be user-defined by a rule
or 'directed Equaluation' owner(car17) = john. Now, the first premise of
the 'functional Datalog' rule
buy(Person,Object) <- pay(Person,owner(Object)) and take(Person,Object)
is an "owner" function call nested into a "pay" relation call. With
additional facts pay(fred,john) and take(fred,car17) also asserted,
the "buy" relation call buy(fred,car17) would be computed thus:
 
buy(fred,car17)
pay(fred,owner(car17)) and take(fred,car17)
pay(fred,john)         and true
true                   and true
true
 
So, owner(car17) _computes_ the actual owner individual, rather than
just _denoting_ it, as a cterm with a constructor symbol "owner"
would. For this corresponding cterm in the first premise, we would
have used square brackets like pay(Person,owner[car17]), but then one
asserted fact would have to be the non-Datalog pay(fred,owner[car17]).
Now, the above 'functional Datalog' rule can be flattened, obtaining
 
buy(Person,Object) <- Own = owner(Object) and pay(Person,Own)
                      and take(Person,Object)
 
This flattened version, along with the directed Equaluation and facts, can
be marked up in the current RuleML as follows:
--> 
 
<Assert mapClosure="universal">
 
    <Equal> 
      <Nano> 
        <op><Fun>owner</Fun></op> 
        <Ind>car17</Ind> 
      </Nano> 
      <Ind>john</Ind> 
    </Equal> 
 
<Implies> 
 <head> 
  <Atom> 
    <op><Rel>buy</Rel></op> 
    <Var>person</Var> 
    <Var>object</Var> 
  </Atom> 
 </head> 
 <body> 
  <And> 
    <Equal> 
      <Var>own</Var> 
      <Nano> 
        <op><Fun>owner</Fun></op> 
        <Var>object</Var> 
      </Nano> 
    </Equal> 
    <Atom> 
      <op><Rel>pay</Rel></op> 
      <Var>person</Var> 
      <Var>own</Var> 
    </Atom> 
    <Atom> 
      <op><Rel>take</Rel></op> 
      <Var>person</Var> 
      <Var>object</Var> 
    </Atom> 
  </And> 
 </body> 
</Implies> 
 
 
  <Atom> 
    <op><Rel>pay</Rel></op> 
    <Ind>fred</Ind> 
    <Ind>john</Ind> 
  </Atom> 
 
  <Atom> 
    <op><Rel>take</Rel></op> 
    <Ind>fred</Ind> 
    <Ind>car17</Ind> 
  </Atom> 
 
</Assert></RuleML>
</Assert>

</RuleML>