<?xml version="1.0" encoding="UTF-8"?>

<Rulebase xmlns="http://www.ruleml.org/0.87/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ruleml.org/0.87/xsd http://www.ruleml.org/0.87/xsd/equalog.xsd" direction="backward">

<!-- a trivial example rulebase for testing the Equalog RuleML sublanguage -->

<Imp>
  <head>
     <Atom>
      <opr><Rel>friend</Rel></opr>
      <Slot><Ind>t</Ind><Var>b</Var></Slot>
      <Var>x</Var>
      <Var>y</Var>
      <Ind>Steph</Ind>
     </Atom>
  </head>
  <rlab><Ind>(implication) rule label</Ind></rlab>
  <body>
    <And>
    <Atom>
      <opr><Rel>friend</Rel></opr>
      <Ind>Jane</Ind>
      <Ind>Joan</Ind>
      <Ind>Jack</Ind>
      <Var>y</Var>
      <Ind>Frank</Ind>
      <Slot><Ind>yar</Ind><Cterm>
          <opc><Ctor>constructor</Ctor></opc>
          <Plex>
            <Var>z</Var>
            <Slot><Ind>yar2</Ind><Var>c</Var></Slot>
          </Plex>
        </Cterm></Slot>
    </Atom>
    </And>
  </body>
</Imp>

<Query>
  <body>
    <Or>
      <Atom>
        <opr><Rel>some relation</Rel></opr>
        <Slot><Ind>role_name1</Ind><Ind>role 1</Ind></Slot>
        <Ind>constant a</Ind>
        <Ind>constant b</Ind>
        <Slot><Ind>role_name2</Ind><Ind>role 2</Ind></Slot>
      </Atom>
      <Atom>
        <opr><Rel>another relation</Rel></opr>
        <Ind>constant c</Ind>
        <Ind>constant d</Ind>
        <Cterm>
          <opc><Ctor>yac</Ctor></opc>
            <Ind>constant g</Ind>
            <Ind>constant h</Ind>
            <Cterm>
              <opc><Ctor>empty</Ctor></opc>
            </Cterm>
            <Ind>constant h</Ind>
        </Cterm>
      </Atom>
      <Eq>
        <Nano>
          <opf><Fun>some function</Fun></opf>
          <Ind>arg1</Ind>
          <Ind>arg2</Ind>
          <Ind>arg3</Ind>
        </Nano>
        <Nano>
          <opf><Fun>some other function</Fun></opf>
          <Ind>arg4</Ind>
          <Ind>arg5</Ind>
          <Ind>arg6</Ind>
        </Nano>
      </Eq>
    </Or>
  </body>
  <rlab><Ind>rule (query) label</Ind></rlab>
</Query>

<Fact>
  <rlab>
    <Cterm>
      <opc><Ctor>rule label</Ctor></opc>
      <Slot><Ind>label</Ind><Ind>an example fact</Ind></Slot>
    </Cterm>
  </rlab>
  <head>
    <Atom>
      <opr><Rel>yet another relation</Rel></opr>
      <Ind>constant e</Ind>
      <Ind>constant b</Ind>
      <Slot><Ind>role_name3</Ind><Ind>role 3</Ind></Slot>
    </Atom>
  </head>
</Fact>

<Fact>
  <rlab><Ind>rule (fact) label</Ind></rlab>
  <head>
    <Eq>
      <Ind>some constant</Ind>
      <Var>d</Var>
    </Eq>
  </head>
</Fact>

<rbaselab>
  <Cterm>
    <opc><Ctor>rulebase label</Ctor></opc>
    <Slot><Ind>label</Ind><Ind>an example rulebase</Ind></Slot>
  </Cterm>
</rbaselab>

</Rulebase>
