org.deri.iris.rules.safety
Class StandardRuleSafetyProcessor

java.lang.Object
  extended by org.deri.iris.rules.safety.StandardRuleSafetyProcessor
All Implemented Interfaces:
IRuleSafetyProcessor

public class StandardRuleSafetyProcessor
extends Object
implements IRuleSafetyProcessor

A standard rule-safety processor that checks if all variables are limited, a la Ullman. If not, a rule unsafe exception is thrown.


Constructor Summary
StandardRuleSafetyProcessor()
          Default constructor.
StandardRuleSafetyProcessor(boolean allowUnlimitedVariablesInNegatedOrdinaryPredicates, boolean ternaryTargetsImplyLimited)
          Constructor.
 
Method Summary
 IRule process(IRule rule)
          Process the rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardRuleSafetyProcessor

public StandardRuleSafetyProcessor()
Default constructor. Initialises with most flexible rule-safety parameters.


StandardRuleSafetyProcessor

public StandardRuleSafetyProcessor(boolean allowUnlimitedVariablesInNegatedOrdinaryPredicates,
                                   boolean ternaryTargetsImplyLimited)
Constructor.

Parameters:
allowUnlimitedVariablesInNegatedOrdinaryPredicates - Indicates if a rule can still be considered safe if one or more variables occur in negative ordinary predicates and nowhere else, e.g. p(X) :- q(X), not r(Y) if true, the above rule would be safe
ternaryTargetsImplyLimited - Indicates if ternary arithmetic built-ins can be used to deduce limited variables, e.g. p(Z) :- q(X, Y), X + Y = Z if true, then Z would be considered limited.
Method Detail

process

public IRule process(IRule rule)
              throws RuleUnsafeException
Description copied from interface: IRuleSafetyProcessor
Process the rule.

Specified by:
process in interface IRuleSafetyProcessor
Parameters:
rule - The rule to process.
Returns:
The processed rule.
Throws:
RuleUnsafeException