Propositional Logic: Formulas in Conjunctive Normal Form (Cnf)

Propositional Logic: Formulas in Conjunctive Normal Form (Cnf)

PROPOSITIONAL LOGIC: FORMULAS IN CONJUNCTIVE NORMAL FORM (CNF) VL Logic, Lecture 1, WS 20/21 Armin Biere, Martina Seidl Institute for Formal Models and Verification Johannes Kepler University Linz A VERY, VERY SHORT PRIMER ON (PROPOSITIONAL) LOGIC VL Logic Part I: Propositional Logic Example: Party Planning We want to plan a party. Unfortunately, the selection of the guests is not straight forward. We have to consider the following rules. 1. If two people are married, we have to invite them both or none of them. Alice is married to Bob and Cecile is married to David. 2. If we invite Alice then we also have to invite Cecile. Cecile does not care if we invite Alice but not her. 3. David and Eva can’t stand each other, so it is not possible to invite both. 4. We want to invite Bob and Fred. Question: Can we find a guest list? 1/8 Party Planning with Propositional Logic propositional variables: inviteAlice, inviteBob, inviteCecile, inviteDavid, inviteEva, inviteFred constraints: 1. invite married: inviteAlice $ inviteBob, inviteCecile $ inviteDavid 2. if Alice then Cecile: inviteAlice ! inviteCecile 3. either David or Eva: : (inviteEva $ inviteDavid) 4. invite Bob and Fred: inviteBob ^ inviteFred encoding in propositional logic: (inviteAlice $ inviteBob) ^ (inviteCecile $ inviteDavid) ^ (inviteAlice ! inviteCecile) ^ : (inviteEva $ inviteDavid) ^ inviteBob ^ inviteFred 2/8 example: syntactically incorrect formula: ^(a _ ^b) ^ (:a _:b) syntactically correct propositional formula (over variables a and b): (a _ b) ^ (:a _:b) different representation: 1 2 0 -1 -2 0 Defining a Language: Syntax What do expressions (words, sentences) of a language look like? set of words: basic building blocks grammar: rules for composing sentences from words and smaller sentences sometimes multiple (equivalent) representations different goals (user-friendliness vs processability) 3/8 Defining a Language: Syntax What do expressions (words, sentences) of a language look like? set of words: basic building blocks grammar: rules for composing sentences from words and smaller sentences sometimes multiple (equivalent) representations different goals (user-friendliness vs processability) example: syntactically incorrect formula: ^(a _ ^b) ^ (:a _:b) syntactically correct propositional formula (over variables a and b): (a _ b) ^ (:a _:b) different representation: 1 2 0 -1 -2 0 3/8 Let propositional variable a be true and propositional variable b be false. Then the truth value of the propositional formula (a _ b) ^ (:a _:b) is true. Defining a Language: Semantics What do expressions mean? evaluation of syntactically correct expressions logic-based languages have a concise semantics no ambiguities no vagueness 4/8 Defining a Language: Semantics What do expressions mean? evaluation of syntactically correct expressions logic-based languages have a concise semantics no ambiguities no vagueness Let propositional variable a be true and propositional variable b be false. Then the truth value of the propositional formula (a _ b) ^ (:a _:b) is true. 4/8 In the formula (a _ b) ^ (:a _:b) a could stand “invite David” and b could stand for “invite Eva”. The formula is true if only one of the two persons is invited. Using a Language: Pragmatics What does an expression stand for? many application problems can be formulated as logical reasoning problems interpretation of expression dependends on context and user 1. encoding of an application problem to be solved 2. evaluation of expression gives solution for application problem 5/8 Using a Language: Pragmatics What does an expression stand for? many application problems can be formulated as logical reasoning problems interpretation of expression dependends on context and user 1. encoding of an application problem to be solved 2. evaluation of expression gives solution for application problem In the formula (a _ b) ^ (:a _:b) a could stand “invite David” and b could stand for “invite Eva”. The formula is true if only one of the two persons is invited. 5/8 Automated Reasoning and Inferences Logical languages allow the inference of new knowledge (“reasoning”). For reasoning, a logic provides various sets of rules (calculi). Reasoning is often based on certain syntactical patterns. example: (modus ponens) x holds. If x holds, then also y holds. y holds. 6/8 Some Remarks on Inferences A system is inconsistent if we can infer that a statement holds and that a statement does not hold at the same time. Assume we have modelled the following system A comes to the party. B comes to the party. If A comes to the party, then B does not come to the party. With the modus ponens, we can infer that B does not come to the party. So, we have some inconsistency in our party model. 7/8 part 2: first-order logic (predicate logic) rich language: predicates, functions, terms, quantifiers great power of expressiveness, high complexity part 3: satisfiability modulo theories (SMT) customizable language: user decides as much expressiveness as required as much complexity as necessary Logics in this Lecture In this lecture, we consider different logic-based languages: part 1: propositional logic (SAT) simple language: only atoms and connectives low expressiveness, low complexity 8/8 part 3: satisfiability modulo theories (SMT) customizable language: user decides as much expressiveness as required as much complexity as necessary Logics in this Lecture In this lecture, we consider different logic-based languages: part 1: propositional logic (SAT) simple language: only atoms and connectives low expressiveness, low complexity part 2: first-order logic (predicate logic) rich language: predicates, functions, terms, quantifiers great power of expressiveness, high complexity 8/8 Logics in this Lecture In this lecture, we consider different logic-based languages: part 1: propositional logic (SAT) simple language: only atoms and connectives low expressiveness, low complexity part 2: first-order logic (predicate logic) rich language: predicates, functions, terms, quantifiers great power of expressiveness, high complexity part 3: satisfiability modulo theories (SMT) customizable language: user decides as much expressiveness as required as much complexity as necessary 8/8 Logics in this Lecture In this lecture, we consider different logic-based languages: part 1: propositional logic (SAT) simple language: only atoms and connectives low expressiveness, low complexity part 2: first-order logic (predicate logic) rich language: predicates, functions, terms, quantifiers great power of expressiveness, high complexity part 3: satisfiability modulo theories (SMT) customizable language: user decides as much expressiveness as required as much complexity as necessary 8/8 SYNTAX OF PROPOSITIONAL FORMULAS IN CNF VL Logic Part I: Propositional Logic propositional variable (also atom, atomic proposition): proposition without any further internal structure we denote variables by symbols x; y; z; a; b; c; p; q (possibly with subscript) literal: (negated) truth constant: >; ?; :>; :? (negated) propositional variable x; :x; y; :y;::: we denote literals by symbols l; k (possibly with subscript) Truth Constants, Variables, Literals truth constant: true (also verum, top): > false (also falsum, bottom): ? 1/5 literal: (negated) truth constant: >; ?; :>; :? (negated) propositional variable x; :x; y; :y;::: we denote literals by symbols l; k (possibly with subscript) Truth Constants, Variables, Literals truth constant: true (also verum, top): > false (also falsum, bottom): ? propositional variable (also atom, atomic proposition): proposition without any further internal structure we denote variables by symbols x; y; z; a; b; c; p; q (possibly with subscript) 1/5 Truth Constants, Variables, Literals truth constant: true (also verum, top): > false (also falsum, bottom): ? propositional variable (also atom, atomic proposition): proposition without any further internal structure we denote variables by symbols x; y; z; a; b; c; p; q (possibly with subscript) literal: (negated) truth constant: >; ?; :>; :? (negated) propositional variable x; :x; y; :y;::: we denote literals by symbols l; k (possibly with subscript) 1/5 examples: x _ y x _ y _:z :? _ x _ a _ > _ :x size of a clause: number of its literals empty clause (size 0): also written as ? or ; unary clause (size 1): :? x :z special clauses binary clauses (size 2): x _ y ternary clauses (size 3): x _ y _:z Wn for (l1 _ ::: _ ln) we also write i=1 li we denote clauses by symbols C; D (possibly with subscript) Clauses A clause is a disjunction (_) of literals. 2/5 size of a clause: number of its literals empty clause (size 0): also written as ? or ; unary clause (size 1): :? x :z special clauses binary clauses (size 2): x _ y ternary clauses (size 3): x _ y _:z Wn for (l1 _ ::: _ ln) we also write i=1 li we denote clauses by symbols C; D (possibly with subscript) Clauses A clause is a disjunction (_) of literals. examples: x _ y x _ y _:z :? _ x _ a _ > _ :x 2/5 empty clause (size 0): also written as ? or ; unary clause (size 1): :? x :z special clauses binary clauses (size 2): x _ y ternary clauses (size 3): x _ y _:z Wn for (l1 _ ::: _ ln) we also write i=1 li we denote clauses by symbols C; D (possibly with subscript) Clauses A clause is a disjunction (_) of literals. examples: x _ y x _ y _:z :? _ x _ a _ > _ :x size of a clause: number of its literals 2/5 Wn for (l1 _ ::: _ ln) we also write i=1 li we denote clauses by symbols C; D (possibly with subscript) Clauses A clause is a disjunction (_) of literals. examples: x _ y x _ y _:z :? _ x _ a _ > _ :x size of a clause: number of its literals empty clause (size 0): also written as ? or ; unary clause (size 1): :? x :z special clauses binary clauses (size 2): x _ y ternary clauses (size 3): x _ y _:z 2/5 we denote clauses by symbols C; D (possibly with subscript) Clauses A clause is a disjunction (_) of literals.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    67 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us