Download Section.8.3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of the function concept wikipedia , lookup

Mathematical proof wikipedia , lookup

Nyaya wikipedia , lookup

Mathematical logic wikipedia , lookup

Intuitionistic logic wikipedia , lookup

Modal logic wikipedia , lookup

Argument wikipedia , lookup

Propositional calculus wikipedia , lookup

New riddle of induction wikipedia , lookup

First-order logic wikipedia , lookup

Combinatory logic wikipedia , lookup

Syllogism wikipedia , lookup

Laws of Form wikipedia , lookup

Natural deduction wikipedia , lookup

Law of thought wikipedia , lookup

Naive set theory wikipedia , lookup

Principia Mathematica wikipedia , lookup

Truth-bearer wikipedia , lookup

Transcript
Section 8.3 Higher-Order Logic
A logic is higher-order if it allows predicate names or function names to be quantified or to
be arguments of a predicate.
Example. The sentence, “There is a function with a fixed point.” can be formalized as
f x p(ƒ(x), x), where p denotes equality.
Example. Given the sentence, “ Every binary relation that is irreflexive and transitive is
antisymmetric.” The sentence can be formalized as
p (x ¬ p(x, x)  x y z (p(x, y)  p(y, z)  p(x, z))  x y (p(x, y)  ¬ p(y, x))).
We can define higher-order logic in terms of sets because predicates and functions are sets.
Example (predicates).
P(x) is true iff x  P.
Q(x, y) is true iff (x, y)  Q.
Example (functions).
ƒ(x) = y iff ƒ(x, y) is true iff (x, y)  ƒ.
So a higher-order logic allows sets to be quantified or to be elements of other sets.
Classifying Logics by Order
The order of a predicate is 1 if its arguments are terms. Otherwise the order is n + 1 where
n is the maximum order of the arguments that are not terms. The order of a function is
always 1 since it’s arguments are always terms.
Examples. In the wff p(x)  q(x, p) the order of p is one and the order of q is two.
In the wff p(x)  q(p)  r(q) the orders of p, q, and r are 1, 2, and 3, respectively.
Note: We agree that a set cannot be defined in terms of itself. So we don’t allow something
like p(q)  q(p) in the same wff since it would mean q  p and p  q.
1
The order of a quantifier is 1 if it quantifies a variable and 2 if it quantifies a function.
Otherwise the order is n + 1 where n is the order of the predicate being quantified.
The order of wff is the maximum of the orders of its predicates and quantifiers.
An nth-order logic is a logic with wffs having order n or less.
Example. The wff f x p(ƒ(x), x) has order 2.
Example/Quiz. What is the order of the following wff?
B (H(B)  R W (B(R)  R(W)))
Answer: The order is 3. As sets, we have W  R  B  H, where W is a variable.
Semantics
A wff has meaning only with respect to an interpretation. Choose a domain D ≠ .
• Assign constants and free variables to elements of D.
• Assign free functions to functions over D.
• Assign free predicates to relations with respect to D.
Example. Given the wff
x p (p(x)  S(p)).
The predicate p has order 1 and the predicate S has order 2. So p(x)  S(p) can be written as
x  p and p  S, or x  p  S. So for any domain D we have
x  D, p  power(D), and S  power(power(D)).
So p  D and S  power(D).
We’ll examine some different interpretations of the wff.
2
Example. Given the wff
W = x p (p(x)  S(p)).
We’ll look at three sample interpretations.
(1) Let I be the interpretation with domain D = {a, b} and S = {{a}, {b}}.
Since x varies over {a, b}, the wff W wrt I can be written as
W = p (p(a)  S(p))  p (p(b)  S(p))
 True  True (Let p = {a} for the first part. So a  p and p  S;
Let p = {b} for the second part. So b  p and p  S.)
 True.
(2) Let I be the interpretation with domain D = {a, b} and S = {, {b}}.
Since x varies over {a, b}, the wff W wrt I can be written as
W = p (p(a)  S(p))  p (p(b)  S(p))
 False  True (For each p  S it follows that p(a) is false. i.e., a  p.)
 False.
(3) Let I be the interpretation with domain D = {a, b} and S = .
Then S(p) is false for all p  D. So W is false wrt I.
Example. Given the wff
W = x p (p(x)  S(p)).
W is unsatisfiable because for any interpretation with domain D, p must vary over all
predicates, including p = , which means p(x) is false for all x  D.
3
Quiz. Do a truth analysis for the wff x p p(x).
Answer: The wff is valid because for any domain D, let p(x) be true for all x  D. From a
set viewpoint, this means choose p = D. Alternatively, for each x, choose p = {x}.
Quiz. Do a truth analysis for the following wff x p p(x).
Answer: The wff is unsatisfiable because for any domain D, let p(x) be false for all x  D.
From a set viewpoint, this means choose p = .
Formal Proofs. The quantifier inference rules extend to higher-order logics.
Example. Formal proof that x p p(x) is valid.
Proof: 1.
2.
3.
4.
5.
x p ¬ p(x)
p ¬ p(c)
¬ p(c)
¬ ¬ p(c)
False
QED
P [for IP], T
1, EI
2, UI
2, UI
5, T
1–6, IP.
Quiz. Give a formal proof that p x p(x) is valid.
Proof: 1. p x ¬ p(x)
P [for IP], T
2. x ¬ True(x)
1, UI
3. ¬ True(c)
2, EI
4. False
3, T
QED
1–4, IP.
Alternative Proof:
1. x p ¬ p(x)
2. p ¬ p(c)
3. ¬ True(c)
4. False
QED
P [for IP], T
1, EI
2, UI
3, T
1–4, IP.
4
Hilbert’s Euclidean Geometry. The axioms (See Text Page 499) are as follows.
Ax1: On any two distinct points there is a line.
x y ((x ≠ y)  L (L(x)  L(y)).
Ax2: On any two distinct points there is at most one line.
x y ((x ≠ y)  L M (L(x)  L(y)  M(x)  M(y)  L = M)).
Ax3: On every line there are at least two points.
L x y ((x ≠ y)  L(x)  L(y)).
Ax4: There are at least three points which are not on the same line.
x y z ((x ≠ y)  (x ≠ z)  (y ≠ z)  L (L(x)  L(y)  ¬ L(z))).
Example/Quiz. Ax1 and Ax2 imply that on any two distinct points there is a unique line.
x y ((x ≠ y)  L (L(x)  L(y)  M (M(x)  M(y)  M = L))).
1.
x≠y
P [for CP]
2.
l(x)  l(y)
Ax1, UI, UI, 1, MP, EI
3.
l(x)  l(y)  M(x)  M(y)  l = M
Ax2, UI, UI, 1, MP,UI, UI
4.
M(x)  M(y)
P [for CP]
5.
l(x)  l(y)  M(x)  M(y)
2, 4, Conj
6.
l=M
3, 5, MP
7.
M(x)  M(y)  l = M
4–6, CP
8.
M (M(x)  M(y)  l = M)
7, UG
9.
l(x)  l(y)  M (M(x)  M(y)  l = M)
2, 8, Conj
10.
L (L(x)  L(y)  M (M(x)  M(y)  M = L))
9, EG
11. (x ≠ y)  L (L(x)  L(y)  M (M(x)  M(y)  M = L)) 1–3, 7–10, CP
12. x y ((x ≠ y)  L (L(x)  L(y)  M (M(x)  M(y)  M = L))) 11, UG, UG 5
QED.
Example. Suppose someone interprets the third order wff
B (H(B)  R w (B(R)  R(w)))
as, “Every house has a room with a window.”
From a formal viewpoint, is this an interpretation I with domain D?
The wff uses w as an individual variable and the predicates have the following meanings in
terms of sets: H(B) means B  H; B(R) means R  B; and R(w) means w  R.
A possible formal Interpretation:
Let D be the set of all windows. Then we have the following statements.
• w varies over D. So w varies over windows.
• R varies over subsets of D. So R(w) means w is a window in R. So R varies over sets of
windows. So we’ll let a room be a set of windows.
• B varies over subsets of subsets of D. So B(R) means R is a set of windows in B. So B
varies over sets of sets of windows. So B varies over sets of rooms. So we’ll let a
building be a set of rooms.
• H is a free predicate of order 3 so it must be defined as a subset of a subset of a subset of
D. So H(B) means B is a set of a set of windows. So H(B) means B is a set of rooms. So
H(B) means B is a building. We’ll let H(B) mean that B is a building with 10 or less
rooms, which we’ll call a house.
So the wff might be described by:
Every building (a set of rooms) that is a house (a building with 10 or less rooms) has a
6
room (a set of windows) with a window.
Example/Quiz. In the previous example we considered the third order wff
B (H(B)  R w (B(R)  R(w)))
together with the interpretation, “Every house has a room with a window.”
What if we want to think of house, room, and window as predicates to describe things (I.e,
the domain D is the set of all things. For example, house(x) means x is a house, room(x)
means x is a room, and window(x) means x is a window. How would we formalize the
sentence using these predicates?
A solution:
X (house(X)  Y (room(Y)  X(Y)  Z (window(Z)  Y(Z)))).
A less intuitive solution: Replace house by H, room by R, and window by W.
X (H(X)  Y (R(Y)  X(Y)  Z (W(Z)  Y(Z)))).
Quiz. What is the order of the wff?
Answer: 3.
7