<?xml version="1.0"?>
<!DOCTYPE rulefile SYSTEM "http://www.cs.ucl.ac.uk/staff/R.Summerton/rulefile.dtd">
<!-- biofusion7.xml Version of: 13/2/04. -->
<!-- Differs from biofusion6 in that Rule 1 searches for subsets of the input set of protein domains
     that are functionally similar. Then, for each subset it finds the least upper bound and the keywords
     that belong to the annotations of the LUB and those nodes above it. Rule 2 is added to deal with the
     case where at least one protein domain that lacks a GOID also fails to have a sequence
     score > 60%. Differs from biofusion5 in that functions no longer used. -->
<rulefile>
	<rule code="1" status="foundational">
		<condition>
			<conditionname sign="positive">selectfunctionalgroups</conditionname>
			<variable>
				<set>1</set>
				<branch extract="textentry">protein/function</branch>
			</variable>
			<logicalvariable type="set">X</logicalvariable>
		</condition>
		<condition>
			<conditionname sign="positive">selectproteingroups</conditionname>
			<variable>
				<set>1</set>
				<branch extract="textentry">protein/name</branch>
			</variable>
			<variable>
				<set>1</set>
				<branch extract="textentry">protein/function</branch>
			</variable>
			<logicalvariable type="set">X</logicalvariable>
			<logicalvariable type="set">Y</logicalvariable>
		</condition>
		<condition>
			<conditionname sign="positive">expandfunctionalgroupings</conditionname>
			<variable>
				<set>1</set>
				<branch extract="textentry">protein/name</branch>
			</variable>
			<variable>
				<set>1</set>
				<branch extract="textentry">protein/function</branch>
			</variable>
			<logicalvariable type="set">Y</logicalvariable>
			<logicalvariable type="set">U</logicalvariable>
		</condition>
		<condition>
			<conditionname sign="positive">getleastupperbounds</conditionname>
			<logicalvariable type="set">Y</logicalvariable>
			<logicalvariable type="set">U</logicalvariable>
			<logicalvariable type="set">Z</logicalvariable>
		</condition>
		<condition>
			<conditionname sign="positive">getkeywordgroups</conditionname>
			<logicalvariable type="set">Z</logicalvariable>
			<logicalvariable type="set">W</logicalvariable>
		</condition>
		<condition>
			<conditionname sign="positive">getnumberoffunctionalgroups</conditionname>
			<logicalvariable type="set">Y</logicalvariable>
			<logicalvariable type="singleton">V</logicalvariable>
		</condition>
		<action>
			<actionname>Initialize</actionname>
			<constant>biofusionanalysis</constant>
		</action>
		<action>
			<actionname>RepeatAddNode</actionname>
			<constant>functionalgroup</constant>
			<logicalvariable type="singleton">V</logicalvariable>
			<constant>biofusionanalysis</constant>
		</action>
		<action>
			<actionname>RepeatAddNode</actionname>
			<constant>selectedproteins</constant>
			<constant>1</constant>
			<constant>biofusionanalysis/functionalgroup</constant>
		</action>
		<action>
			<actionname>RepeatAddText</actionname>
			<logicalvariable type="set">Y</logicalvariable>
			<constant>biofusionanalysis/functionalgroup/selectedproteins</constant>
		</action>
		<action>
			<actionname>RepeatAddNode</actionname>
			<constant>commonfunction</constant>
			<constant>1</constant>
			<constant>biofusionanalysis/functionalgroup</constant>
		</action>
		<action>
			<actionname>RepeatAddText</actionname>
			<logicalvariable type="set">Z</logicalvariable>
			<constant>biofusionanalysis/functionalgroup/commonfunction</constant>
		</action>
		<action>
			<actionname>RepeatAddNode</actionname>
			<constant>keywords</constant>
			<constant>1</constant>
			<constant>biofusionanalysis/functionalgroup</constant>
		</action>
		<action>
			<actionname>RepeatAddAtomicTrees</actionname>
			<logicalvariable type="set">W</logicalvariable>
			<constant>keyword</constant>
			<constant>biofusionanalysis/functionalgroup/keywords</constant>
		</action>
	</rule>
	<rule code="2" status="optional">
		<condition>
			<conditionname sign="positive"> cannotfindsemanticgeneralization </conditionname>
			<variable>
				<set>1</set>
				<branch extract="textentry">protein/name</branch>
			</variable>
			<variable>
				<set>1</set>
				<branch extract="textentry">protein/function</branch>
			</variable>
			<logicalvariable type="singleton"> X </logicalvariable>
		</condition>
		<action>
			<actionname>AddText</actionname>
			<logicalvariable type="singleton"> X </logicalvariable>
			<constant>biofusionAnalysis/commonfunction</constant>
		</action>
	</rule>
</rulefile>
