perm-ref : zero-based reference

perm-eval : one-based (standard) reference

perm-eval* : one-based (standard) reference with out-of-bounds handling

+perm-inverse-eval : one-based (standard) reference of inverse

+perm-inverse-eval* : one-based (standard) reference of inverse with out-of-bounds handling

perm-size : the size of the permutation (number of mapped elements)

perm-length : number of inversions

(aref (perm.spec perm) n))

(defun perm-eval* (perm n)

- "Evaluate the permutation PERM at index N."

+ "Evaluate the permutation PERM at index N. If N is larger than the

+size of the permutation, return the fixed point."

"Permutation index of ~D must be greater than 1."

(aref (perm.spec perm) n)))

+(defun perm-inverse-eval (perm n)

+ "Evaluate the inverse of the permutation PERM at index N."

+ (assert (<= 1 n (perm-size perm))

+ "Permutation index of ~D must be within 1 and the length of the ~

+ (position n (perm.spec perm)))

+(defun perm-inverse-eval* (perm n)

+ "Evaluate the inverse of the permutation PERM at index N. If N is

+larger than the size of the permutation, return the fixed point."

+ "Permutation index of ~D must be greater than 1."

+ (if (> n (perm-size perm))

+ (position n (perm.spec perm))))

"The size of a permutation PERM."

(1- (length (perm.spec perm))))