<?xml version="1.0"?>

<xs:schema 
targetNamespace="http://www.ruleml.org/0.91/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.ruleml.org/0.91/xsd"
>

	<xs:annotation>
		<xs:documentation xml:lang="en">
			This is the XML Schema module for RuleML slots.
			File: slot_module.xsd
			Version: 0.91
			Last Modification: 2006-08-18
			
			This module declares the following RuleML element and attributes:
			* slot
			* @card
			* @weight
			
			See http://www.ruleml.org/modularization for details about this modularization approach.
		</xs:documentation>
	</xs:annotation>
	
	<!--
		*** slot ***
		A user-defined slot consisting of a name (first position) and a filler (second position).
		
		See http://www.ruleml.org/0.91/glossary/#gloss-slot

		content model (normally):
		( (Ind | Data), (Ind | Data | Skolem | Var | Reify) )
		
		Another (context-sensitive) version of <slot> is in the holog module.
	-->
	<xs:attributeGroup name="slot.attlist">
		<xs:attributeGroup ref="card.attrib"/>
		<xs:attributeGroup ref="weight.attrib"/>
	</xs:attributeGroup>
	<xs:group name="slot-name.extend">
		<xs:choice>
			<xs:element ref="Ind"/>
			<xs:element ref="Data"/>
		</xs:choice>
	</xs:group>
	<xs:group name="slot.content">
		<xs:sequence>
			<xs:group ref="slot-name.extend"/>
			<xs:group ref="arg.content"/>
		</xs:sequence>
	</xs:group>
	<xs:complexType name="slot.type">
		<xs:group ref="slot.content"/>
		<xs:attributeGroup ref="slot.attlist"/>
	</xs:complexType>
	<xs:element name="slot" type="slot.type"/>

	<!--
		*** @card ***
		An attribute optionally specifying a slot's cardinality.
		
		See http://www.ruleml.org/0.91/glossary/#gloss-@card		
	-->
	<xs:attributeGroup name="card.attrib">
		<xs:attribute name="card" type="xs:nonNegativeInteger" use="optional"/>
	</xs:attributeGroup>

	<!--
		*** @weight ***
		An attribute optionally specifying a slot's relative weight.
		
		See http://www.ruleml.org/0.91/glossary/#gloss-@weight		
	-->
	<xs:attributeGroup name="weight.attrib">
		<xs:attribute name="weight" use="optional">
			<xs:simpleType>
				<xs:restriction base="xs:decimal">
					<xs:minInclusive value="0"/>
					<xs:maxInclusive value="1"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:attributeGroup>

</xs:schema>