LIN 3021 Formal Semantics Lecture 3 Albert Gatt
LIN 3021 Formal Semantics Lecture 3 Albert Gatt
Aims �This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of compositionality. � First, we’ll do it by providing a compositional interpretation of a couple of formal languages. 2. We’ll then look at Natural Language, and ask how we can model meaning in the same sort of way.
Syntax and semantics of formal systems � In defining a compositional semantics formal languages like Propositional Logic, we: �Specify the syntax using a set of recursive rules of the following kind: � If α is a wff then γ = C(α) is a wff. � where C is some unary syntactic operation, such as logical negation � If α is a wff and β is a wff, then γ = F(α, β) is a wff. � where F is some binary syntactic operation, such as logical conjunction �Specify the semantics using recursive rules that correspond to the syntax: � If α is interpreted as [[α]], then γ = C(α) is interpreted as M([[α]]) � where M is a semantic operation corresponding to C � If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F(α, β) is interpreted as [[γ]] = G([[α]], [[β]]) � where G is a semantic operation corresponding to F. � NB: this is not too different from the way we proceeded in describing the semantics of simple predicative expressions
Part 1 Compositional semantics for propositional logic
Basic vocabulary �We assume infinitely many propositional variables for atomic propositions: �p, q, r, s, t, …, p 1, q 1, r 1, s 1, … �We also have the logical connectives: �¬, , , ->, �We also need the two parentheses ( and ) �No other symbol belongs to propositional logic.
Syntactic rules • If α is a wff then γ = C(α) is a wff. • If α is a wff and β is a wff, then γ = F(α, β) is a wff. 1. Every propositional variable is a wff �thus, p is a formula of propositional logic �so is q, r etc 2. If α is a wff and β is a wff, then the following are also wffs: a) ¬α b) (α β) c) (α β) d) (α β) e) (α β) 3. Only expressions constructed by these rules are wff’s.
The semantics of Propositional Logic �In Propositional Logic, we’re only dealing with atomic statements and combinations thereof �(we’re not looking at the structure of those statements) �All we can do with statements is assign them a true or false interpretation. �So our semantic rules must: �Specify the truth value of the atomic statements �Specify the way that complex statements can be evaluated as a function of their structure. �Let f be a function which assigns each atomic statement a truth value 1 (true) or 0 (false).
Semantic rules Syntax • If α is interpreted as [[α]], then γ = C(α) is interpreted as M([[α]]) • If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F(α, β) is interpreted as [[γ]] = G([[α]], [[β]]) Semantics Every prop. variable is 1. If α is a wff, then [[α]] = f(α) a wff. 2. If α is a wff and β is a wff, then: 2. If α is a wff and β is a wff, then the following are a) [[¬α]] = 0 if [[α]=1; 1 otherwise. also wffs: b) [[(α β)]] = 1 iff [[α]] = 1 and [[β]] = a) ¬α 1 b) (α β) c) [[(α β)]] =1 iff [[α]] = 1 or [[β]] = 1 c) (α β) d) [[(α β)]] = 1 iff [[α]] = 0 or [[β]] = d) (α β) 1 e) (α β) e) [[α β]] = 1 iff [[α]] = [[β]] 3. Only expressions constructed by these rulesthese are wff’s. Note: semantic rules basically describe the structure of the truth 1. tables for the connectives.
Using the rules for compositional interpretation �In logic, every formula is unambiguous, i. e. can be assigned a unique derivation tree (compare this to NL). �This means the semantic rules can operate unambiguously as well. �Example: ¬(p q) ¬(p q) (syn. 2 a) 0 (sem. 2 a) (p q) (syn. 2 c) 1 (sem. 2 c) p(syn. 1) q (syn. 1) 0 (sem. 1) 1 (sem. 1)
Part 2 Compositional semantics for propositional logic
Basic vocabulary �individual constants: a, b, c, … �individual variables: x, y, z… �predicate variables: P, Q, R… �quantifiers: , Also, from propositional logic: �propositional variables: p, q, r… �logical connectives: ¬, , , ->, �parentheses: ( )
Some conventions �We will use t 1, t 2, etc to stand for any individual term: �a variable; or �an individual constant. �We will use Greek letters (α, β…) to stand for well -formed formulas of predicate logic.
Syntactic rules • If α is a wff then γ = C(α) is a wff. • If α is a wff and β is a wff, then γ = F(α, β) is a wff. If t 1, t 2, …, tn are individual terms, and P is an n-place predicate, then P(t 1, t 2, …, tn) is a wff. 1. If α is a wff and β is a wff, then the following are also wffs: 2. a) b) c) d) e) ¬α (α β) 3. If α is a wff and v is a variable, then ( v)α is a wff 4. If α is a wff and v is a variable, then ( v)α is a wff 5. Only the formulas constructed with these rules are wff’s of predicate logic.
Semantics of Predicate Logic � For PL, we need to deal with variables and other individual terms. So it’s crucial to specify a model: �M = <U, I> where � U is our domain of individuals (what our variables range over) � I is our interpretation function � We’ll use last week’s model as our example: �U = {Isabel Osmond, Emma Bovary, Alexander Portnoy, Beowulf} � We also need to introduce a variable assignment function (denoted g). �Roughly, this is just a function that, given a domain U, assigns each variable in a formula some value in U.
Variable assignments � Consider: � x. clever(x) � “Some x is clever. ” �x “stands for” some individual in the domain U. � To determine whether this is true, we need to determine some value for x – there must be at least one which makes the formula come out true. � Suppose our model stipulates that: �[[clever]]M = {A. Portnoy, E. Bovary, I. Osmond} �If we start with x = Beowulf, then the formula is false. �We need to test alternative values of x while we’re interpreting the formula.
Semantic rules • If α is interpreted as [[α]], then γ = C(α) is interpreted as M([[α]]) • If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F(α, β) is 1. If α is a constant, then [[α]]M, g = I(α) interpreted as [[γ]] = G([[α]], [[β]]) � Constants are fixed by our interpretation function If α is a variable, then [[α]]M, g = g(α) 2. � 3. � Variables are assigned by our variable assignment function If P is an n-ary predicate and t 1, . . . , tn are terms, then [[P(t 1, . . . , tn)]] = 1 iff <[[t 1]]M, g, . . . , [[tn]]M, g> [[P]]M, g Predicates are interpreted as ordered n-tuples If α is a wff and β is a wff, then: 4. a) b) c) d) e) [[¬α]]M, g = 1 iff [[α]]M, g = 0 [[α β]]M, g = 1 iff [[α]]M, g = 1 and [[β]]M, g =1 [[α β]]M, g =1 iff [[α]]M, g = 1 or [[β]]M, g =1 [[α β]]M, g = 1 iff [[α]]M, g = 0 or [[β]]M, g =1 [[α β]]M, g = 1 iff [[α]]M, g = [[β]]M, g Essentially the same as for propositional logic, but we need to make reference to the model M and the assignment function g α]]M, g = 1 iff then [[( v) 5. If α is a wff and v is a variable, all x U, [[α]]M, g[x/v]= 1 6. If α is a wff and v is a variable, then [[( v)α]]M, g = 1 iff there is at least one x U, [[α]]M, g[x/v]= 1 for
A closer look. . . 5. If α is a wff and v is a variable, then [[( v)α]]M, g = 1 iff for all x U, [[α]]M, g[x/v]= 1 6. If α is a wff and v is a variable, then [[( v)α]]M, g = 1 iff there is at least one x U, [[α]]M, g[x/v]= 1 �The notation [[α]]M, g[x/v] = 1 can be interpreted as a kind of instruction: �Find an assignment function which is identical to the original, except that the value for v is substituted for x.
A closer look Our model � U = {isabel, emma, Semantics} � Constants: = Isabel �[[e]]M = Emma �[[s]]M = Semantics A formula � x[book(x) read(i, x)] �Isabel reads a book x[book(x) read(i, x)] �[[i]]M � Predicates: �[[person]]M = {isabel, emma} �[[book]]M = {Semantics} �[[read]]M = {<isabel, Semantics>} � Initial variable assignment: �g(x) = emma book(x) read(i, x) x book(x) book x read(i, x) read i x �Only if x = Semantics is this formula true
Interpreting the formula We proceed bottom-up: x[book(x) read(i, x)] � [[book]]M, g = Semantics � [[x]M, g = emma book(x) read(i, x) x book(x) book x � Therefore [[book(x)]]M, g = 0 read(i, x) read x
Interpreting the formula We proceed bottom-up: x[book(x) read(i, x)] � [[book]]M, g = Semantics � [[x]M, g = emma book(x) read(i, x) x � Therefore [[book(x)]]M, g = 0 � [[read]]M, g = book(x) book x read(i, x) read x {<isabel, Semantics>} � [[i]M, g = isabel � [[x]]M, g = emma � Therefore [[read(i, x)]]M, g = 0
Interpreting the formula We proceed bottom-up: x[book(x) read(i, x)] � [[book]]M, g = Semantics � [[x]M, g = emma book(x) read(i, x) x � Therefore [[book(x)]]M, g = 0 � [[read]]M, g = book(x) book x read(i, x) read x {<isabel, Semantics>} � [[i]M, g = isabel � [[x]]M, g = emma � Therefore [[read(i, x)]]M, g = 0 � [[book(x) read(i, x)]]M, g = 0
The situation so far � We have a formula where we’ve x[book(x) read(i, x)] set the value for the free variable x using our initial variable assignment g. book(x) read(i, x) x � We know that its value is 0. � At this point, we find that the book(x) book x read(i, x) read x variable is bound by the existential quantifier. And our interpretation rule says: find some assignment g’ identical to the original, except that the value for the free variable x is substituted for some other value so that the formula comes out true on this assignment
The situation so far � Clearly, our assignment x[book(x) read(i, x)] book(x) read(i, x) x book(x) book x read(i, x) read x g doesn’t make the formula come out true. � Can we find another assignment g’ identical to g, except that x in g’ is a different individual, which is a book? �g’(x) = Semantics � On this assignment, the formula comes out true. (The point is that the initial assignment was needed to get us up the tree, but ultimately had no effect on the final interpretation. )
In general �To compositionally interpret Predicate Logic formulas, we need models and explicit consideration of how variables are assigned. �We’ve seen an example with existential quantification. �Things proceed in largely the same way with universal quantification, except that we have to check whether the formula is true for every value of the variable, on a given assignment.
- Slides: 24