relational logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) relational...
TRANSCRIPT
![Page 1: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/1.jpg)
Relational Logic
![Page 2: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/2.jpg)
Premises: If Jack knows Jill, then Jill knows Jack. Jack knows Jill.
Conclusion: Is it the case that Jill knows Jack?
Propositional Logic
![Page 3: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/3.jpg)
Premises: If one person knows another, then the second person knows the first. Jack knows Jill.
Conclusion: Is it the case that Jill knows Jack?
How do we represent the first premise in a way that allows us to derive the desired conclusion?
Problem
![Page 4: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/4.jpg)
New Linguistic Features: Variables Quantifiers
Sample Sentence:
∀x.∀y.(knows(x,y) ⇒ knows(y,x))
Relational Logic
![Page 5: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/5.jpg)
Syntax
Semantics
Examples, Examples, Examples
Properties of Sentences
Logical Entailment
Decidability
Programme
![Page 6: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/6.jpg)
Syntax
![Page 7: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/7.jpg)
Wordsa, b, g, p
Termsg(a,a)
Sentences∀x.(p(x) ⇒ p(x,g(x,x)))
Components of Language
![Page 8: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/8.jpg)
Words are strings of letters, digits, and occurrences of the underscore character.
Variables begin with characters from the end of the alphabet (from u through z).
u, v, w, x, y, z
Constants begin with digits or letters from the beginning of the alphabet (from a through t).
a, b, c, 123, comp225, barack_obama
Words
![Page 9: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/9.jpg)
Object constants represent objects.
joe, stanford, usa, 2345
Relation constants represent relations.
knows, loves
Constants
![Page 10: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/10.jpg)
The arity of a relation constant is the number of arguments it takes.
Unary relation constant - 1 argument
Binary relation constant - 2 arguments
Ternary relation constant - 3 arguments
n-ary relation constant - n arguments
Arity
![Page 11: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/11.jpg)
A signature consist of a set of object constants and a set of relation constants together with a specification of arity for the relation constants.
Object Constants: a, b
Unary Relation Constant: pBinary Relation Constant: q
Signatures
![Page 12: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/12.jpg)
A term is either a variable or an object constant,.
Terms represent objects.
Terms are analogous to noun phrases in natural language.
Terms
![Page 13: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/13.jpg)
Three types of sentences in Relational Logic:
Relational sentences - analogous to the simple sentences in natural language
Logical sentences - analogous to the logical sentences in natural language
Quantified sentences - sentences that express the significance of variables
Sentences
![Page 14: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/14.jpg)
A relational sentence is an expression formed from an n-ary relation constant and n terms enclosed in parentheses and separated by commas.
q(a,y)
Relational sentences are not terms and cannot be nested in relational sentences.
No! q(a,q(a,y)) No!
Relational Sentences
![Page 15: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/15.jpg)
Logical sentences in Herbrand Logic are analogous to those in Propositional Logic.
(¬q(a,b))(p(a) ∧ p(b))(p(a) ∨ p(b))(q(x,y) ⇒ q(y,x))(q(x,y) ⇔ q(y,x))
Logical Sentences
![Page 16: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/16.jpg)
Universal sentences assert facts about all objects.
(∀x.(p(x) ⇒ q(x,x)))
Existential sentence assert the existence of objects with given properties.
(∃x.(p(x) ∧ q(x,x)))
Quantified sentences can be nested within other sentences.
(∀x.p(x)) ∨ (∃x.q(x,x))(∀x.(∃y.q(x,y)))
Quantified Sentences
![Page 17: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/17.jpg)
Parentheses can be removed when precedence allows us to reconstruct sentences correctly.
Precedence relations same as in Propositional Logic with quantifiers being of higher precedence than logical operators.
∀x.p(x) ⇒ q(x,x) → (∀x.p(x)) ⇒ q(x,x)∃x.p(x) ∧ q(x,x) → (∃x.p(x)) ∧ q(x,x)
Parentheses
![Page 18: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/18.jpg)
An expression is ground if and only if it contains no variables.
Ground sentence:p(a)
Non-Ground Sentence:∀x.p(x)
Ground and Non-Ground Expressions
![Page 19: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/19.jpg)
An occurrence of a variable is bound if and only if it lies in the scope of a quantifier of that variable. Otherwise, it is free.
∃y.q(x,y)
In this example, x is free and y is bound.
Bound and Free Variables
![Page 20: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/20.jpg)
A sentence is open if and only if it has free variables. Otherwise, it is closed.
Open sentence:∃y.q(x,y)
Closed Sentence:∀x.∃y.q(x,y)
Open and Closed Sentences
![Page 21: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/21.jpg)
Semantics
![Page 22: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/22.jpg)
The Herbrand base for a Relational language is the set of all ground relational sentences that can be formed from the vocabulary of the language.
Herbrand Base
![Page 23: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/23.jpg)
Object Constants: a, bUnary Relation Constant: pBinary Relation Constant: q
Herbrand Base:
{p(a), p(b), q(a,a), q(a,b), q(b,a), q(b,b)}
Example
![Page 24: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/24.jpg)
A truth assignment is an association between ground atomic sentences and the truth values true or false. As with Propositional Logic, we use 1 as a synonym for true and 0 as a synonym for false.
p(a)i = 1 p(b)i = 0 q(a,a)i = 1 q(a,b)i = 0 q(b,a)i = 1 q(b,b)i = 0
Truth Assignment
![Page 25: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/25.jpg)
A sentential truth assignment is an association between arbitrary sentences in a Herbrand language and the truth values 1 and 0.
Truth Assignment Sentential Truth Assignmentp(a)i = 1 (p(a) ∨ p(b))i = 1p(b)i = 0 (p(a) ∧ ¬p(b))i = 1
Each base truth assignment leads to a particular sentential truth assignment based on the type of sentence.
Sentential Truth Assignment
![Page 26: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/26.jpg)
(¬ϕ)i = 1 if and only if ϕi = 0
(ϕ ∧ ψ)i = 1 if and only if ϕi = 1 and ψi = 1
(ϕ ∨ ψ)i = 1 if and only if ϕ i = 1 or ψi = 1
(ϕ ⇒ ψ)i = 1 if and only if ϕi = 0 or ψi = 1
(ϕ ⇔ ψ)i = 1 if and only if ϕi = ψi
Logical Sentences
![Page 27: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/27.jpg)
An instance of an expression is an expression in which all free variables have been consistently replaced by ground terms.
Consistent replacement here means that, if one occurrence of a variable is replaced by a ground term, then all occurrences of that variable are replaced by the same ground term.
Instances
![Page 28: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/28.jpg)
A universally quantified sentence is true for a truth assignment if and only if every instance of the scope of the quantified sentence is true for that assignment.
An existentially quantified sentence is true for a truth assignment if and only if some instance of the scope of the quantified sentence is true for that assignment.
Quantified Sentences
![Page 29: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/29.jpg)
Truth Assignment:p(a)i = 1 q(a,a)i = 1p(b)i = 0 q(a,b)i = 0
q(b,a)i = 1 q(b,b)i = 0
Sentence:∀x.(p(x) ⇒ q(x,x))
Instances:p(a) ⇒ q(a,a)p(b) ⇒ q(b,b)
Example
![Page 30: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/30.jpg)
Truth Assignment:p(a)i = 1 q(a,a)i = 1p(b)i = 0 q(a,b)i = 0
q(b,a)i = 1 q(b,b)i = 0
Sentence:∀x.(p(x) ⇒ q(x,x))
Instances:p(a) ⇒ q(a,a) √p(b) ⇒ q(b,b)
Example
![Page 31: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/31.jpg)
Truth Assignment:p(a)i = 1 q(a,a)i = 1p(b)i = 0 q(a,b)i = 0
q(b,a)i = 1 q(b,b)i = 0
Sentence:∀x.(p(x) ⇒ q(x,x))
Instances:p(a) ⇒ q(a,a) √p(b) ⇒ q(b,b) √
Example
![Page 32: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/32.jpg)
Truth Assignment:p(a)i = 1 q(a,a)i = 1p(b)i = 0 q(a,b)i = 0
q(b,a)i = 1 q(b,b)i = 0
Sentence:∀x.(p(x) ⇒ q(x,x)) √
Instances:p(a) ⇒ q(a,a) √p(b) ⇒ q(b,b) √
Example
![Page 33: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/33.jpg)
Truth Assignment:p(a)i = 1 q(a,a)i = 1p(b)i = 0 q(a,b)i = 0
q(b,a)i = 1 q(b,b)i = 0
Sentence:∀x.∃y.q(x,y)
Instances: ∃y.q(a,y) ∃y.q(b,y)
q(a,a) q(b,a) q(a,b) q(b,b)
Example
![Page 34: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/34.jpg)
A truth assignment satisfies a sentence with free variables if and only if it satisfies every instance of that sentence. (In other words, we can think of all free variables as being universally quantified.)
(∃y.q(x,y))i = (∀x.∃y.q(x,y))i
A truth assignment satisfies a set of sentences if and only if it satisfies every sentence in the set.
Open Sentences
![Page 35: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/35.jpg)
Example - Sorority World
![Page 36: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/36.jpg)
Sorority World
![Page 37: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/37.jpg)
Object Constants: abby, bess, cody, dana
Binary Relation Constant: likes
Herbrand base has 16 ground relational sentences.
Signature
![Page 38: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/38.jpg)
¬likes(abby,abby) ¬likes(bess,abby)¬likes(abby,bess ¬likes(bess,bess) likes(abby,cody) likes(bess,cody)¬likes(abby,dana) ¬likes(bess,dana)
likes(cody,abby) ¬likes(dana,abby) likes(cody,bess) ¬likes(dana,bess)¬likes(cody,cody) likes(dana,cody) likes(cody,dana) ¬likes(dana,dana)
Data
![Page 39: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/39.jpg)
Abby likes everyone Bess likes.If Bess likes a girl, then Abby also likes her.
∀y.(likes(bess,y) ⇒ likes(abby,y))
Cody likes everyone who likes her.If some girl likes Cody, then Cody likes that girl.
∀x.(likes(x,cody) ⇒ likes(cody,x))
Sentences
![Page 40: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/40.jpg)
Cody likes somebody who likes her.There is someone who likes cody and is liked by Cody.
∃y.(likes(cody,y) ∧ likes(y,cody))
Nobody likes herself.It is not the case that someone likes herself.
¬∃x.likes(x,x)
Sentences
![Page 41: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/41.jpg)
Everybody likes somebody.
∀x.∃y.likes(x,y)
There is somebody whom everybody likes.
∃y.∀x.likes(x,y)
Sentences
![Page 42: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/42.jpg)
Abby Bess
Cody Dana
Example
![Page 43: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/43.jpg)
Abby Bess
Cody Dana
Everybody Likes Somebody
![Page 44: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/44.jpg)
Abby Bess
Cody Dana
Everybody Likes Somebody
![Page 45: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/45.jpg)
Abby Bess
Cody Dana
Everybody Likes Somebody
![Page 46: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/46.jpg)
Abby Bess
Cody Dana
Everybody Likes Somebody
![Page 47: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/47.jpg)
Abby Bess
Cody Dana
Everybody Likes Somebody
![Page 48: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/48.jpg)
Abby Bess
Cody Dana
There is Somebody Whom Everyone Likes
![Page 49: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/49.jpg)
Example - Blocks World
![Page 50: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/50.jpg)
Blocks World
![Page 51: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/51.jpg)
Object Constants: a, b, c, d, e
Unary Relation Constants: clear - blocks with no blocks on top. table - blocks on the table.
Binary Relation Constants: on - pairs of blocks in which first is on the second. above - pairs in which first block is above the second.
Ternary Relation Constant: stack - triples of blocks arranged in a stack.
Signature
![Page 52: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/52.jpg)
¬on(a,a) ¬on(b,a) ¬on(c,a) on(a,b) ¬on(b,b) ¬on(c,b)¬on(a,c) on(b,c) ¬on(c,c)¬on(a,d) ¬on(b,d) ¬on(c,d)¬on(a,e) ¬on(b,e) ¬on(c,e)
¬on(d,a) ¬on(e,a) ¬on(d,b) ¬on(e,b) ¬on(d,c) ¬on(e,c) ¬on(d,d) ¬on(e,d) on(d,e) ¬on(e,e)
Data
![Page 53: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/53.jpg)
Definition of clear:
∀y.(clear(y) ⇔ ¬∃x.on(x,y))
Definition of table:
∀x.(table(x) ⇔ ¬∃y.on(x,y))
Definitions
![Page 54: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/54.jpg)
Definition of stack:
∀x.∀y.∀z.(stack(x,y,z) ⇔ on(x,y) ∧ on(y,z))
Definition of above:
∀x.∀z.(above(x,z) ⇔ on(x,z) ∨ ∃y.(on(x,y) ∧ above(y,z)))
∀x.¬above(x,x)
Definitions
![Page 55: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/55.jpg)
Example - Modular Arithmetic
![Page 56: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/56.jpg)
In Modular Arithmetic of modulus 4 there are just 4 numbers (0,1, 2, 3).
0+0=01+0=1 2+0=2 3+0=30+1=11+1=2 2+1=3 3+1=00+2=21+2=3 2+2=0 3+2=10+3=31+3=0 2+3=1 3+3=2
Modular Arithmetic
![Page 57: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/57.jpg)
Object Constants: 0, 1, 2, 3
Binary Relation Constants: same - the first and second arguments are identical next - the second argument is number after the first
Ternary Relation Constant: plus - the third argument is the sum of the first two
plus(1,2,3)
Signature
![Page 58: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/58.jpg)
Ground Relational Data:
same(0,0) ¬same(1,0) ¬same(2,0) ¬same(3,0)¬same(0,1) same(1,1) ¬same(2,1) ¬same(3,1)¬same(0,2) ¬same(1,2) same(2,2) ¬same(3,2)¬same(0,3) ¬same(1,3) ¬same(2,3) same(3,3)
Same
![Page 59: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/59.jpg)
Ground Relational Data:
¬next(0,0) ¬next(1,0) ¬next(2,0) next(3,0) next(0,1) ¬next(1,1) ¬next(2,1) ¬next(3,1)¬next(0,2) next(1,2) ¬next(2,2) ¬next(3,2)¬next(0,3) ¬next(1,3) next(2,3) ¬next(3,3)
Next
![Page 60: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/60.jpg)
Ground Relational Data:
next(0,1)next(1,2)next(2,3)next(3,0)
Deal with negative literals by saying that all other cases are false. How do we do this?
Next
![Page 61: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/61.jpg)
For every x, there is just one y such that next(x,y):
∀x.∀y.∀z.(next(x,y) ∧ next(x,z) ⇒ same(y,z)
Logically equivalent formulation:
∀x.∀y.∀z.(next(x,y) ∧ ¬same(y,z) ⇒ ¬next(x,z))
Functionality Axiom
![Page 62: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/62.jpg)
Ground Relational Data:
plus(0,0,0) plus(1,0,1) plus(2,0,2) plus(3,0,3)plus(0,1,1) plus(1,1,2) plus(2,1,3) plus(3,1,0)plus(0,2,2) plus(1,2,3) plus(2,2,0) plus(3,2,1)plus(0,3,3) plus(1,3,0) plus(2,3,1) plus(3,3,2)
Functionality Axiom:
∀x.∀y. ∀z.∀w.(plus(x,y,z) ∧ plus(x,y,w) ⇒ same(z,w)
Addition
![Page 63: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/63.jpg)
Identity:
∀y.plus(0,y,y)
Successor:
∀x.∀y.∀z.(plus(x,y,z) ∧ next(x,x2) ∧ next(z,z2) ⇒ plus(x2,y,z2))
Functionality:
∀x.∀y.∀z.∀w.(plus(x,y,z) ∧ plus(x,y,w) ⇒ same(z,w)
Alternative Definition of Addition
![Page 64: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/64.jpg)
Properties of Sentences
![Page 65: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/65.jpg)
A sentence is valid if and only ifevery interpretation satisfies it.
A sentence is contingent if and only ifsome interpretation satisfies it andsome interpretation falsifies it.
A sentence is unsatisfiable if andonly if no interpretation satisfies it.
Valid
Contingent
Unsatisfiable
Properties of Sentences
![Page 66: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/66.jpg)
A sentences is satisfiable if and onlyif it is either valid or contingent.
A sentences is falsifiable if and onlyif it is contingent or unsatisfiable.
Valid
Contingent
Unsatisfiable
}
}
Properties of Sentences
![Page 67: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/67.jpg)
Law of the Excluded Middle:p(a) ∨ ¬p(a)
Double Negation:p(a) ⇔ ¬¬p(a)
deMorgan's Laws:¬(p(a) ∧ q(a,b)) ⇔ (¬p(a) ∨¬q(a,b))¬(p(a) ∨ q(a,b)) ⇔ (¬p(a) ∧¬q(a,b))
Logical Validities
![Page 68: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/68.jpg)
Common Quantifier Reversal:∀x.∀y.q(x,y) ⇔ ∀y.∀x.q(x,y)∃x.∃y.q(x,y) ⇔ ∃y.∃x.q(x,y)
Existential Distribution:∃y.∀x.q(x,y) ⇒ ∀x.∃y.q(x,y)
Negation Distribution:¬∀x.p(x) ⇔ ∃x.¬p(x) ¬∃x.p(x) ⇔ ∀x.¬p(x)
Quantificational Validities
![Page 69: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/69.jpg)
Logical Entailment
![Page 70: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/70.jpg)
A set of premises Δ logically entails a conclusion ϕ (written as Δ |= ϕ) if and only if every interpretation that satisfies the premises also satisfies the conclusion.
{p(a)} |= (p(a) ∨ p(b))
{p(a)} |# (p(a) ∧ p(b))
{p(a), p(b)} |= (p(a) ∧ p(b))
Logical Entailment
![Page 71: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/71.jpg)
∃y.∀x.q(x,y) |= ∀x.∃y.q(x,y)
∀x.∀y.q(x,y) |= ∀y.∀x.q(x,y)
∀x.∀y.q(x,y) |= ∀x.∀y.q(y,x)
Examples with Quantification
![Page 72: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/72.jpg)
q(x,y) |= q(y,x)
∀x.∀y.q(x,y) |= ∀y.∀x.q(y,x)
Example with Free Variables
![Page 73: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/73.jpg)
Relational Logic and Propositional Logic
![Page 74: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/74.jpg)
There is a simple procedure for mapping RL sentences to equivalent PL sentences.
(1) Convert to Prenex form.
(2) Compute the grounding.
(3) Rewrite from FHL to PL.
Mapping
![Page 75: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/75.jpg)
A sentence is in prenex form if and only if (1) it is closed and (2) all of the quantifiers are outside of all logical operators.
Sentence in Prenex Form:∀x.∃y.∀z.(p(x,y) ∨ q(z))
Sentences not in Prenex Form:∀x.∃y.p(x,y) ∨ ∃y.q(y)∀x.(p(x,y) ∨ q(x))
Prenex Form
![Page 76: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/76.jpg)
Rename duplicate variables. ∀y.p(x,y) ∨ ∃y.q(y) → ∀y.p(x,y) ∨ ∃z.q(z)
Distribute logical operators over quantifiers. ∀y.p(x,y) ∨ ∃z.q(z) → ∀y.∃z.(p(x,y) ∨ q(z))
Quantify any free variables. ∀y.∃z.(p(x,y) ∨ q(z)) → ∀x.∀y.∃z.(p(x,y) ∨ q(z))
Conversion to Prenex Form
![Page 77: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/77.jpg)
Let Δ0=Δ and Γ0={}. On each step, process ϕ in Δ until Δ is empty.
If ϕ is ground, we remove from Δi and add to ΓiΔi+1= Δi - {ϕ}Γi+1= Γi ∪ {ϕ}
If ∀υ.ϕ[υ], replace on Δi with all instancesΔi+1= Δi - {∀υ.ϕ[υ]} ∪ {ϕ[τi] | τi a constant}Γi+1= Γi
If ∃υ.ϕ[υ], replace on Δi with disjunction of instancesΔi+1= Δi - {∃υ.ϕ[υ]} ∪ {ϕ[τ1]∨…∨ϕ[τn]}Γi+1= Γi
Grounding
![Page 78: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/78.jpg)
Δ0={p(a), ∀x.(p(x) ⇒ q(x)) , ∃x.q(x)}Γ0={}
Δ1={∀x.p(x) ⇒ q(x)) , ∃x.q(x)} Γ1={p(a)}
Δ2={p(a) ⇒ q(a), p(b) ⇒ q(b), ∃x.q(x)}Γ2={p(a)}
Δ3={p(b) ⇒ q(b), ∃x.q(x)} Γ3={p(a), p(a) ⇒ q(a)}
Δ4={∃x.q(x)}Γ4={p(a), p(a) ⇒ q(a), p(b) ⇒ q(b)}
Example 1
![Page 79: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/79.jpg)
Δ4={∃x.q(x)}Γ4={p(a), p(a) ⇒ q(a), p(b) ⇒ q(b)}
Δ5={q(a) ∨ q(b)} Γ5={p(a), p(a) ⇒ q(a), p(b) ⇒ q(b)}
Δ6={}Γ6={p(a), p(a) ⇒ q(a), p(b) ⇒ q(b), q(a) ∨ q(b)}
Example 2
![Page 80: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/80.jpg)
Select a proposition for each ground relational sentence and rewrite the grounding from FHL to PL.
FHL Grounding:{p(a), p(a) ⇒ q(a), p(b) ⇒ q(b), q(a) ∨ q(b)}
Corresponding PL:p(a) ↔ pa q(a) ↔ qap(b) ↔ pb q(b) ↔ qb
Corresponding PL:{pa, pa ⇒ qa, pb ⇒ qb, qa ∨ qb}
Renaming RL to PL
![Page 81: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/81.jpg)
Unsatisfiability and logical entailment for Propositional Logic (PL) is decidable.
Given our mapping, we also know that unsatisfiability logical entailment for Relational Logic (RL) is also decidable.
Decidability
![Page 82: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/82.jpg)
A logic is compact if and only if every unsatisfiable set of sentences (including infinite sets) has a finite subset that is unsatisfiable.
Propositional Logic is compact.
Given our mapping, we know that RL must also be compact.
Compactness
![Page 83: Relational Logiclogic.stanford.edu/intrologic/lectures/lecture_06.pdf · q(a,y) Relational sentences are not terms and cannot be nested in relational sentences. No! q(a,q(a,y)) No!](https://reader034.vdocument.in/reader034/viewer/2022042202/5ea2cec8207e1402761660ca/html5/thumbnails/83.jpg)