org.deri.iris.optimisations.magicsets
Interface ISip

All Known Implementing Classes:
LeftToRightSip

public interface ISip

A SIP (Sideway Information Passing) to determine which variable of which literal was passed/bound by which literal.

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

Method Summary
 boolean containsVertex(ILiteral literal)
          Determines whether the sip constains a specific literal.
 Set<IVariable> getBoundVariables(ILiteral literal)
          Determines all variables, which are passed to this literal.
 Set<ILiteral> getDepends(ILiteral literal)
          Searches for literals on which the submitted literal depends.
 Set<LabeledEdge<ILiteral,Set<IVariable>>> getEdgesEnteringLiteral(ILiteral literal)
          Searches for edges entering this literal.
 Set<LabeledEdge<ILiteral,Set<IVariable>>> getEdgesLeavingLiteral(ILiteral literal)
          Searches for edges leaving this literal.
 Set<ILiteral> getLeafVertices()
          Determines the leafes of this graph.
 Comparator<ILiteral> getLiteralComparator()
          Returns the Comparator to compare literals according to their position in the sips.
 Set<ILiteral> getRootVertices()
          Determines the roots of this graph.
 Set<IVariable> variablesPassedByLiteral(ILiteral source, ILiteral target)
          Determines the set of variables passed to one literal by one specific edge.
 

Method Detail

getBoundVariables

Set<IVariable> getBoundVariables(ILiteral literal)
Determines all variables, which are passed to this literal.

Parameters:
literal - the literal for which to determine the variables
Returns:
the set of variables
Throws:
IllegalArgumentException - if the literal is null

getDepends

Set<ILiteral> getDepends(ILiteral literal)
Searches for literals on which the submitted literal depends.

Parameters:
literal - the literal for which to search for dependencies
Returns:
the set of literal on which the submitted literal depends
Throws:
IllegalArgumentException - if the literal is null

getEdgesEnteringLiteral

Set<LabeledEdge<ILiteral,Set<IVariable>>> getEdgesEnteringLiteral(ILiteral literal)
Searches for edges entering this literal.

Parameters:
literal - the literal for which to search for entering edges
Returns:
set of edges entering this literal
Throws:
IllegalArgumentException - if the literal is null

getEdgesLeavingLiteral

Set<LabeledEdge<ILiteral,Set<IVariable>>> getEdgesLeavingLiteral(ILiteral literal)
Searches for edges leaving this literal.

Parameters:
literal - the literal for which to search for entering edges
Returns:
set of edges entering this literal
Throws:
IllegalArgumentException - if the literal is null

variablesPassedByLiteral

Set<IVariable> variablesPassedByLiteral(ILiteral source,
                                        ILiteral target)
Determines the set of variables passed to one literal by one specific edge.

Parameters:
source - the source of the edge
target - the target of the edge
Returns:
the set of variables
Throws:
IllegalArgumentException - if one of the literal is null

containsVertex

boolean containsVertex(ILiteral literal)
Determines whether the sip constains a specific literal.

Parameters:
literal - the literal for which to search for
Returns:
whether or not the literal is in the sip
Throws:
IllegalArgumentException - if the literal is null

getRootVertices

Set<ILiteral> getRootVertices()
Determines the roots of this graph. A root is a Literal (vertex) with no entering arcs.

Returns:
the set of literals with no entering arcs

getLeafVertices

Set<ILiteral> getLeafVertices()
Determines the leafes of this graph. A leafe is a Literal (vertex) with no outfgoing arcs.

Returns:
the set of literals with no outfgoing arcs

getLiteralComparator

Comparator<ILiteral> getLiteralComparator()
Returns the Comparator to compare literals according to their position in the sips. If you want to use this comparator with adorned literals use the SipHelper.getAdornedSip(AdornedRule) method to get the sip for adorned literals, otherwise it wont work as expected.

Returns:
the comparator to compare literals
See Also:
SipHelper#getAdornedSip(org.deri.iris.evaluation.common.AdornedProgram.IAdornedRule)