Predicate Logic Jason Filippou CMSC250 @ UMCP 06-06-2016 Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 1 / 42
Outline 1 Propositional logic falls short 2 Predicate Logic Syntax Semantics Proof theory Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 2 / 42
Propositional logic falls short Propositional logic falls short Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 3 / 42
Propositional logic falls short Modelling worlds The goal of logic has, is, and will be to model domain knowledge about the world, and make certain inferences, based on a certain theory of proof . So, for every scenario, we have an agreement on what our world is. E.g CSIC, CS department, State of Maryland Consider how the world affects the truth value of certain propositional logic statements! freshman ∨ sophomore ∨ junior ∨ senior motorcycle ∧ red light ⇒ wait for green Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 4 / 42
Propositional logic falls short Semantic simplicity of propositional symbols Suppose we already have the propositional symbol charlie . How do we express the fact that Charlie is a unicorn? Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 5 / 42
Propositional logic falls short Semantic simplicity of propositional symbols Suppose we already have the propositional symbol charlie . How do we express the fact that Charlie is a unicorn? 1 Insert a new symbol, charlie the unicorn , retract (?) symbol charlie . 2 Insert rule charlie ∧ horned charlie ⇒ charlie the unicorn and the symbol horned charlie , use modus ponens. What about the pink and gray unicorns? Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 5 / 42
Propositional logic falls short Semantic simplicity of propositional symbols Manually curated knowledge is time-consuming, error-prone, and sometimes contradicting. Stable modeling example (whiteboard). Beats the point of inference rules : Why did we even come up with the automated construction of new knowledge if we end up putting stuff in ourselves? Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 6 / 42
Propositional logic falls short Semantic simplicity of propositional symbols Modeling properties of an element of our world is virtually impossible in propositional logic. For every object in our world, we need to replicate every property! (whiteboard) How do we relate objects to one another? E.g siblings, coworkers,... Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 7 / 42
Propositional logic falls short The need for more symbols How can I write a statement that says “ Every CS250 student will sit for a midterm”? Need a symbol to express the notion of “every item x that satisfies some property P ”... How about “ There’s at least two people in this classroom who share a birth month?” Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 8 / 42
Propositional logic falls short Propositional Logic is not enough... Expressiveness - tractability trade-off. Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 9 / 42
Propositional logic falls short Propositional Logic is not enough... Tracta-what? Expressiveness - tractability trade-off. Propositional logic is the most basic kind of logic. Excellent for: Modeling hardware (boolean gates). The study of computational complexity (SAT problem). Not-so-excellent for: Translating language into computer-readable format. Building deductive databases. Efficient inference on large domains. The next-step: First-Order logic ! Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 9 / 42
Propositional logic falls short Propositional Logic is not enough... Tracta-what? Expressiveness - tractability trade-off. Propositional logic is the most basic kind of logic. Excellent for: Modeling hardware (boolean gates). The study of computational complexity (SAT problem). Not-so-excellent for: Translating language into computer-readable format. Building deductive databases. Efficient inference on large domains. The next-step: First-Order logic ! Only we won’t do full FOL � Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 9 / 42
Predicate Logic Predicate Logic Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 10 / 42
Predicate Logic What is predicate logic? An extension of propositional logic we have come up with . A subset of FOL suitable for introducing formal proofs. “The logic of quantified statements” is another suitable characterization (Epp). Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 11 / 42
Predicate Logic A hierarchy of logics Infinitary Logic Type Theory Second-Order Logic First- Order Logic Propositional Logic Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 12 / 42
Predicate Logic A hierarchy of logics Infinitary Logic Type Theory Second-Order Logic First- Order Logic Predicates, quantifiers, functors, backward / forward chaning, undecidability of inference Propositional Logic Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 13 / 42
Predicate Logic A hierarchy of logics Infinitary Logic Type Theory Second-Order Logic Only aspects of FOL First- Order Logic included in Predicates, quantifiers, functors, backward / forward chaning, undecidability of inference “Predicate Logic”. Propositional Logic Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 14 / 42
Predicate Logic Syntax Syntax Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 15 / 42
Predicate Logic Syntax Variables and Constants Our syntax has some crucial additions over Propositional Logic. Variables (denoted lowercase) and their (sometimes implicit) domains . E.g: E.g x ∈ R ( Dom ( c ) = R ) E.g c , with Dom ( c ) = { green, red, blue } Constants (denoted uppercase): Unique identifiers of objects in our database (similar to Propositional Logic’s “propositional symbols”). Sun, Earth, Benedict Cumberbatch, Jason Filippou Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 16 / 42
Predicate Logic Syntax Predicates Predicate Symbols : typically used to denote properties of objects, like adverbs or adjectives in language. Written with uppercase first letter: P, Q, Father, Rainy Predicates (denoted uppercase): consist of a predicate symbol followed by at least one constant and variable as an “argument” within parentheses. E.g: Odd ( x ), Even ( y ), Father ( q, r ), with Dom ( x ) = Dom ( y ) = N , Dom ( q ) = { s | s is a MD resident under 18 } and Dom ( r ) = { s | s is a male PA resident over 22 } , King ( Charlie, Bananas ), Enrolled ( x, CMSC 250), with Dom ( x ) = CS UMD Undergraduates. Arity of a predicate: The number of its arguments. We constrain predicates to have arity at least 1, otherwise (a) They make no sense and (b) They are undistinguishable from constants. Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 17 / 42
Predicate Logic Syntax Quantifiers The symbols “exists”: ∃ and “forall”: ∀ , followed by at least one variable and one predicate. ( ∃ x )( Prime ( x )) ( ∀ x )( Politician ( x ) ⇒ Liar ( x )) Parentheses can be used to define the scope of a quantifier. When the scope is obvious, they can be ommitted (e.g above). Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 18 / 42
Predicate Logic Syntax Quantifiers The symbols “exists”: ∃ and “forall”: ∀ , followed by at least one variable and one predicate. ( ∃ x )( Prime ( x )) ( ∀ x )( Politician ( x ) ⇒ Liar ( x )) Parentheses can be used to define the scope of a quantifier. When the scope is obvious, they can be ommitted (e.g above). Can I have more than 1 predicate on the right of a quantifier? Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 18 / 42
Predicate Logic Syntax Quantified Statements Absolutely! We will call those quantified statements , and they are somewhat equivalent to propositional logic’s “compound statements” 1 Existential statements follow ∃ . 2 Universal statements follow ∀ . 3 Mixed statements follow both: ( ∀ x )( Person ( x ) ⇒ ( ∃ z )( Loves ( z, x ))). ( ∀ p 1 , p 2 ∈ R 2 )( ∃ p 3 ∈ R 2 ) dist ( p 3 , p 1 ) = dist ( p 3 , p 2 ) ( ∀ q )( Prime ( q ) ⇒ ( ∃ p )( Prime ( p ) ∧ p > q )) We can also have regular, non-quantified statements that involve constants instead of variables ( ground statements), or statements that involve both: Hates ( Jason, Artichokes ) ∧ Hates ( Jason, Brussel Sprouts ), Form Triangle ( P 1 , P 2 , P 3 ) ∨ Colinear ( P 1 , P 2 , P 3 ) ( ∀ x )( Lives ( x, North America ) ⇔ Lives ( x, Canada ) ∨ Lives ( x, USA ) ∨ Lives ( x, Mexico )) Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 19 / 42
Predicate Logic Syntax Bound / Free variables in statements Bound variable: A variable that is quantified. E.g: ( ∃ z ) Unicorn ( z ) ∧ Nuts ( z ) ( ∀ x, y ∈ N ) Divides ( x, y ) ⇔ ( ∃ z ∈ N ) y = x ∗ z Free variable: A variable that isn’t bound. E.g: ( ∀ x ) P ( x, y ) ( ∃ z )( R ( z, s ) ∨ Q ( z )) ⇒ F ( z ) Q ( x ) ⇒ ( ∀ x ) Q ( x ) Use parentheses when necessary! Sentence: A quantified statement with only bound variables. Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 20 / 42
Predicate Logic Semantics Semantics Jason Filippou (CMSC250 @ UMCP) Predicates 06-06-2016 21 / 42
Recommend
More recommend