Semantics: Difference between revisions
No edit summary |
|||
(32 intermediate revisions by the same user not shown) | |||
Line 80: | Line 80: | ||
== The language of first order logic == | == The language of first order logic == | ||
[[File:Fpl1- | [[File:Fpl1-gwJPG.JPG | 800px]] | ||
== Extending the language: Connectives == | == Extending the language: Connectives == | ||
Line 96: | Line 96: | ||
[[File:Negation and connectivesJPG.JPG | 400px]] | [[File:Negation and connectivesJPG.JPG | 400px]] | ||
=== Examples == | === Examples === | ||
The vocabulary that we introduced above and the rule for atomic formulas license the following two atomic formulas: | The vocabulary that we introduced above and the rule for atomic formulas license the following two atomic formulas: | ||
Line 111: | Line 107: | ||
=== Negated formulas === | === Negated formulas === | ||
(3) ¬love2(the-cat,peter)<br> | (3) <span style="color: red>'''¬'''</span>love2(the-cat,peter)<br> | ||
(4) ¬love2(peter,the-cat) | (4) <span style="color: red>'''¬'''</span>love2(peter,the-cat) | ||
Note that because (3) and (4) are formulas, the negation rule can apply to them as well, so that (5) and (6) are also well formed formulas: | Note that because (3) and (4) are formulas, the negation rule can apply to them as well, so that (5) and (6) are also well formed formulas: | ||
(5) ¬¬love2(the-cat,peter)<br> | (5) <span style="color: red>'''¬'''</span><span style="color: red>'''¬'''</span>love2(the-cat,peter)<br> | ||
(6) ¬¬love2(peter,the-cat) | (6) <span style="color: red>'''¬'''</span><span style="color: red>'''¬'''</span>love2(peter,the-cat) | ||
As a result, the following is a well formed formula as well: | As a result, the following is a well formed formula as well: | ||
(7) ¬¬¬¬¬¬love2(the-cat,peter) | (7) <span style="color: red>'''¬'''</span><span style="color: red>'''¬'''</span><span style="color: red>'''¬'''</span><span style="color: red>'''¬'''</span><span style="color: red>'''¬'''</span><span style="color: red>'''¬'''</span>love2(the-cat,peter) | ||
By adding the negation rule alone, our grammar of first-order logic now licenses infinitely many well formed formulas! | By adding the negation rule alone, our grammar of first-order logic now licenses infinitely many well formed formulas! | ||
'''Notation''': besides "¬", the tilde "~" is also often used as the negation symbol. | '''Notation''': besides "<span style="color: red>'''¬'''</span>", the tilde "<span style="color: red>'''~'''</span>" is also often used as the negation symbol. | ||
=== Conjunctions === | === Conjunctions === | ||
Line 131: | Line 127: | ||
The conjunction rule licenses all the following formulas: | The conjunction rule licenses all the following formulas: | ||
(8) (love2(the-cat,peter) ∧ love2(peter,the-cat))<br> | (8) (love2(the-cat,peter) <span style="color: red>'''∧'''</span> love2(peter,the-cat))<br> | ||
(9) (love2(peter,the-cat) ∧ love2(the-cat,peter)) | (9) (love2(peter,the-cat) <span style="color: red>'''∧'''</span> love2(the-cat,peter)) | ||
(8) is called "the conjunction of formulas (1) and (2)". (9) is the conjunction of (2) and (1). | (8) is called "the conjunction of formulas (1) and (2)". (9) is the conjunction of (2) and (1). | ||
Line 138: | Line 134: | ||
These formulas consist of 5 pieces each. The pieces of (8), for instance, are: | These formulas consist of 5 pieces each. The pieces of (8), for instance, are: | ||
a. the opening parenthesis: (<br> | a. the opening parenthesis: <span style="color: red>'''('''</span><br> | ||
b. the atomic formula: (love2(the-cat,peter)<br> | b. the atomic formula: (love2(the-cat,peter)<br> | ||
c. the conjunction connective: ∧<br> | c. the conjunction connective: <span style="color: red>'''∧'''</span><br> | ||
d. the atomic formula: love2(peter,the-cat). | d. the atomic formula: love2(peter,the-cat).<br> | ||
e. the closing parenthesis: )<br> | e. the closing parenthesis: <span style="color: red>''')'''</span><br> | ||
'''Important:''' the opening and closing parentheses are part of the expression. Without them, the expression is not well formed! | '''Important:''' the opening and closing parentheses are part of the expression. Without them, the expression is not well formed! | ||
Line 148: | Line 144: | ||
Further conjunctions: | Further conjunctions: | ||
(10) ((love2(the-cat,peter) ∧ love2(peter,the-cat)) ∧ (love2(peter,the-cat) ∧ love2(the-cat,peter))) | (10) ((love2(the-cat,peter) <span style="color: red>'''<span style="color: red>'''∧'''</span>'''</span> love2(peter,the-cat)) <span style="color: red>'''∧'''</span> (love2(peter,the-cat) <span style="color: red>'''∧'''</span> love2(the-cat,peter))) | ||
(10) is the conjunction of (8) and (9). | (10) is the conjunction of (8) and (9). | ||
(11) ¬(love2(the-cat,peter) ∧ love2(peter,the-cat))<br> | (11) ¬(love2(the-cat,peter) <span style="color: red>'''∧'''</span> love2(peter,the-cat))<br> | ||
(12) ¬(love2(the-cat,peter) ∧ ¬love2(peter,the-cat))<br> | (12) ¬(love2(the-cat,peter) <span style="color: red>'''∧'''</span> ¬love2(peter,the-cat))<br> | ||
(13) ¬(¬love2(the-cat,peter) ∧ ¬love2(peter,the-cat))<br> | (13) ¬(¬love2(the-cat,peter) <span style="color: red>'''∧'''</span> ¬love2(peter,the-cat))<br> | ||
=== Disjunctions, Implications, and the Equivalence === | === Disjunctions, Implications, and the Equivalence === | ||
Line 161: | Line 156: | ||
The three remaining connectives create formulas with the following names: | The three remaining connectives create formulas with the following names: | ||
'''Disjunction:''' (love2(the-cat,peter) ∨ love2(peter,the-cat))<br> | '''Disjunction:''' (love2(the-cat,peter) <span style="color: red>'''∨'''</span> love2(peter,the-cat))<br> | ||
'''Implication:''' (love2(the-cat,peter) ⊃ love2(peter,the-cat))<br> | '''Implication:''' (love2(the-cat,peter) <span style="color: red>'''⊃'''</span> love2(peter,the-cat))<br> | ||
'''Equivalence:''' (love2(the-cat,peter) & | '''Equivalence:''' (love2(the-cat,peter) <span style="color: red>'''≡'''</span> love2(peter,the-cat)) | ||
Note, again, that the surrounding parenthesis are part of the formula! | |||
The following is a schema of a well formed formula that contains a negation and all four connectives. We use capital letters to represent formulas in order to make the overall formula readable: | |||
(14) <span style="color: red>'''¬'''</span>(A <span style="color: red>'''∧'''</span> (B <span style="color: red>'''∨'''</span> (C <span style="color: red>'''⊃'''</span> (D <span style="color: red>'''≡'''</span> E)))) | |||
(14) is the negation of a conjunction of a disjunction of an implication of an equivalence. All other expression in which the negation and the four connectives are mixed are well formed as well, as long as at each step exactly one of the 5 rules for making formulas into formulas are applied. | |||
=== Parentheses === | |||
Study the following expression: | |||
(15) A ∧ B ∨ C | |||
This is not a well formed expression because it contains the connectives ∧ and ∨ but not the parentheses that the rules for these connectives insert into the well formed formulas. | |||
There are two ways to repair (15): | |||
(16) ((A ∧ B) ∨ C) | |||
This is the disjunction of the formulas (A ∧ B) and C. | |||
(17) (A ∧ (B ∨ C)) | |||
This is the conjunction of the formulas A and (B ∨ C). | |||
Not only are these formulas syntactically different, they also mean different things, as we will see. The parentheses thus have a disambiguing function and are thus crucial! By this reasoning, there is one case where we are allowed to leave out parentheses, namely when they don't serve the function to disambiguate: | |||
'''Convention:''' The outermost parentheses of a non-atomic proposition may be dropped for easier readability. | |||
Techniqually speaking, the resulting expressions are not well formed, but everybody accepts them as useful abbreviations. | |||
'''Notation:''' In some systems, the symbol → is used instead of ⊃ and ⟷ is used instead of ≡. | |||
== Parsing complex formulas == | |||
Since the meanings of complex formulas depends on their internal structure, it is absolutely important that you know how to read them!!! For that it is crucial that for each expression you '''identify the main connective.''' The main connective of a well formed formula is defined as follows: | |||
Main connective | |||
The '''main connective''' of a well formed formula is the last connective that was used to build the formula from its subformulas. For this purpose, the negation also counts as a connective. | |||
Example: | |||
Above, we gave the formula: | |||
(14) ¬(A ∧ (B ∨ (C ⊃ (D ≡ E)))) | |||
Let us break it down into subexpressions and identify the main connectives and immediate subformulas of each expression: | |||
* ¬(A ∧ (B ∨ (C ⊃ (D ≡ E)))) | |||
** Main connective: ¬ | |||
** Subformulas: (A ∧ (B ∨ (C ⊃ (D ≡ E)))) | |||
* A | |||
** Main connective: none, because A is an atomic formula | |||
** Subformulas: none | |||
* (A ∧ (B ∨ (C ⊃ (D ≡ E)))) | |||
** Main connective: ∧ | |||
** Subformulas: A, (B ∨ (C ⊃ (D ≡ E))) | |||
* (B ∨ (C ⊃ (D ≡ E))) | |||
** Main connective: ∨ | |||
** Subformulas: B, (C ⊃ (D ≡ E)) | |||
* B | |||
** Main connective: none, because B is an atomic formula | |||
** Subformulas: none | |||
* (C ⊃ (D ≡ E)) | |||
** Main connective: ⊃ | |||
** Subformulas: C, (D ≡ E) | |||
* C | |||
** Main connective: none, because C is an atomic formula | |||
** Subformulas: none | |||
* (D ≡ E) | |||
** Main connective: ≡ | |||
** Subformulas: D, E | |||
* D | |||
** Main connective: none, because D is an atomic formula | |||
** Subformulas: none | |||
* E | |||
** Main connective: none, because E is an atomic formula | |||
** Subformulas: none | |||
== Video and a truth tabel generator== | |||
[https://www.youtube.com/watch?v=ZWdltj5Mqdc Video on truth tables] | |||
[https://trutabgen.com/ A Truth table generator] | |||
Try it out by pasting the following expressions into the top box and pressing the button: | |||
* ~P | |||
* (P & Q) | |||
* ((P <=> ~Q) -> R) v ~R | |||
If you want to type in your own expressions, then first click on "How to type" in order to see how to type connectives. | |||
== Online Exercises == | |||
Go to the following page: | |||
[https://carnap.io/enroll/CBA%20WiSe%202020%2F21 Carnap] | |||
Unit 1 [[Semantics_2|Unit 2]] [[Semantics_3|Unit 3]] |
Latest revision as of 12:14, 3 February 2021
Why do semantics?
- Expressions of natural languages can contain information about the world, i.e. they have meanings.
- Speakers and listeners have (reliable) intuitions about this meaning relation:
- The meaning of the name "Angela Merkel" is the person Angela Merkel.
- The sentence "Angela Merkel is the first female chancellor of Germany." correctly describes the world (= is true).
- The sentence "Germany lies in Asia." does not correctly describe the world (is false).
- Speakers and listeners can infer information from the meanings of sentences:
- From "Lilly is a cat." it follows that "Lilly is an animal."
- From "Lilly is as old as Fido." it follows that "Fido is as old as Lilly."
- From "Lilly is asleep." it follows that "Someone is asleep."
On the other hand:
- From "Lilly is an animal." it does not follow that "Lilly is a cat."
- From "Lilly is older than Fido." it does not follow that "Fido is older than as Lilly."
- From "Someone is asleep." does not follow that "Lilly is asleep."
But: there is the ambiguity problem
(https://examples.yourdictionary.com/reference/examples/examples-of-ambiguity.html)
(https://jennirodd.com/tag/ambiguity-resolution/)
(https://laptrinhx.com/three-comic-rabbits-for-december-2812179095/)
Further examples:
- The word "punch" can either refer to a drink or to a boxing movement.
- Does it then follow from "Ethel's punch was impressive." that "Ethel's drink was impressive."?
- It depends on the meaning of "punch" whether this follows. Hence: the entailment relationship cannot be a relation between forms. It must be a relationship between forms depending on their meanings.
- Thus, from "Ethel's punch was impressive." interpreted in such a way that "punch" is a drink, it does follow that "Ethel's drink was impressive."
- But from "Ethel's punch was impressive." interpreted in such a way that "punch" is a boxing movement, it does not follow that "Ethel's drink was impressive."
- The sentence "Sherlock saw the man with binoculars." can describe two different situations:
- Thus, from the form "Sherlock saw the man with binoculars." alone it does not follows that that the man had binoculars and it also does not follow that Sherlock had binoculars. As in the first example, we need to know the meaning of the sentence in order to know what follows from it.
The solution: Logic
From Wikipedia:
Logic is the systematic study of valid rules of inference, i.e. the relations that lead to the acceptance of one proposition (the conclusion) on the basis of a set of other propositions (premises).
Logics are designed to differ from natural languages in that they are languages that impose the following crucial reqirement:
Each logical expression has at most a single meaning.
- Consequence: logical languages do not suffer from the ambiguity problem in entailment that natural languages display.
How to do inferencing with English
- To every grammatical and meaningful expression of English we assign one or more expressions of a logical language. This process is called translation.
- To every expression of the logical language we assign one and only one meaning. This process is called interpretation or more precisely interpretation in a model.
- The interpretation of an expression is called its denotation.
- The denotations of the translations of an English expressions are (indirectly) also denotations of the English expression.
- We can now say things like the following:
- From "Ethel's punch was impressive." where "punch" denotes a drink, it follows that "Ethel's drink was impressive."
- From "Ethel's punch was impressive." where "punch" denotes a boxing movement, it does not follow that "Ethel's drink was impressive."
- From "Sherlock saw the man with binoculars." where the denotation of "with binoculars" applies to the denotation of "man", it follows that "The man with with binoculars was seen by Sherlock."
- From "Sherlock saw the man with binoculars." where the denotation of "with binoculars" applies to the denotation of "saw", it does not follow that "The man with with binoculars was seen by Sherlock."
The language of first order logic
Extending the language: Connectives
So far, we only have a single rule for forming formulas, namely the rule that makes an atomic formula from an n-place predicate and n names. This language is so constrained that it does not allow us to express many things we would like to express.
For this reason, we now add a new type of rule, namely a rule which takes 1 or 2 formulas and combines them into a new formula. Each rule makes use of the negation symbol or one of four so-called connectives.
We repeat the rule that we already have and then add the new rules:
The new rules:
Examples
The vocabulary that we introduced above and the rule for atomic formulas license the following two atomic formulas:
(1) love2(the-cat,peter)
(2) love2(peter,the-cat)
With the new rules, we can form the following non-atomic formulas (= formulas containing other formulas). Each type of formula is named after the negation or the connective used.
Negated formulas
(3) ¬love2(the-cat,peter)
(4) ¬love2(peter,the-cat)
Note that because (3) and (4) are formulas, the negation rule can apply to them as well, so that (5) and (6) are also well formed formulas:
(5) ¬¬love2(the-cat,peter)
(6) ¬¬love2(peter,the-cat)
As a result, the following is a well formed formula as well:
(7) ¬¬¬¬¬¬love2(the-cat,peter)
By adding the negation rule alone, our grammar of first-order logic now licenses infinitely many well formed formulas!
Notation: besides "¬", the tilde "~" is also often used as the negation symbol.
Conjunctions
The conjunction rule licenses all the following formulas:
(8) (love2(the-cat,peter) ∧ love2(peter,the-cat))
(9) (love2(peter,the-cat) ∧ love2(the-cat,peter))
(8) is called "the conjunction of formulas (1) and (2)". (9) is the conjunction of (2) and (1).
These formulas consist of 5 pieces each. The pieces of (8), for instance, are:
a. the opening parenthesis: (
b. the atomic formula: (love2(the-cat,peter)
c. the conjunction connective: ∧
d. the atomic formula: love2(peter,the-cat).
e. the closing parenthesis: )
Important: the opening and closing parentheses are part of the expression. Without them, the expression is not well formed!
Further conjunctions:
(10) ((love2(the-cat,peter) ∧ love2(peter,the-cat)) ∧ (love2(peter,the-cat) ∧ love2(the-cat,peter)))
(10) is the conjunction of (8) and (9).
(11) ¬(love2(the-cat,peter) ∧ love2(peter,the-cat))
(12) ¬(love2(the-cat,peter) ∧ ¬love2(peter,the-cat))
(13) ¬(¬love2(the-cat,peter) ∧ ¬love2(peter,the-cat))
Disjunctions, Implications, and the Equivalence
The three remaining connectives create formulas with the following names:
Disjunction: (love2(the-cat,peter) ∨ love2(peter,the-cat))
Implication: (love2(the-cat,peter) ⊃ love2(peter,the-cat))
Equivalence: (love2(the-cat,peter) ≡ love2(peter,the-cat))
Note, again, that the surrounding parenthesis are part of the formula!
The following is a schema of a well formed formula that contains a negation and all four connectives. We use capital letters to represent formulas in order to make the overall formula readable:
(14) ¬(A ∧ (B ∨ (C ⊃ (D ≡ E))))
(14) is the negation of a conjunction of a disjunction of an implication of an equivalence. All other expression in which the negation and the four connectives are mixed are well formed as well, as long as at each step exactly one of the 5 rules for making formulas into formulas are applied.
Parentheses
Study the following expression:
(15) A ∧ B ∨ C
This is not a well formed expression because it contains the connectives ∧ and ∨ but not the parentheses that the rules for these connectives insert into the well formed formulas.
There are two ways to repair (15):
(16) ((A ∧ B) ∨ C)
This is the disjunction of the formulas (A ∧ B) and C.
(17) (A ∧ (B ∨ C))
This is the conjunction of the formulas A and (B ∨ C).
Not only are these formulas syntactically different, they also mean different things, as we will see. The parentheses thus have a disambiguing function and are thus crucial! By this reasoning, there is one case where we are allowed to leave out parentheses, namely when they don't serve the function to disambiguate:
Convention: The outermost parentheses of a non-atomic proposition may be dropped for easier readability.
Techniqually speaking, the resulting expressions are not well formed, but everybody accepts them as useful abbreviations.
Notation: In some systems, the symbol → is used instead of ⊃ and ⟷ is used instead of ≡.
Parsing complex formulas
Since the meanings of complex formulas depends on their internal structure, it is absolutely important that you know how to read them!!! For that it is crucial that for each expression you identify the main connective. The main connective of a well formed formula is defined as follows:
Main connective The main connective of a well formed formula is the last connective that was used to build the formula from its subformulas. For this purpose, the negation also counts as a connective.
Example:
Above, we gave the formula:
(14) ¬(A ∧ (B ∨ (C ⊃ (D ≡ E))))
Let us break it down into subexpressions and identify the main connectives and immediate subformulas of each expression:
- ¬(A ∧ (B ∨ (C ⊃ (D ≡ E))))
- Main connective: ¬
- Subformulas: (A ∧ (B ∨ (C ⊃ (D ≡ E))))
- A
- Main connective: none, because A is an atomic formula
- Subformulas: none
- (A ∧ (B ∨ (C ⊃ (D ≡ E))))
- Main connective: ∧
- Subformulas: A, (B ∨ (C ⊃ (D ≡ E)))
- (B ∨ (C ⊃ (D ≡ E)))
- Main connective: ∨
- Subformulas: B, (C ⊃ (D ≡ E))
- B
- Main connective: none, because B is an atomic formula
- Subformulas: none
- (C ⊃ (D ≡ E))
- Main connective: ⊃
- Subformulas: C, (D ≡ E)
- C
- Main connective: none, because C is an atomic formula
- Subformulas: none
- (D ≡ E)
- Main connective: ≡
- Subformulas: D, E
- D
- Main connective: none, because D is an atomic formula
- Subformulas: none
- E
- Main connective: none, because E is an atomic formula
- Subformulas: none
Video and a truth tabel generator
Try it out by pasting the following expressions into the top box and pressing the button:
- ~P
- (P & Q)
- ((P <=> ~Q) -> R) v ~R
If you want to type in your own expressions, then first click on "How to type" in order to see how to type connectives.
Online Exercises
Go to the following page: