<?xml version="1.0"?>
<!-- $Id: xsb.xsl,v 1.2 2001/03/22 07:32:13 mdean Exp $ --> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="text"/> 

  <xsl:template match="var">V<xsl:value-of select="."/></xsl:template>

  <xsl:template match="rel">'<xsl:value-of select="."/>'</xsl:template>

  <xsl:template match="ind">'<xsl:value-of select="."/>'</xsl:template>

  <xsl:template match="atom"><xsl:apply-templates select="rel"/>(_<xsl:for-each select="var|ind">, <xsl:apply-templates select="."/></xsl:for-each>)</xsl:template>

  <xsl:template match="and">
    <xsl:apply-templates select="atom[1]"/><xsl:for-each select="atom[position() &gt; 1]">, <xsl:apply-templates select="."/></xsl:for-each>
  </xsl:template>

  <xsl:template match="if">
    <xsl:text xml:space="preserve">% </xsl:text><xsl:value-of select="@label"/>
    <xsl:text xml:space="preserve">
    </xsl:text>		
    <xsl:apply-templates select="atom[1]"/> :- <xsl:apply-templates select="*[position() &gt; 1]"/>.
  </xsl:template>

</xsl:stylesheet>
