org.uacalc.alg.op
Interface Operation

All Known Subinterfaces:
TermOperation
All Known Implementing Classes:
AbstractOperation, OperationWithDefaultValue, TermOperationImp

public interface Operation

This interface specifies an operation, that is, a map from the direct product of some number (called the arity) of a set to the set. Since the set will often be just {0, 1, ..., n-1} we have intValueAt(int[] args) form of the operation. We also have an Object form for general sets. Since only one or the other may be required, both are optional.


Method Summary
 int arity()
          This gives the arity of this operation.
 int getSetSize()
          This gives the size of the set upon which the operation is defined.
 int[] getTable()
          Get the table for this operation or null if it does not exist.
 int[] getTable(boolean makeTable)
          Get the table for this operation.
 int intValueAt(int arg)
          This (optional) operation is for fast access to the table, if it exits.
 int intValueAt(int[] args)
          This (optional) operation is the int version.
 boolean isAssociative()
          Is this operation binary and associative.
 boolean isCommutative()
          Is this operation binary and commutative.
 boolean isIdempotent()
          Is this operation idempotent in the sense f(x,x,..,x) = x.
 boolean isTableBased()
           
 boolean isTotal()
          Only OperationWithDefaultValue's can fail this.
 boolean isTotallySymmetric()
          Is this operation totally symmetric; that is, invariant under all permutation of the variables.
 void makeTable()
          This will make a table and so make the operation faster but requires more space.
 OperationSymbol symbol()
          The operation symbol for this operation.
 int[] valueAt(int[][] args)
          This operation is for fast product operation.
 java.lang.Object valueAt(java.util.List args)
          This operation is the element version.
 

Method Detail

arity

int arity()
This gives the arity of this operation.


getSetSize

int getSetSize()
This gives the size of the set upon which the operation is defined.


symbol

OperationSymbol symbol()
The operation symbol for this operation.


valueAt

java.lang.Object valueAt(java.util.List args)
This operation is the element version.


valueAt

int[] valueAt(int[][] args)
This operation is for fast product operation.

Parameters:
args - an array of arity int arrays from the product algebra.

intValueAt

int intValueAt(int[] args)
This (optional) operation is the int version.


intValueAt

int intValueAt(int arg)
This (optional) operation is for fast access to the table, if it exits.

Parameters:
arg - the Horner encoding of the actual args.
Returns:

makeTable

void makeTable()
This will make a table and so make the operation faster but requires more space. So if A is in HSP(B) then for ints x and y, x * y would be evaluated by finding the representative of x and y of the congruence; then these representatives would be expanded into array representing the corresponding elements in the direct product. These would be multiplied and then the whole process would be reversed. If A is reasonable small it may make sense to make a table for the multiplication.


getTable

int[] getTable()
Get the table for this operation or null if it does not exist.


getTable

int[] getTable(boolean makeTable)
Get the table for this operation. If it does not exist make it if makeTable is true.

Parameters:
makeTable - forces the table to be made if necessary
Returns:
the table

isTableBased

boolean isTableBased()

isIdempotent

boolean isIdempotent()
Is this operation idempotent in the sense f(x,x,..,x) = x.


isAssociative

boolean isAssociative()
Is this operation binary and associative.


isCommutative

boolean isCommutative()
Is this operation binary and commutative.


isTotallySymmetric

boolean isTotallySymmetric()
Is this operation totally symmetric; that is, invariant under all permutation of the variables.


isTotal

boolean isTotal()
Only OperationWithDefaultValue's can fail this.

Returns:


Copyright 2003 Ralph Freese. All Rights Reserved.