org.deri.iris.rules.stratification
Class LocalStratifier

java.lang.Object
  extended by org.deri.iris.rules.stratification.LocalStratifier
All Implemented Interfaces:
IRuleStratifier

public class LocalStratifier
extends Object
implements IRuleStratifier

A local stratification algorithm. This algorithm will 'split' rules and so will likely return more rules than were provided.

See Also:
org.deri.iris.rules.IRuleStratifier#stratify()

Constructor Summary
LocalStratifier(boolean strict)
          Constructor.
 
Method Summary
 boolean isStrict()
          Indicates if the stratifier is applying strict variable-constant substitutions only.
 List<List<IRule>> stratify(List<IRule> rules)
          Stratify the rules, i.e.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocalStratifier

public LocalStratifier(boolean strict)
Constructor.

Parameters:
strict - true, if the stratifier is permitted to substitute variables with constants when they appear in equality built-ins. false, if the substitution may only occur when the built-in is an exact equality
Method Detail

isStrict

public boolean isStrict()
Indicates if the stratifier is applying strict variable-constant substitutions only.

Returns:
true, if strict, false otherwise.

stratify

public List<List<IRule>> stratify(List<IRule> rules)
Description copied from interface: IRuleStratifier
Stratify the rules, i.e. arrange them in to groups such that each increasing level of rules can be evaluated before the next higher level of dependent rules.

Specified by:
stratify in interface IRuleStratifier
Parameters:
rules - The collection of rules to stratify
Returns:
The rules arranged in to strata. The number of rules returned may be different to the number provided, because the stratification technique might require the rules to be re-written.

toString

public String toString()
Overrides:
toString in class Object