 Hi there and welcome back to fill 320 deductive logic. It's our last lecture for this unit on SL unit number two and this one is on what we call well-formed formulae. We learned last time about the basic connectives in SL including how they can be used to translate or symbolize various kinds of sentences. In this lecture we're going to talk about in a more sort of careful way how to define what exactly a sentence is in SL and how to distinguish meaningful which sentences are meaningful, which SL constructions are meaningful. Let's start with a logic puzzle of the day. So have a look at this. On a fictional island all inhabitants are either knights who always tell the truth or naves who always lie. John and Bill are residents of the island of knights and naves. John says we are both naves. Who is what? Is John a nave or a knight? What about Bill? Is he a nave or a knight? So think about that and let us know on discord what you think the answer is. What we're going to do here today is give a really careful formal definition of what a sentence of SL is in terms of the concepts of expression and well-formed formula or well-formed formulae. So far we've had more of a rough and ready understanding and now we're going to really strictly define it. This kind of definition is not itself part of SL. It's part of what we might call the meta-language of SL but it defines what the language of SL is. So first we have to define what the symbols of SL are. It's a handy chart in the book for this. SL is made up of sentence letters A through Z, capital letters. You can also use subscripts if you need to. You can add a little subscript to your letters if you need more than the normal amount or if it is a little easier to do the translation. Also you have the five connectives that we've talked about, the logical connectives and parentheses. These are all the components that go into an SL expression and then we define carefully an expression of SL as any string of symbols in an SL. So any combination of these three types of symbols gives you an expression of SL. Of course, many such expressions are going to be a meaningless jumble of symbols. They might look something like this, nonsense. So we want to define what a meaningful expression of SL can be and by meaningful we mean that they can be true or false, that they have that property of truth value. We call these well-formed formulae or we use WFF as an acronym for that and we'll say woof. So you hear me saying woof a lot, not suddenly switched into the language that my dog uses. I am talking about well-formed formulae. So woofs are defined using a series of rules. First, every atomic sentence, every sentence letter is a woof, is a well-formed formula. That's our first rule, that's simple. Second, if a is a woof then not a is a woof of SL. Now note here that a is a funny script font, not our usual chalkboard font. That's because script a isn't our usual sentence letter, it's not an atomic sentence. Instead, I'm using script a as a variable to stand in for any woof, any well-formed formula, an atomic sentence or a complex one. So script a is not a symbol of SL and so not script a there is not an expression or a woof. This is a meta language expression. This is an expression in the language that we're using to define SL. So we call script a a meta variable. The definitions that I'm giving, these rules that I'm giving are recursive. They apply to expressions in SL that we've generated using these rules. So rule number two says if you have a woof then if you add the negation to the front of it you also have a woof. You have a new woof, a new well-formed formula. Rule three says if a and b, here these are script letters so they stand for any kind of arbitrary expression of SL. If a and b are woofs then a and b, right here in parentheses is a woof. And we have similar rules for disjunction, conditional and biconditional. So you take any two woofs, any two well-formed formulae of SL, you put parentheses around them and one of these four connectives between them and you have a new woof. Finally, the last rule, all and only woofs of SL can be generated by applications of these rules. Like I said that the definition is recursive. So to generate a sentence of SL, a well-formed formula of SL, you just apply the rules over and over again to make more and more complicated sentences. Now SL has a really nice feature. Any woof of SL is a sentence, right? Any woof of SL can be true or false. Not every formal language is like this. QL, which we'll learn in unit five, has woofs that are not sentences, right? So we have to distinguish between well-formed formulae and sentences, right? So let's try applying these seven rules to some examples. I want you to pause the video and try it on your own, okay? You can take these 10 different expressions and I want you to figure out which of these are woofs of SL and if it's not a woof of SL, try to figure out how you would fix it, okay? Pause it, try it on your own. We'll see how you did. All right, you figure it out. So right off we can say number one is a woof of SL. It's just a sentence letter with a subscript. It's a long subscript but that's fine. Number two is also a woof of SL, right? You can see that it's just multiple applications of the rule number two, the negation rule, right? To a sentence letter A. Six is a woof of SL. You can see that it's just the normal conjunction rule applied to two atomic sentences. And 10 is a very complex expression but if you take a second and look at it, you can also see it fits all of the rules for generating a woof of SL. The rest are not precisely following the woof rules and require a little bit of fixing up. So number three, you see there's some extra parentheses there. We got to get rid of those. Then we have a reasonable woof of SL, right? Number four is a woof of SL but it's missing the parentheses that go around the outside. They forgot that, right? Number five, not clear what it's supposed to mean. It looks like it's missing the sentence letter that goes in the front so let's just use A. That will fix it. Number seven is simply missing the closing parentheses around the outside whereas number eight is missing parentheses around one of the two conjuncts. We can just throw them in there. That'll fix it. And number nine is missing the outside parentheses, right, that go around the outside of the whole expression. And now with all the additions in red or subtractions that I've made, all of them now are woofs of SL. Okay, so having looked at well-formed formulae, there are a few ways we can relax the strict definitions for convenience or clarity. So those seven rules are like very strict rules and we can have a few what we call notational conventions that we can adopt in order to transform a woof, a well-formed formula of SL into a sentence in a kind of looser sense. We've been sort of implicitly using these conventions already in our prior symbolizations and now we're going to make them explicit. We'll call what these rules generate, sentences of SL allowing for notational conventions. Here are the notational conventions we'll use. If there are parentheses around the outside of a sentence, the entire sentence, we can remove those. We can also use square brackets in place of round parentheses if doing so allows us to be a little bit more clear, right? So for complicated sentences, this is useful because you can kind of, it's easy to lose track of all the parentheses and sort of alternating between square and round brackets will help us keep the relationships clear. We'll also say you can leave the parentheses out in sentences like A and B and C where it's a bunch of conjunctions in a row or when you have a bunch of disjunctions in a row. Why? Because the order you apply it doesn't really matter, right? You can think of it like addition and multiplication. If you have a bunch of multiplications or additions in a row, as long as you don't have anything else going on, it doesn't really matter what order you do them in. It works like this in SL2 with conjunction and disjunction. So now let's look at some examples of applying these notational conventions. So we've got these nine expressions and what I want to know, first, is it a wolf of SL? Second, is it a sentence of SL if we allow for the notational conventions? I want you to pause the video and see if you can do it on your own before we go through them. Okay, did you figure it out? Let's find out. So number one is not a wolf of SL. There's no rule that allows that has you put parentheses around an atomic sentence. It's also not one of our notational conventions. Notational convention refers to removing the parentheses around a sentence, but not adding additional parentheses. What about number two? Also not a wolf of SL. The parentheses around the disjunction are missing, but that's allowed under our notational convention. So it is a sentence of SL if you allow for notational conventions. Number three is a wolf, and therefore it's also a sentence allowed for notational conventions. You can apply the negation as many times as you like. Number four is nonsense. It's missing something, a sentence letter, parentheses, it's not clear what's missing. So it is neither. Number five is a standard wolf of SL. And so it's also a sentence. Number six is not a wolf. You know why? Because it's missing those outside parentheses, but it is a sentence if we allow for those notational conventions that allow us to take the parentheses away. Seven is not a wolf. You can see it's missing the parentheses that belong to this main disjunction, but that's allowed under notational conventions. The square brackets mean it's not a wolf, but those are allowed under the notational conventions. Some of the parentheses, the ones around the conditional and the disjunction have been turned into square brackets. The parentheses around the whole expression, the conjunction, have also been removed. This is not a wolf. You can see you've got your biconditional and your conditional there on the left hand side with no intervening parentheses. And unlike the series of conjunctions or disjunctions, you can't remove the parentheses around those. So it's also not a sentence involving notational conventions. And so that means it's not a sentence in either sense. So those are how we use those formal definitions to determine whether a certain expression is a sentence or a well-formed formula. The notion of a well-formed formula is useful because it allows us to give an extremely precise definition, one that will be useful in later units as we try to formally analyze the meaning of our various expressions. If you have any questions, let me know in office hours or outside of it via email, in person, discord, etc. This is the last lecture for unit number two. So try all these things out on our practice problems. And I want to wish you best of luck with the exam. I'll see you in unit three. Bye for now.