edu.neu.ccs.evergreen.ir
Class RelationNumberUtil

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

public class RelationNumberUtil
extends java.lang.Object


Constructor Summary
RelationNumberUtil()
           
 
Method Summary
static int and(int rank, int... variablePositions)
          Given a set of variable positions, return a relation that is the anding of these variables
static int equiv(int rank, int... variablePositions)
          Given two variables x,y returns a relation that represents x=y
static int imply(int rank, int... variablePositions)
          Given two variables x,y returns a relation that represents x==>y
static void main(java.lang.String[] args)
           
static int nMap(int relationNumber, int rank, int... variablePositions)
          nMaps a number of variables in a certain relation
static int or(int rank, int... variablePositions)
          Given a set of variable positions, return a relation that is the or of these variables
static int xor(int rank, int... variablePositions)
          Given two variables x,y returns a relation that represents xor(x,y)
static int 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

RelationNumberUtil

public RelationNumberUtil()
Method Detail

or

public static int 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 relation number that represents the oring of the variables at the given positions

and

public static int 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 relation number that represents the anding of the variables at the given positions

nMap

public static int 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 relation number that represents the given relation with the given set of variables renamed

imply

public static int 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 relation number that represents the x=>y where x,y are the given two variable positions

equiv

public static int 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 relation number that represents the x=y where x,y are the given two variable positions

xor

public static int 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 relation number that represents the xor(x,y) where x,y are the given two variable positions

xTrueVars

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

Parameters:
rank -
numberOfTrueVars -
Returns:
an integer representing the relation number which is true only when the given number of vars is true

main

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