Difference Analysis Generated by HtmlDiff on 18/10/2010 1:27 PM  

 
<?xml version="1.0" encoding="utf-8"?>
<RuleML xmlns="http://www.ruleml.org/1.0/xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ruleml.org/1.0/xsd http://www.ruleml.org/1.0/xsd/framehohornlogeq.xsd">

  <content>
  <Assert>
      <formula>
    <Entails>
      <!-- a trivial example rulebase for testing the framehohornlogeq RuleML sublanguage -->
      <Rulebase>
        <!-- from SWSL document at http://www.daml.org/services/swsl/report/swsl.shtml -->
        <!-- section 6.2 -->
        <!-- explicit equality -->
        <Implies>
          <then>
            <Equal>
              <Uniterm>
                <op>
                  <Const>f</Const>
                </op>
                <Const>a</Const>
                <Var>X</Var>
              </Uniterm>
              <Uniterm>
                <op>
                  <Const>g</Const>
                </op>
                <Var>Y</Var>
                <Const>b</Const>
              </Uniterm>
            </Equal>
          </then>
          <if>
            <Uniterm>
              <op>
                <Const>p</Const>
              </op>
                  <arg index="0">
              <Var>X</Var>
                  </arg>
                  <arg index="1">
              <Var>Y</Var>
                  </arg>
            </Uniterm>
          </if>
        </Implies>
        <!-- section 6.3 -->
        <!-- non-positional Atom with required oid and optional op -->
        <Atom>
          <oid>
            <Const>o</Const>
          </oid>
          <op>
            <Const>test relation</Const>
          </op>
          <slot>
            <Uniterm>
                  <op>
              <Const>f</Const>
                  </op>
                  <arg index="1">
              <Const>a</Const>
                  </arg>
                  <arg index="2">
              <Const>b</Const>
                  </arg>
            </Uniterm>
            <Const>3</Const>
          </slot>
        </Atom>
        <!-- singleton slot -->
        <Atom>
          <oid>
            <Const>mary</Const>
          </oid>
          <slot>
            <Const>female</Const>
          </slot>
        </Atom>
        <!-- new set-valued tag -->
        <Atom>
          <oid>
            <Const>t'</Const>
          </oid>
          <slot>
            <Const>m'</Const>
            <Set>
              <Const>v1'</Const>
              <Const>...</Const>
              <Const>vk'</Const>
            </Set>
          </slot>
        </Atom>
        <!-- class membership and subclass molecules -->
        <InstanceOf>
          <Const>t'</Const>
          <Const>s'</Const>
        </InstanceOf>
        <SubclassOf>
          <Uniterm>
                <op>
            <Const>t'</Const>
                </op>
          </Uniterm>
          <Uniterm>
                <op>
            <Const>s'</Const>
                </op>
          </Uniterm>
        </SubclassOf>
        <!-- signature molecule -->
        <Signature>
          <oid>
            <Const>t'</Const>
          </oid>
          <slot>
            <Const>m'</Const>
            <Const>v'</Const>
          </slot>
        </Signature>
        <!-- boolean signature molecule -->
        <Signature>
          <oid>
            <Const>t'</Const>
          </oid>
          <slot>
            <Const>m'</Const>
          </slot>
        </Signature>
        <!-- cardinality Conststraints -->
        <Signature>
          <oid>
            <Const>t'</Const>
          </oid>
          <slot minCard="0" maxCard="1">
            <Uniterm>
                  <op>
              <Const>s'</Const>
                  </op>
                  <arg index="1">
              <Const>t1'</Const>
                  </arg>
                  <arg index="2">
              <Const>...</Const>
                  </arg>
                  <arg index="3">
              <Const>tn'</Const>
                  </arg>
            </Uniterm>
            <Const>v'</Const>
          </slot>
        </Signature>
        <!-- Slot access and path expressions -->
        <Uniterm>
          <oid>
            <Const>r</Const>
          </oid>
          <op>
            <Const>s</Const>
          </op>
          <Get>
            <oid>
              <Const>room</Const>
            </oid>
            <SlotProd>
              <Const>ceiling</Const>
              <Const>color</Const>
            </SlotProd>
          </Get>
        </Uniterm>
        <!-- section 6.4 -->
        <!-- reification -->
        <Uniterm>
          <oid>
            <Const>a</Const>
          </oid>
          <op>
            <Const />
          </op>
          <slot>
            <Const>b</Const>
            <Uniterm>
              <op>
                <Const>p</Const>
              </op>
                  <arg index="0">
              <Uniterm>
                <oid>
                  <Var>X</Var>
                </oid>
                <op>
                  <Const />
                </op>
                <slot>
                  <Const>foo</Const>
                  <Const>bar</Const>
                </slot>
              </Uniterm>
                  </arg>
            </Uniterm>
          </slot>
        </Uniterm>
        <Uniterm>
          <oid>
            <Const>john</Const>
          </oid>
          <op>
            <Const />
          </op>
          <slot>
            <Const>believes</Const>
            <Uniterm>
              <op>
                <Const>p</Const>
              </op>
                  <arg index="0">
              <Var>X</Var>
                  </arg>
            </Uniterm>
          </slot>
        </Uniterm>
        <!-- miscellaneous stuff, same as from hohornlog  -->
        <Implies>
          <then>
            <Equal>
              <Const>some Conststant</Const>
              <Var>d</Var>
            </Equal>
          </then>
          <if>
            <And>
                  <formula>
              <Or>
                      <formula>
                <Equal>
                  <Const>some Conststant</Const>
                  <Var>d</Var>
                </Equal>
                      </formula>
                      <formula>
                <Uniterm>
                          <op>
                  <Const>unequal</Const>
                          </op>
                          <arg index="1">
                  <Var>x</Var>
                          </arg>
                          <arg index="2">
                  <Var>person</Var>
                          </arg>
                </Uniterm>
                      </formula>
              </Or>
                  </formula>
            </And>
          </if>
        </Implies>
        <Equal>
          <Const>some Conststant</Const>
          <Var>d</Var>
        </Equal>
        <Equal>
          <Uniterm>
            <op>
              <Const>some function</Const>
            </op>
            <Const>arg1</Const>
            <Const>arg2</Const>
            <Const>arg3</Const>
          </Uniterm>
          <Uniterm>
            <op>
              <Const>some other function</Const>
            </op>
            <Const>arg4</Const>
            <Const>arg5</Const>
            <Const>arg6</Const>
          </Uniterm>
        </Equal>
        <Forall>
              <declare>
          <Var>d</Var>
              </declare>
              <formula>
          <Equal>
            <Const>some Conststant</Const>
            <Var>d</Var>
          </Equal>
              </formula>
        </Forall>
        <Equivalent>
              <torso>
          <Equal>
            <Const>some Conststant</Const>
            <Var>d</Var>
          </Equal>
              </torso>
              <torso>
          <Equal>
            <Const>some Conststant</Const>
            <Var>e</Var>
          </Equal>
              </torso>
        </Equivalent>
        <Implies>
          <then>
            <Uniterm>
              <op>
                <Const>friend</Const>
              </op>
              <slot>
                <Const>t</Const>
                <Var>b</Var>
              </slot>
                  <arg index="0">
              <Var>x</Var>
                  </arg>
                  <arg index="1">
              <Var>y</Var>
                  </arg>
                  <arg index="2">
              <Const>Steph</Const>
                  </arg>
            </Uniterm>
          </then>
          <if>
            <And>
                  <formula>
              <Or>
                      <formula>
                <Atom>
                  <oid>
                    <Const>o</Const>
                  </oid>
                  <Const>unequal</Const>
                </Atom>
                      </formula>
              </Or>
                  </formula>
            </And>
          </if>
        </Implies>
        <Equivalent>
              <torso>
          <Uniterm>
                  <op>
            <Const>unequal</Const>
                  </op>
                  <arg index="1">
            <Var>x</Var>
                  </arg>
                  <arg index="2">
            <Var>person</Var>
                  </arg>
          </Uniterm>
              </torso>
              <torso>
          <Uniterm>
                  <op>
            <Const>unequal</Const>
                  </op>
                  <arg index="1">
            <Var>x</Var>
                  </arg>
                  <arg index="2">
            <Var>person</Var>
                  </arg>
          </Uniterm>
              </torso>
        </Equivalent>
        <Forall>
              <declare>
          <Var>x</Var>
              </declare>
              <formula>
          <Uniterm>
                  <op>
            <Const>unequal</Const>
                  </op>
                  <arg index="1">
            <Var>x</Var>
                  </arg>
                  <arg index="2">
            <Var>person</Var>
                  </arg>
          </Uniterm>
              </formula>
        </Forall>
      </Rulebase>
      <Rulebase>
        <Implies>
          <then>
            <Neg>
                  <strong>
              <And>
                      <formula>
                <Uniterm>
                          <op>
                  <Const>pricediscount</Const>
                          </op>
                          <arg index="1">
                  <Var>CUST</Var>
                          </arg>
                          <arg index="2">
                  <Var>Y</Var>
                          </arg>
                </Uniterm>
                      </formula>
                      <formula>
                <Uniterm>
                          <op>
                  <Const>pricediscount</Const>
                          </op>
                          <arg index="1">
                  <Var>CUST</Var>
                          </arg>
                          <arg index="2">
                  <Var>Z</Var>
                          </arg>
                </Uniterm>
                      </formula>
              </And>
                  </strong>
            </Neg>
          </then>
          <if>
            <Neg>
                  <strong>
              <Equal>
                <Var>Y</Var>
                <Var>Z</Var>
              </Equal>
                  </strong>
            </Neg>
          </if>
        </Implies>
        <Neg>
              <strong>
          <And>
                  <formula>
            <Uniterm>
                      <op>
              <Const>pricediscount</Const>
                      </op>
                      <arg index="1">
              <Var>CUST</Var>
                      </arg>
                      <arg index="2">
              <Const>fivepercent</Const>
                      </arg>
            </Uniterm>
                  </formula>
                  <formula>
            <Uniterm>
                      <op>
              <Const>pricediscount</Const>
                      </op>
                      <arg index="1">
              <Var>CUST</Var>
                      </arg>
                      <arg index="2">
              <Const>tenpercent</Const>
                      </arg>
            </Uniterm>
                  </formula>
          </And>
              </strong>
        </Neg>
      </Rulebase>
    </Entails>
      </formula>
  </Assert>
  </content>
</RuleML>