org.deri.iris.rules
Class RuleAnalyser

java.lang.Object
  extended by org.deri.iris.rules.RuleAnalyser

public class RuleAnalyser
extends Object

Methods to analyse rules.

Author:
Richard P??ttler (richard dot poettler at sti2 dot at)

Constructor Summary
RuleAnalyser()
           
 
Method Summary
static boolean containsConstructedTerms(ITuple tuple)
           
static boolean hasHeadLiteralInBody(IRule rule)
          Checks, whether the rule got some head atoms in the body.
static boolean hasSatisfiableVariableAssignment(IRule rule)
           Checks whether it is possible to assign any values to variables by static analysis of the rule.
static boolean isProductive(IRule rule)
          Checks, whether a rule is productive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleAnalyser

public RuleAnalyser()
Method Detail

hasHeadLiteralInBody

public static boolean hasHeadLiteralInBody(IRule rule)
Checks, whether the rule got some head atoms in the body.

Parameters:
rule - the rule to check
Returns:
true if the rule body contains head atoms, otherwise false
Throws:
IllegalArgumentException - if the rule is null

hasSatisfiableVariableAssignment

public static boolean hasSatisfiableVariableAssignment(IRule rule)
                                                throws EvaluationException

Checks whether it is possible to assign any values to variables by static analysis of the rule.

The implementation of this method is not finished. At the moment it is not able to handle constructed terms.

Parameters:
rule - the rule to check
Returns:
true if a variable assignment was found, which doesn't make sense.
Throws:
EvaluationException - if something went wrong while evaluating one of the equality built-ins.

containsConstructedTerms

public static boolean containsConstructedTerms(ITuple tuple)

isProductive

public static boolean isProductive(IRule rule)
Checks, whether a rule is productive.

Parameters:
rule - the rule to check
Returns:
true if the rule is productive, otherwise false
Throws:
IllegalArgumentException - if the rule is null