Propositional and First Order Logic

Propositional and First Order Logic

Propositional and First Order Logic Propositional Logic First Order Propositional and First Order Logic Logic Background Knowledge Summary Propositional and First Order Logic Propositional Logic First Order Logic Propositional Logic [Chang-Lee Ch. 2] First Order Logic [Chang-Lee Ch. 3] Propositional Logic Propositional and First Order Logic Propositional Logic Summary First Order Logic Syntax Semantics Normal Forms Deduction and Refutation Basic Concepts Propositional and First Order Logic Propositional logic is the simplest logicillustrates basic ideas Propositional Logic using propositions First Order P Snow is whyte Logic 1 , P2 , Today it is raining P3 , This automated reasoning course is boring Pi is an atom or atomic formula Each Pi can be either true or false but never both The values true or false assigned to each proposition is called truth value of the proposition Syntax Propositional and First Recursive denition of well-formed formulas Order Logic 1 An atom is a formula Propositional 2 If S is a formula, :S is a formula Logic (negation) First Order Logic 3 If S1 and S2 are formulas, S1 ^ S2 is a formula (conjunction) 4 If S1 and S2 are formulas, S1 _ S2 is a formula (disjunction) 5 All well-formed formulas are generated by applying above rules Shortcuts: S1 ! S2 can be written as :S1 _ S2 S1 $ S2 can be written as (S1 ! S2) ^ (S2 ! S1) Semantics Propositional and First Order Logic Propositional Relationships between truth values of atoms and truth values of Logic formulas First Order Logic :S is true i S is false S1 ^ S2 is true i S1 is true and S2 is true S1 _ S2 is true i S1 is true or S2 is true S1 ! S2 is true i S1 is false or S2 is true i.e., is false i S1 is true and S2 is false S1 $ S2 is true i S1 ! S2 is true and S2 ! S1 is true Semantics: Example Propositional and First Order Logic Propositional Logic Example (Truth Tables for main logical connectives) First Order Logic P1 P2 :P1 P1 ^ P2 P1 _ P2 P1 ! P2 P1 $ P2 TTFTTTT TFFFTFF FTTFTTF FFTFFTT Propositional logic: Evaluation of Formula Propositional and First Order Logic Recursive Evaluation Propositional Consider the formula G :P1 ^ (P2 _ P3) Logic , Suppose we know that P1 = F ; P2 = F ; P3 = T First Order Logic Then we have :P1 ^ (P2 _ P3) = true ^ (false _ true) = true ^ true = true Note We evaluate :P1 before P1 ^ P2, this is because the following decreasing rank for connectives operator holds: $ ! _ ^ : Sol. PQP _ QP ^ Q :(P ^ Q) G TTTTFF TFTFTT FTTFTT FFFFTF Exercise: Truth Tables Propositional and First Order Logic Example (XOR) Propositional Write the truth table for the formula: Logic First Order Logic G , (P _ Q) ^ :(P ^ Q) Exercise: Truth Tables Propositional and First Order Logic Example (XOR) Propositional Write the truth table for the formula: Logic First Order Logic G , (P _ Q) ^ :(P ^ Q) Sol. PQP _ QP ^ Q :(P ^ Q) G TTTTFF TFTFTT FTTFTT FFFFTF Interpretation Propositional and First Order Logic Denition Propositional Logic Interpretation: Given a propositional formula G, let First Order fA1; ··· ; Ang be the set of atoms which occur in the formula, Logic an Interpretation I of G is an assignment of truth values to fA1; ··· ; Ang. Example Consider the formula: G , (P _ Q) ^ :(P ^ Q) Set of atoms: fP; Qg Interpretation for G: I = fP = T; Q = Fg Interpretation contd. Propositional and First Order Logic Each atom Ai can be assigned either True or False but never both. Propositional Logic Given an interpretation I a formula G is said to be true in First Order Logic I i G is evaluated to True in the interpretation Given a formula G with n distinct atoms there will be 2n distinct interpretations for the atoms in G. Convention: fP; :Q; :R; Sg represents an interpretation I : fP = T ; Q = F ; R = F ; S = T g. Given a formula G and an interpretation I , if G is true under I we say that I is a model for G.and we can write I j= G Validity Propositional and First Denition Order Logic Valid Formula: A formula F is valid i it is true in all its interpretation Propositional Logic First Order A valid formula can be also called a Tautology Logic A formula which is not valid is invalid If F is valid we can write j= F Example (de Morgan's Law) (:(P ^ Q) $ (:P _:Q)) is a valid formula PQ :(P ^ Q) :P _:Q (:(P ^ Q) $ (:P _:Q)) TTFFT TFTTT FTTTT FFTTT Inconsistency Propositional and First Denition Order Logic Inconsistent Formula: A formula F is inconsistent i it is false in all its interpretation Propositional Logic First Order An inconsistent formula is said to be unsatisable Logic A formula which is not inconsistent is consistent or satisable Invalid is dierent from Inconsistent Example :((:(P ^ Q) $ (:P _:Q))) is inconsistent PQ (:(P ^ Q) $ (:P _:Q)) :(:(P ^ Q) $ (:P _:Q)) TTTF TFTF FTTF FFTF Inconsistency and Validity Propositional and First A formula is valid i its negation is inconsistent (and vice Order Logic versa) A formula is invalid (consistent) i there is at least an Propositional Logic interpretation in which the formula is false (true) First Order Logic An inconsistent formula is invalid but the opposite does not hold A valid formula is consistent but the opposite does not hold Example The formula G , P _ Q is invalid (e.g., it is false when P and Q are false) but is not inconsistent because it is true in all other cases. Moreover, G is consistent (e.g., it is true whenever P or Q are false) but is not valid because it is false when both P and Q are false. Decidability Propositional and First Order Logic Property Propositional Propositional Logic is decidable: there is a terminating method Logic to decide whether a formula is valid. First Order Logic To decide whether a formula is valid: 1 we can enumerate all possible interpretations 2 for each interpretation evaluate the formula Number of interpretations for a formula are nite (2n) Decidability is a very strong and desirable property for a Logical System Trade o between representational power and decidability Logical Equivalence Propositional and First Denition Order Logic Logical Equivalence: Two formulas F and G are logically equivalent F ≡ G i the truth values of F and G are the same Propositional Logic under every interpretation of F and G. First Order Logic Useful equivalence rules (P ^ Q) ≡ (Q ^ P) commutativity of ^ (P _ Q) ≡ (Q _ P) commutativity of _ ((P ^ Q) ^ R) ≡ (P ^ (Q ^ R)) associativity of ^ ((P _ Q) _ R) ≡ (P _ (Q _ R)) associativity of _ :(:P) ≡ P double-negation elimination (P ! Q) ≡ (:Q !:P) contraposition (P ! Q) ≡ (:P _ Q) implication elimination (P $ Q) ≡ ((P ! Q) ^ (Q ! P)) biconditional elimination :(P ^ Q) ≡ (:P _:Q) de Morgan :(P _ Q) ≡ (:P ^ :Q) de Morgan (P ^ (Q _ R)) ≡ ((P ^ Q) _ (P ^ R)) distributivity of ^ over _ (P _ (Q ^ R)) ≡ ((P _ Q) ^ (P _ R)) distributivity of _ over ^ Normal Forms Propositional and First Order Logic Standard ways of writing formulas Two main normal forms: Propositional Logic Conjunctive Normal Form (CNF) First Order Logic Disjunctive Normal Form (DNF) Denition Literal: a literal is an atom or the negation of an atom Denition Negation Normal Form: A formula is in Negation Normal Form (NNF) i negations appears only in front of atoms CNF Propositional and First Denition Order Logic Conjunctive Normal Form: A formula F is in Conjunctive Normal Form (CNF) i it is in Negation Normal Form and it Propositional has the form F F F F , where each F is a Logic , 1 ^ 2 ^ · · · ^ n i First Order disjunction of literals. Logic If F is in CNF Each Fi is called a clause CNF is also refered to as Clausal Form Example The formula G , (:P _ Q) ^ (:P _ R) is in CNF. We can write G as a set of clauses fC1; C2g where C1 = :P _ Q and C2 = :P _ R. The formula G , :(P _ Q) ^ (:P _ R) is not in CNF because negation appears in front of a formula and not only in front of atoms. DNF Propositional and First Order Logic Denition Propositional Logic Disjunctive Normal Form: A formula F is in Disjunctive Normal First Order Form (DNF) i it is in Negation Normal Form and it has the Logic form F , F1 _ F2 _···_ Fn, where each Fi is a conjunction of literals. Example The formula G , (:P ^ R) _ (Q ^ :P) _ (Q ^ P) is in DNF. Any formula can be transformed into a normal form by using the equivalence rules given above. Sol. Given P _ Q ^ :(P ^ Q) apply de Morgan's law on the second part and directly obtain (P _ Q) ^ (:P _:Q) For more examples see Examples 2.8, 2.9 [Chang and Lee Ch. 2] Try to prove the other equivalence Transforming Formulas Propositional and First Order Logic Example (Formula transformations) Propositional Logic Prove that the following logical equivalences hold by First Order transforming formulas: Logic P _Q ^:(P ^Q) $ (P _Q)^(:P _:Q) $ (:P ^Q)_(P ^:Q) Transforming Formulas Propositional and First Order Logic Example (Formula transformations) Propositional Logic Prove that the following logical equivalences hold by First Order transforming formulas: Logic P _Q ^:(P ^Q) $ (P _Q)^(:P _:Q) $ (:P ^Q)_(P ^:Q) Sol. Given P _ Q ^ :(P ^ Q) apply de Morgan's law on the second part and directly obtain (P _ Q) ^ (:P _:Q) For more examples see Examples 2.8, 2.9 [Chang and Lee Ch.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    72 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