JTP API Documentation

jtp.gmp
Class ClauseOrientation

java.lang.Object
  |
  +--jtp.gmp.ClauseOrientation
All Implemented Interfaces:
Serializable

public class ClauseOrientation
extends Object
implements Serializable

A view of a Clause in which one of the Literals in the clause has been selected as a head.

ClauseOrientations are the objects that are stored and manipulated by the ClauseOrientationKB. They are used to represent the contrapositives of a Clause.

See Also:
Serialized Form

Constructor Summary
ClauseOrientation(Clause cl, Literal head)
          Creates a new clause orientation from a clause and a literal chosen as the orientation head.
 
Method Summary
 Collection clauses()
           
 List createSubGoals(List dst)
          Produces a list of Literal subgoals which, if proven, prove the head of this ClauseOrientation.
 Clause getClause()
           
 Literal getHead()
           
 Collection literals()
           
static ClauseOrientation[] produceOrientations(Clause cl)
          Given a Clause cl with n Literals, returns an array with n ClauseOrientations.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClauseOrientation

public ClauseOrientation(Clause cl,
                         Literal head)
Creates a new clause orientation from a clause and a literal chosen as the orientation head. Note that the head has to be one of the literals in the clause! This rule is not checked, and disregarding it will wreak havoc.

Parameters:
cl - The clause
head - one of the clause's literals, chosen as head for this orientation.
Method Detail

produceOrientations

public static ClauseOrientation[] produceOrientations(Clause cl)
Given a Clause cl with n Literals, returns an array with n ClauseOrientations. In each ClauseOrientation, the clause is cl, and the head is a Literal in cl. A different Literal is the head in each ClauseOrientation in the returned array.


toString

public String toString()
Overrides:
toString in class Object

literals

public Collection literals()

clauses

public Collection clauses()

getHead

public Literal getHead()

getClause

public Clause getClause()

createSubGoals

public List createSubGoals(List dst)
Produces a list of Literal subgoals which, if proven, prove the head of this ClauseOrientation.

The returned list consists of the literals from this ClauseOrientation's clause in negated form, minus the head literal.

Parameters:
dst - a List to which the Literal subgoals will be added. If null, an ArrayList will be created and used.
Returns:
the List of Literal subgoals. If dst is non-null, dst will be returned.

JTP API Documentation