org.deri.iris.optimisations.magicsets
Class AdornedProgram.AdornedPredicate

java.lang.Object
  extended by org.deri.iris.optimisations.magicsets.AdornedProgram.AdornedPredicate
All Implemented Interfaces:
Comparable<IPredicate>, IPredicate
Enclosing class:
AdornedProgram

public static class AdornedProgram.AdornedPredicate
extends Object
implements IPredicate

Represents an adorned predicate. A adorned predicate is a predicate with an array of adornments attached to it denoting the bound and free arguments of it's tuple's terms

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

Constructor Summary
AdornedProgram.AdornedPredicate(IAtom atom)
          Constructs an adorned predicate out of an atom.
AdornedProgram.AdornedPredicate(IAtom atom, Collection<IVariable> bounds)
          Constructs an adorned predicate out of an atom and its bound variables.
AdornedProgram.AdornedPredicate(ILiteral literal)
          Constructs an adorned predicate out of a literal.
AdornedProgram.AdornedPredicate(String symbol, Adornment[] adornment)
          Constructs an adorned predicate.
AdornedProgram.AdornedPredicate(String symbol, int arity, Adornment[] adornment)
          Constructs an adorned predicate.
 
Method Summary
 int compareTo(IPredicate other)
           
 boolean equals(Object object)
           
 Adornment[] getAdornment()
           
 int getArity()
           Returns the arity of the predicate.
 String getPredicateSymbol()
           Returns the predicate symbol.
 IPredicate getUnadornedPredicate()
           
 int hashCode()
           
 boolean hasSameSignature(IPredicate other)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdornedProgram.AdornedPredicate

public AdornedProgram.AdornedPredicate(String symbol,
                                       Adornment[] adornment)
Constructs an adorned predicate.

Parameters:
symbol - symbol for the predicate
adornment - the array of bound and frees
Throws:
IllegalArgumentException - if the adornment is null
IllegalArgumentException - if the predicate symbol is null
IllegalArgumentException - if the adornment contains null

AdornedProgram.AdornedPredicate

public AdornedProgram.AdornedPredicate(String symbol,
                                       int arity,
                                       Adornment[] adornment)
Constructs an adorned predicate.

Parameters:
symbol - symbol for the predicate
arity - the arity of the predicate.
adornment - the array of bound and frees
Throws:
IllegalArgumentException - if the adornment is null
IllegalArgumentException - if the predicate symbol is null
IllegalArgumentException - if the adornment contains null
IllegalArgumentException - if the arity of the predicate is bigger than the length of the adornment

AdornedProgram.AdornedPredicate

public AdornedProgram.AdornedPredicate(IAtom atom,
                                       Collection<IVariable> bounds)
Constructs an adorned predicate out of an atom and its bound variables. All occurrences in the atom of the bound variables will be marked as bound in the adornment.

Parameters:
atom - the atom
bounds - collection of all bound variables of the atom
Throws:
IllegalArgumentException - if the atom is null

AdornedProgram.AdornedPredicate

public AdornedProgram.AdornedPredicate(ILiteral literal)
Constructs an adorned predicate out of a literal. All ground terms will be marked as bound.

Parameters:
literal - for which to construct the adorned predicate
Throws:
IllegalArgumentException - if literal's the atom is null

AdornedProgram.AdornedPredicate

public AdornedProgram.AdornedPredicate(IAtom atom)
Constructs an adorned predicate out of an atom. All ground terms will be marked as bound.

Parameters:
atom - the atom
Throws:
IllegalArgumentException - if the atom is null
Method Detail

hasSameSignature

public boolean hasSameSignature(IPredicate other)

getUnadornedPredicate

public IPredicate getUnadornedPredicate()

getAdornment

public Adornment[] getAdornment()

getArity

public int getArity()
Description copied from interface: IPredicate

Returns the arity of the predicate.

Specified by:
getArity in interface IPredicate
Returns:
The arity.

getPredicateSymbol

public String getPredicateSymbol()
Description copied from interface: IPredicate

Returns the predicate symbol.

Specified by:
getPredicateSymbol in interface IPredicate
Returns:
The predicate symbol.

compareTo

public int compareTo(IPredicate other)
Specified by:
compareTo in interface Comparable<IPredicate>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object