Satisfiability Checking

Satisfiability Checking

Satisfiability Checking First-Order Logic Prof. Dr. Erika Ábrahám RWTH Aachen University Informatik 2 LuFG Theory of Hybrid Systems WS 14/15 Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 1 / 38 First-order logic We have seen that natural languages are not well-suited for correct reasoning. Propositional logic is useful but sometimes not expressive enough for modeling. First-order (FO) logic is a framework with the syntactical ingredients: 1 Theory symbols: constants, variables, function symbols 2 Lifting from theory to the logical level: predicate symbols 3 Logical symbols: Logical connectives and quantifiers 3 is fixed Fixing 1 and 2 gives different FO instances Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 2 / 38 Constants, variables, function symbols, terms Theory symbols: constants, variables, function symbols Example: Constants:0 ; 1 Variables: x; y; z;::: Function symbol binary + Terms (theory expressions) are inductively defined by the following rules: 1 All constants and variables are terms. 2 If t1;:::; tn (n > 0) are terms and f an n-ary function symbol then f (t1; :::; tn) is a term. Only strings obtained by finitely many applications of these rules are terms. Example terms:0, x,0 + 1, x + 1, +(x; +(y; 1))( x + (y + 1)) Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 3 / 38 Predicates, constraints Predicates lift terms from the theory to the logical level. Example predicate symbols: binary ≥; >; =; <; ≤ (Theory) constraints are inductively defined by the following rule: 1 If P is an n-ary predicate symbol and t1;:::; tn are terms then P(t1;:::; tn) is a constraint. Only strings obtained by finitely many applications of this rule are constraints. Example constraints: x<x + 1, (x + 1) + y=((x + y) + 1) Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 4 / 38 Logical connectives and quantifiers, formulas Logical connectives: unary :, binary ^; _; !; $;::: Universal quantifier 8 (“for all”), existential quantifier 9 (“exists”) (Well-formed) formulas are inductively defined by the following rules: 1 If c is a constraint then c is a formula (called atomic formula). 2 If ' is a formula then (:') is a formula. 3 If ' and are formulas then (' ^ ) is a formula. 4 Similar rules apply to other binary logical connectives. 5 If ' is a formula and x is a variable, then (8x:') and (9x:') are formulas. Only expressions which can be obtained by finitely many applications of these rules are formulas. Example formulas: x < x + 1 (atomic formula) :(x < 0) x < x + 1 ^ (x + 1) + y =( x + y) + 1 8x:9y: y = x + 1 Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 5 / 38 Example Assume the argumentation: 1 All men are mortal. 2 Socrates is a man. 3 Therefore, Socrates is mortal. We can formalize it by defining Constants: Socrates Variables: x Predicate symbols: unary isMen, isMortal Formalization: 1 8x: isMen(x) ! isMortal(x) 2 isMen(Sokrates) 3 isMortal(Sokrates) Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 6 / 38 Some remarks and notation Constants can also be seen as function symbols of arity0. Sometimes equality (=) is included as a logical symbol. E.g., the logical connectives negation (:) and conjunction (^) and the existential quantifier (9) would be sufficient, the remaining syntax (_; !; $;:::; 8) are syntactic sugar. We omit parenthesis whenever we may restore them through operator precedence: binds stronger : ^ _ ! $ 9 8 Thus, we write: ::a for (:(:a)); 9a: 9b: (a ^ b ! P(a; b)) for 9a: 9b: ((a ^ b) ! P(a; b)) Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 7 / 38 Free and bound variables The free and bound variables of a formula are defined inductively: If ' is an atomic formula then a variable x is free in ' iff x occurs in '. Moreover, there are no bound variables in any atomic formula. A variable x is free in (:') iff x is free in '. Moreover, x is bound in (:') iff x is bound in '. x is free in (' ^ ) iff x is free in either ' or . Moreover, x is bound in (' ^ ) iff x is bound in either ' or . The same rule applies to any other binary connective in place of ^. x is free in (9y:') iff x is free in ' and x is a symbol different from y. Moreover, x is bound in (9y:') iff x is y or x is bound in '. The same rule holds with 8 in place of 9. Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 8 / 38 Free and bound variables Examples: In P(z) _ 8x: 8y: (P(x) ! Q(z)), x and y are bound variables, z is a free variable, and w is neither bound nor free. In Q(z) _ 8z:P(z), z is both bound and free. Being free or bound is for specific occurrences of variables in a formula. In Q(z) _ 8z:P(z), the first occurrence of z is free while the second is bound. Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 9 / 38 Signature Σ, Σ-formula, Σ-sentence A signature Σ fixes the set of non-logical symbols. A Σ-formula is a formula with non-logical symbols from Σ. A Σ-sentence is a Σ-formula without free variables. In the previous example: Σ = (Sokrates; isMen(·); isMortal(·)) with Sokrates a constant and isMen and isMortal unary predicate symbols. The formulas 1 8x: isMen(x) ! isMortal(x) 2 isMen(Sokrates) 3 isMortal(Sokrates) are Σ-sentences (the only variable x is bound). Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 10 / 38 Further examples Σ = f0; 1; +;> g 0; 1 are constant symbols + is a binary function symbol > is a binary predicate symbol Examples of Σ-sentences: 9x: 8y: x > y 8x: 9y: x > y 8x: x + 1 > x 8x: :(x + 0 > x _ x > x + 0) Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 11 / 38 Further examples Σ = f0; 1; +; ∗;<; isPrimeg 0; 1 constant symbols +; ∗ binary function symbols < binary predicate symbol isPrime unary predicate symbol An example Σ-sentence: 8n: (1 < n ! (9p: isPrime(p) ^ n < p < 2 ∗ n)) Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 12 / 38 Example Let Σ = f0; 1; +; =g where0 ; 1 are constants, + is a binary function symbol and = a binary predicate symbol. Let ' = 9x: x + 0 = 1a Σ-formula. Q: Is ' true? A: So far these are only symbols, strings. No meaning yet. Q: What do we need to fix for the semantics? A: We need a domain for the variables. Let’s say N0. Q: Is ' true in N0? A: Depends on the interpretation of ’+’ and ’=’! Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 13 / 38 Structures, satisfiability, validity A Σ-structure is given by: a domain D, an interpretation I of the non-logical symbols in Σ that maps each constant symbol to a domain element, each (free) variable to a domain element, each function symbol of arity n to a function of type Dn ! D, and each predicate symbol of arity n to a predicate of type Dn ! f0; 1g. A Σ-formula is satisfiable if there exists a Σ-structure that satisfies it. A Σ-formula is valid if it is satisfied by all Σ-structures. Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 14 / 38 Semantics Semantics of terms and formulas under a structure (D; I ): constants: [[c]](D;I ) = I (c) variables: [[x]](D;I ) = I (x) functions: [[f (t1;:::; tn)]](D;I ) = I (f )([[t1]](D;I );:::; [[tn]](D;I )) predicates: [[p(t1;:::; tn)]](D;I ) = I (p)([[t1]](D;I );:::; [[tn]](D;I )) logical structure: 1 if [[']](D;I ) = 0 [[:']](D;I ) = 0 if [[']](D;I ) = 1 1 if [[']](D;I ) = 1 and [[ ]](D;I ) = 1 [[' ^ ]](D;I ) = 0 if [[']](D;I ) = 0 or [[ ]](D;I ) = 0 1 if there exists v2D such that [[']](D;I [x7!v]) = 1 [[9x:']](D;I ) = 0 if for all v2D we have [[']](D;I [x7!v]) = 0 Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 15 / 38 Example Σ = f0; 1; +; =g ' = 9x: x + 0 = 1a Σ-formula Q: Is ' satisfiable? A: Yes. Consider the structure S: Domain: N0 Interpretation: 0 and1 are mapped to0 and1 in N0 + means addition = means equality S satisfies '. S is said to be a model of '. Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 16 / 38 Example (cont.) Σ = f0; 1; +; =g ' = 9x: x + 0 = 1a Σ-formula Q: Is ' valid? A: No. Consider the structure S0: Domain: N0 Interpretation: 0 and1 are mapped to0 and1 in N0 + means multiplication = means equality S0 does not satisfy '. Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 17 / 38 Theories T , T -safisfiability and T -validity A Σ-theory T is defined by a set of Σ-sentences. A Σ-formula ' is T -satisfiable if there exists a structure that satisfies both the sentences of T and '. A Σ-formula ' is T -valid if all structures that satisfy the sentences defining T also satisfy '. The number of sentences that are necessary for defining a theory may be large or infinite. Instead, it is common to define a theory through a set of axioms. The theory is defined by these axioms and everything that can be inferred from them by a sound inference system. Satisfiability Checking — Prof. Dr. Erika Ábrahám (RWTH Aachen University) WS 14/15 18 / 38 Examples Σ = f0; 1; +; =g ' = 9x: x + 0 = 1a Σ-formula.

View Full Text

Details

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