edu.toronto.cs.algebra
Class AbstractTableAlgebra

java.lang.Object
  extended by edu.toronto.cs.algebra.AbstractTableAlgebra
All Implemented Interfaces:
IAlgebra
Direct Known Subclasses:
DeMorganTableAlgebra

public abstract class AbstractTableAlgebra
extends java.lang.Object
implements IAlgebra

Implementation of a lattice that sorts its elements in topological order and builds a join table following the algorithms in Free Lattices by Ralph Freese author: Arie Gurfinkel arie@cs.toronto.edu /**** Implements all kinds of (partially) ordered set operations namely: topological sorting and computing a join table


Constructor Summary
AbstractTableAlgebra(AbstractTableAlgebra set1, AbstractTableAlgebra set2)
          Construct an ordered set which is a product of set1 and set2
AbstractTableAlgebra(java.util.Collection _elements, java.util.Collection aboveRelation)
          Constructs an ordered set given a collection of elements and an above relation (given a set of pairs)
 
Method Summary
 AlgebraValue bot()
           
 java.util.Collection carrierSet()
           
 IntIterator carrierSetId()
           
 void dumpTables(java.io.PrintWriter out)
          TESTER method and debug functions
 void dumpValueMap(java.io.PrintWriter out)
           
 AlgebraValue eq(AlgebraValue v1, AlgebraValue v2)
           
 AlgebraValue geq(AlgebraValue v1, AlgebraValue v2)
           
 java.util.Set getJoinIrredundant(java.util.BitSet subset)
           
 int[][] getJoinTable()
           
 int[][] getMeetTable()
           
 AlgebraValue getValue(int id)
           
 AlgebraValue getValue(java.lang.String name)
          Lattice Interface
abstract  AlgebraValue impl(AlgebraValue v1, AlgebraValue v2)
           
 AlgebraValue join(AlgebraValue v1, AlgebraValue v2)
           
 AlgebraValue[] joinDecomposition(AlgebraValue v)
           
 AlgebraValue leq(AlgebraValue v1, AlgebraValue v2)
           
 AlgebraValue meet(AlgebraValue v1, AlgebraValue v2)
           
abstract  AlgebraValue neg(AlgebraValue v)
           
 AlgebraValue noValue()
           
 int size()
           
 AlgebraValue top()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.toronto.cs.algebra.IAlgebra
getMeetIrredundant
 

Constructor Detail

AbstractTableAlgebra

public AbstractTableAlgebra(AbstractTableAlgebra set1,
                            AbstractTableAlgebra set2)
Construct an ordered set which is a product of set1 and set2


AbstractTableAlgebra

public AbstractTableAlgebra(java.util.Collection _elements,
                            java.util.Collection aboveRelation)
Constructs an ordered set given a collection of elements and an above relation (given a set of pairs)

Method Detail

noValue

public AlgebraValue noValue()
Specified by:
noValue in interface IAlgebra

getJoinTable

public int[][] getJoinTable()

getMeetTable

public int[][] getMeetTable()

getValue

public AlgebraValue getValue(java.lang.String name)
Lattice Interface

Specified by:
getValue in interface IAlgebra

getValue

public AlgebraValue getValue(int id)
Specified by:
getValue in interface IAlgebra

meet

public AlgebraValue meet(AlgebraValue v1,
                         AlgebraValue v2)
Specified by:
meet in interface IAlgebra

join

public AlgebraValue join(AlgebraValue v1,
                         AlgebraValue v2)
Specified by:
join in interface IAlgebra

neg

public abstract AlgebraValue neg(AlgebraValue v)
Specified by:
neg in interface IAlgebra

impl

public abstract AlgebraValue impl(AlgebraValue v1,
                                  AlgebraValue v2)
Specified by:
impl in interface IAlgebra

top

public AlgebraValue top()
Specified by:
top in interface IAlgebra

bot

public AlgebraValue bot()
Specified by:
bot in interface IAlgebra

eq

public AlgebraValue eq(AlgebraValue v1,
                       AlgebraValue v2)
Specified by:
eq in interface IAlgebra

leq

public AlgebraValue leq(AlgebraValue v1,
                        AlgebraValue v2)
Specified by:
leq in interface IAlgebra

geq

public AlgebraValue geq(AlgebraValue v1,
                        AlgebraValue v2)
Specified by:
geq in interface IAlgebra

size

public int size()
Specified by:
size in interface IAlgebra

carrierSetId

public IntIterator carrierSetId()
                         throws java.lang.UnsupportedOperationException
Specified by:
carrierSetId in interface IAlgebra
Throws:
java.lang.UnsupportedOperationException

carrierSet

public java.util.Collection carrierSet()
                                throws java.lang.UnsupportedOperationException
Specified by:
carrierSet in interface IAlgebra
Throws:
java.lang.UnsupportedOperationException

joinDecomposition

public AlgebraValue[] joinDecomposition(AlgebraValue v)
Specified by:
joinDecomposition in interface IAlgebra

dumpTables

public void dumpTables(java.io.PrintWriter out)
TESTER method and debug functions


dumpValueMap

public void dumpValueMap(java.io.PrintWriter out)

getJoinIrredundant

public java.util.Set getJoinIrredundant(java.util.BitSet subset)
Specified by:
getJoinIrredundant in interface IAlgebra