Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (74.66 KB, 1 trang )
Understanding Propositional Logic
43
I leave it as exercises for the reader to show that each of these inductive definitions
defines the set of all natural numbers.
We now consider the recursive definitions:
1. h1 (0) = 1;
2. h1 (2n + 1) = 3n + h1 (n);
3. h1 (2n) = h1 (n) + 1, for n > 0.
and
1. h2 (0) = 0;
2. h2 (n + 2) = 2h2 (n) + 3;
3. h2 (2n + 1) = h2 (n) + 1;
They look similar, and yet there is something wrong with the second definition. What?
First, note that h2 (1) = h2 (2 × 0 + 1) = h2 (0) + 1 = 1. Now, let us compute h2 (3). On
the one hand, h2 (3) = h2 (1 + 2) = 2h2 (1) + 3 = 5. On the other hand, h2 (3) = h2 (2 ·
1 + 1) = h2 (1) + 1 = 2. Thus, we have obtained two different values, which is definitely
bad. The problem comes from the fact that the second definition allows for essentially
different generations of the same object, leading us to define the notion of unique generation.
1.4.5.5 Unique generation
For the correctness of recursive definitions it should be required that every element of
C(B, F) can be constructed uniquely (up to the order of the steps). Otherwise, definitions
can lead to problems as above. More formally, the elements of C(B, F) are represented
by expressions (terms) built from the elements of B by applying the operations from F.
Unique generation means that every element of C(B, F) can be represented by a unique
expression.
Example 40
1. The standard definition of natural numbers and Definition 1 above have the unique
generation property. These can be proved by induction on natural numbers.
2. Definition 2 given above does not satisfy the unique generation property.