Download presentation
Presentation is loading. Please wait.
1
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder
2
Computability and Complexity 8-2 Propositional Formulas A propositional formula is an expression built from variables parenthesis (, ) logical connectives - conjunction “and” - disjunction “or” - negation “not” - implication “if … then …” Examples:
3
Computability and Complexity 8-3 Propositional Formulas Semantics A truth assignment is an assignment of variables in a formula with truth values 0 and 1 (or “F” and “T”, or “FALSE” and “TRUTH”) Truth assignment T satisfies , written T : if is a variable X, then T if and only if T(X)=1 if =¬ ’ then T if and only if T ’ if then T if and only if and if then T if and only if or Examples: T(X)=1, T(Y)=0, T(Z)=0
4
Computability and Complexity 8-4 Types of Propositional Formulas A formula is said to be valid if T for any truth assignment T (tautology) A formula is said to be satisfiable if T for some truth assignment T A formula is said to be unsatisfiable if T for no truth assignment T valid s a t i s f i a b l e unsatisfiable Formulas and are said to be equivalent, , if they have the same satisfying assignments
5
Computability and Complexity 8-5 Main Tautologies
6
Computability and Complexity 8-6 Main Equivalences
7
Computability and Complexity 8-7 Conjunctive Normal Form A literal is a variable or its negation, X or ¬X A clause is a disjunction of literals A Conjunctive Normal Form (CNF) is a conjunction of clauses Examples: Theorem Every propositional formula is equivalent to a CNF.
8
Computability and Complexity 8-8 Predicates and Quantifiers A predicate on a set A is a function A A … A {0,1} Informally, a predicate expresses some property of its argument Examples: P(X,Y) : X Y Q(X,Y,Z): Z is in between X and Y, that is X < Z < Y or Y < Z < X Quantifiers: if a set A is fixed X means “for every X A ” X means “there exists X A ” A function is a function A A … A A Examples: f(X,Y) = X + Y g(X,Y,Z) = X · log(Y + Z²) h(X) = 3X + X²
9
Computability and Complexity 8-9 First Order Syntax A vocabulary is a collection of predicate and function symbols, each of which is assigned a non-negative number, the arity Example (Number theory): Predicate symbols: =(X,Y), i.e X = Y ; <(X,Y), i.e. X < Y Function symbols: +(X,Y), i.e. X + Y; (X,Y), i.e. X Y; ^(X,Y), i.e. (X), i.e. X + 1 0 Example (Graph theory): Predicate symbols: =(X,Y), i.e X = Y ; E(X,Y), i.e. X is connected to Y Function symbols: no
10
Computability and Complexity 8-10 A term is an expression built from variables and function symbols Examples: (+(X,Y),+(X,Z)) (X + Y) (X + Z) We denote 1= (0), 2 = ( (0)), … An atomic formula is a predicate symbol followed by a list of terms in parenthesis; the number of terms in the list must match the arity of the predicate symbol =(+(^(X,T),^(Y,T)),^(Z,T)) Examples:
11
Computability and Complexity 8-11 A first order formula is defined as follows: an atomic formula is a formula if and are formulas, then ( ) is a formula if and are formulas, then ( ) is a formula if and are formulas, then ( ) is a formula if is a formula, then ( ) is a formula if is a formula, then ( X ) is a formula if is a formula, then ( X ) is a formula
12
Computability and Complexity 8-12 Examples
13
Computability and Complexity 8-13 Free and Bound Variables Any occurrence of X in an expression X or X is bound Any occurrence which is not bound is free A variable that has a free occurrence is called free A formula without free variables is called a sentence
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.