FUNCTION: IsYama - test whether the argument is a Yamanouchi word
CALLING SEQUENCE:
- IsYama(expr)
- TYP[IsYama](expr)
-
PARAMETERS:
- expr = any expression
SYNOPSIS:
- The IsYama function tests whether expr is a Yamanouchi word on the
alphabet of integers. By default, it tests whether expr is a left
Yamanouchi word.
- IsYama(w) = IsYama(w, 'left') but one can test whether w is a right
Yamanouchi word by using IsYama(w, 'right').
- We recall that a word is said to be a left Yamanouchi one if and only if
all its left subwords are such that #1 >= #2 >= #3 >= ... where #i
denotes the number of ith letter (first letter is the smallest integer
appearing in the word). A right Yamanouchi word is obtained by replacing
left by right in the previous definition.
- Whenever there is a conflict between the function name IsYama and
another name used in the same session, use the long form TYP['IsYama'].
EXAMPLES:
> with(TYP):
> IsYama(w[2,1]);
false
> IsYama(w[-2,-1]);
true
> IsYama(w[4,3,4,4,3,3,2,1,2,2,1,1], 'right');
true
SEE ALSO: IsWord