edu.neu.ccs.evergreen.ir
Class RelationFactory

java.lang.Object
  extended by edu.neu.ccs.evergreen.ir.RelationFactory

public class RelationFactory
extends java.lang.Object


Constructor Summary
RelationFactory()
           
 
Method Summary
static RelationI and(int rank, int... variablePositions)
          Given a set of variable positions, return a relation that is the anding of these variables
static RelationI and(RelationI... relations)
           
static RelationI equiv(int rank, int... variablePositions)
          Given two variables x,y returns a relation that represents x=y
static RelationI equiv(RelationI relation1, RelationI relation2)
           
static RelationI imply(int rank, int... variablePositions)
          Given two variables x,y returns a relation that represents x==>y
static RelationI imply(RelationI relation1, RelationI relation2)
           
static void main(java.lang.String[] args)
           
static RelationI nMap(int relationNumber, int rank, int... variablePositions)
          nMaps a number of variables in a certain relation
static RelationI nMap(RelationI relation, int... variablePositions)
          nMaps a number of variables in a certain relation
static RelationI not(RelationI relation)
           
static RelationI or(int rank, int... variablePositions)
          Given a set of variable positions, return a relation that is the or of these variables
static RelationI or(RelationI... relations)
           
static RelationI xor(int rank, int... variablePositions)
          Given two variables x,y returns a relation that represents xor(x,y)
static RelationI xor(RelationI relation1, RelationI relation2)
           
static RelationI xTrueVars(int rank, int numberOfTrueVars)
          for 1in3 use xTrueVars(3,1)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationFactory

public RelationFactory()
Method Detail

or

public static RelationI or(int rank,
                           int... variablePositions)
Given a set of variable positions, return a relation that is the or of these variables

Parameters:
rank - the rank of the created relation
variablePositions - an arbitrary number of variable positions
Returns:
a relationI object that represents the oring of the variables at the given positions

and

public static RelationI and(int rank,
                            int... variablePositions)
Given a set of variable positions, return a relation that is the anding of these variables

Parameters:
rank - the rank of the created relation
variablePositions - an arbitrary number of variable positions
Returns:
a RelationI object that represents the anding of the variables at the given positions

nMap

public static RelationI nMap(int relationNumber,
                             int rank,
                             int... variablePositions)
nMaps a number of variables in a certain relation

Parameters:
relationNumber -
rank - the rank of the created relation
variablePositions - an arbitrary number of variable positions
Returns:
a RelationI object that represents the given relation with the given set of variables renamed

nMap

public static RelationI nMap(RelationI relation,
                             int... variablePositions)
nMaps a number of variables in a certain relation

Parameters:
relation -
variablePositions - an arbitrary number of variable positions
Returns:
a RelationI object that represents the given relation with the given set of variables renamed

imply

public static RelationI imply(int rank,
                              int... variablePositions)
Given two variables x,y returns a relation that represents x==>y

Parameters:
rank - the rank of the created relation
variablePositions - two variable positions
Returns:
a RelationI object that represents the x=>y where x,y are the given two variable positions

equiv

public static RelationI equiv(int rank,
                              int... variablePositions)
Given two variables x,y returns a relation that represents x=y

Parameters:
rank - the rank of the created relation
variablePositions - two variable positions
Returns:
a RelationI object that represents the x=y where x,y are the given two variable positions

xor

public static RelationI xor(int rank,
                            int... variablePositions)
Given two variables x,y returns a relation that represents xor(x,y)

Parameters:
rank - the rank of the created relation
variablePositions - two variable positions
Returns:
a RelationI object that represents the xor(x,y) where x,y are the given two variable positions

xTrueVars

public static RelationI xTrueVars(int rank,
                                  int numberOfTrueVars)
for 1in3 use xTrueVars(3,1)

Parameters:
rank -
numberOfTrueVars -
Returns:
a RelationI object representing the relation which is true only when the given number of vars is true

or

public static RelationI or(RelationI... relations)
Parameters:
relations -
Returns:
RelationI object whose relationNumber is the bitwise or of the given set of relations

and

public static RelationI and(RelationI... relations)
Parameters:
relations -
Returns:
RelationI object whose relationNumber is the bitwise and of the given set of relations

not

public static RelationI not(RelationI relation)
Parameters:
relation -
Returns:
RelationI object whose relationNumber is the bitwise not of the given relation

xor

public static RelationI xor(RelationI relation1,
                            RelationI relation2)
Parameters:
relation1 -
relation2 -
Returns:
RelationI object whose relationNumber is the bitwise xor of the given two relations

equiv

public static RelationI equiv(RelationI relation1,
                              RelationI relation2)
Parameters:
relation1 -
relation2 -
Returns:
RelationI object whose relationNumber is the bitwise equiv. of the given two relations

imply

public static RelationI imply(RelationI relation1,
                              RelationI relation2)
Parameters:
relation1 -
relation2 -
Returns:
RelationI object whose relationNumber is the bitwise implication of the given two relations

main

public static void main(java.lang.String[] args)