translating English to predicate logic

advertisement
Here are some examples of converting statements from English to
predicate logic:
The square of any rational number is greater than or equal to zero.
(∀x : Q | : y 2 ≥ 0))
Every positive real number has a square root.
(∀x : R | x > 0 : (∃y : R | : y 2 = x))
Multiplication for the real numbers has an identity element.
(∃x : R | : (∀y : R | : yx = y))
– Typeset by FoilTEX –
1
Every real number has a multiplicative inverse.
(∀x : R | : (∃y : R | : yx = 1))
Every non-zero real number has a multiplicative inverse.
(∀x : R | ¬x = 0 : (∃y : R | : yx = 1))
The only divisors of k are 1 and k.
(∀i : N | : i|j ⇒ (i = 1 ∨ i = k))
The only divisors of k are 1 and k and k 6= 1; in other words, k is a
– Typeset by FoilTEX –
2
prime number.
(∀i : N | : i|j ⇒ (i = 1 ∨ i = k)) ∧ ¬k = 1
This can be abbreviated by defing a new predicate symbol to represent a
Boolean valued function on the natural numbers. Let prime : N → B be
defined so that prime.k = true if and only if k is a prime. Then the
following defines the function prime in predicate logic:
prime.k ≡ (∀i : N | : i|j ⇒ (i = 1 ∨ i = k)) ∧ ¬k = 1
Every number has a prime divisor.
(∀j : N | : (∃k : N |prime.k : k|j))
– Typeset by FoilTEX –
3
Every number greater than 1 has a prime divisor.
(∀j : N | j > 1 : (∃k : N |prime.k : k|j))
There are infinitely many prime numbers.
(∀j : N | : (∃k : N |k > j
: prime.k))
The natural number k is of the from n! for some n.
(∃n : N | : k = (·i | 1 ≤ i ≤ n : i))
– Typeset by FoilTEX –
4
Download