org.deri.iris.api.basics
Interface IRule

All Known Implementing Classes:
Rule

public interface IRule

Represents a rule in the program. A rule has a form:

q :- p1, p2,...,pn

where q is a positive literal (the head), and p1, p2,...,pn is a conjunction of several literals (the body). Only safe rules are supported. A rule is safe if its every variable occurs in one of its positive, non built-in, atoms of the body.

$Id: IRule.java,v 1.9 2007-10-30 08:28:27 poettler_ric Exp $

Version:
$Revision: 1.9 $
Author:
Darko Anicic, DERI Innsbruck

Method Summary
 List<ILiteral> getBody()
          Get the rule body.
 List<ILiteral> getHead()
          Get the rule head-
 boolean isRectified()
           A rule is rectified if its head has the same form as heads of the other rules from the program, e.g.
 

Method Detail

getHead

List<ILiteral> getHead()
Get the rule head-

Returns:
The rule head.

getBody

List<ILiteral> getBody()
Get the rule body.

Returns:
The rule body.

isRectified

boolean isRectified()

A rule is rectified if its head has the same form as heads of the other rules from the program, e.g. p(X1,...,Xk) for variables X1,...,Xk.

For a given pair of rules:

after the rectification we get the following rules:

where both rules have heads of the same form.

Returns:
True if the rule is rectified; otherwise false.