<?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/dishornlog.xsd">

<!-- a trivial example rulebase for testing the Hornlog RuleML sublanguage -->

<Assert mapClosure="universal">


<Implies>
  <oid>
    <Cterm>
      <op><Ctor>rule label</Ctor></op>
      <slot><Ind>label</Ind><Ind>an example fact</Ind></slot>
    </Cterm>
  </oid>
  <head>
     <Or>
       <Atom>
         <op><Rel>friend</Rel></op>
         <slot><Ind>t</Ind><Var>b</Var></slot>
         <Var>x</Var>
         <Var>y</Var>
         <Ind>Steph</Ind>
       </Atom>
       <Atom>
         <op><Rel>friend</Rel></op>
         <slot><Ind>t</Ind><Var>b</Var></slot>
         <Var>x</Var>
         <Var>y</Var>
         <Ind>Jill</Ind>
       </Atom>
     </Or>
  </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>


      <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>
        <Skolem>constant b</Skolem>
        <repo><Var>b</Var></repo>
        <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>
        <repo><Var>x</Var></repo>
        <slot><Ind>role_name3</Ind><Ind>role 3</Ind></slot>
        <resl><Plex><slot><Skolem/><Ind>test</Ind></slot></Plex></resl>
      </Atom>


    <Atom>
      <op><Rel>yet another relation</Rel></op>
        <Skolem>constant b</Skolem>
      <Ind>constant e</Ind>
      <Ind>constant b</Ind>
      <slot><Ind>role_name3</Ind><Ind>role 3</Ind></slot>
      <resl><Var>b</Var></resl>
    </Atom>

</Assert>

</RuleML>
