[RuleML-all] Multiple Assertions and Avoiding Recursion with RuleML & NxBRE

dhuffkc at hotmail.com dhuffkc at hotmail.com
Fri Nov 16 10:01:14 AST 2007


Pardon the basic questions.  I am using the NxBRE .NET engine, but my 
questions are primarily RuleML-related.  If there's a "RuleML by Example" 
resource available or a better forum to post I'd love to know about it.

Can I assert multiple new facts for the same condition (multiple heads for 
one body)?  Something like:

<Implies>
	<head>
		<Atom>
			<Rel>RelDerived 1</Rel>
			<Var>entity</Var>
			<Ind>DerivedValue 1</Ind>
		</Atom>
		<Atom>
			<Rel>RelDerived 2</Rel>
			<Var>entity</Var>
			<Ind>DerivedValue 2</Ind>
		</Atom>
	</head>
	<body>
		<Atom>
			<Rel>RelBase</Rel>
			<Var>entity</Var>
			<Ind>BaseValue</Ind>
		</Atom>
	</body>
</Implies>

In another situation, I am deriving a new fact, then have rules that modify 
that fact.  I only want to apply the modified rules once, however the second 
implication continues to run:

<!-- assert new fact based on value of existing fact -->
<Implies>
	<Atom>
		<Rel>Rel1</Rel>
		<Var>entity</Var>
		<Var>v1</Var>
	</Atom>
	<Atom>
		<Rel>NewRel</Rel>
		<Var>entity</Var>
		<Ind uri="nxbre://expression">{var:v1}</Ind>
	</Atom>
</Implies>

<!-- if Rel2(entity,i2) AND NewRel(entity,newValue), modify new fact 
NewRel(entity,newValue+1) only once -->
<Implies>
	<And>
		<Atom>
			<Rel>Rel2</Rel>
			<Var>entity</Var>
			<Ind>i2</Ind>
		</Atom>
		<Atom>
			<Rel>NewRel</Rel>
			<Var>entity</Var>
			<Var>newValue</Var>
		</Atom>
	</And>
	<Atom>
		<Rel>NewRel</Rel>
		<Var>entity</Var>
		<Ind uri="nxbre://expression">{var:newValue} + 1</Ind>
	</Atom>
</Implies>


This is probably clear as mud, but any assistance is appreciated.

Regards,

Don Huff 



More information about the RuleML-all mailing list