automated reasoning
play

Automated Reasoning Resolution Theorem Proving Temur Kutsia RISC, - PowerPoint PPT Presentation

Automated Reasoning Resolution Theorem Proving Temur Kutsia RISC, Johannes Kepler University, Linz, Austria kutsia@risc.jku.at What is Automated Reasoning Reasoning: The process of making inferences. Automated reasoning studies methods to


  1. Example Translating English sentences into first-order logic formulas: For each nonzero natural number there exists exactly one immediate predecessor natural number. Assume: ◮ zero : constant for 0. ◮ pred : unary function symbol for predecessor. ◮ . = : binary predicate symbol for equality.

  2. Example Translating English sentences into first-order logic formulas: For each nonzero natural number there exists exactly one immediate predecessor natural number. ∀ x . ( ¬ ( x . = 0 ) ⇒ ∃ y . ( y . = pred ( x ) ∧ ∀ z . ( z . = pred ( x ) ⇒ y . = z ))) Assume: ◮ zero : constant for 0. ◮ pred : unary function symbol for predecessor. ◮ . = : binary predicate symbol for equality.

  3. Free and Bound Variables A is the scope of a quantifier Qx in Qx . A , Q ∈ { ∀ , ∃ } . An occurrence of a variable x in a formula is bound , if it is in the scope of a quantifier Qx . Any other occurrence of a variable in a formula is free .

  4. Free and Bound Variables A is the scope of a quantifier Qx in Qx . A , Q ∈ { ∀ , ∃ } . An occurrence of a variable x in a formula is bound , if it is in the scope of a quantifier Qx . Any other occurrence of a variable in a formula is free . In ∀ x . p ( x , y ) ∧ ∃ y . q ( y ) , the occurrence of x and the second occurrence of y are bound, the first occurrence of y is free.

  5. Free and Bound Variables A is the scope of a quantifier Qx in Qx . A , Q ∈ { ∀ , ∃ } . An occurrence of a variable x in a formula is bound , if it is in the scope of a quantifier Qx . Any other occurrence of a variable in a formula is free . In ∀ x . p ( x , y ) ∧ ∃ y . q ( y ) , the occurrence of x and the second occurrence of y are bound, the first occurrence of y is free. Formula without free occurrences of variables is called closed .

  6. Substitutions Substitution: A function σ from variables to terms, whose domain Dom ( σ ) := { x | σ ( x ) � = x } is finite.

  7. Substitutions Substitution: A function σ from variables to terms, whose domain Dom ( σ ) := { x | σ ( x ) � = x } is finite. Range of a substitution σ : Ran ( σ ) := { σ ( x ) | x ∈ Dom ( σ ) } .

  8. Substitutions Substitution: A function σ from variables to terms, whose domain Dom ( σ ) := { x | σ ( x ) � = x } is finite. Range of a substitution σ : Ran ( σ ) := { σ ( x ) | x ∈ Dom ( σ ) } . Variable range of a substitution σ : VRan ( σ ) := Var ( Ran ( σ )) .

  9. Substitutions Substitution: A function σ from variables to terms, whose domain Dom ( σ ) := { x | σ ( x ) � = x } is finite. Range of a substitution σ : Ran ( σ ) := { σ ( x ) | x ∈ Dom ( σ ) } . Variable range of a substitution σ : VRan ( σ ) := Var ( Ran ( σ )) . Notation: lower case Greek letters σ , ϑ , ϕ , ψ , . . . . Identity substitution: ε .

  10. Substitutions Notation: If Dom ( σ ) = { x 1 , . . . , x n } , then σ can be written as the set { x 1 �→ σ ( x 1 ) , . . . , x n �→ σ ( x n ) } .

  11. Substitutions Substitutions can be extended to terms: σ ( f ( t 1 , . . . , t n )) = f ( σ ( t 1 ) , . . . , σ ( t n )) . σ ( t ) : an instance of t .

  12. Substitutions Substitutions can be extended to terms: σ ( f ( t 1 , . . . , t n )) = f ( σ ( t 1 ) , . . . , σ ( t n )) . σ ( t ) : an instance of t . Example: σ = { x �→ i ( y ) , y �→ e } . t = f ( y , f ( x , y )) σ ( t ) = f ( e , f ( i ( y ) , e ))

  13. Substitutions Substitutions can be extended to terms: σ ( f ( t 1 , . . . , t n )) = f ( σ ( t 1 ) , . . . , σ ( t n )) . σ ( t ) : an instance of t . Example: σ = { x �→ i ( y ) , y �→ e } . t = f ( y , f ( x , y )) σ ( t ) = f ( e , f ( i ( y ) , e )) Sub : The set of substitutions.

  14. Substitution Composition Composition of ϑ and σ : ( σϑ )( x ) := σ ( ϑ ( x )) . Composition is associative but not commutative.

  15. Substitution Composition Algorithm for obtaining a set representation of a composition of two substitutions in a set form. ◮ Given: θ = { x 1 �→ t 1 , . . . , x n �→ t n } σ = { y 1 �→ s 1 , . . . , y m �→ s m } , the set representation of their composition σθ is obtained from the set { x 1 �→ σ ( t 1 ) , . . . , x n �→ σ ( t n ) , y 1 �→ s 1 , . . . , y m �→ s m } by deleting ◮ all y i �→ s i ’s with y i ∈ { x 1 , . . . , x n } , ◮ all x i �→ σ ( t i ) ’s with x i = σ ( t i ) .

  16. Substitution Composition Example (Composition) θ = { x �→ f ( y ) , y �→ z } . σ = { x �→ a , y �→ b , z �→ y } . σθ = { x �→ f ( b ) , z �→ y } .

  17. Substitution Composition Example (Composition) θ = { x �→ f ( y ) , y �→ z } . σ = { x �→ a , y �→ b , z �→ y } . σθ = { x �→ f ( b ) , z �→ y } . Let σ = { x �→ y , y �→ z , z �→ x } and ϑ = { y �→ x , z �→ y , x �→ z } σσ =

  18. Substitution Composition Example (Composition) θ = { x �→ f ( y ) , y �→ z } . σ = { x �→ a , y �→ b , z �→ y } . σθ = { x �→ f ( b ) , z �→ y } . Let σ = { x �→ y , y �→ z , z �→ x } and ϑ = { y �→ x , z �→ y , x �→ z } σσ = { x �→ z , y �→ x , z �→ y } .

  19. Substitution Composition Example (Composition) θ = { x �→ f ( y ) , y �→ z } . σ = { x �→ a , y �→ b , z �→ y } . σθ = { x �→ f ( b ) , z �→ y } . Let σ = { x �→ y , y �→ z , z �→ x } and ϑ = { y �→ x , z �→ y , x �→ z } σσ = { x �→ z , y �→ x , z �→ y } . ϑσ = .

  20. Substitution Composition Example (Composition) θ = { x �→ f ( y ) , y �→ z } . σ = { x �→ a , y �→ b , z �→ y } . σθ = { x �→ f ( b ) , z �→ y } . Let σ = { x �→ y , y �→ z , z �→ x } and ϑ = { y �→ x , z �→ y , x �→ z } σσ = { x �→ z , y �→ x , z �→ y } . ϑσ = ε .

  21. Semantics: Structure Structure S = ( D , I ) . ◮ D : nonempty domain. ◮ I : interpretation function. ◮ Structure fixes interpretation of function and predicate symbols. ◮ Meaning of variables is determined by a variable assignment.

  22. Semantics: Interpretation Function The interpretation function assigns ◮ to each f ∈ F n an n -ary function f I : D n → D , (in particular, c I ∈ D for each constant c ) ◮ to each p ∈ P n (different from . = ), an n -ary relation p I on D .

  23. Variable Assignment A structure S = ( D , I ) is given. Variable assignment σ S maps each x ∈ V into an element of D : σ S ( x ) ∈ D . Semantic counterpart of substitutions. Define: � σ S ( y ) , if x � = y σ S [ x → d ]( y ) := otherwise. d ,

  24. Interpretation of Terms A structure S = ( D , I ) and a variable assignment σ S are given. Value of a term t under S and σ S , Val S , σ S ( t ) : ◮ Val S , σ S ( x ) = σ S ( x ) . ◮ Val S , σ S ( f ( t 1 , . . . , t n )) = f I ( Val S , σ S ( t 1 ) , . . . , Val S , σ S ( t n )) .

  25. Interpretation of Formulas A structure S = ( D , I ) and a variable assignment σ S are given. The truth value of a formula under S and σ S is either true or false . For atomic formulas:

  26. Interpretation of Formulas A structure S = ( D , I ) and a variable assignment σ S are given. The truth value of a formula under S and σ S is either true or false . For atomic formulas: ◮ Val S , σ S ( s . = t ) = true iff Val S , σ S ( s ) = Val S , σ S ( t ) .

  27. Interpretation of Formulas A structure S = ( D , I ) and a variable assignment σ S are given. The truth value of a formula under S and σ S is either true or false . For atomic formulas: ◮ Val S , σ S ( s . = t ) = true iff Val S , σ S ( s ) = Val S , σ S ( t ) . ◮ Val S , σ S ( p ( t 1 , . . . , t n )) = true iff ( Val S , σ S ( t 1 ) , . . . , Val S , σ S ( t n )) ∈ p I .

  28. Interpretation of Formulas For compound formulas:

  29. Interpretation of Formulas For compound formulas: ◮ Val S , σ S ( ¬ A ) = true iff Val S , σ S ( A ) = false .

  30. Interpretation of Formulas For compound formulas: ◮ Val S , σ S ( ¬ A ) = true iff Val S , σ S ( A ) = false . ◮ Val S , σ S ( A ∨ B ) = true iff Val S , σ S ( A ) = true or Val S , σ S ( B ) = true .

  31. Interpretation of Formulas For compound formulas: ◮ Val S , σ S ( ¬ A ) = true iff Val S , σ S ( A ) = false . ◮ Val S , σ S ( A ∨ B ) = true iff Val S , σ S ( A ) = true or Val S , σ S ( B ) = true . ◮ Val S , σ S ( A ∧ B ) = true iff Val S , σ S ( A ) = true and Val S , σ S ( B ) = true .

  32. Interpretation of Formulas For compound formulas: ◮ Val S , σ S ( ¬ A ) = true iff Val S , σ S ( A ) = false . ◮ Val S , σ S ( A ∨ B ) = true iff Val S , σ S ( A ) = true or Val S , σ S ( B ) = true . ◮ Val S , σ S ( A ∧ B ) = true iff Val S , σ S ( A ) = true and Val S , σ S ( B ) = true . ◮ Val S , σ S ( A ⇒ B ) = true iff Val S , σ S ( A ) = false or Val S , σ S ( B ) = true .

  33. Interpretation of Formulas For compound formulas: ◮ Val S , σ S ( ¬ A ) = true iff Val S , σ S ( A ) = false . ◮ Val S , σ S ( A ∨ B ) = true iff Val S , σ S ( A ) = true or Val S , σ S ( B ) = true . ◮ Val S , σ S ( A ∧ B ) = true iff Val S , σ S ( A ) = true and Val S , σ S ( B ) = true . ◮ Val S , σ S ( A ⇒ B ) = true iff Val S , σ S ( A ) = false or Val S , σ S ( B ) = true . ◮ Val S , σ S ( A ⇔ B ) = true iff Val S , σ S ( A ) = Val S , σ S ( B ) .

  34. Interpretation of Formulas For quantified formulas: ◮ Val S , σ S ( ∃ x . A ) = true iff Val S , σ S [ x → d ] ( A ) = true for some d ∈ D . ◮ Val S , σ S ( ∀ x . A ) = true iff Val S , σ S [ x → d ] ( A ) = true for all d ∈ D .

  35. Interpretation of Formulas The value of a formula A under S : ◮ Val S ( A ) = true iff Val S , σ S ( A ) = true for all σ S . The value of a closed formula is independent of variable assignment.

  36. Interpretation of Formulas The value of a formula A under S : ◮ Val S ( A ) = true iff Val S , σ S ( A ) = true for all σ S . The value of a closed formula is independent of variable assignment. S is called a model of A iff Val S ( A ) = true . Written � S A .

  37. Interpretation of Formulas The value of a formula A under S : ◮ Val S ( A ) = true iff Val S , σ S ( A ) = true for all σ S . The value of a closed formula is independent of variable assignment. S is called a model of A iff Val S ( A ) = true . Written � S A . A is a logical consequence of B iff every model of B is a model of A . Written B � A .

  38. Example Formula: ∀ x . ( p ( x ) ⇒ q ( f ( x ) , a ))

  39. Example Formula: ∀ x . ( p ( x ) ⇒ q ( f ( x ) , a )) Define S = ( D , I ) as ◮ D = { 1, 2 } , ◮ a I = 1 , ◮ f I ( 1 ) = 2, f I ( 2 ) = 1 , ◮ p I = { 2 } , ◮ q I = { ( 1, 1 ) , ( 1, 2 ) , ( 2, 2 ) } .

  40. Example Formula: ∀ x . ( p ( x ) ⇒ q ( f ( x ) , a )) Define S = ( D , I ) as ◮ D = { 1, 2 } , ◮ a I = 1 , ◮ f I ( 1 ) = 2, f I ( 2 ) = 1 , ◮ p I = { 2 } , ◮ q I = { ( 1, 1 ) , ( 1, 2 ) , ( 2, 2 ) } . Val S ( ∀ x . ( p ( x ) ⇒ q ( f ( x ) , a ))) = true .

  41. Example Formula: ∀ x . ( p ( x ) ⇒ q ( f ( x ) , a )) Define S = ( D , I ) as ◮ D = { 1, 2 } , ◮ a I = 1 , ◮ f I ( 1 ) = 2, f I ( 2 ) = 1 , ◮ p I = { 2 } , ◮ q I = { ( 1, 1 ) , ( 1, 2 ) , ( 2, 2 ) } . Val S ( ∀ x . ( p ( x ) ⇒ q ( f ( x ) , a ))) = true . Hence, � S A .

  42. Validity, Unsatisfiability A formula A is valid, if � S A for all S . Written � A .

  43. Validity, Unsatisfiability A formula A is valid, if � S A for all S . Written � A . A formula A is unsatisfiable, if � S A for no S .

  44. Validity, Unsatisfiability A formula A is valid, if � S A for all S . Written � A . A formula A is unsatisfiable, if � S A for no S .

  45. Validity, Unsatisfiability A formula A is valid, if � S A for all S . Written � A . A formula A is unsatisfiable, if � S A for no S . Formulas

  46. Validity, Unsatisfiability A formula A is valid, if � S A for all S . Written � A . A formula A is unsatisfiable, if � S A for no S . Valid Non-valid

  47. Validity, Unsatisfiability A formula A is valid, if � S A for all S . Written � A . A formula A is unsatisfiable, if � S A for no S . Valid Non-valid Satisfiable Unsat

  48. Validity, Unsatisfiability A formula A is valid, if � S A for all S . Written � A . A formula A is unsatisfiable, if � S A for no S . Non-valid Valid Unsat sat

  49. Validity, Unsatisfiability Proposition Let A and B be formulas and K be a set of formulas. Then 1. A is valid iff ¬ A is unsatisfiable. 2. B | = A iff B ∧ ¬ A is unsatisfiable. 3. K | = A iff K ∪ {¬ A } is unsatisfiable.

  50. Inference System Resolution Calculus

  51. The Resolution Calculus Operates on the clausal fragment of first-order logic Clause: A formula of the form ∀ x 1 . · · · . ∀ x n . ( L 1 ∨ · · · ∨ L k ) , where ◮ each L i is a literal, ◮ L 1 ∨ · · · ∨ L k contains no variables other than x 1 , . . . , x n . Every first-order formula can be reduced to a set of clauses. The reduction preserves unsatisfiability. Clauses are often written without quantifier prefix: L 1 ∨ · · · ∨ L k .

  52. Clausification Every first-order formula can be reduced to a set of clauses: Step 1: Transformation into a prenex normal form: Q 1 x 1 . · · · Q n x n . M , where each Q i is either ∀ or ∃ and the formula M contains no quantifiers. Step 2: Skolemization. Step 3: CNF transformation. Step 4: Stripping off the quantifiers and transforming the formula in CNF into set of clauses.

  53. Transformation into a Prenex Normal Form Traditional way. Rename bound variables, apply the � P rules in any context. ( ∀ = ∃ , ∃ = ∀ , B does not contain x freely.) A 1 ⇔ A 2 � P ( A 1 ⇒ A 2 ) ∧ ( A 2 ⇒ A 1 ) . ¬ Qx . A � P Qx . ¬ A . ⋆ ∈ {∧ , ∨} (( Qx . A ) ⋆ B ) � P ( Qx . A ⋆ B ) , (( Qx . A ) ⇒ B ) � P ( Qx . A ⇒ B ) . ( B ⋆ ( Qx . A )) � P Qx . ( B ⋆ A ) , ⋆ ∈ {∧ , ∨ , ⇒ }

  54. Transformation into a Prenex Normal Form Traditional way. Rename bound variables, apply the � P rules in any context. ( ∀ = ∃ , ∃ = ∀ , B does not contain x freely.) A 1 ⇔ A 2 � P ( A 1 ⇒ A 2 ) ∧ ( A 2 ⇒ A 1 ) . ¬ Qx . A � P Qx . ¬ A . ⋆ ∈ {∧ , ∨} (( Qx . A ) ⋆ B ) � P ( Qx . A ⋆ B ) , (( Qx . A ) ⇒ B ) � P ( Qx . A ⇒ B ) . ( B ⋆ ( Qx . A )) � P Qx . ( B ⋆ A ) , ⋆ ∈ {∧ , ∨ , ⇒ } If F � ∗ P G , then G is in prenex normal form. If F and G are closed, then they are equivalent.

  55. Skolemization Replace existentially quantified variables by Skolem functions: ◮ The formula Q 1 x 1 . · · · Q n x n . M is in prenex normal form ◮ Skolemization rule: ∀ x 1 . · · · ∀ x n . ∃ y . Q 1 z 1 . · · · Q m z m . M [ y ] � S ∀ x 1 . · · · ∀ x n . Q 1 z 1 . · · · Q m z m . M [ f ( x 1 , . . . , x n )] where f is a new function symbol of arity n with n � 0 . ◮ Intuition: replace ∃ y by a concrete choice function computing y from all the arguments it depends on.

  56. Skolemization Replace existentially quantified variables by Skolem functions: ◮ The formula Q 1 x 1 . · · · Q n x n . M is in prenex normal form ◮ Skolemization rule: ∀ x 1 . · · · ∀ x n . ∃ y . Q 1 z 1 . · · · Q m z m . M [ y ] � S ∀ x 1 . · · · ∀ x n . Q 1 z 1 . · · · Q m z m . M [ f ( x 1 , . . . , x n )] where f is a new function symbol of arity n with n � 0 . ◮ Intuition: replace ∃ y by a concrete choice function computing y from all the arguments it depends on. If G is in PNF and G � ∗ S H , then H is in PNF without ∃ . H | = G but not the other way around. G is (un)satisfiable iff H is (un)satisfiable.

  57. Skolemization does not preserve equivalence G � ∗ S H , G � | = H : ◮ G = ∃ x . p ( x ) , H = p ( a ) . ◮ S = ( { 1, 2 } , I ) . ◮ a I = 1 . ◮ p I = { 2 } . ◮ Then Val S ( G ) = true but Val S ( H ) = false .

  58. Transformation into Clausal Normal Form F � ∗ P Q 1 y 1 · · · Q n y n . A � ∗ S ∀ x 1 · · · ∀ x n . B CNF ∀ x 1 . · · · . ∀ x n . ∧ k � ∗ i = 1 C i where C i are clauses. � ∗ CNF preserves (un)satisfiability. { C 1 , . . . , C k } : clausal normal form of F .

  59. Clausification Example ∀ x . ∃ y . ( ∃ z . ( p ( x , z ) ∨ p ( y , z )) ⇒ ∃ u . q ( x , y , u ))

  60. Clausification Example ∀ x . ∃ y . ( ∃ z . ( p ( x , z ) ∨ p ( y , z )) ⇒ ∃ u . q ( x , y , u )) ∀ x . ∃ y . ∀ z . ( p ( x , z ) ∨ p ( y , z ) ⇒ ∃ u . q ( x , y , u )) � P

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend