 Hi, welcome back to Fill 320, Deductive Logic. I'm Professor Matthew Brown. We're continuing our discussion today of QL, and today we're going to be defining well-formed formulae in QL. You remember we did this earlier on with SL, and we're going to do it again today. This is going to allow us to refine our discussion of QL to be a little bit more precise. I'm going to start here again by mentioning the different components of QL. This is just taken straight from the book. We've got the predicates, whether without subscripts as capital letters, the constants, A through W, whether without predicates, the variables, with subscripts as needed, and the connectives that we had in SL, the parentheses, and the quantifiers. We're going to define an expression of QL as we did with SL as any string of symbols of QL. Take any of the symbols of QL and write them down in any order, and you have an expression of QL. We're going to define a term of QL as any constant, singular term, or variable. So we use the generic term to refer to either constant or variable, and we'll say an atomic formula of QL is an in-place predicate followed by n terms. So one capital letter followed by one or more lowercase letters. And then, like in SL, we define a well-formed formula with a series of rules. The first rule is that every atomic formula is a wolf, is a well-formed formula. So every capital letter followed by lowercase letters is an atomic formula. Instead of using script letters here, I'm going to use shapes, squares, and circles as my meta variables for sentences, for expressions, just to highlight that we're not talking about predicate letters. We're just talking about expressions. So if square is a wolf, then not square is a wolf. That's the negation rule. We've got the same conjunction, disjunction, and biconditional rules that we had for SL, right? For any two expressions, square and circle, the conjunction, disjunction, conditional, or biconditional with the parentheses around them is also a wolf, right? And then we have new rules for our quantifiers. This is a little, they're a little complicated, so I'll walk you through them slowly. Rule seven says if square is a wolf and diamond is a variable and square contains at least one occurrence of that variable, diamond, and square contains no diamond quantifiers, no quantifiers that quantify over that variable, then for all star square is a wolf, right? So if you have a wolf that has an X in it, say, and no quantifier applying to X yet, if you then add for all X in front of that wolf, you also have a wolf, right? And same exact rule for the existential quantifier. So this allows us to build up an expression using quantifiers. Rules seven and eight allows to do that. And then as with SL, rule nine says all and only wolves of QL can be generated by application of these rules. Here's how Magnus writes them in the book using the more familiar script letter meta variables, right? But it's this, otherwise it's the same, right? So these define for us what a wolf is. These are recursive rules as with SL. So you start with atomic formula, GX, L, A, B, etc. You apply these nine rules, you apply really one of rules two through eight to add more complexity. You can this way recursively define arbitrarily long expressions. Two more things that we need to know, two more definitions that we need to know. The first is a sentence of QL is any wolf of QL that contains no free variables. This is an important difference between SL and QL. In SL, every wolf is automatically a sentence. Every SL wolf is meaningful, it is truth-evaluable, it has a truth value. That's not the case for QL. There are wolves that don't have quantifiers but do have variables in them. And we don't know how to assign a truth value to those sentences, right? You can't assign a truth value to a sentence with a variable in it unless you already have a quantifier. We will also allow expressions of QL following the same notational conventions that we use for SL to count as sentences of QL following those notational conventions. So there's a little bit of a different relationship between expressions, wolves and sentences in QL than there was in SL. For SL, every wolf is a sentence. Every sentence is an expression. It's a little bit different here. So the broadest category is expressions. That's any of the symbols of QL in any order, right? Then we have the well-formed formulae as a subset of expressions. The sentences are also a subset of expressions but they're not completely overlapping in either direction. So here, where there's a wolf but not a sentence, those are wolves with free variables in them. Here in the overlap, these are wolves with no free variables, right? So those are sentences and wolves. And then over here, we've got the sentences that have been modified by the notational conventions and so are not by the strict definition well-formed formulae. So this notion of free and bound variables may be a little unclear. So let's look at some examples here. These are just various expressions in QL. So let's look a little bit more closely here. This first sentence FA then GA, A is a constant, not a variable. So there are no variables and so there are no free variables. FX, if FX then GX, right? X is a variable but there's no quantifier here, right? So the X is a free variable. In this next expression for all X, if FX then GX, the quantifier applies to everything in the parentheses. And so all of the variable X inside the parentheses are bound by this quantifier. So there are no free variables, there are only bound variables. So while this second example is a wolf, not a sentence, this is a wolf and a sentence. Now the next expression looks similar, but we've got this Y here, Y is a variable, but it's not bound by any quantifier. So it's also a free variable, right? In order to have it be bound, we need another quantifier. You could put it out here would be one way. It could be in here instead, right? What matters to the expression being, what matters to the variable being bound is that it's within the scope of a quantifier that applies to that same variable. So let's look here at these examples. I want you to think about are these wolves sentences, both or neither, right? So take a moment, pause, and we will go through it together. All right, let's see. So number one, ZA and ZB and ZC, this is a sentence, right? It's not a wolf because there are no parentheses around the conjunctions. Remember we can get rid of those parentheses, that's one of our notational conventions, but it means it's a sentence, not a wolf. There are no variables, and so there are no free variables. There are no variables in two either, B is a constant, right? And this has got everything you need for a wolf, so it's both, right? It's both a wolf and a sentence. Number three, still no variables, but it is a sentence because the outside parentheses are gone, right? Again, that's allowed by notational conventions only. Number four, you've got the variable X, but it's bound by the quantifier. All your parentheses are in place, everything looks good, so that's both. Number five, you will see the quantifiers are such that they are only applying to the atomic formula right next to them. That means that this Y and this X are free variables. So that means it's neither, it's not a sentence, can't be a sentence, it's also not a wolf because the parentheses around the conjunction are gone, so it's neither. It is just an expression. Six is tidy, it looks good, it's both. Seven has no free variables, definitely a sentence, but it's using the square brackets convention so it is a sentence. Eight is both, nine is both, 10. It's a little unclear, but you'll notice here this X is not bound by this quantifier over X. That quantification scope stops at that end parentheses here, so you got a free variable. You're also missing the outside parentheses around this conjunction, so we're gonna say that's neither. Number 11 is a sentence using notational conventions. All of your variables are bound by the appropriate quantifier, so it's good on that realm. And then this last one is a sentence using notational conventions, and that is because it is missing those outside parentheses around the conditional. Okay, so that's some examples of how we apply the definitions of well-formed formula and sentence. This is gonna be pretty important when we get to our next unit and we're doing the semantics of QL, and you'll see why in unit six. That's all we have for today's lecture on well-formed formulae and the strict definition of sentences in QL. In our last lecture, we are going to look at some extensions of QL using the concept of identity. I will see you then, have a great day.