org.uacalc.alg
Class Algebras

java.lang.Object
  extended by org.uacalc.alg.Algebras

public class Algebras
extends java.lang.Object

A class with static methods for algebras.


Method Summary
static Term findNUF(SmallAlgebra alg, int arity)
          This will find a near unamimity term of the given arity if one exits; otherwise it return null.
static SmallAlgebra fullTransformationSemigroup(int n, boolean includeConstants, boolean includeId)
           
static boolean isEndomorphism(Operation endo, SmallAlgebra alg)
           
static boolean isHomomorphism(int[] map, SmallAlgebra alg0, SmallAlgebra alg1)
           
static int jonssonLevel(SmallAlgebra alg)
          If this algebra generates a distributive variety, this returns the minimal number of Jonsson terms; otherwise it returns -1, but it is probably better to jonssonTerms and get get the actual terms.
static java.util.List jonssonTerms(SmallAlgebra alg)
          This returns a list of Jonsson terms witnessing or null if the algebra does generate a congruence distributive variety.
static void main(java.lang.String[] args)
           
static SmallAlgebra makeRandomAlgebra(int n, int[] arities)
          Make a random algebra of a given the arities of the operations.
static SmallAlgebra makeRandomAlgebra(int n, int[] arities, long seed)
          Make a random algebra of a given the arities of the operations, optionally supplying a seed to the random number generator (in case regenerating the same algebra is important.
static SmallAlgebra makeRandomAlgebra(int n, SimilarityType simType)
          Make a random algebra of a given similarity type.
static SmallAlgebra makeRandomAlgebra(int n, SimilarityType simType, long seed)
          Make a random algebra of a given similarity type, optionally supplying a seed to the random number generator (in case regenerating the same algebra is important.
static SmallAlgebra matrixPower(SmallAlgebra alg, int k)
          The matrix power algebra as defined in Hobby-McKenzie.
static SmallAlgebra ternaryDiscriminatorAlgebra(int card)
           
static java.util.NavigableSet<IntArray> unaryClone(java.util.List<Partition> pars, Partition eta0, Partition eta1)
           
static SmallAlgebra unaryCloneAlgFromPartitions(java.util.List<Partition> pars, java.util.List<Partition> decomp)
          WARNING: this is not complete.
static SmallAlgebra unaryCloneAlgFromPartitions(java.util.List<Partition> pars, Partition eta0, Partition eta1)
          Make the unary algebra whose operations are the clone of unary operation respecting every partition in pars and also eta0 and eta1, which meet and join to 0 and 1 and permute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unaryCloneAlgFromPartitions

public static SmallAlgebra unaryCloneAlgFromPartitions(java.util.List<Partition> pars,
                                                       java.util.List<Partition> decomp)
WARNING: this is not complete. Make an algebra from the unary operations respecting a list pars of partitions.

Parameters:
pars - a list of partitions
decomp - a sublist whose meet is 0
Returns:
the algebra

unaryCloneAlgFromPartitions

public static SmallAlgebra unaryCloneAlgFromPartitions(java.util.List<Partition> pars,
                                                       Partition eta0,
                                                       Partition eta1)
Make the unary algebra whose operations are the clone of unary operation respecting every partition in pars and also eta0 and eta1, which meet and join to 0 and 1 and permute.

Parameters:
pars -
eta0 -
eta1 -
Returns:

unaryClone

public static java.util.NavigableSet<IntArray> unaryClone(java.util.List<Partition> pars,
                                                          Partition eta0,
                                                          Partition eta1)

findNUF

public static Term findNUF(SmallAlgebra alg,
                           int arity)
This will find a near unamimity term of the given arity if one exits; otherwise it return null.


jonssonTerms

public static java.util.List jonssonTerms(SmallAlgebra alg)
This returns a list of Jonsson terms witnessing or null if the algebra does generate a congruence distributive variety. It is guarenteed to be the least number of terms possible.


jonssonLevel

public static int jonssonLevel(SmallAlgebra alg)
If this algebra generates a distributive variety, this returns the minimal number of Jonsson terms; otherwise it returns -1, but it is probably better to jonssonTerms and get get the actual terms. So congruence distributivity can be tested by seeing if this this is positive. If the algebra has only one element, it returns 2. For a lattice it returns 3. For Miklos Marioti's 5-ary near unanimity operation on a 4 element set, it returns 7 (the maximum possible).


isEndomorphism

public static boolean isEndomorphism(Operation endo,
                                     SmallAlgebra alg)

isHomomorphism

public static boolean isHomomorphism(int[] map,
                                     SmallAlgebra alg0,
                                     SmallAlgebra alg1)

matrixPower

public static SmallAlgebra matrixPower(SmallAlgebra alg,
                                       int k)
The matrix power algebra as defined in Hobby-McKenzie.

Parameters:
alg -
k -
Returns:

fullTransformationSemigroup

public static SmallAlgebra fullTransformationSemigroup(int n,
                                                       boolean includeConstants,
                                                       boolean includeId)

makeRandomAlgebra

public static SmallAlgebra makeRandomAlgebra(int n,
                                             SimilarityType simType)
Make a random algebra of a given similarity type.


makeRandomAlgebra

public static SmallAlgebra makeRandomAlgebra(int n,
                                             SimilarityType simType,
                                             long seed)
Make a random algebra of a given similarity type, optionally supplying a seed to the random number generator (in case regenerating the same algebra is important.


makeRandomAlgebra

public static SmallAlgebra makeRandomAlgebra(int n,
                                             int[] arities)
Make a random algebra of a given the arities of the operations.


makeRandomAlgebra

public static SmallAlgebra makeRandomAlgebra(int n,
                                             int[] arities,
                                             long seed)
Make a random algebra of a given the arities of the operations, optionally supplying a seed to the random number generator (in case regenerating the same algebra is important.


ternaryDiscriminatorAlgebra

public static SmallAlgebra ternaryDiscriminatorAlgebra(int card)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright 2003 Ralph Freese. All Rights Reserved.