public class Operations
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
binaryOpToCSV(java.lang.String desc,
Operation binop,
java.io.PrintStream out) |
static boolean |
commutes(int[] map,
Operation op0,
Operation op1)
Test if map defines a homomorphism wrt these operations.
|
static boolean |
commutes(Operation unaryOp,
Operation op)
This tests if an operation commutes with a unary operation.
|
static boolean |
equalValues(Operation op0,
Operation op1)
Test if these have the same int values on the common sized set.
|
static int[] |
findDifference(Operation op0,
Operation op1) |
static int[] |
findDifference(Operation op0,
Operation op1,
ProgressReport report)
Find an argument where these operations differ.
|
static boolean |
isAssociative(Operation op)
Test if an operation is binary and associative.
|
static boolean |
isCommutative(Operation op)
Test if an operation is binary and commutative.
|
static boolean |
isIdempotent(Operation op)
Test if an operation is idempotent.
|
static boolean |
isMaltsev(Operation op)
Check if a ternary operation is a Maltsev operation.
|
static boolean |
isTotal(Operation op) |
static boolean |
isTotallySymmetric(Operation op)
Test if an operation is totally symmetric; that is, invariant
under all permutation of the variables.
|
static void |
main(java.lang.String[] args) |
static Operation |
makeBinaryIntOperation(OperationSymbol symbol,
int algSize,
int[][] table) |
static Operation |
makeBinaryLeftShift(int vecSize,
int rootSize)
This maps a pair of vectors (x,y) to (y_{k-1},x_0, ..., x_{k-2}); see
McKenzie's finite forbidden lattices.
|
static Operation |
makeCompositionOp(int n,
int pow) |
static Operation |
makeConstantIntOperation(int algSize,
int elt) |
static Operation |
makeConstantIntOperation(java.lang.String symbolPrefix,
int algSize,
int elt) |
static java.util.List<Operation> |
makeConstantIntOperations(int algSize) |
static Operation |
makeDerivedOperation(Operation op,
int[] reductionArray,
int newArity)
The operation derived by equating variables.
|
static Operation |
makeFullCycle(int algSize) |
static Operation |
makeIntOperation(Operation opx)
This makes a new operation that agrees with the original but is
table based and so faster.
|
static Operation |
makeIntOperation(OperationSymbol symbol,
int algSize,
int[] valueTable)
Construct an Operation from a valueTable.
|
static Operation |
makeIntOperation(java.lang.String symbol,
int arity,
int algSize,
int[] valueTable)
Construct an Operation from a valueTable.
|
static java.util.List<Operation> |
makeIntOperations(java.util.List<Operation> ops) |
static java.util.List<Operation> |
makeJonssonOperationsFromNUF(Operation nuf)
Make the Jonsson terms from a near unanimity operation, omitting
the two projections.
|
static Operation |
makeLeftShift(int vecSize,
int rootSize)
The unary operation that cyclically shifts a vector left.
|
static java.util.Map<OperationSymbol,Operation> |
makeMap(java.util.List<Operation> ops)
This makes a hash map from the operation symbols to the operations.
|
static Operation |
makeMatrixDiagonalOp(int vecSize,
int rootSize) |
static Operation |
makeModuleOperation(int modulus,
int[] coeffs) |
static Operation |
makeOperationFromScript(OperationSymbol symbol,
int arity,
int algSize,
java.lang.String[] script)
The
script should be the body of the definition
of intValueAt(int[] args). |
static Operation |
makeRandomOperation(int n,
OperationSymbol opSym)
Make an operation with the the given opeation symbol
and set size.
|
static Operation |
makeRandomOperation(int n,
OperationSymbol opSym,
java.util.Random random)
Make an operation with the the given opeation symbol
and set size.
|
static java.util.List<Operation> |
makeRandomOperations(int n,
SimilarityType simType)
Make a list of operations corresponding to a similarity type and a
set size.
|
static java.util.List<Operation> |
makeRandomOperations(int n,
SimilarityType simType,
long seed)
Make a list of operations corresponding to a similarity type and a
set size.
|
static Operation |
makeTransposition(int algSize,
int a0,
int a1)
Make a unary operation interchanging a0 and a1.
|
static int |
power(int base,
int pow) |
static Operation |
ternaryDiscriminator(int size) |
public static boolean commutes(Operation unaryOp, Operation op)
public static boolean commutes(int[] map, Operation op0, Operation op1)
map
- an array defining the mapop0
- the first operationop1
- the second operationpublic static boolean isTotal(Operation op)
public static final boolean isIdempotent(Operation op)
public static final boolean isCommutative(Operation op)
public static final boolean isTotallySymmetric(Operation op)
public static final boolean isAssociative(Operation op)
public static final boolean isMaltsev(Operation op)
op
- public static final int[] findDifference(Operation op0, Operation op1, ProgressReport report)
op0
- op1
- java.lang.IllegalArgumentException
- if the arities or set sizes differ.public static java.util.Map<OperationSymbol,Operation> makeMap(java.util.List<Operation> ops)
public static boolean equalValues(Operation op0, Operation op1)
public static Operation ternaryDiscriminator(int size)
public static Operation makeRandomOperation(int n, OperationSymbol opSym)
n
- the set sizeopSym
- the operation symbolpublic static Operation makeRandomOperation(int n, OperationSymbol opSym, java.util.Random random)
n
- the set sizeopSym
- the operation symbolrandom
- a random number generator.public static java.util.List<Operation> makeRandomOperations(int n, SimilarityType simType)
n
- the set sizesimType
- the similarity typepublic static java.util.List<Operation> makeRandomOperations(int n, SimilarityType simType, long seed)
n
- the set sizesimType
- the similarity typeseed
- a random seed or -1public static Operation makeDerivedOperation(Operation op, int[] reductionArray, int newArity)
reductionArray
- an int array that can be viewed as a map
from the int less than the arity of op
into the arity of the derived operation.public static java.util.List<Operation> makeJonssonOperationsFromNUF(Operation nuf)
public static final int power(int base, int pow)
public static Operation makeLeftShift(int vecSize, int rootSize)
public static Operation makeBinaryLeftShift(int vecSize, int rootSize)
public static Operation makeMatrixDiagonalOp(int vecSize, int rootSize)
public static Operation makeModuleOperation(int modulus, int[] coeffs)
public static Operation makeCompositionOp(int n, int pow)
public static Operation makeOperationFromScript(OperationSymbol symbol, int arity, int algSize, java.lang.String[] script) throws javax.script.ScriptException
script
should be the body of the definition
of intValueAt(int[] args).javax.script.ScriptException
public static java.util.List<Operation> makeIntOperations(java.util.List<Operation> ops)
public static Operation makeIntOperation(Operation opx)
opx
- the original operationpublic static Operation makeIntOperation(java.lang.String symbol, int arity, int algSize, int[] valueTable)
valueTable
- a Horner encode table of the values of the operation.public static Operation makeIntOperation(OperationSymbol symbol, int algSize, int[] valueTable)
valueTable
- a Horner encode table of the values of the operation.public static Operation makeBinaryIntOperation(OperationSymbol symbol, int algSize, int[][] table)
public static Operation makeConstantIntOperation(int algSize, int elt)
public static Operation makeTransposition(int algSize, int a0, int a1)
algSize
- a0
- a1
- public static Operation makeFullCycle(int algSize)
public static Operation makeConstantIntOperation(java.lang.String symbolPrefix, int algSize, int elt)
public static java.util.List<Operation> makeConstantIntOperations(int algSize)
public static void binaryOpToCSV(java.lang.String desc, Operation binop, java.io.PrintStream out)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
Copyright 2003 Ralph Freese. All Rights Reserved.