
First-Order Predicate Logic (1) Predicate Logic (1) • Atomic sentences and ground sentences • S-structure and truth relation for ground sentences • Atomic formulas and quantifier-free formulas • S-interpretation and truth relation for quantifier-free formulas • First-order predicate logic formulas • Truth relation for first-order predicate logic formulas Illustrations from databases and arithmetic. Logic in Computer Science 2012 2 Predicate Logic Predicate logic is an extension of propositional logic with more expressive power. It is needed because in many applications propositional atomic formulas can- not be regarded as atoms but should carry additional structure. Consider: • p0: my car is blue. • p1: blue cars are fast. • p2: my car is fast. Then ‘my car is fast’ should be a logical consequence of ‘my car is blue’ and ‘blue cars are fast’. However, fp0; p1g 6j= p2: We introduce predicate logic to represent those (and many more) sentences. Logic in Computer Science 2012 3 Ground Sentences and their Semantics Individual Constants Individual constants are symbols that denote a fixed individual object. For ex- ample, • we could use Peter as an individual constant to denote a particular per- son; • we could use 2 as an individual constant to denote the number 2; • but we could also use 2, 3, or Peter as an individual constant to denote the number 2; • we could use Liverpool as an individual constant to denote Liverpool; • but we could also use UK as an individual constant to denote France. We use lower case letters c; d; e etc and c1; c2 : : : ; d1; d2 ::: as individual con- stants. Logic in Computer Science 2012 5 Predicate Symbols Predicate Symbols are used to denote a property of objects or a relation be- tween objects. Every predicate symbol comes with an arity ≥ 1. For example, • integer could be used as a predicate of arity 1 to denote the property of being an integer. • country could be used as a predicate of arity 1 to denote the property of being a country. • younger could be used as a predicate of arity 2 to denote the relation “younger than” between living beings. • has birthday could be used as a predicate of arity 2 to denote a relation between humans and dates: Peter has birthday on the 7th of February 1999. We use upper case letters P; Q; R etc and P1;P2 :::;Q1;Q2 ::: as predicate symbols. Predicates of arity 1,2,3 are also called unary, binary, and ternary predicates. Logic in Computer Science 2012 6 Atomic Sentences In predicate logic, the simplest kinds of claims are those made with a single predicate symbol followed by the appropriate number of individual constants. Definition If P is a predicate symbol of arity n and c1; : : : ; cn are individual con- stants, then P (c1; : : : ; cn) is an atomic sentence. Examples: • If integer is a unary predicate symbol and 3 an individual constant, then integer(3) is an atomic sentence stating that 3 is an integer (more precisely, the predicate integer applies to the individual object denoted by 3). • If integer is a unary predicate symbol and Peter an individual constant, then the expression integer(Peter) is an atomic sentence stating that Peter is an integer (more precisely, the predicate integer applies to the individual object denoted by Peter). Logic in Computer Science 2012 7 Atomic Sentences: more examples • If younger is a binary predicate symbol and Sue and Tom are individual constants, then younger(Sue; Tom) is an atomic sentence that states that Sue is younger than Tom (more precisely, the object denoted by Sue is in the relation denoted by younger to the object denoted by Tom). • If has birthday is a binary predicate symbol and Tom and 7:11:1999 are indi- vidual constants, then has birthday(Tom; 7:11:1999) is an atomic sentence stating that Tom was born 7.11.1999 (more precisely, the object denoted by Tom is in the relation denoted by has birthday to the object denote by 7.11.1999). • If sum is a ternary predicate symbol and 3, 4 and 7 are individual constants, then sum(3; 4; 7) is an atomic sentence stating that the sum of 3 and 4 is 7 (more precisely, the objects denoted by 3, 4, and 7 are in the relation denoted by sum). Logic in Computer Science 2012 8 Signature and Ground Sentences A signature S is a set of predicate symbols (with their arities) and individual constants. The set of all ground sentences over S is defined inductively as follows: • all atomic sentences using symbols from S only are ground sentences over S; • if F and G are ground sentences over S, then (F ^G) is a ground sentence over S; • if F and G are ground sentences over S, then (F _G) is a ground sentence over S; • if F is a ground sentence over S, then :F is a ground sentence over S; • nothing else is a ground sentence over S. Logic in Computer Science 2012 9 A signature for kinship relations Our (very incomplete) signature SK for kinship relations consists of • unary predicate symbols male and female; • a binary predicate symbol parent of; • two binary predicate symbols father of and mother of; • a binary predicate grandparent of; • binary predicates brother of and sister of. • a binary predicate ancestor of. If we want to give small illustrating examples, we sometimes work with SK0 = ffather of; mother ofg. Logic in Computer Science 2012 10 Kinship Relations Using individual constants a; b; c : : :, we can now use ground sentences over the signature SK [ fa; b; c : : :g to express the relation between concrete people, e.g., • a is the father of b, but b is not father of c: (father of(a; b) ^ :father of(b; c)) • a is a brother of b or e is a sister of f: (brother of(a; b) _ sister of(e; f)) Logic in Computer Science 2012 11 Signature for arithmetic The signature SAR for arithmetic consists of: • individual constants: 0; 1; 2;:::; • a binary predicate symbol smaller; • a ternary predicate symbol sum; • a ternary predicate symbol prod; • a unary predicate symbol even. The following are ground sentences over SAR: • (smaller(3; 4) ^ :smaller(5; 3)); • even(21); • (:sum(3; 4; 12) ^ prod(3; 4; 12)). Logic in Computer Science 2012 12 Semantics So far, ground sentences are just words without any meaning. To give an interpretation for ground sentences, we require more than just the truth values “true” and “false”. In this case, we require a “domain of discourse” in which the individual constants and predicate symbols are interpreted. Depending on the signature (and, therefore, application) the domain of dis- course can play very different roles: • If we do arithmetic, it can be the natural, rational, or real numbers (with corresponding operations); • Our domain of discourse can be a database instance (which we query or pose integrity constraints on); • When doing program verification, we can represent a run (or all runs) of a program we want to verify as a domain of discourse; • If we specify a terminology for medicine or biology, the domain of dis- course can be gene products, medications, treatments, etc. Logic in Computer Science 2012 13 Semantics: S-structures Let S be a signature. An S-structure F is an object of the form F = (DF ; (sF j s 2 S)); where • DF is a non-empty set (the domain of discourse); • for all predicate symbols P 2 S of arity n: P F is a n-ary relation on DF ; for example, if P is a unary predicate, then P F ⊆ DF and if P is a binary predicate, then P F ⊆ DF × DF ; P F is called the extension of P in F or the interpretation of P in F. • for all individual constant symbols c in S: cF is an element of DF (in other words, we have cF 2 DF ). cF is called the object denoted by c in F or the interpretation of c in F. Logic in Computer Science 2012 14 Examples of SK-structures (kinship relations) For simplicity we use SK0 = ffather of; mother ofg. Note that any F = (DF ; father ofF ; mother ofF ) with DF a nonempty set, father ofF ⊆ DF × DF and mother ofF ⊆ DF × DF is an SK0-structure. For example, F1 F1 F1 • F1 with D = f1g, father of = f(1; 1)g, and mother of = f(1; 1)g. In this structure 1 is a father of himself and a mother of herself. F2 F2 F2 • F2 with D = fa; bg, father of = f(a; b)g, and mother of = f(b; a)g. In this structure a is a father of b and b is a mother of a. F3 F3 • F3 with D = f1; 2;:::g, father of = f(n + 1; n) j n > 0g, and mother ofF3 = ;. In this structure, 2 is father of 1, 3 is a father of 2, and so on. Logic in Computer Science 2012 15 SK0-structures extended with individual constants To use names for individuals we have to extend the signature. For example, define the signature S by setting S = SK0 [ fa; b; c; dg. Then S-structures are of the form F = (DF ; father ofF ; mother ofF ; aF ; bF ; cF ; dF ); where, in addition, aF ; bF ; cF ; dF 2 DF . We can take, for example, F1 F1 F1 F1 F1 F1 F1 F1 = (D ; father of ; mother of ; a ; b ; c ; d ) defined by • DF1 = f1; 2; 3; 4; 5g; • father ofF1 = ;; • mother ofF1 = f(1; 2); (2; 3)g; • aF1 = 1; bF1 = 1; cF1 = 3; dF1 = 4.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages59 Page
-
File Size-