Albert Gatt LIN3021 Formal Semantics Lecture 3
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 for 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 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 last week.
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 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. If α is a wff then γ = C( α ) is a wff. If α is a wff and β is a wff, then γ = F( α, β ) is a wff.
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 SyntaxSemantics 1. Every prop. variable is a wff. 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. 1. If α is a wff, then [[ α ]] = f( α ) 2. If α is a wff and β is a wff, then: a) [[¬ α ]] = 0 if [[ α ]=1; 1 otherwise. b) [[( α β )]] = 1 iff [[ α ]] = 1 and [[ β ]] = 1 c) [[( α β )]] =1 iff [[ α ]] = 1 or [[ β ]] = 1 d) [[( α β )]] = 1 iff [[ α ]] = 0 or [[ β ]] = 1 e) [[ α β ]] = 1 iff [[ α ]] = [[ β ]] Note: these semantic rules basically describe the structure of the truth tables for the connectives. If α is interpreted as [[α]], then then γ = C( α ) is interpreted as M([[ α]] ) If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F( α, β ) is interpreted as [[ γ ]] = G( [[α]], [[β]])
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. 2a) (p q) (syn. 2c) q (syn. 1) p(syn. 1) 0 (sem. 2a) 1 (sem. 2c) 1 (sem.1) 0 (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 t1, t2, 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 1. If t 1, t 2, …, t n are individual terms, and P is an n-place predicate, then P(t 1, t 2, …, t n ) is a wff. 2. If α is a wff and β is a wff, then the following are also wffs: 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. If α is a wff then γ = C( α ) is a wff. If α is a wff and β is a wff, then γ = F( α, β ) is a wff.
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 = 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 1. If α is a constant, then [[ α ]] M,g = I( α ) Constants are fixed by our interpretation function 2. If α is a variable, then [[ α ]] M,g = g( α ) Variables are assigned by our variable assignment function 3. If P is an n-ary predicate and t 1,...,t n are terms, then [[P(t1,...,tn)]] = 1 iff [[P]] M,g Predicates are interpreted as ordered n-tuples 4. If α is a wff and β is a wff, then: a) [[¬ α ]] M,g = 1 iff [[ α ]] M,g = 0 b) [[ α β ]] M,g = 1iff [[ α ]] M,g = 1 and [[ β ]] M,g =1 c) [[ α β ]] M,g =1 iff [[ α ]] M,g = 1 or [[ β ]] M,g =1 d) [[ α β ]] M,g = 1 iff [[ α ]] M,g = 0 or [[ β ]] M,g =1 e) [[ α β ]]M,g = 1 iff [[ α ]] M,g = [[ β ]] M,g 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 If α is interpreted as [[α]], then then γ = C( α ) is interpreted as M([[ α]] ) If α is interpreted as [[α]] and β is interpreted as [[β]], then γ = F( α, β ) is interpreted as [[ γ ]] = G( [[α]], [[β]]) Essentially the same as for propositional logic, but we need to make reference to the model M and the assignment function g
A closer look 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 modelA formula U = {isabel, emma, Semantics} Constants: [[i]] M = Isabel [[e]] M = Emma [[s]] M = Semantics Predicates: [[person]] M = {isabel, emma} [[book]] M = {Semantics} [[read]] M = { } Initial variable assignment: g(x) = emma x[book(x) read(i,x)] Isabel reads a book Only if x = Semantics is this formula true x[book(x) read(i,x)] book(x) read(i,x) x read(i,x)book(x) bookx xread i
Interpreting the formula We proceed bottom-up: [[book]] M,g = Semantics [[x] M,g = emma Therefore [[book(x)]] M,g = 0 x[book(x) read(i,x)] book(x) read(i,x) x read(i,x)book(x) bookx xread
Interpreting the formula We proceed bottom-up: [[book]] M,g = Semantics [[x] M,g = emma Therefore [[book(x)]] M,g = 0 [[read]] M,g = { } [[i] M,g = isabel [[x]] M,g = emma Therefore [[read(i,x)]] M,g = 0 x[book(x) read(i,x)] book(x) read(i,x) x read(i,x)book(x) bookx xread
Interpreting the formula We proceed bottom-up: [[book]] M,g = Semantics [[x] M,g = emma Therefore [[book(x)]] M,g = 0 [[read]] M,g = { } [[i] M,g = isabel [[x]] M,g = emma Therefore [[read(i,x)]] M,g = 0 [[book(x) read(i,x)]] M,g = 0 x[book(x) read(i,x)] book(x) read(i,x) x read(i,x)book(x) bookx xread
The situation so far We have a formula where we’ve set the value for the free variable x using our initial variable assignment g. We know that its value is 0. At this point, we find that the 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 x[book(x) read(i,x)] book(x) read(i,x) x read(i,x)book(x) bookx xread
The situation so far Clearly, our assignment 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. x[book(x) read(i,x)] book(x) read(i,x) x read(i,x)book(x) bookx xread (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.