<?xml version="1.0" encoding="UTF-8"?>
<PositiveEntailmentTest id="Conflict_resolution"
    src="http://www.w3.org/2005/rules/test/repository/tc/Conflict_resolution" xmlns="http://www.w3.org/2009/10/rif-test#">
    <status>Approved</status>
    <dialect>PRD</dialect>
    <purpose>This test highlights the role of priority in PRD's conflict resolution.</purpose>
    <description>The second rule fires before the first rule because it has higher priority. Without priority, implementations may resolve the conflict arbitrarily, and the conclusion is not guaranteed.</description>
    <PremiseDocument>
        <Normative syntax="RIF/XML">
            <name>Conflict_resolution-premise.rif</name>
            <remote>http://www.w3.org/2005/rules/test/repository/tc/Conflict_resolution/Conflict_resolution-premise.rif</remote>
        </Normative>
        <Presentation syntax="RIFPRD-PS"><![CDATA[
Document(
  Prefix(ex   <http://example.org/example#>)
  
  Group  (
    Group 1 (
      Forall ?x ( If ?x#ex:T Then Do (Retract(?x[ex:p->1]))))
    Group 2 (
      Forall ?y ( If And(?y#ex:T ?y[ex:p->1]) Then ?y[ex:q->2] ))

    Do ((?new New()) 
         Assert(?new#ex:T) 
         Assert(?new[ex:p->1]) 
    ) 
)
]]></Presentation>
    </PremiseDocument>
    <ConclusionDocument>
        <Normative syntax="RIF/XML">
            <name>Conflict_resolution-conclusion.rif</name>
            <remote>http://www.w3.org/2005/rules/test/repository/tc/Conflict_resolution/Conflict_resolution-conclusion.rif</remote>
        </Normative>
        <Presentation syntax="RIFPRD-PS"><![CDATA[
Exists ?x (?x[ex:q->2])
]]></Presentation>
    </ConclusionDocument>
</PositiveEntailmentTest>
