edu.neu.ccs.rawmaterial
Class SymFormula

java.lang.Object
  extended by edu.neu.ccs.rawmaterial.SymFormula

 class SymFormula
extends java.lang.Object

Class for generation of symmetric formula. It takes care of all types of relations:

  1. symmetric relation - Relations for which arrangement of variables is not important. e.g relation 22 (001 or 010 or 100), a b c and c b a both can be satisfied by !a !b c. All the combinations should be generated for these relations. Therefore, (n choose 3) constraint will be generated.
  2. asymmetric relation - Relations for which arrangement of variables is important. e.g relation 2(001), a b c and c b a both can not be satisfied by same assignment. 1st requires a !b !c and 2nd will be satisfied by c !b !a. In this case (n choose 3) * 6 constraints will be generated.
  3. dont cares - There are some relations that have terms that we dont care about. e.g. relation 170 (001 or 011 or 101 or 111) where only the last one matters, the other two are dont cares. In this case we introduce variable named dc1, dc2 to represent dont care terms. The number of relations will depend on if the remaining formula is symmetric or asmmetric.

Author:
Charu Chandra and Wu Jiang

Field Summary
(package private) static java.lang.String dc1
           
(package private) static java.lang.String dc2
           
(package private) static java.lang.String dc3
           
(package private) static int rankNo
           
 
Constructor Summary
SymFormula()
           
 
Method Summary
static java.lang.String[][] generateSymFormula(int varNum, int relNum)
          Resturns a two dimensional array of Strings that contains rows of symmetric formula
static void p(java.lang.String s)
           
static java.lang.String[][] permAndCombinations(int n, int relNum)
          Find all the permutations and combinations for a relation number for n variables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rankNo

static int rankNo

dc1

static java.lang.String dc1

dc2

static java.lang.String dc2

dc3

static java.lang.String dc3
Constructor Detail

SymFormula

SymFormula()
Method Detail

p

public static void p(java.lang.String s)

permAndCombinations

public static java.lang.String[][] permAndCombinations(int n,
                                                       int relNum)
Find all the permutations and combinations for a relation number for n variables

Parameters:
n -
relNum -
Returns:

generateSymFormula

public static java.lang.String[][] generateSymFormula(int varNum,
                                                      int relNum)
Resturns a two dimensional array of Strings that contains rows of symmetric formula

Parameters:
varNum -
relNum -
Returns: