<?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">

<!-- a trivial example rulebase for testing the Equalog RuleML sublanguage -->

<Assert mapClosure="universal">


<Forall>
    <Var>d</Var>
    <Equal>
      <Ind>some constant</Ind>
      <Var>d</Var>
    </Equal>
</Forall>

<Equivalent>
    <Equal>
      <Ind>some constant</Ind>
      <Var>d</Var>
    </Equal>
    <Equal>
      <Ind>some constant</Ind>
      <Var>e</Var>
    </Equal>
</Equivalent>

<Implies>
  <head>
     <Atom>
      <op><Rel>friend</Rel></op>
      <slot><Ind>t</Ind><Var>b</Var></slot>
      <Var>x</Var>
      <Var>y</Var>
      <Ind>Steph</Ind>
     </Atom>
  </head>
  <body>
    <And>
    <Atom>
      <op><Rel>friend</Rel></op>
      <Ind>Jane</Ind>
      <Ind>Joan</Ind>
      <Ind>Jack</Ind>
      <Var>y</Var>
      <Ind>Frank</Ind>
      <slot><Ind>yar</Ind><Cterm>
          <op><Ctor>constructor</Ctor></op>
          <Plex>
            <Var>z</Var>
            <slot><Ind>yar2</Ind><Var>c</Var></slot>
          </Plex>
        </Cterm></slot>
    </Atom>
    </And>
  </body>
</Implies>


      <Atom>
        <op><Rel>some relation</Rel></op>
        <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>
        <op><Rel>another relation</Rel></op>
        <Ind>constant c</Ind>
        <Ind>constant d</Ind>
        <Cterm>
          <op><Ctor>yac</Ctor></op>
            <Ind>constant g</Ind>
            <Ind>constant h</Ind>
            <Cterm>
              <op><Ctor>empty</Ctor></op>
            </Cterm>
            <Ind>constant h</Ind>
        </Cterm>
      </Atom>
 
     <Equal>
        <Nano>
          <op><Fun>some function</Fun></op>
          <Ind>arg1</Ind>
          <Ind>arg2</Ind>
          <Ind>arg3</Ind>
        </Nano>
        <Nano>
          <op><Fun>some other function</Fun></op>
          <Ind>arg4</Ind>
          <Ind>arg5</Ind>
          <Ind>arg6</Ind>
        </Nano>
      </Equal>

    <Atom>
      <op><Rel>yet another relation</Rel></op>
      <Ind>constant e</Ind>
      <Ind>constant b</Ind>
      <slot><Ind>role_name3</Ind><Ind>role 3</Ind></slot>
    </Atom>

    <Equal>
      <Ind>some constant</Ind>
      <Var>d</Var>
    </Equal>


</Assert>

</RuleML>
