Let P be a string in .
P[i..j]: Array range notation character i to j inclusive indexed from 1 to length of string.
|P| denotes the length of string P.
AB is the concatenation of strings A and B.
: the string Q is a prefix of R. R = QS for some S.
: the string Q is a suffix of R. R = SQ for some S.