First-Order Predicate Logic. First-Order Logic 153/467

Size: px
Start display at page:

Download "First-Order Predicate Logic. First-Order Logic 153/467"

Transcription

1 First-Order Predicate Logic First-Order Logic 153/467

2 What Propositional Logic Cannot Express Propositional logic dealt with logical forms of compound propositions It worked well with relationships like not, and, or, if/then We would like to have a way to talk about individuals (also called objects) and in addition to talk about some object, and all objects, without enumerating all objects in a set This requires extensions to Propositional Logic First-Order Logic Introduction and Motivation 154/467

3 Some Example Statements Some example statements: Not all birds can fly Every student is younger than some instructor These refer to things: birds, students, instructors They also refer to properties of things, either as individuals (ability to fly) or in combination (relative age) We would like to make such statements in our logic and to combine them with the connectives of propositional logic Statements like those above require a context, or world, to be meaningful First-Order Logic Introduction and Motivation 155/467

4 Informal Introduction to Predicate Logic We shall briefly discuss some worlds for predicate logic Arithmetic (the inspiration for formal predicate logic) The blocks world (a classical AI example) Graphs (a ubiquitous concept in CS) Databases (the applied CS version of predicate logic) In each, we shall see the following ingredients Domains The set of objects; also called the universe Constants Objects with specific names Relations Properties of objects, alone or in combination Functions Association of objects to others First-Order Logic Introduction and Motivation 156/467

5 Arithmetic, Etc In arithmetic, we have several possible domains N: The natural numbers Z: The integers Q: The rationals Integers modulo n Over these, we have predicates (or relations): <: Less than Has a square root and also functions: +,, etc A sample formula: x ( y (y < x)) First-Order Logic Introduction and Motivation 157/467

6 A Classic AI Example: Blocks Worlds A blocks world consists of a set of blocks, and a table Each block may be on the table, or on one of the other blocks Each block may have a colour In the picture, there are three blocks Two of them are blue (vertical stripes) and one is red (diagonal stripes) B B3 B Set of objects: {B1, B2, B3} We can describe the world with relations: On, OnTable, Red, Blue, First-Order Logic Introduction and Motivation 158/467

7 Describing a Blocks World The domain {B1, B2, B3} is a finite set Therefore, we can list all of the properties, in various ways: OnTable(B1), OnTable(B2), OnTable(B3) On: B1 B2 B3 B1 F F F B2 F F F B3 T F F The set { b Blue(b) } of blue blocks is {B2, B3} First-Order Logic Introduction and Motivation 159/467

8 Properties in the Blocks World Some properties are fundamental to the world No box is on itself x On(x, x) A box on the table is not on any box : x (OnTable(x) ( y On(x, y))) Some properties depend on the situation Every red box has a box on it : x (Red(x) y On(y, x)) Some box is on a box that is on the table : x y (On(x, y) OnTable(y)) First-Order Logic Introduction and Motivation 160/467

9 Graphs A graph is a binary relation A finite graph: An infinite graph: y x 3 2 (The set { x, y y = 1 + x/2 }) A graph is undirected if the relation is symmetric; ie, the formula x y (E(x, y) E(y, x)) holds First-Order Logic Introduction and Motivation 161/467

10 Relational Databases A relational database is a listing of one or more relations Example: Person: The people (or their names) NumberOf : An association between people and their phone numbers Here the domain contains both people and phone numbers the objects about which we have relations A sample statement: Somebody has no phone number x (Person(x) ( y (NumberOf (x, y))) First-Order Logic Introduction and Motivation 162/467

11 A Conundrum Consider the statement, Only people have phone numbers How shall we represent it as a logical formula? Whenever x and y satisfy NumberOf (x, y), then x is a person x ( y (NumberOf (x, y) Person(x))) Whenever x has some phone number y, then x is a person x (( y NumberOf (x, y)) Person(x)) These two formulas are respectively equivalent to x ( y ( NumberOf (x, y) Person(x))) and to x (( ( y NumberOf (x, y))) Person(x)) Are these two formulas equivalent? First-Order Logic Introduction and Motivation 163/467

12 Domains We now turn to general definitions A domain is a non-empty set In principle, any non-empty set can be a domain: the natural numbers, people now alive, {T, F}, etc A constant symbol refers to an object in the domain; eg, 0, B1, Justin Trudeau, etc First-Order Logic Concepts of First-Order Logic 164/467

13 Predicates/Relations A predicate, or relation, represents a property that an individual, or collection of individuals, may (or may not) have In English, we might express a predicate as is a student In symbolic logic, we write S(x) to mean x has property S For example, if S is the property of being a student, then Alex is a student becomes S(Alex) Similarly, we might use I(Sam) for Sam is an instructor and Y (Alex,Sam) for Alex is younger than Sam First-Order Logic Concepts of First-Order Logic 165/467

14 Representing Relations Mathematically, we represent a relation by the set of all things that have the property If S is the set of all students, then x S means x is a student The only restriction on a relation is that it must be a subset of the domain A k-ary relation is a set of k-tuples of domain elements For example, the binary relation less-than, over a domain D, is represented by the set { x, y D 2 x < y } As another example, the On relation in the sample blocks world has just one pair: { B3, B1 } (In a relational database, the listing of such a set is called a table ) First-Order Logic Concepts of First-Order Logic 166/467

15 Variables Variables make statements more expressive You may think of a variable as a place holder, or blank, that can be replaced by a concrete object Alternatively, a variable is a name without a fixed referent Which object the name refers to can vary from time to time A variable lets us refer to an object, without specifying perhaps without even knowing which particular object it is Thus we can express a relation in the abstract S(x): x is a student I(x): x is an instructor Y (x, y): x is younger than y First-Order Logic Concepts of First-Order Logic 167/467

16 Uses of Variables In general, we use variables that range over the domain to make general statements, such as x 2 0, and in expressing conditions which individuals may or may not satisfy, such as x + x = x x This latter condition is satisfied by only two numbers: 0 and 2 The meaning of such an expression will depend on the domain For example, the formula x 2 < x is always false over the domain of integers, but not over the domain of rational numbers First-Order Logic Concepts of First-Order Logic 168/467

17 Quantifiers What about Every student x is younger than some professor y? In math-speak, we say for all to express every and there exists to express some A familiar(?) example from calculus: For all ε > 0, there exists δ > 0 such that for all y, if x y < δ then f(x) f(y) < ε For all is denoted by, the universal quantifier symbol, and there exists is denoted by, the existential quantifier symbol In FOL, the above comes out as the formula ε (ε > 0 δ (δ > 0 y ( x y < δ f(x) f(y) < ε))) First-Order Logic Concepts of First-Order Logic 169/467

18 Quantifiers: Examples Quantifiers require a variable: x (for all x) or z (there exists z) For example, the statement Not all birds can fly can be written as ( x (B(x) F (x))) Every student is younger than some instructor can become x (S(x) ( y (I(y) Y (x, y)))) Or should that be y (I(y) x (S(x) Y (x, y)))? These two formulas are NOT equivalent! First-Order Logic Concepts of First-Order Logic 170/467

19 Syntax of Predicate Logic Syntax of First-Order Logic 171/467

20 The seven kinds of symbols: The Language of First-Order Logic 1 Constant symbols Usually c, d, c 1, c 2,, d 1, d 2 2 Variables Usually x, y, z, x 1, x 2,, y 1, y 2 3 Function symbols Usually f, g, h, f 1, f 2,, g 1, g 2, 4 Predicate symbols Usually P, Q,, P 1, P 2,, Q 1, Q 2, 5 Connectives:,,,, and 6 Quantifiers: and 7 Punctuation: (, ), and, Function symbols and predicate symbols have an assigned arity the number of arguments required The last three kinds of symbols connectives, quantifiers, and punctuation will have their meaning fixed by the syntax and semantics Constants, variables, functions and predicate symbols are not restricted They may be assigned any meaning, consistent with their kind and arity Syntax of First-Order Logic 172/467

21 Terms In FOL, we need to consider two kinds of expressions: those that can have a truth value, called formulas, and those that refer to an object of the domain, called terms We start with terms Definition The set of terms is defined inductively as follows 1 Each constant symbol is a term, and each variable is a term Such terms are called atomic terms 2 If t 1,, t n are terms and f is an n-ary function symbol, then f(t 1,, t n ) is a term If n = 2 (a binary function symbol), we may write (t 1 f t 2 ) instead of f(t 1, t 2 ) 3 Nothing else is a term Syntax of First-Order Logic 173/467

22 Examples of Terms Example 1 If 0 is a constant symbol, x and y are variables, and s (1) and + (2) are function symbols, then 0, x, and y are terms, as are s(0) and +(x, s(y)) The expressions s(x, y) and s + x are not terms Example 2 Suppose f is a unary function symbol, g is a binary function symbol, and a is a constant symbol Then g(f(a), a) and f(g(a, f(a))) are terms The expressions g(a) and f(f(a), a) are not terms Syntax of First-Order Logic 174/467

23 Atomic Formulas As in propositional logic, a formula represents a proposition (a true/false statement) The relation symbols produce propositions Definition: An atomic formula (or atom) is an expression of the form P (t 1,, t n ) where P is an n-ary relation symbol and each t i is a term (1 i n) If P has arity 2, the atom P (t 1, t 2 ) may alternatively be written (t 1 P t 2 ) Syntax of First-Order Logic 175/467

24 General Formulas We define the set of well-formed formulas of first-order logic inductively as follows 1 An atomic formula is a formula 2 If α is a formula, then ( α) is a formula 3 If α and β are formulas, and is a binary connective symbol, then (α β) is a formula 4 If α is a formula and x is a variable, then each of ( x α) and ( x α) is a formula 5 Nothing else is a formula In case 4, the formula α is called the scope of the quantifier The quantifier keeps the same scope if it is included in a larger formula Syntax of First-Order Logic 176/467

25 Parse Trees Parse trees for FOL formulas are similar to parse trees for propositional formulas Quantifiers x and y form nodes is the same way as negation (ie, only one sub-tree) A predicate P (t 1, t 2,, t n ) has a node labelled P with a sub-tree for each of the terms t 1, t 2,, t n Syntax of First-Order Logic 177/467

26 Examples: Parse trees Example: ( x ((P (x) Q(x)) S(x, y))) Syntax of First-Order Logic 178/467

27 Examples: Parse trees Example: ( x ((P (x) Q(x)) S(x, y))) Example: ( x (F (b) ( y ( z (G(y, z) H(u, x, y)))))) Syntax of First-Order Logic 178/467

28 Examples: Parse trees Example: ( x ((P (x) Q(x)) S(x, y))) Example: ( x (F (b) ( y ( z (G(y, z) H(u, x, y)))))) Ordinarily, one would omit many of the parentheses in the second formula, and write simply x (F (b) y z (G(y, z) H(u, x, y))) Syntax of First-Order Logic 178/467

29 Semantics: Interpretations We cover more on syntax later, but we first start the discussion of semantics Definition: Fix a set L of constant symbols, function symbols, and relation symbols (The language of our formulas) An interpretation (for the set L) consists of A non-empty set dom( ), called the domain (or universe) of For each constant symbol c, a member c of dom( ) For each function symbol f (i), an i-ary function f For each relation symbol R (i), an i-ary relation R Huth and Ryan use the term model instead of interpretation (Not a standard usage) Variable-free semantics 179/467

30 Values of Variable-Free Terms For terms and formulas that contain no variables or quantifiers, an interpretation suffices to specify their meaning The meaning arises in the obvious(?) fashion from the syntax of the term or formula Definition: Fix an interpretation For each term t containing no variables, the value of t under interpretation, denoted t, is as follows If t is a constant c, the value t is c If t is f(t 1,, t n ), the value t is f (t 1,, t n) The value of a term is always a member of the domain of Variable-free semantics 180/467

31 Formulas with Variable-Free Terms Formulas get values in much the same fashion as terms, except that values of formulas lie in {F, T} Definition: Fix an interpretation For each formula α containing no variables, the value of α under interpretation, denoted α, is as follows If α is R(t 1,, t n ), then { α T = { F if t 1,, t n R otherwise If α is ( β) or (β γ), then α is determined by β and γ in the same way as for propositional logic Variable-free semantics 181/467

32 Examples Let 0 be a constant symbol, f (1) a function symbol and E (1) a relation symbol Thus E(f(0)) and E(f(f(0))) are both formulas Consider an interpretation with Domain: N, the natural numbers 0 : zero f : successor; { x, x + 1 x N } E : is even ; { y + y y N } Terms get numerical values: f(0) is 1 and f(f(0)) is 2 Formula E(f(0)) means 1 is even, and E(f(0)) = F Formula E(f(f(0))) means 2 is even, and E(f(f(0))) = T What about some other interpretation? Variable-free semantics 182/467

33 Example, Continued Let be the interpretation with Domain: Q, the rational numbers 0 : two f : halving; { x, x/2 x Q } E : is an integer ; { x x Z } E(f(0)) means 1 is an integer, and E(f(0)) is T E(f(f(0))) means 1/2 is an integer, and E(f(f(0))) is F Exercise: in both and, the formula E(f(f(0))) E(f(0)) receives value F Find another interpretation which gives it the value T Variable-free semantics 183/467

34 Gotchas Two often-overlooked points about interpretations 1 There is NO default meaning for relation, function or constant symbols = 3 might mean that one plus two equals three but only if we specify that interpretation Any interpretation of constants 1, 2, and 3, function symbol + (2) and relation symbol = (2) is possible 2 Functions must be defined at every point in the domain (Ie, they must be total) If we have language with a binary function symbol, we cannot specify an interpretation with domain N and subtraction for Subtraction is not total on N Variable-free semantics 184/467

35 Variables To discuss the evaluation of formulas that contain variables, we need a few more concepts from syntax We shall discuss bound and free variables, substitution of terms for variables Syntax, Continued Free and Bound Variables 185/467

36 Free and Bound Variables Recall: the scope of a quantifier in a sub-formula x α or x α is the formula α An occurrence of a variable in a formula is bound if it lies in the scope of some quantifier of the same variable; otherwise it is free In other words, a quantifier binds its variable within its scope Example In formula x ( y (x + y = z)), x is bound (by x), y is bound (by y), and z is free Example In formula P (x) ( x ( Q(x))), the first occurrence of x is free and the last occurrence of x is bound (The variable symbol immediately after or is neither free nor bound) Syntax, Continued Free and Bound Variables 186/467

37 Free and Bound Variables Formally, a variable occurs free in a formula α if and only if it is a member of the set FV(α) defined as follows 1 If α is P (t 1,, t k ), then FV(α) = { x x appears in some t i } 2 If α is ( β), then FV(α) = FV(β) 3 If α is (β γ), then FV(α) = FV(β) FV(γ) 4 If α is Qx β (for Q {, }), then FV(α) = FV(β) {x} A formula has the same free variables as its parts, except that a quantified variable becomes bound A formula with no free variables is called a closed formula, or a sentence Syntax, Continued Free and Bound Variables 187/467

38 Substitution The notation α[t/x], for a variable x, a term t, and a formula α, denotes the formula obtained from α by replacing each free occurrence of x with t Intuitively, it is the formula that answers the question, What happens to α if x has the value specified by term t? Examples If α is the formula E(f(x)), then α[(y + y)/x] is E(f(y + y)) α[f(x)/x] is E(f(f(x))) E(f(x + y))[y/x] is E(f(y + y)) Substitution does NOT affect bound occurrences of the variable If β is x (E(f(x)) S(x, y)), then β[g(x, y)/x] is β, because β has no free occurrence of x Syntax, Continued Substitution 188/467

39 Examples: Substitution Example Let β be P (x) ( x Q(x)) What is β[y/x]? Syntax, Continued Substitution 189/467

40 Examples: Substitution Example Let β be P (x) ( x Q(x)) What is β[y/x]? β[y/x] is P (y) ( x Q(x)) Only the free x gets substituted Syntax, Continued Substitution 189/467

41 Examples: Substitution Example Let β be P (x) ( x Q(x)) What is β[y/x]? β[y/x] is P (y) ( x Q(x)) Only the free x gets substituted Example What about β[(y 1)/z], where β is x ( y ((x + y) = z)))? Syntax, Continued Substitution 189/467

42 Examples: Substitution Example Let β be P (x) ( x Q(x)) What is β[y/x]? β[y/x] is P (y) ( x Q(x)) Only the free x gets substituted Example What about β[(y 1)/z], where β is x ( y ((x + y) = z)))? At first thought, we might say x ( y ((x + y) = (y 1))) But there s a problem the free variable y in the term (y 1) got captured by the quantifier y We want to avoid this capture Syntax, Continued Substitution 189/467

43 Avoiding Capture Example Formula α = S(x) y (P (x) Q(y)); term t = f(y, y) The leftmost x can be substituted by t since it is not in the scope of any quantifier, but substituting in P (x) puts the variable y into the scope of y We can prevent capture of variables in two ways Declare that a substitution is undefined in cases where capture would occur One can often evade problems by a different choice of variable (Above, we might be able to substitute f(z, z) instead of f(y, y) Or alter α to quantify some other variable) Write the definition of substitution carefully, to prevent capture Huth and Ryan opt for the first method We shall use the second Syntax, Continued Substitution 190/467

44 Substitution Formal Definition Let x be a variable and t a term For a term u, the term u[t/x] is u with each occurrence of the variable x replaced by the term t For a formula α, 1 If α is P (t 1,, t k ), then α[t/x] is P (t 1 [t/x],, t k [t/x]) 2 If α is ( β), then α[t/x] is ( β[t/x]) 3 If α is (β γ), then α[t/x] is (β[t/x] γ[t/x]) 4 (Continued next page ) Syntax, Continued Substitution 191/467

45 Substitution Formal Definition (2) For variable x, term t and formula α: 4 If α is (Qx β), then α[t/x] is α 5 If α is (Qy β) for some other variable y, then (a) If y does not occur in t, then α[t/x] is (Qy β[t/x]) (b) Otherwise, select a variable z that occurs in neither α nor t; then α[t/x] is (Qz (β[z/y])[t/x]) The last case prevents capture by renaming the quantified variable to something harmless (Huth and Ryan specify that the substitution is undefined if capture would occur case 5(b) above With this more complex definition, one never has to add a condition regarding undefined substitutions Substitution always behaves the way it should ) Syntax, Continued Substitution 192/467

46 Example, Revisited Example If α is x ( y (x + y = z)), what is α[(y 1)/z]? This falls under case 5(b): the term to be substituted, namely y 1, contains a variable y quantified in formula α Let β be (x + y = z); thus α is x ( y β) Syntax, Continued Substitution 193/467

47 Example, Revisited Example If α is x ( y (x + y = z)), what is α[(y 1)/z]? This falls under case 5(b): the term to be substituted, namely y 1, contains a variable y quantified in formula α Let β be (x + y = z); thus α is x ( y β) Select a new variable, say w Then β[w/y] is x + w = z, and β[w/y][(y 1)/z] is (x + w) = (y 1) Thus the required formula α[(y 1)/z] is x w((x + w) = (y 1)) Syntax, Continued Substitution 193/467

48 Semantics of Predicate Logic Semantics 194/467

49 FOL Adds to Propositional Logic In propositional logic, semantics was described in terms of valuations to propositional atoms FOL includes more ingredients (ie, predicates, functions, variables, terms, constants, etc) and, hence, the semantics for FOL must account for all of the ingredients We already saw the concept of an interpretation, which specifies the domain and the identities of the constants, relations and functions Formulas that include variables, and perhaps quantifiers, require additional information, known as an environment (or assignment) Semantics 195/467

50 Environments A first-order environment is a function that assigns a value in the domain to each variable Example With the domain N, we might have environment E 1 given by E 1 (x) = 9 and E 1 (y) = 2 If the interpretation specifies < is less-than, then x < y gets value false Example With the domain of fictional animals, we might have E 2 (x) = Tweety and E 2 (y) = Nemo If the interpretation specifies < is was created before, then x < y gets value true Semantics Environments 196/467

51 Constants Vs Variables Example: Let α 1 be P (c) (where c is a constant), and let α 2 be P (x) (where x a variable) Let be the interpretation with domain N, c = 2 and P = is even Then α 1 = T, but α 2 is undefined To give α 2 a value, we must also specify an environment For example, if E(x) = 2, then α (,E) 2 = T If we wish, we can consider a formula such as α 2 that contains a free variable x as expressing a function: the function that maps E(x) to α (,E) 2 Semantics Environments 197/467

52 Meaning of Terms The combination of an interpretation and an environment supplies a value for every term Definition: Fix an interpretation and environment E For each term t, the value of t under and E, denoted t (,E), is as follows If t is a constant c, the value t (,E) is c If t is a variable x, the value t (,E) is x E If t is f(t 1,, t n ), the value t (,E) is f (t (,E) 1,, t (,E) n ) To extend this definition to formulas, we must consider quantifiers But first, a few examples Semantics Environments 198/467

53 Meaning of Terms Example Example Suppose a language has constant symbol 0, a unary function s, and a binary function + We shall write + in infix position: x + y instead of +(x, y) The expressions s(s(0) + s(x)) and s(x + s(x + s(0))) are both terms The following are examples of interpretations and environments dom{ } = {0, 1, 2, }, 0 = 0, s is the successor function and + is the addition operation Then, if E(x) = 3, the terms get values (s(s(0) + s(x))) (,E) = 6 and (s(x + s(x + s(0)))) (,E) = 9 Semantics Environments 199/467

54 Meaning of Terms Example 2 dom{ } is the collection of all words over the alphabet {a, b}, 0 = a, s appends a to the end of a string, and + is concatenation Let E(x) = aba Then (s(s(0) + s(x))) (,E) = aaabaaa and (s(x + s(x + s(0)))) (,E) = abaabaaaaa Semantics Environments 200/467

55 Quantified Formulas To evaluate the truthfulness of a formula x α (resp x α), we should check whether α holds for every (resp, for some) value a in the domain How can we express this precisely? Definition: For any environment E and domain element d, the environment E with x re-assigned to d, denoted E[x d], is given by { d if y is x E[x d](y) = { E(y) if y is not x Semantics Environments 201/467

56 Values of Quantified Formulas Definition: The values of x α and x α are given by { ( x α) (,E) T = { F { ( x α) (,E) T = { F if α (,E[x d]) = T for every d in dom( ) otherwise if α (,E[x d]) = T for some d in dom( ) otherwise Note: The values of ( x α) (,E) and ( x α) (,E) do not depend on the value of E(x) The value E(x) only matters for free occurrences of x Semantics Environments 202/467

57 Examples: Value of a Quantified Formula Example Let dom( ) = {a, b} and R = { a, a, a, b, b, b } Let E(x) = a and E(y) = b We have R(x, x) (,E) = T, since E(x), E(x) = a, a R R(y, x) (,E) = F, since E(y), E(x) = b, a R ( y R(y, x)) (,E) = T, since R(y, x) (,E[y a]) = T (That is, E[y a](y), E[y a](x) = a, a R ) What is ( x y R(x, y)) (,E)? Semantics Environments 203/467

58 Examples: Continued Example Let dom( ) = {a, b} and R = { a, a, a, b, b, b } Let E(x) = a and E(y) = b What is ( x y R(x, y)) (,E)? Since b, a R, we have R(x, y) (,E[x b][y a]) = F, and thus ( x y R(x, y)) (,E) = F Semantics Environments 204/467

59 Examples: Continued Example Let dom( ) = {a, b} and R = { a, a, a, b, b, b } Let E(x) = a and E(y) = b What is ( x y R(x, y)) (,E)? Since b, a R, we have R(x, y) (,E[x b][y a]) = F, and thus ( x y R(x, y)) (,E) = F What about ( x y R(x, y)) (,E)? Semantics Environments 204/467

60 A Question of Syntax In the previous example, we wrote R(x, y) (,E[x b][y a]) = F Why did we not write simply R(b, a) = F or perhaps R(b, a) (,E) = F? Semantics Environments 205/467

61 A Question of Syntax In the previous example, we wrote R(x, y) (,E[x b][y a]) = F Why did we not write simply R(b, a) = F or perhaps R(b, a) (,E) = F? Because R(b, a) is not a formula The elements a and b of dom( ) are not symbols in the language; they cannot appear in a formula Semantics Environments 205/467

62 Satisfaction of Formulas An interpretation and environment E satisfy a formula α, denoted E α, if α (,E) = T; they do not satisfy α, denoted E α, if α (,E) = F Form of α R(t 1,, t k ) β β γ β γ β γ x β x β Condition for E α t (,E) 1,, t (,E) k R E β both E β and E γ either E β or E γ (or both) either E β or E γ (or both) for every a dom( ), E[x a] β there is some a dom( ) such that E[x a] β If E α for every E, then satisfies α, denoted α Semantics Satisfaction of Formulas 206/467

63 Example: Satisfaction Example Consider the formula y R(x, y y) (For R a binary relation and a binary function) Suppose dom( ) = {1, 2, 3, }, is the addition operation, and R is the equality relation Then E y R(x, y y) iff E(x) is an even number Semantics Satisfaction of Formulas 207/467

64 Validity and Satisfiability Validity and satisfiability of formulas have definitions analogous to the ones for propositional logic Definition: A formula α is valid if every interpretation and environment satisfy α; that is, if E α for every and E, satisfiable if some interpretation and environment satisfy α; that is, if E α for some and E, and unsatisfiable if no interpretation and environment satisfy α; that is, if E α for every and E (The term tautology is not used in predicate logic) Semantics Satisfaction of Formulas 208/467

65 Example: Satisfiability and Validity Let α be the formula P (f(g(x), g(y)), g(z)) The formula is satisfiable: dom( ): N f : summation g : squaring P : equality E(x) = 3, E(y) = 4 and E(z) = 5 α is not valid (Why?) Semantics Satisfaction of Formulas 209/467

66 Quantifiers Over Finite Domains The universal and existential quantifiers may be understood respectively as generalizations of conjunction and disjunction If the domain D = {a 1,, a k } is finite then: For all x, R(x) iff R(a 1 ) and and R(a k ) There exists x, R(x) iff R(a 1 ) or or R(a k ) where R is a property Semantics Satisfaction of Formulas 210/467

67 Relevance Lemma Lemma: Let α be a first-order formula, be an interpretation, and E 1 and E 2 be two environments such that E 1 (x) = E 2 (x) for every x that occurs free in α Then E1 α if and only if E2 α Proof by induction on the structure of α Semantics Satisfaction of Formulas 211/467

68 Logical Consequence Suppose Σ is a set of formulas and α is a formula We say that α is a logical consequence of Σ, written as Σ α, iff for any interpretation and environment E, we have E Σ implies E α α means that α is valid Semantics Satisfaction of Formulas 212/467

69 Example: Entailment Example: Show that ( x(α β)) (( x α) ( x β)) Proof by contradiction Suppose there are and E such that E ( x(α β)) (( x α) ( x β)) Then we must have E x(α β) and E ( x α) ( x β); the second gives E x α and E x β Using the definition of for formulas with, we have for every a dom( ), E[x a] α β and E[x a] α Thus also E[x a] β for every a dom( ) Thus E x β, a contradiction Semantics Satisfaction of Formulas 213/467

70 Example II: Entailment Example Show that x( γ) ( x γ) Semantics Satisfaction of Formulas 214/467

71 Example II: Entailment Example Show that x( γ) ( x γ) Suppose that E x( γ) By definition, this means for every a dom( ), E[x a] γ Again by definition (for a formula with ), this is equivalent to for every a dom( ), E[x a] γ and also to there is no a dom( ) such that E[x a] γ This last is the definition of E ( x γ), as required Semantics Satisfaction of Formulas 214/467

72 Example Example: Show that, in general, ( x α) ( x β) x(α β) (That is, find α and β such that consequence does not hold) Semantics Satisfaction of Formulas 215/467

73 Example Example: Show that, in general, ( x α) ( x β) x(α β) (That is, find α and β such that consequence does not hold) Key idea: φ 1 φ 2 yields true whenever φ 1 is false Let α be R(x) Let have domain {a, b} and R = {a} Then ( x α) ( x β) for any β (Why?) Semantics Satisfaction of Formulas 215/467

74 Example Example: Show that, in general, ( x α) ( x β) x(α β) (That is, find α and β such that consequence does not hold) Key idea: φ 1 φ 2 yields true whenever φ 1 is false Let α be R(x) Let have domain {a, b} and R = {a} Then ( x α) ( x β) for any β (Why?) To obtain x(α β), we can use R(x) for β (Why?) Thus ( x α) ( x β) x(α β), as required (Why?) Semantics Satisfaction of Formulas 215/467

75 Example Example: for any formula α and term t, ( x α) α[t/x] Recall that functions must be total! Semantics Satisfaction of Formulas 216/467

76 Proofs in First-Order Logic Using Natural Deduction Natural Deduction 217/467

77 Natural Deduction for FOL Natural Deduction for FOL extends Natural Deduction for propositional logic by including rules for introduction and elimination of quantifiers Other proof techniques and tricks remain the same as natural deduction for propositional logic Natural Deduction 218/467

78 e and i Elimination of and introduction of are fairly straightforward Name -notation inference notation -elimination ( e) -introduction ( i) If Σ x α then Σ α[t/x] If Σ α[t/x], then Σ x α x α α[t/x] α[t/x] x α Given that a formula is true for every value of x, conclude it is true for any particular value, such as that of t Given that a formula is true for a particular value (denoted by t), conclude it is true for some value Natural Deduction -Elimination and -Introduction 219/467

79 Example: e All fish can swim Nemo is a fish Therefore, Nemo can swim In FOL: show that { x(f (x) S(x)), F (Nemo)} S(Nemo) Proof: 1 x(f (x) S(x)) Premise 2 F (Nemo) Premise 3 F (Nemo) S(Nemo) e: 1 4 S(Nemo) e: 2, 3 The proof doesn t care what F and S mean Fishiness and swimming ability really have nothing to do with the argument Natural Deduction -Elimination and -Introduction 220/467

80 Example: i Example Show P (y) x(p (x) Q(y)) 1 P (y) Premise 2 P (y) Assumption 3 e: 2, 1 4 Q(y) e: 3 5 P (y) Q(y) i: x(p (x) Q(y)) i: 5 Natural Deduction -Elimination and -Introduction 221/467

81 Note to the example The general form of rule i: α[t/x] x α Use in the previous example: P (y) Q(y) x(p (x) Q(y)) We took P (x) Q(y) for α However, knowing what α[t/x] is, does not determine what α is We could also take P (x) Q(x) for α; thus the derivation step would be P (y) Q(y) x(p (x) Q(x)) But the formula x(p (x) Q(x)) is not what we wanted to prove Natural Deduction -Elimination and -Introduction 222/467

82 Soundness of -Elimination and -Introduction Claim: For any formula φ, variable x and term t, x φ φ[t/x] and φ[t/x] xφ Proof: Suppose E Qx φ; ie, for (every/some) d dom( ), φ (,E[x d]) = T Since t (,E) is value in the domain, it suffices to show Claim II: For every formula φ, variable x and term t, φ[t/x] (,E) = φ (,E[x t(,e) ]) To prove this second claim, we use the definition of substitution to do an induction on the structure of formula φ Natural Deduction -Elimination and -Introduction 223/467

83 Soundness of -Elimination, Cont d One of the cases: φ is a quantified formula, say y α We have ( y α) (,E[x t(,e) ]) = T iff for some d dom( ), α (,E[x t(,e) ][y d]) = T Likewise, we have (( y α)[t/x]) (,E) = T iff for some d dom( ), (α[t/x]) (,E[y d]) = T In the first case, t is evaluated under environment E In the second, t is evaluated under environment E[y d] (or a further modification) If y is free in t, the difference matters! Also, we have a problem if y is the same variable as x Natural Deduction -Elimination and -Introduction 224/467

84 Defining Substitution The definition of substitution included the following For a variable x and a term t: 4 If α is (Qx β), then α[t/x] is α 5 If α is (Qy β) for some other variable y, then If y does not occur in t, then α[t/x] is (Qy β[t/x]) Otherwise, let z be a variable that occurs in neither α nor t; then α[t/x] is (Qz (β[z/y])[t/x]) With this definition, we always get that, as required, Proof left to you (Qy α) (,E[x t(,e) ]) = ((Qy α)[t/x]) (,E) (Note: ((Qy α)[t/x]) (,E) may differ from (Qy(α[t/x])) (,E)!) Natural Deduction -Elimination and -Introduction 225/467

85 Proving a Universal To motivate the rule of -introduction, we consider ordinary mathematical usage In order to prove that a property holds for all integers, one often starts with Let x be an integer This means the same as Assume that the variable x refers to an integer Then one proves that x has the property Since we know nothing about the value x, except that it is an integer, this justifies that every integer has the property One could also start the proof with Let x be anything If x is an integer, then The conclusion is essentially the same Natural Deduction -Introduction 226/467

86 Rule -Introduction Definition: a variable is fresh in a subproof if it occurs nowhere outside the box of the subproof Freshness captures the notion of know nothing about Name -notation inference notation -introduction ( i) If Σ α[y/x] and y not free in Σ or α, then Σ x α y fresh α[y/x] x α In words: in order to prove x α(x), prove α(y) for arbitrary y Natural Deduction -Introduction 227/467

87 Rule i Is Sound To further clarify the rule i, we show that it is sound That is, Suppose that Σ α[y/x] and y is not free in Σ or α Then Σ x α Proof: Fix an arbitrary and E with E Σ The supposition Σ α[y/x] thus requires E α[y/x] We need to show that E[x a] α for every a dom( ) Consider an arbitrary a dom( ) Since y is not free in Σ, the Relevance Lemma yields E[y a] Σ Since y is not free in α, we have α[y/x] (,E[y a]) = α (,E[x a]) Therefore E[x a] α for every a, and thus E x α as required Natural Deduction -Introduction 228/467

88 Example: Use of i Example Show that x α x α, for any α 1 x α Premise 2 u fresh α[u/x]?? n x α i: 2 6 Note: u fresh means we choose any variable not in α Natural Deduction -Introduction 229/467

89 Example: Use of i Example Show that x α x α, for any α 1 x α Premise 2 u fresh 3 α[u/x] Assumption 4 x α i: 3 5 e: 1, 4 6 α[u/x] i: x α i: 2 6 Note: u fresh means we choose any variable not in α Natural Deduction -Introduction 229/467

90 Example: Another use of i Show that x(α β) ( x α) ( x β) 1 x(α β) Premise ( x α) ( x β) i?? Note: do not apply rule e until you know which term to use Natural Deduction -Introduction 230/467

91 Example: Another use of i Show that x(α β) ( x α) ( x β) 1 x(α β) Premise 2 x α Assumption x β i??? 8 ( x α) ( x β) i?? Note: do not apply rule e until you know which term to use Natural Deduction -Introduction 230/467

92 Example: Another use of i Show that x(α β) ( x α) ( x β) 1 x(α β) Premise 2 x α Assumption 3 u fresh 6 β[u/x]?? 7 x β i??? 8 ( x α) ( x β) i?? Note: do not apply rule e until you know which term to use Natural Deduction -Introduction 230/467

93 Example: Another use of i Show that x(α β) ( x α) ( x β) 1 x(α β) Premise 2 x α Assumption 3 u fresh 4 α[u/x] β[u/x] e: 1 5 α[u/x] e: 2 6 β[u/x] e: 4, 5 7 x β i: ( x α) ( x β) i: 2 7 Note: do not apply rule e until you know which term to use Natural Deduction -Introduction 230/467

94 Elimination of an Existential Quantifier Name -notation inference notation -elimination ( e) If Σ, α[u/x] β, with u fresh, then Σ, x α β x α α[u/x], u fresh β β In e, the variable u should not occur free in Σ, α, or β (Of course, u will normally be free in α[u/x]) Natural Deduction -Elimination 231/467

95 Rule e Is Sound The rule e is sound That is, Suppose that Σ, α[u/x] β and u is not free in Σ, α, or β Then Σ, x α β Proof: Exercise Follow the proof of soundness of i Natural Deduction -Elimination 232/467

96 Example: Use of e Example Show that x R(x) y R(y) 1 x R(x) Premise 2 R(u), u fresh Assumption 3 y R(y) i: 2 (term u) 4 y R(y) e: 1, 2 3 Natural Deduction -Elimination 233/467

97 Extending the example? Clearly, the previous proof did not depend on the particular relation R that we used Can we do the same proof for arbitrary formulas? Does x α y α[y/x] hold? 1 x α Premise 2 α[u/x], u fresh Assumption 3 α[y/x][u/y]???? 4 y α[y/x] i: 3 (term u) 5 y α[y/x] e: 1, 2 4 Is the formula on line 2 the same as the one on line 3? Natural Deduction -Elimination 234/467

98 Extending the example? Clearly, the previous proof did not depend on the particular relation R that we used Can we do the same proof for arbitrary formulas? Does x α y α[y/x] hold? 1 x α Premise 2 α[u/x], u fresh Assumption 3 α[y/x][u/y]???? 4 y α[y/x] i: 3 (term u) 5 y α[y/x] e: 1, 2 4 Is the formula on line 2 the same as the one on line 3? If y is free in α, then no the derivation fails But otherwise, it works Natural Deduction -Elimination 234/467

99 Example: and together Example Show that x α x α 1 x α Premise x α e?? Natural Deduction -Elimination 235/467

100 Example: and together Example Show that x α x α 1 x α Premise 2 α[u/x], u fresh Assumption x α i?? 7 x α e?? Natural Deduction -Elimination 235/467

101 Example: and together Example Show that x α x α 1 x α Premise 2 α[u/x], u fresh Assumption 3 x α Assumption 4 α[u/x] e: 3 5 e: 4, 2 6 x α i: x α e: 1, 2 6 Natural Deduction -Elimination 235/467

102 Example: e and i together, again We can interchange the quantifiers in the previous deduction Example Show x α x α 1 x α Premise 2 x α Assumption 3 α[u/x] (u fresh) Assumption 4 α[u/x] e: 1 5 e: 3, 4 6 e: 2, x α i: 2 6 Natural Deduction -Elimination 236/467

103 Quantifiers and Negation: The final case So far, we have shown x α x α, x α x α, and x α x α Example Show that x α x α 1 x α Premise α[t/x]?? x α i:?? Natural Deduction -Elimination 237/467

104 Quantifiers and Negation: The final case So far, we have shown x α x α, x α x α, and x α x α Example Show that x α x α 1 x α Premise α[t/x]?? x α i:?? For what term t can we prove α[t/x]? Natural Deduction -Elimination 237/467

105 Quantifiers and Negation: The final case So far, we have shown x α x α, x α x α, and x α x α Example Show that x α x α 1 x α Premise α[t/x]?? x α i:?? For what term t can we prove α[t/x]? There is no such t! We need to try something cleverer Natural Deduction -Elimination 237/467

106 The Final Case: A full proof Example Show that x α x α 1 ( x α) Premise 2 ( x( α)) Assumption 3 u fresh 4 α[u/x] Assumption 5 x( α) i: 4 6 e: 5, 2 7 ( α[u/x]) i: α[u/x] e: 7 9 x α i: e: 9, 1 11 ( ( x( α))) i: x( α) e: 11 Natural Deduction -Elimination 238/467

107 Repeated Quantifiers The rules for elimination and introduction of quantifiers can be generalized to multiple quantifiers Let x 1,, x n be n distinct variables If Σ x 1 x n α, then Σ α[t 1 /x 1 ] [t n /x n ] If Σ α[t 1 /x 1 ] [t n /x n ], for terms t 1,, t n, then Σ x 1 x n α If Σ α[u 1 /x 1 ] [u n /x n ], with variables u 1,, u n fresh, then Σ x 1 x n α If Σ x 1 x n α and Σ {α[u 1 /x 1 ] [u n /x n ] β, with u 1,, u n fresh, then Σ β Natural Deduction -Elimination 239/467

108 Example: Repeated universal quantifiers Example Show that x y A(x, y) y x A(x, y) 1 x y A(x, y) Premise 2 u, v fresh 3 A(u, v) e ( 2): 1 4 y x A(x, y) i ( 2): 3 Natural Deduction -Elimination 240/467

109 Exercise on Quantifier Rules Exercise Show that { x(q(x) R(x)), x(p (x) Q(x)) } x(p (x) R(x)) Left to you Natural Deduction -Elimination 241/467

110 FOL with Equality Generally, relation symbols have no mandated interpretation Sometimes, however, one makes an exception for the symbol = Definition: First-Order Logic with Equality is First-Order Logic with the restriction that the symbol = must be interpreted as equality on the domain: (=) = { d, d d dom( ) } There are two ways to account for this restriction in proofs 1 Add deduction rules for symbol =: Equals-Introduction: t = t =i Equals-Elimination: t 1 = t 2 α[t 1 /x] α[t 2 /x] 2 Alternatively, use axioms rather than deduction rules Logic With Equality 242/467 =e

111 Axioms for Equality Instead of deduction rules for =, we can choose to use axioms for equality An axiom is a formula that it is implicitly a premise for any proof It may be used at any time, the same as an explicit premise EQ1: EQ2: x (x = x) is an axiom For each formula α and variable z, x y (x = y (α[x/z] α[y/z])) is an axiom (EQ2, which says that that multiple formulas are axioms, is an axiom schema) These axioms imply Symmetry of =: ND= x y(x = y y = x) Transitivity of =: ND= w x y(x = y (y = w x = w)) Logic With Equality 243/467

112 Symmetry of Equality: Proof Lemma (EqSymm): ND= x y(x = y y = x) 1 u, v fresh u = v v = u??? x y(x = y y = x) i ( 2): 1? Logic With Equality 244/467

113 Symmetry of Equality: Proof Lemma (EqSymm): ND= x y(x = y y = x) 1 u, v fresh 2 u = v Assumption v = u?? u = v v = u i: 2? x y(x = y y = x) i ( 2): 1? Logic With Equality 244/467

114 Symmetry of Equality: Proof Lemma (EqSymm): ND= x y(x = y y = x) 1 u, v fresh 2 u = v Assumption 3 x y(x = y (x = u y = u)) EQ2 [ z = u ] 4 u = v (u = u v = u) e ( 2) [u, v]: 3 5 u = u v = u e: 2, 4 v = u?? u = v v = u i: 2? x y(x = y y = x) i ( 2): 1? Logic With Equality 244/467

115 Symmetry of Equality: Proof Lemma (EqSymm): ND= x y(x = y y = x) 1 u, v fresh 2 u = v Assumption 3 x y(x = y (x = u y = u)) EQ2 [ z = u ] 4 u = v (u = u v = u) e ( 2) [u, v]: 3 5 u = u v = u e: 2, 4 6 x(x = x) EQ1 7 u = u e [u]: 6 8 v = u e: 7,5 9 u = v v = u i: x y(x = y y = x) i ( 2): 1 10 Logic With Equality 244/467

116 Transitivity of Equality: Proof Lemma (EqTrans) ND= w x y(x = y (y = w x = w)) 1 w, u, v fresh 2 x y((x = y) (x = w y = w)) EQ2 [(z = w)] 3 v = u (v = w u = w) e ( 2) [v, u]: 2 4 u = v Assumption 5 v = u EQsymm: 4 6 u = w v = w e: 5, 3 7 u = v (v = w u = w) i: w x y (x = y (y = w x = w)) i ( 3): 1 7 Logic With Equality 245/467

117 Derived Proof Rules for Equality Equality satisfies the following derived rules EQtrans(k): t 1 = t 2 t 2 = t 3 t k = t k+1 t 1 = t k+1 for any t 1,, t k+1 EQtrans(k) results from k 1 uses of transitivity EqSubs[r]: t 1 = t 2 r[t 1 /z] = r[t 2 /z] for any variable z and terms r, t 1 and t 2 Prove as an exercise Logic With Equality 246/467

118 Soundness and Completeness of Natural Deduction for First-Order Logic Soundness and Completeness 247/467

119 Soundness and Completeness of Natural Deduction Theorem Natural Deduction is sound for FOL: if Σ α, then Σ α Natural Deduction is complete for FOL: if Σ α, then Σ α Proof outline: Soundness: Each application of a rule is sound By induction, any finite number of rule applications is sound Completeness: We shall show the contrapositive: if Σ α, then Σ α We shall not give the full proof, but we will sketch the main points Soundness and Completeness 248/467

120 Completeness of ND for FOL: Getting started To show: if Σ α, then Σ α Lemma I: If Σ α, then Σ { α} α By rule i, if Σ { α} α, then Σ α α Thus Σ α Lemma II: If there are and E st E Σ { α}, then Σ α and E satisfy Σ but not α Lemma III (the big one): If Σ { α} α, then there are and E such that E Σ { α} Soundness and Completeness Sketch of Proof of Completeness 249/467

121 Whence a Domain? Given: Σ { α} α Required: interpretation and environment E that satisfy Σ { α} To start, we need a domain Where can we get one? Soundness and Completeness Sketch of Proof of Completeness 250/467

122 Whence a Domain? Given: Σ { α} α Required: interpretation and environment E that satisfy Σ { α} To start, we need a domain Where can we get one? We use the set of terms That is, let the domain be { t t is a term } (The notation indicates that we refer to the domain element, rather than to the expression) Soundness and Completeness Sketch of Proof of Completeness 250/467

123 Interpretation of Terms For a set Σ of premises, we want an interpretation I and an environment E, over the domain of terms Constants, variables, and functions are easy to handle For a constant symbol c, we define c I = c For a variable x, we define x E = x For a k-ary function symbol f, we define f I ( t 1,, t k ) = f(t 1,, t k ) Relations pose a problem, since they depend on Σ For a relation symbol R (k), we must determine, for each tuple t 1,, t k, whether to put t 1,, t k into the set R I The basic idea is to consider each possible formula, one by one For each, restrict the set of interpretations to account for it Since we assume no proof of contradiction exists, we can guarantee that we always have some interpretations left as possible Soundness and Completeness Sketch of Proof of Completeness 251/467

124 Checking a Formula Suppose we have a list of all atomic formulas: α 1, α 2, α 3, We will create a list of sets: Σ 0, Σ 1, Σ 2, etc, with Σ 0 = Σ and Σ i+1 determined from Σ i and α i+1 : Σ 0 Σ for i 1, 2, 3, if Σ i 1 {α i } α i set Σ i Σ i 1 {α i } else set Σ i Σ i 1 { α i } Let β k denote the formula added at step k; thus β k is either α k or α k Let Σ denote the union of all Σ i : Σ = Σ {β 1, β 2, β 3, } Soundness and Completeness Sketch of Proof of Completeness 252/467

125 Once we have Σ, it The Satisfying Interpretation Almost is consistent (there is no γ st Σ { γ} γ), and contains either R(t 1,, t k ) or R(t 1,, t k ) for every relation symbol R and terms t 1,, t k Thus Σ defines an interpretation and environment: R = { t 1,, t k R(t 1,, t k ) Σ } This almost works, but we must handle two subtleties We need a list of all formulas, in some order Existential formulas (ie, x ) may never get a term to satisfy them Thus they evaluate to F even if x α is true Soundness and Completeness Sketch of Proof of Completeness 253/467

126 Ensuring Satisfaction of Existential Formulas We use the following trick to ensure that each existential formula in Σ has a term that satisfies it Let c 1, c 2, be a list of fresh constant symbols, that do not occur in any formula of Σ For each formula γ i, add the formula ( x γ i ) γ i [c i /x] to the set Σ 0 at the start of the construction (And include their terms in the domain!) At the end of the construction, if Σ x γ i, then also Σ γ i [c i /x] Soundness and Completeness Sketch of Proof of Completeness 254/467

127 One Piece of the Puzzle : Listing all formulas As one part of the construction, we require a list of all possible formulas Since we may have arbitrarily many constant, variable, functions and relation symbols, of any arity, we must take care that everything gets onto the list at some point For example, if we take the ith formula to be R(c i ), then many formulas (R(x), Q 4 (f 7 (y 66 )), etc) never appear on the list We do the listing in stages, starting from stage 1 At stage j, consider the first j constants, variables, and function symbols Form all terms that combine these, using at most j applications of a function Apply each of the first j relation symbols to each of these terms, and then form all formulas from these that use at most j connectives or quantifiers The set of formulas formed this way is large, but finite After all have been listed, continue to stage j + 1 Soundness and Completeness Sketch of Proof of Completeness 255/467

128 Extended Example: Peano Arithmetic Arithmetic 256/467

129 Axioms Thus far, we have used symbols for functions, relations, etc, without a fixed meaning An interpretation can specify them arbitrarily Often, however, we want to use one or more symbols in a specific way The usual approach to this is to use axioms Definition: An axiom is a formula that is assumed as a premise in any proof An axiom schema is a set of axioms, defined by a pattern or rule Axioms often behave like additional inference rules Arithmetic Axioms for Arithmetic 257/467

130 Example: Axioms for equality Recall the axioms of equality: EQ1: EQ2: x x = x is an axiom For each choice of formula α and variable z, x 1 x 2 (x 1 = x 2 (α[x 1 /z] α[x 2 /z])) is an axiom We shall keep these, and add new ones Notation: in place of writing k x(x = x) Axiom EQ1 k+1 t = t e[term t]: k we shall simply write k t = t EQ1+ e and similarly for other axioms Arithmetic Axioms for Arithmetic 258/467

131 Natural Numbers Fix the domain as N, the natural numbers Interpret the constant symbol 0 as zero and the unary function symbol s as successor Thus each number in N has a term: 0, s(0), s(s(0)), s(s(s(0))), Zero and successor satisfy the following axioms PA1: x(s(x) 0) Zero is not a successor PA2: x y(s(x) = s(y) x = y) Nothing has two predecessors ( PA stands for Peano Axioms, named for Giuseppe Peano) Arithmetic Axioms for Arithmetic 259/467

132 Addition and Multiplication Further axioms characterize + (addition) and (multiplication) PA3: x(x + 0 = x) Adding zero to any number yields the same number PA4: x y x + s(y) = s(x + y) Adding a successor yields the successor of adding the number PA5: x x 0 = 0 Multiplying by zero yields zero PA6: x y(x s(y) = (x y) + x) Multiplication by a successor Arithmetic Axioms for Arithmetic 260/467

133 Induction in Peano Arithmetic The six axioms above define + and for any particular numbers They do not, however, allow us to reason adequately about all numbers For that, we use an additional axiom: induction PA7: For each formula φ and variable v, φ[0/v] (( v(φ φ[s(v)/v])) ( v φ)) is an axiom The formula φ represents the property to be proved To prove φ for every x, we can prove the base case φ[0/x] and the inductive case x(φ φ[s(x)/x]) Arithmetic Axioms for Arithmetic 261/467

Predicate Logic: Syntax

Predicate Logic: Syntax Predicate Logic: Syntax Alice Gao Lecture 12 Based on work by J. Buss, L. Kari, A. Lubiw, B. Bonakdarpour, D. Maftuleac, C. Roberts, R. Trefler, and P. Van Beek 1/31 Outline Syntax of Predicate Logic Learning

More information

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson Predicate Calculus Formal Methods in Verification of Computer Systems Jeremy Johnson Outline 1. Motivation 1. Variables, quantifiers and predicates 2. Syntax 1. Terms and formulas 2. Quantifiers, scope

More information

Predicate Calculus. CS 270 Math Foundations of Computer Science Jeremy Johnson

Predicate Calculus. CS 270 Math Foundations of Computer Science Jeremy Johnson Predicate Calculus CS 270 Math Foundations of Computer Science Jeremy Johnson Presentation uses material from Huth and Ryan, Logic in Computer Science: Modelling and Reasoning about Systems, 2nd Edition

More information

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas. 1 Chapter 1 Propositional Logic Mathematical logic studies correct thinking, correct deductions of statements from other statements. Let us make it more precise. A fundamental property of a statement is

More information

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO

More information

Learning Goals of CS245 Logic and Computation

Learning Goals of CS245 Logic and Computation Learning Goals of CS245 Logic and Computation Alice Gao April 27, 2018 Contents 1 Propositional Logic 2 2 Predicate Logic 4 3 Program Verification 6 4 Undecidability 7 1 1 Propositional Logic Introduction

More information

06 From Propositional to Predicate Logic

06 From Propositional to Predicate Logic Martin Henz February 19, 2014 Generated on Wednesday 19 th February, 2014, 09:48 1 Syntax of Predicate Logic 2 3 4 5 6 Need for Richer Language Predicates Variables Functions 1 Syntax of Predicate Logic

More information

Predicate Logic: Sematics Part 1

Predicate Logic: Sematics Part 1 Predicate Logic: Sematics Part 1 CS402, Spring 2018 Shin Yoo Predicate Calculus Propositional logic is also called sentential logic, i.e. a logical system that deals with whole sentences connected with

More information

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P. First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable

More information

Introduction to Metalogic

Introduction to Metalogic Philosophy 135 Spring 2008 Tony Martin Introduction to Metalogic 1 The semantics of sentential logic. The language L of sentential logic. Symbols of L: Remarks: (i) sentence letters p 0, p 1, p 2,... (ii)

More information

Predicate Logic - Introduction

Predicate Logic - Introduction Outline Motivation Predicate Logic - Introduction Predicates & Functions Quantifiers, Coming to Terms with Formulas Quantifier Scope & Bound Variables Free Variables & Sentences c 2001 M. Lawford 1 Motivation:

More information

CHAPTER 2. FIRST ORDER LOGIC

CHAPTER 2. FIRST ORDER LOGIC CHAPTER 2. FIRST ORDER LOGIC 1. Introduction First order logic is a much richer system than sentential logic. Its interpretations include the usual structures of mathematics, and its sentences enable us

More information

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig First-Order Logic First-Order Theories Roopsha Samanta Partly based on slides by Aaron Bradley and Isil Dillig Roadmap Review: propositional logic Syntax and semantics of first-order logic (FOL) Semantic

More information

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic Mathematics 114L Spring 2018 D.A. Martin Mathematical Logic 1 First-Order Languages. Symbols. All first-order languages we consider will have the following symbols: (i) variables v 1, v 2, v 3,... ; (ii)

More information

Herbrand Theorem, Equality, and Compactness

Herbrand Theorem, Equality, and Compactness CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Herbrand Theorem, Equality, and Compactness The Herbrand Theorem We now consider a complete method for proving the unsatisfiability of sets of first-order

More information

Automated Reasoning Lecture 5: First-Order Logic

Automated Reasoning Lecture 5: First-Order Logic Automated Reasoning Lecture 5: First-Order Logic Jacques Fleuriot jdf@inf.ac.uk Recap Over the last three lectures, we have looked at: Propositional logic, semantics and proof systems Doing propositional

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Today s class will be an introduction

More information

Lecture 10: Predicate Logic and Its Language

Lecture 10: Predicate Logic and Its Language Discrete Mathematics (II) Spring 2017 Lecture 10: Predicate Logic and Its Language Lecturer: Yi Li 1 Predicates and Quantifiers In this action, we show you why a richer language should be introduced than

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

Mathematical Preliminaries. Sipser pages 1-28

Mathematical Preliminaries. Sipser pages 1-28 Mathematical Preliminaries Sipser pages 1-28 Mathematical Preliminaries This course is about the fundamental capabilities and limitations of computers. It has 3 parts 1. Automata Models of computation

More information

G52DOA - Derivation of Algorithms Predicate Logic

G52DOA - Derivation of Algorithms Predicate Logic G52DOA - Derivation of Algorithms Predicate Logic Venanzio Capretta Predicate Logic So far, we studied propositional logic, in which we started with unspecified propositional variables A, B, C, and combined

More information

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4 INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4 Neil D. Jones DIKU 2005 Some slides today new, some based on logic 2004 (Nils Andersen), some based on kernebegreber (NJ 2005) PREDICATE LOGIC:

More information

15414/614 Optional Lecture 3: Predicate Logic

15414/614 Optional Lecture 3: Predicate Logic 15414/614 Optional Lecture 3: Predicate Logic Anvesh Komuravelli 1 Why Predicate Logic? Consider the following statements. 1. Every student is younger than some instructor. 2. Not all birds can fly. Propositional

More information

Informal Statement Calculus

Informal Statement Calculus FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example

More information

Introduction to Logic in Computer Science: Autumn 2007

Introduction to Logic in Computer Science: Autumn 2007 Introduction to Logic in Computer Science: Autumn 2007 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Tableaux for First-order Logic The next part of

More information

Syntax of FOL. Introduction to Logic in Computer Science: Autumn Tableaux for First-order Logic. Syntax of FOL (2)

Syntax of FOL. Introduction to Logic in Computer Science: Autumn Tableaux for First-order Logic. Syntax of FOL (2) Syntax of FOL Introduction to Logic in Computer Science: Autumn 2007 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam The syntax of a language defines the way in which

More information

First Order Logic: Syntax and Semantics

First Order Logic: Syntax and Semantics CS1081 First Order Logic: Syntax and Semantics COMP30412 Sean Bechhofer sean.bechhofer@manchester.ac.uk Problems Propositional logic isn t very expressive As an example, consider p = Scotland won on Saturday

More information

Notes on Propositional and First-Order Logic (CPSC 229 Class Notes, January )

Notes on Propositional and First-Order Logic (CPSC 229 Class Notes, January ) Notes on Propositional and First-Order Logic (CPSC 229 Class Notes, January 23 30 2017) John Lasseter Revised February 14, 2017 The following notes are a record of the class sessions we ve devoted to the

More information

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16) THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16) FOL: A language to formulate knowledge Logic is the study of entailment relationslanguages, truth conditions and rules of inference. FOL or Predicate

More information

COMP 409: Logic Homework 5

COMP 409: Logic Homework 5 COMP 409: Logic Homework 5 Note: The pages below refer to the text from the book by Enderton. 1. Exercises 1-6 on p. 78. 1. Translate into this language the English sentences listed below. If the English

More information

Chapter 1. Logic and Proof

Chapter 1. Logic and Proof Chapter 1. Logic and Proof 1.1 Remark: A little over 100 years ago, it was found that some mathematical proofs contained paradoxes, and these paradoxes could be used to prove statements that were known

More information

First Order Logic (FOL) 1 znj/dm2017

First Order Logic (FOL) 1   znj/dm2017 First Order Logic (FOL) 1 http://lcs.ios.ac.cn/ znj/dm2017 Naijun Zhan March 19, 2017 1 Special thanks to Profs Hanpin Wang (PKU) and Lijun Zhang (ISCAS) for their courtesy of the slides on this course.

More information

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010) http://math.sun.ac.za/amsc/sam Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics 2009-2010 Lecture notes in progress (27 March 2010) Contents 2009 Semester I: Elements 5 1. Cartesian product

More information

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION KRIPKE S THEORY OF TRUTH RICHARD G HECK, JR 1. INTRODUCTION The purpose of this note is to give a simple, easily accessible proof of the existence of the minimal fixed point, and of various maximal fixed

More information

A Logic Primer. Stavros Tripakis University of California, Berkeley

A Logic Primer. Stavros Tripakis University of California, Berkeley EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2015 A Logic Primer Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley) EE 144/244,

More information

Predicate Calculus - Semantics 1/4

Predicate Calculus - Semantics 1/4 Predicate Calculus - Semantics 1/4 Moonzoo Kim CS Dept. KAIST moonzoo@cs.kaist.ac.kr 1 Introduction to predicate calculus (1/2) Propositional logic (sentence logic) dealt quite satisfactorily with sentences

More information

1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation

1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation Knowledge Bases and Databases Part 1: First-Order Queries Diego Calvanese Faculty of Computer Science Master of Science in Computer Science A.Y. 2007/2008 Overview of Part 1: First-order queries 1 First-order

More information

The semantics of propositional logic

The semantics of propositional logic The semantics of propositional logic Readings: Sections 1.3 and 1.4 of Huth and Ryan. In this module, we will nail down the formal definition of a logical formula, and describe the semantics of propositional

More information

Propositional Logic: Part II - Syntax & Proofs 0-0

Propositional Logic: Part II - Syntax & Proofs 0-0 Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems

More information

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning. 3: Logic Why logic? Logic about inference or argument Start from assumptions or axioms Make deductions according to rules of reasoning Logic 3-1 Why logic? (continued) If I don t buy a lottery ticket on

More information

Handout: Proof of the completeness theorem

Handout: Proof of the completeness theorem MATH 457 Introduction to Mathematical Logic Spring 2016 Dr. Jason Rute Handout: Proof of the completeness theorem Gödel s Compactness Theorem 1930. For a set Γ of wffs and a wff ϕ, we have the following.

More information

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures Formal Logic: Quantifiers, Predicates, and Validity CS 130 Discrete Structures Variables and Statements Variables: A variable is a symbol that stands for an individual in a collection or set. For example,

More information

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic CS 103 Discrete Structures Chapter 1 Propositional Logic Chapter 1.1 Propositional Logic 1 1.1 Propositional Logic Definition: A proposition :is a declarative sentence (that is, a sentence that declares

More information

Propositional Logic: Syntax

Propositional Logic: Syntax Logic Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and programs) epistemic

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics Statistics York University Sept 18, 2014 Outline 1 2 Tautologies Definition A tautology is a compound proposition

More information

CHAPTER 0: BACKGROUND (SPRING 2009 DRAFT)

CHAPTER 0: BACKGROUND (SPRING 2009 DRAFT) CHAPTER 0: BACKGROUND (SPRING 2009 DRAFT) MATH 378, CSUSM. SPRING 2009. AITKEN This chapter reviews some of the background concepts needed for Math 378. This chapter is new to the course (added Spring

More information

03 Review of First-Order Logic

03 Review of First-Order Logic CAS 734 Winter 2014 03 Review of First-Order Logic William M. Farmer Department of Computing and Software McMaster University 18 January 2014 What is First-Order Logic? First-order logic is the study of

More information

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19. Intelligent Agents First Order Logic Ute Schmid Cognitive Systems, Applied Computer Science, Bamberg University last change: 19. Mai 2015 U. Schmid (CogSys) Intelligent Agents last change: 19. Mai 2015

More information

A Logic Primer. Stavros Tripakis University of California, Berkeley. Stavros Tripakis (UC Berkeley) EE 144/244, Fall 2014 A Logic Primer 1 / 35

A Logic Primer. Stavros Tripakis University of California, Berkeley. Stavros Tripakis (UC Berkeley) EE 144/244, Fall 2014 A Logic Primer 1 / 35 EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2014 A Logic Primer Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley) EE 144/244,

More information

22c:145 Artificial Intelligence. First-Order Logic. Readings: Chapter 8 of Russell & Norvig.

22c:145 Artificial Intelligence. First-Order Logic. Readings: Chapter 8 of Russell & Norvig. 22c:145 Artificial Intelligence First-Order Logic Readings: Chapter 8 of Russell & Norvig. Einstein s Puzzle in Logic We used propositinal variables to specify everything: x 1 = house #1 is red ; x 2 =

More information

A Little Deductive Logic

A Little Deductive Logic A Little Deductive Logic In propositional or sentential deductive logic, we begin by specifying that we will use capital letters (like A, B, C, D, and so on) to stand in for sentences, and we assume that

More information

A Little Deductive Logic

A Little Deductive Logic A Little Deductive Logic In propositional or sentential deductive logic, we begin by specifying that we will use capital letters (like A, B, C, D, and so on) to stand in for sentences, and we assume that

More information

First-order logic Syntax and semantics

First-order logic Syntax and semantics 1 / 43 First-order logic Syntax and semantics Mario Alviano University of Calabria, Italy A.Y. 2017/2018 Outline 2 / 43 1 Motivation Why more than propositional logic? Intuition 2 Syntax Terms Formulas

More information

Predicate Calculus - Syntax

Predicate Calculus - Syntax Predicate Calculus - Syntax Lila Kari University of Waterloo Predicate Calculus - Syntax CS245, Logic and Computation 1 / 26 The language L pred of Predicate Calculus - Syntax L pred, the formal language

More information

Introduction to first-order logic:

Introduction to first-order logic: Introduction to first-order logic: First-order structures and languages. Terms and formulae in first-order logic. Interpretations, truth, validity, and satisfaction. Valentin Goranko DTU Informatics September

More information

First order Logic ( Predicate Logic) and Methods of Proof

First order Logic ( Predicate Logic) and Methods of Proof First order Logic ( Predicate Logic) and Methods of Proof 1 Outline Introduction Terminology: Propositional functions; arguments; arity; universe of discourse Quantifiers Definition; using, mixing, negating

More information

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom. Knowledge representation Introduction Knowledge is the progression that starts with data which s limited utility. Data when processed become information, information when interpreted or evaluated becomes

More information

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now CSC 438F/2404F Notes (S. Cook) Fall, 2008 Peano Arithmetic Goals Now 1) We will introduce a standard set of axioms for the language L A. The theory generated by these axioms is denoted PA and called Peano

More information

Lecture Notes on Heyting Arithmetic

Lecture Notes on Heyting Arithmetic Lecture Notes on Heyting Arithmetic 15-317: Constructive Logic Frank Pfenning Lecture 8 September 21, 2017 1 Introduction In this lecture we discuss the data type of natural numbers. They serve as a prototype

More information

Logic Part I: Classical Logic and Its Semantics

Logic Part I: Classical Logic and Its Semantics Logic Part I: Classical Logic and Its Semantics Max Schäfer Formosan Summer School on Logic, Language, and Computation 2007 July 2, 2007 1 / 51 Principles of Classical Logic classical logic seeks to model

More information

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations Logic Propositions and logical operations Main concepts: propositions truth values propositional variables logical operations 1 Propositions and logical operations A proposition is the most basic element

More information

Final Exam (100 points)

Final Exam (100 points) Final Exam (100 points) Honor Code: Each question is worth 10 points. There is one bonus question worth 5 points. In contrast to the homework assignments, you may not collaborate on this final exam. You

More information

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte Handout on Logic, Axiomatic Methods, and Proofs MATH 3181 001 Spring 1999 David C. Royster UNC Charlotte January 18, 1999 Chapter 1 Logic and the Axiomatic Method 1.1 Introduction Mathematicians use a

More information

02 Propositional Logic

02 Propositional Logic SE 2F03 Fall 2005 02 Propositional Logic Instructor: W. M. Farmer Revised: 25 September 2005 1 What is Propositional Logic? Propositional logic is the study of the truth or falsehood of propositions or

More information

The predicate calculus is complete

The predicate calculus is complete The predicate calculus is complete Hans Halvorson The first thing we need to do is to precisify the inference rules UI and EE. To this end, we will use A(c) to denote a sentence containing the name c,

More information

A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ

A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ NICOLAS FORD Abstract. The goal of this paper is to present a proof of the Nullstellensatz using tools from a branch of logic called model theory. In

More information

Propositional logic (revision) & semantic entailment. p. 1/34

Propositional logic (revision) & semantic entailment. p. 1/34 Propositional logic (revision) & semantic entailment p. 1/34 Reading The background reading for propositional logic is Chapter 1 of Huth/Ryan. (This will cover approximately the first three lectures.)

More information

Introduction to Logic and Axiomatic Set Theory

Introduction to Logic and Axiomatic Set Theory Introduction to Logic and Axiomatic Set Theory 1 Introduction In mathematics, we seek absolute rigor in our arguments, and a solid foundation for all of the structures we consider. Here, we will see some

More information

CS 2800: Logic and Computation Fall 2010 (Lecture 13)

CS 2800: Logic and Computation Fall 2010 (Lecture 13) CS 2800: Logic and Computation Fall 2010 (Lecture 13) 13 October 2010 1 An Introduction to First-order Logic In Propositional(Boolean) Logic, we used large portions of mathematical language, namely those

More information

Logic for Computer Scientists

Logic for Computer Scientists Logic for Computer Scientists Pascal Hitzler http://www.pascal-hitzler.de CS 499/699 Lecture, Winter Quarter 2011 Wright State University, Dayton, OH, U.S.A. [final version: 03/10/2011] Contents 1 Propositional

More information

Predicate Logic: Introduction and Translations

Predicate Logic: Introduction and Translations Predicate Logic: Introduction and Translations Alice Gao Lecture 10 Based on work by J. Buss, L. Kari, A. Lubiw, B. Bonakdarpour, D. Maftuleac, C. Roberts, R. Trefler, and P. Van Beek 1/29 Outline Predicate

More information

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2

PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 PREDICATE LOGIC: UNDECIDABILITY AND INCOMPLETENESS HUTH AND RYAN 2.5, SUPPLEMENTARY NOTES 2 Neil D. Jones DIKU 2005 14 September, 2005 Some slides today new, some based on logic 2004 (Nils Andersen) OUTLINE,

More information

MAI0203 Lecture 7: Inference and Predicate Calculus

MAI0203 Lecture 7: Inference and Predicate Calculus MAI0203 Lecture 7: Inference and Predicate Calculus Methods of Artificial Intelligence WS 2002/2003 Part II: Inference and Knowledge Representation II.7 Inference and Predicate Calculus MAI0203 Lecture

More information

1 Predicates and Quantifiers

1 Predicates and Quantifiers 1 Predicates and Quantifiers We have seen how to represent properties of objects. For example, B(x) may represent that x is a student at Bryn Mawr College. Here B stands for is a student at Bryn Mawr College

More information

Automata Theory and Formal Grammars: Lecture 1

Automata Theory and Formal Grammars: Lecture 1 Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)

More information

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies Valentin Stockholm University September 2016 Propositions Proposition:

More information

Outline. Formale Methoden der Informatik First-Order Logic for Forgetters. Why PL1? Why PL1? Cont d. Motivation

Outline. Formale Methoden der Informatik First-Order Logic for Forgetters. Why PL1? Why PL1? Cont d. Motivation Outline Formale Methoden der Informatik First-Order Logic for Forgetters Uwe Egly Vienna University of Technology Institute of Information Systems Knowledge-Based Systems Group Motivation Syntax of PL1

More information

Relational Reasoning in Natural Language

Relational Reasoning in Natural Language 1/67 Relational Reasoning in Natural Language Larry Moss ESSLLI 10 Course on Logics for Natural Language Inference August, 2010 Adding transitive verbs the work on R, R, and other systems is joint with

More information

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory Motivation CS389L: Automated Logical Reasoning Lecture 10: Overview of First-Order Theories Işıl Dillig Last few lectures: Full first-order logic In FOL, functions/predicates are uninterpreted (i.e., structure

More information

CONTENTS. Appendix C: Gothic Alphabet 109

CONTENTS. Appendix C: Gothic Alphabet 109 Contents 1 Sentential Logic 1 1.1 Introduction............................ 1 1.2 Sentences of Sentential Logic................... 2 1.3 Truth Assignments........................ 7 1.4 Logical Consequence.......................

More information

Gödel s Incompleteness Theorems

Gödel s Incompleteness Theorems Seminar Report Gödel s Incompleteness Theorems Ahmet Aspir Mark Nardi 28.02.2018 Supervisor: Dr. Georg Moser Abstract Gödel s incompleteness theorems are very fundamental for mathematics and computational

More information

cis32-ai lecture # 18 mon-3-apr-2006

cis32-ai lecture # 18 mon-3-apr-2006 cis32-ai lecture # 18 mon-3-apr-2006 today s topics: propositional logic cis32-spring2006-sklar-lec18 1 Introduction Weak (search-based) problem-solving does not scale to real problems. To succeed, problem

More information

Classical First-Order Logic

Classical First-Order Logic Classical First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) First-Order Logic (Classical) MFES 2008/09

More information

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic The Importance of Being Formal Martin Henz February 5, 2014 Propositional Logic 1 Motivation In traditional logic, terms represent sets, and therefore, propositions are limited to stating facts on sets

More information

Logic for Computer Scientists

Logic for Computer Scientists Logic for Computer Scientists Pascal Hitzler http://www.pascal-hitzler.de CS 499/699 Lecture, Spring Quarter 2010 Wright State University, Dayton, OH, U.S.A. Final version. Contents 1 Propositional Logic

More information

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam Logic and Modelling Introduction to Predicate Logic Jörg Endrullis VU University Amsterdam Predicate Logic In propositional logic there are: propositional variables p, q, r,... that can be T or F In predicate

More information

First-Order Logic. Chapter Overview Syntax

First-Order Logic. Chapter Overview Syntax Chapter 10 First-Order Logic 10.1 Overview First-Order Logic is the calculus one usually has in mind when using the word logic. It is expressive enough for all of mathematics, except for those concepts

More information

CMPSCI 601: Tarski s Truth Definition Lecture 15. where

CMPSCI 601: Tarski s Truth Definition Lecture 15. where @ CMPSCI 601: Tarski s Truth Definition Lecture 15! "$#&%(') *+,-!".#/%0'!12 43 5 6 7 8:9 4; 9 9 < = 9 = or 5 6?>A@B!9 2 D for all C @B 9 CFE where ) CGE @B-HI LJKK MKK )HG if H ; C if H @ 1 > > > Fitch

More information

LING 501, Fall 2004: Quantification

LING 501, Fall 2004: Quantification LING 501, Fall 2004: Quantification The universal quantifier Ax is conjunctive and the existential quantifier Ex is disjunctive Suppose the domain of quantification (DQ) is {a, b}. Then: (1) Ax Px Pa &

More information

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013 Notes on Satisfiability-Based Problem Solving First Order Logic David Mitchell mitchell@cs.sfu.ca October 23, 2013 Preliminary draft. Please do not distribute. Corrections and suggestions welcome. In this

More information

Proof Techniques (Review of Math 271)

Proof Techniques (Review of Math 271) Chapter 2 Proof Techniques (Review of Math 271) 2.1 Overview This chapter reviews proof techniques that were probably introduced in Math 271 and that may also have been used in a different way in Phil

More information

Chapter 1 Elementary Logic

Chapter 1 Elementary Logic 2017-2018 Chapter 1 Elementary Logic The study of logic is the study of the principles and methods used in distinguishing valid arguments from those that are not valid. The aim of this chapter is to help

More information

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability 16.2. MINIMAL ARITHMETIC AND REPRESENTABILITY 207 If T is a consistent theory in the language of arithmetic, we say a set S is defined in T by D(x) if for all n, if n is in S, then D(n) is a theorem of

More information

Peano Arithmetic. by replacing the schematic letter R with a formula, then prefixing universal quantifiers to bind

Peano Arithmetic. by replacing the schematic letter R with a formula, then prefixing universal quantifiers to bind Peano Arithmetic Peano Arithmetic 1 or PA is the system we get from Robinson s Arithmetic by adding the induction axiom schema: ((R(0) v (œx)(r(x) 6 R(sx))) 6 (œx)r(x)). What this means is that any sentence

More information

Propositional logic. First order logic. Alexander Clark. Autumn 2014

Propositional logic. First order logic. Alexander Clark. Autumn 2014 Propositional logic First order logic Alexander Clark Autumn 2014 Formal Logic Logical arguments are valid because of their form. Formal languages are devised to express exactly that relevant form and

More information

Classical First-Order Logic

Classical First-Order Logic Classical First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2009/2010 Maria João Frade (DI-UM) First-Order Logic (Classical) MFES 2009/10

More information

GÖDEL S COMPLETENESS AND INCOMPLETENESS THEOREMS. Contents 1. Introduction Gödel s Completeness Theorem

GÖDEL S COMPLETENESS AND INCOMPLETENESS THEOREMS. Contents 1. Introduction Gödel s Completeness Theorem GÖDEL S COMPLETENESS AND INCOMPLETENESS THEOREMS BEN CHAIKEN Abstract. This paper will discuss the completeness and incompleteness theorems of Kurt Gödel. These theorems have a profound impact on the philosophical

More information

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1) Week 1: Logic Lecture 1, 8/1 (Sections 1.1 and 1.3) Examples of theorems and proofs Theorem (Pythagoras). Let ABC be a right triangle, with legs of lengths a and b, and hypotenuse of length c. Then a +

More information

First-Order Logic (FOL)

First-Order Logic (FOL) First-Order Logic (FOL) Also called Predicate Logic or Predicate Calculus 2. First-Order Logic (FOL) FOL Syntax variables x, y, z, constants a, b, c, functions f, g, h, terms variables, constants or n-ary

More information

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic Introduction to EF-games Inexpressivity results for first-order logic Normal forms for first-order logic Algorithms and complexity for specific classes of structures General complexity bounds Preliminaries

More information