// Path: src/utils/ByteWrapper.java
// public class ByteWrapper {
// 	public byte value;
// 
// 	public ByteWrapper(byte value) {
// 		this.value = value;
// 	}
// }
// 
// Path: src/utils/Hash.java
// public class Hash {
// 	/*
// 	 * comment from C&C: shift value to multiply by with each additional
// 	 * component of the hash function; this number is normally selected to be
// 	 * a smallish prime; 31 and 37 seem to work well
// 	 */
// 	private final static long INC = 92821;
// 	private long hash;
// 
// 	public Hash(Hash other) {
// 		hash = other.value();
// 	}
// 
// 	public Hash(long hash) {
// 		this.hash = hash;
// 	}
// 
// 	public Hash(byte hash) {
// 		this.hash = (hash);
// 	}
// 
// 	public long value() {
// 		return hash;
// 	}
// 
// 	public void plusEqual(long value) {
// 		// += in the C&C code
// 		hash *= INC;
// 		hash += value;
// 	}
// 
// 	public void barEqual(long value) {
// 		// |= in the C&C code
// 		hash += value;
// 	}
// 
// 	public void timesEqual(long value) {
// 		// *= in the C&C code
// 		hash *= value;
// 	}
// }


import utils.ByteWrapper;
import utils.Hash;
		this.unificationHash = new Hash(other.unificationHash);
		this.equivalenceHash = isComplex() ? eHashComplex() : eHashBasic();
		// need to call eHash method again since the feature may have changed from other

	}

	/*
	 * uses the constructor above; upper-case first letter since this is
	 * effectively a constructor; called TransVariable because it copies the
	 * other Category whilst translating its variables using the transTable
	 */
	public static Category TransVariable(Category other, byte[] transTable, GrammaticalFeature feat) {
		return new Category(other, transTable, feat);
	}

	private byte countArgs() {
		if ( isBasic() ) {
			return (byte) 0;
		} else {
			return (byte) (result.countArgs() + 1);
		}
	}

	/*
	 * gets the variables ordered according to the left-to-right category order
	 * e.g. (S{Z}\NP{Y})/NP{X} would get changed to: (S{X}\NP{Y})/NP{Z} (X=1,
	 * Y=2, Z=3 in VarID; 0 is reserved for the no variable case (NONE)) the "_"
	 * variable is treated like any other, eg: ((S{Z}\NP{Y})/NP{Z}){_} becomes:
	 * ((S{X}\NP{Y})/NP{Z}){W}
	 */
// Path: src/utils/ByteWrapper.java
// public class ByteWrapper {
// 	public byte value;
// 
// 	public ByteWrapper(byte value) {
// 		this.value = value;
// 	}
// }
// 
// Path: src/utils/Hash.java
// public class Hash {
// 	/*
// 	 * comment from C&C: shift value to multiply by with each additional
// 	 * component of the hash function; this number is normally selected to be
// 	 * a smallish prime; 31 and 37 seem to work well
// 	 */
// 	private final static long INC = 92821;
// 	private long hash;
// 
// 	public Hash(Hash other) {
// 		hash = other.value();
// 	}
// 
// 	public Hash(long hash) {
// 		this.hash = hash;
// 	}
// 
// 	public Hash(byte hash) {
// 		this.hash = (hash);
// 	}
// 
// 	public long value() {
// 		return hash;
// 	}
// 
// 	public void plusEqual(long value) {
// 		// += in the C&C code
// 		hash *= INC;
// 		hash += value;
// 	}
// 
// 	public void barEqual(long value) {
// 		// |= in the C&C code
// 		hash += value;
// 	}
// 
// 	public void timesEqual(long value) {
// 		// *= in the C&C code
// 		hash *= value;
// 	}
// }


// Path: src/lexicon/Category.java
import utils.ByteWrapper;
import utils.Hash;

		this.unificationHash = new Hash(other.unificationHash);
		this.equivalenceHash = isComplex() ? eHashComplex() : eHashBasic();
		// need to call eHash method again since the feature may have changed from other

	}

	/*
	 * uses the constructor above; upper-case first letter since this is
	 * effectively a constructor; called TransVariable because it copies the
	 * other Category whilst translating its variables using the transTable
	 */
	public static Category TransVariable(Category other, byte[] transTable, GrammaticalFeature feat) {
		return new Category(other, transTable, feat);
	}

	private byte countArgs() {
		if ( isBasic() ) {
			return (byte) 0;
		} else {
			return (byte) (result.countArgs() + 1);
		}
	}

	/*
	 * gets the variables ordered according to the left-to-right category order
	 * e.g. (S{Z}\NP{Y})/NP{X} would get changed to: (S{X}\NP{Y})/NP{Z} (X=1,
	 * Y=2, Z=3 in VarID; 0 is reserved for the no variable case (NONE)) the "_"
	 * variable is treated like any other, eg: ((S{Z}\NP{Y})/NP{Z}){_} becomes:
	 * ((S{X}\NP{Y})/NP{Z}){W}
	 */
	public void reorderVariables(byte[] seenVariables, ByteWrapper nextVarID) {