org.deri.iris.rules.compiler
Class RuleCompiler

java.lang.Object
  extended by org.deri.iris.rules.compiler.RuleCompiler

public class RuleCompiler
extends Object

A rule compiler for creating objects that compute new facts using forward-chaining techniques.


Constructor Summary
RuleCompiler(IFacts facts, Configuration configuration)
          Constructor.
RuleCompiler(IFacts facts, IEquivalentTerms equivalentTerms, Configuration configuration)
          Creates a new RuleCompiler.
 
Method Summary
 ICompiledRule compile(IQuery query)
          Compile a query.
 ICompiledRule compile(IRule rule)
          Compile a rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleCompiler

public RuleCompiler(IFacts facts,
                    Configuration configuration)
Constructor.

Parameters:
facts - The facts that will be used by the compiled rules.

RuleCompiler

public RuleCompiler(IFacts facts,
                    IEquivalentTerms equivalentTerms,
                    Configuration configuration)
Creates a new RuleCompiler.

Parameters:
facts - The facts that will be used by the compiled rules.
equivalentTerms - The equivalent terms.
configuration - The configuration.
Method Detail

compile

public ICompiledRule compile(IRule rule)
                      throws EvaluationException
Compile a rule. No optimisations of any kind are attempted.

Parameters:
rule - The rule to be compiled
Returns:
The compiled rule, ready to be evaluated
Throws:
EvaluationException - If the query can not be compiled for any reason.

compile

public ICompiledRule compile(IQuery query)
                      throws EvaluationException
Compile a query. No optimisations of any kind are attempted.

Parameters:
query - The query to be compiled
Returns:
The compiled query, ready to be evaluated
Throws:
EvaluationException - If the query can not be compiled for any reason.