| |
The set of all the strings over an alphabet A, here denoted by Str, can be defined as follows
- Basis: emptyString() is in Str and if a in A then LengthOneString(a) is in Str.
- Induction: if x is in Str and (a1,a2) is a pair of elements of A then AddTwo(a1,a2)(x) is in Str.
Here B={emptyString} union{LengthOneString(a), a in A} and I={AddTwo(a1,a2), (a1,a2) in A x A}.
Note that if AddTwo(a1,a2)(x) is interpreted as the string whose characters are a1 followed by those of x in order followed by a2 then this inductive definition of strings is well-suited for easily defining the predicate function that checks whether reading a string from left to right is as reading it from right to left.
|