Re: [RIF] homework for 10/17 telecon

Sorry may be I don't understand the question.
If you have an append atom inside of the body of a rule this can contain 
for example, object variables (typed one) i.e.
   <r2ml:GenericAtom r2ml:predicateID="append">
    <r2ml:arguments>
      <r2ml:ObjectVariable r2ml:name="U" r2ml:classID="ex:Customer"/>
     <r2ml:ObjectVariable r2ml:name="V" r2ml:classID="ex:Customer"/>
     <r2ml:ObjectVariable r2ml:name="W" r2ml:classID="ex:Customer"/>
    </r2ml:arguments>
   </r2ml:GenericAtom>

Here is something similar with explicit casting in programming 
languages. In an intuitive execution model supposing that U and V are 
bound and W is the result, then W it will contain Customer objects. I 
hope this it is helpful.

-Adrian

Francis McCabe wrote:

>
> This misses the point. I was interested in how the *type* information  
> would be carried.
> Frank
>
> On Oct 17, 2006, at 7:24 AM, Adrian Giurca wrote:
>
>> Dear all,
>>
>> Francis McCabe wrote:
>>
>>>
>>> Gerd:
>>>  Looking at the example XML encoding, I would predict that you  
>>> would  have some trouble representing generic or polymorphically  
>>> typed  entities.
>>>  Can you show how you would encode:
>>>
>>>  concat:[list[t],list[t]]=>list[t].
>>>  concat([],L)=>L.
>>>  concat([E,..L],M)=>[E,..concat(L,M)].
>>>
>>> (This is a function, but cold easily be expressed using  predications.)
>>> Frank
>>>
>> The standard append Prolog predicate is expressed by two derivation  
>> rules.
>>
>> append([],L,L).
>>
>> append([X|L1],L2,[X|L12])  :- append(L1,L2,L12).
>> We need just a built-in function i.e. the list constructor and a  
>> GenericEntityName i.e. the empty list.
>> In R2ML this it will be:
>>
>> <r2ml:DerivationRuleSet>
>>
>> <r2ml:DerivationRule>
>>
>> <r2ml:Documentation>
>>
>>  <r2ml:SourceCode>
>>
>> append([],L,L).
>>
>> </r2ml:SourceCode>
>>  </r2ml:Documentation>
>>
>>  <r2ml:conclusion>
>>
>>    <r2ml:GenericAtom r2ml:predicateID="append">
>>
>>     <r2ml:arguments>
>>
>>       <r2ml:GenericEntityName r2ml:genericEntityID="ns:emptyList"/>
>>
>>       <r2ml:GenericVariable r2ml:name="L"/>
>>
>>       <r2ml:GenericVariable r2ml:name="L"/>
>>
>>     </r2ml:arguments>
>>
>>    </r2ml:GenericAtom>
>>
>>  </r2ml:conclusion>
>>
>> </r2ml:DerivationRule>
>>
>>  <r2ml:DerivationRule>
>>
>>  <r2ml:Documentation>
>>
>> <r2ml:SourceCode>
>>
>>   append([X|L1],L2,[X|L12]):- append(L1,L2,L12).
>> </r2ml:SourceCode>
>>  </r2ml:Documentation>
>>
>>   <r2ml:conditions>
>>
>>    <r2ml:GenericAtom r2ml:predicateID="append">
>>
>>     <r2ml:arguments>
>>
>>       <r2ml:GenericVariable r2ml:name="L1"/>
>>
>>       <r2ml:GenericVariable r2ml:name="L2"/>
>>
>>       <r2ml:GenericVariable r2ml:name="L12"/>
>>
>>     </r2ml:arguments>
>>
>>    </r2ml:GenericAtom>
>>
>>   </r2ml:conditions>
>>
>>   <r2ml:conclusion>
>>
>>     <r2ml:GenericAtom r2ml:predicateID="append">
>>
>>      <r2ml:arguments>
>>
>>        <r2ml:GenericFunctionTerm  
>> r2ml:genericFunctionID="ns:list_constructor">
>>
>>         <r2ml:arguments>
>>
>>            <r2ml:GenericVariable r2ml:name="H"/>
>>
>>            <r2ml:GenericVariable r2ml:name="L1"/>
>>         </r2ml:arguments>
>>
>>        </r2ml:GenericFunctionTerm>
>>        <r2ml:GenericVariable r2ml:name="L2"/>
>>        <r2ml:GenericFunctionTerm  
>> r2ml:genericFunctionID="ns:list_constructor">
>>        <r2ml:arguments>
>>
>>        <r2ml:GenericVariable r2ml:name="H"/>
>>
>>            <r2ml:GenericVariable r2ml:name="L12"/>
>>         </r2ml:arguments>
>>
>>        </r2ml:GenericFunctionTerm>
>>      </r2ml:arguments>
>>
>>     </r2ml:GenericAtom>
>>
>>   </r2ml:conclusion>
>>
>>  </r2ml:DerivationRule>
>>
>> </r2ml:DerivationRuleSet>
>>
>> -Adrian Giurca
>>
>>>
>>> On Oct 17, 2006, at 6:20 AM, Gerd Wagner wrote:
>>>
>>>>> We expect to plan the bulk of the next telecon discussing the   
>>>>> technical
>>>>> proposal [http://www.w3.org/2005/rules/wg/wiki/CORE], especially  the
>>>>> syntax.
>>>>
>>>>
>>>>
>>>> Here is a proposal how to extend it in order to accommodate typing.
>>>>
>>>> -Gerd
>>>> <REWERSE RIF Condition Language Extension Proposal.html>
>>>
>>>
>>>
>>>
>>
>
>


-- 
Dr. Adrian Giurca
http://www.informatik.tu-cottbus.de/~agiurca/

Received on Tuesday, 17 October 2006 16:45:42 UTC