automated reasoning
play

Automated Reasoning Rewriting-Based Deduction Temur Kutsia RISC, - PowerPoint PPT Presentation

Automated Reasoning Rewriting-Based Deduction Temur Kutsia RISC, Johannes Kepler University, Linz, Austria kutsia@risc.jku.at The Equality Relation Equality . = : A very important relation Reflexive Symmetric Transitive


  1. Basic Concepts in Term Rewriting R : a term rewriting system. ◮ The rewrite relation induced by R , denoted → R , is a binary relation on terms defined as: s → R t iff there exist l → r ∈ R , a position p in s , a substitution σ such that s | p = σ ( l ) and t = s [ σ ( r )] p . ◮ R ⊆ → R . We may omit R when it is obvious.

  2. Basic Concepts in Term Rewriting ◮ s reduces to t by R iff s → R t . ◮ s is reducible by R iff there is a t such that s → R t . ◮ s is irreducible (is in normal form) by R iff s is not reducible. ◮ ← R stands for the inverse and → ∗ R for reflexive-transitive closure of → R . ◮ t is a normal form of s by R iff s → ∗ R t and t is irreducible by R . ◮ R is terminating iff → R is well-founded, i.e., there is no infinite sequence of rewrite steps s 1 → R s 2 → R s 3 → R · · · .

  3. Basic Concepts in Term Rewriting R is confluent iff for all terms s , t 1 , t 2 , if s → ∗ R t 1 and s → ∗ R t 2 , then there exists a term r such that t 1 → ∗ R r and t 2 → ∗ R r .

  4. Basic Concepts in Term Rewriting R is confluent iff for all terms s , t 1 , t 2 , if s → ∗ R t 1 and s → ∗ R t 2 , then there exists a term r such that t 1 → ∗ R r and t 2 → ∗ R r . Graphically: ∗ s t 1 ∗ ∗ t 2 r ∗

  5. Basic Concepts in Term Rewriting t 1 and t 2 are joinable by R if there exists a term r such that t 1 → ∗ R r and t 2 → ∗ R r . Notation: t 1 ↓ R t 2 .

  6. Basic Concepts in Term Rewriting Example Let + be a binary (infix) function symbol, s a unary function symbol, 0 a constant. R := { 0 + x → x , s ( x ) + y → s ( x + y ) } . Then: ◮ s ( 0 ) + s ( s ( 0 )) → R s ( 0 + s ( s ( 0 ))) → R s ( s ( s ( 0 ))) . ◮ s ( 0 ) + s ( s ( 0 )) → ∗ R s ( s ( s ( 0 ))) . ◮ s ( s ( s ( 0 ))) is irreducible by R and, hence, is a normal form of s ( 0 ) + s ( s ( 0 )) , of s ( 0 + s ( s ( 0 ))) , and of s ( s ( s ( 0 ))) .

  7. Basic Concepts in Term Rewriting A TRS R is convergent iff it is confluent and terminating. A convergent TRS provides a decision procedure for the underlying equational theory: Two terms are equivalent iff they reduce to the same normal form. Computation of normal forms by repeated reduction is a don’t care non-deterministic process for convergent TRSs.

  8. Basic Concepts in Term Rewriting A strict order > on terms is called a reduction order iff it is 1. monotonic: If s > t , then r [ s ] > r [ t ] for all terms s , t , r ; 2. stable: If s > t , then σ ( s ) > σ ( t ) for all terms s , t and a substitution σ ; 3. well-founded.

  9. Basic Concepts in Term Rewriting A strict order > on terms is called a reduction order iff it is 1. monotonic: If s > t , then r [ s ] > r [ t ] for all terms s , t , r ; 2. stable: If s > t , then σ ( s ) > σ ( t ) for all terms s , t and a substitution σ ; 3. well-founded. Why are reduction orders interesting?

  10. Basic Concepts in Term Rewriting A strict order > on terms is called a reduction order iff it is 1. monotonic: If s > t , then r [ s ] > r [ t ] for all terms s , t , r ; 2. stable: If s > t , then σ ( s ) > σ ( t ) for all terms s , t and a substitution σ ; 3. well-founded. Why are reduction orders interesting? Theorem A TRS R terminates iff there exists a reduction order > that satisfies l > r for all l → r ∈ R .

  11. Reduction Orders ◮ | t | : The size of the term t . ◮ The order > 1 : s > 1 t iff | s | > | t | .

  12. Reduction Orders ◮ | t | : The size of the term t . ◮ The order > 1 : s > 1 t iff | s | > | t | . ◮ > 1 is monotonic and well-founded.

  13. Reduction Orders ◮ | t | : The size of the term t . ◮ The order > 1 : s > 1 t iff | s | > | t | . ◮ > 1 is monotonic and well-founded. ◮ However, > 1 is not a reduction order because it is not stable: | f ( f ( x , x ) , y ) | = 5 > 3 = | f ( y , y ) | For σ = { y �→ f ( x , x ) } : | σ ( f ( f ( x , x ) , y )) | = | f ( f ( x , x ) , f ( x , x )) | = 7, | σ ( f ( y , y ) | = | f ( f ( x , x ) , f ( x , x )) | = 7.

  14. Reduction Orders ◮ | t | x : The number of occurrences of x in t . ◮ The order > 2 : s > 2 t iff | s | > | t | and | s | x � | t | x for all x .

  15. Reduction Orders ◮ | t | x : The number of occurrences of x in t . ◮ The order > 2 : s > 2 t iff | s | > | t | and | s | x � | t | x for all x . ◮ > 2 is a reduction order.

  16. Methods for Construction Reduction Orders ◮ Polynomial orders ◮ Simplification orders: ◮ Recursive path orders ◮ Knuth-Bendix orders

  17. Methods for Construction Reduction Orders ◮ Polynomial orders ◮ Simplification orders: ◮ Recursive path orders ◮ Knuth-Bendix orders Goal: Provide a variety of different reduction orders that can be used to show termination; not only by hand, but also automatically.

  18. Lexicographic Path Order Main idea behind recursive path orders: ◮ Two terms are compared by first comparing their root symbols. ◮ Then recursively comparing the collections of their immediate subterms.

  19. Lexicographic Path Order Main idea behind recursive path orders: ◮ Two terms are compared by first comparing their root symbols. ◮ Then recursively comparing the collections of their immediate subterms. ◮ Collections seen as multisets yields the multiset path order. (Not considered in this course.)

  20. Lexicographic Path Order Main idea behind recursive path orders: ◮ Two terms are compared by first comparing their root symbols. ◮ Then recursively comparing the collections of their immediate subterms. ◮ Collections seen as multisets yields the multiset path order. (Not considered in this course.) ◮ Collections seen as tuples yields the lexicographic path order.

  21. Lexicographic Path Order Main idea behind recursive path orders: ◮ Two terms are compared by first comparing their root symbols. ◮ Then recursively comparing the collections of their immediate subterms. ◮ Collections seen as multisets yields the multiset path order. (Not considered in this course.) ◮ Collections seen as tuples yields the lexicographic path order. ◮ Combination of multisets and tuples yields the recursive path order with status. (Not considered in this course.)

  22. Lexicographic Path Order Let F be a finite signature and > be a strict order on F (called the precedence). The lexicographic path order > lpo on T ( F , V ) induced by > is defined as follows: s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . � lpo stands for the reflexive closure of > lpo .

  23. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e .

  24. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ f ( x , e ) > lpo x by (1)

  25. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ f ( x , e ) > lpo x by (1) ◮ i ( e ) > lpo e by (2a), because e � lpo e .

  26. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e .

  27. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ i ( f ( x , y )) > ? lpo f ( i ( x ) , i ( y )) :

  28. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ i ( f ( x , y )) > ? lpo f ( i ( x ) , i ( y )) : ◮ Since i > f , (2b) reduces it to the problems: i ( f ( x , y )) > ? lpo i ( x ) and i ( f ( x , y )) > ? lpo i ( y ) .

  29. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ i ( f ( x , y )) > ? lpo i ( x ) is reduced by (2c) to i ( f ( x , y )) > ? lpo x and f ( x , y ) > ? lpo x , which hold by (1).

  30. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ i ( f ( x , y )) > ? lpo i ( x ) is reduced by (2c) to i ( f ( x , y )) > ? lpo x and f ( x , y ) > ? lpo x , which hold by (1). ◮ i ( f ( x , y )) > lpo i ( y ) is shown similarly.

  31. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e .

  32. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ f ( f ( x , y ) , z ) > ? lpo f ( x , f ( y , z ))) . By (2c) with i = 1 :

  33. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ f ( f ( x , y ) , z ) > lpo x because of (1).

  34. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ f ( f ( x , y ) , z ) > ? lpo f ( y , z ) : By (2c) with i = 1 : ◮ f ( f ( x , y ) , z ) > lpo y and f ( f ( x , y ) , z ) > lpo z by (1). ◮ f ( x , y ) > lpo y by (1).

  35. Lexicographic Path Order s > lpo t iff (1) t ∈ Var ( s ) and t � = s , or (2) s = f ( s 1 , . . . , s m ) , t = g ( t 1 , . . . , t n ) , and (2a) s i � lpo t for some i , 1 � i � m , or (2b) f > g and s > lpo t j for all j , 1 � j � n , or (2c) f = g , s > lpo t j for all j , 1 � j � n , and there exists i , 1 � i � m such that s 1 = t 1 , . . . s i − 1 = t i − 1 and s i > lpo t i . Example (Cont.) F = { f , i , e } , f is binary, i is unary, e is constant, with i > f > e . ◮ f ( x , y ) > lpo x by (1).

  36. Reduction Orders Reduction orders are not total for terms with variables. For instance, f ( x ) and f ( y ) can not be ordered. f ( x , y ) and f ( y , x ) can not be ordered either. However, many reduction orders are total on ground terms. Fortunately, in theorem proving applications one can often reason about non-ground formulas by considering the corresponding ground instances. In such situations, ordered rewriting techniques can be applied.

  37. Ordered Rewriting Given: A reduction order > and a set of equations E . The rewrite system E > is defined as E > := { σ ( s ) → σ ( r ) | ( s . = t ∈ E or t . = s ∈ E ) and σ ( s ) > σ ( t ) } The rewrite relation → E > induced by E > represents ordered rewriting with respect to E and > .

  38. Ordered Rewriting Example ◮ If > is a lexicographic path ordering with precedence + > a > b > c , then b + c > c + b > c . ◮ Let E := { x + y . = y + x } . ◮ We may use the commutativity equation for ordered rewriting. ◮ ( b + c ) + c → E > ( c + b ) + c → E > c + ( c + b ) .

  39. Ordered Rewriting If > is a reduction ordering total on ground terms, then E > contains all (non-trivial) ground instances of an equation s . = t ∈ E , either as a rule σ ( s ) → σ ( t ) or a rule σ ( t ) → σ ( s ) . A rewrite system R is called ground convergent if the induced ground rewrite relation (that is, the rewrite relation → R restricted to pairs of ground terms) is terminating and confluent. A set of equations E is called ground convergent with respect to > if E > is ground convergent.

  40. Critical Pairs Ordered rewriting leads to the inference rule, called superposition: s . r [ u ] . = t = v , σ ( r [ t ] . = v ) where σ = mgu ( s , u ) , σ ( t ) � � σ ( s ) , σ ( v ) � � σ ( r ) , and u is not a variable. The equation σ ( r [ t ] . = v ) is called an ordered critical pair (with overlapped term σ ( r [ u ]) ) between s . = t and r [ u ] . = v .

  41. Critical Pairs Lemma Let > be a ground total reduction ordering. A set E of equations is ground convergent with respect to > iff for all ordered critical pairs σ ( r [ t ] . = v ) (with overlapped term σ ( r [ u ]) ) between equations in E and for all ground substitutions ϕ , if ϕ ( σ ( r [ u ])) > ϕ ( σ ( r [ t ])) and ϕ ( σ ( r [ u ])) > ϕ ( σ ( v )) , then ϕ ( σ ( r [ t ])) ↓ E > ϕ ( σ ( v )) .

  42. Critical Pairs Example ◮ Let E := { f ( f ( x )) . = g ( x ) } and > be the LPO with f > g . ◮ Take a critical pair between the equation and its renamed copy, f ( f ( x )) . = g ( x ) and f ( f ( y )) . = g ( y ) . f ( f ( f ( x ))) f ( g ( x )) g ( f ( x ))

  43. Critical Pairs Example ◮ Let E := { f ( f ( x )) . = g ( x ) } and > be the LPO with f > g . ◮ Take a critical pair between the equation and its renamed copy, f ( f ( x )) . = g ( x ) and f ( f ( y )) . = g ( y ) . f ( f ( f ( x ))) f ( g ( x )) g ( f ( x )) ◮ f ( f ( f ( x ))) > f ( g ( x )) and f ( f ( f ( x ))) > g ( f ( x )) , but f ( g ( x )) �↓ E > g ( f ( x )) .

  44. Critical Pairs Example ◮ Let E := { f ( f ( x )) . = g ( x ) } and > be the LPO with f > g . ◮ Take a critical pair between the equation and its renamed copy, f ( f ( x )) . = g ( x ) and f ( f ( y )) . = g ( y ) . f ( f ( f ( x ))) f ( g ( x )) g ( f ( x )) ◮ f ( f ( f ( x ))) > f ( g ( x )) and f ( f ( f ( x ))) > g ( f ( x )) , but f ( g ( x )) �↓ E > g ( f ( x )) . ◮ E is not ground convergent with respect to > .

  45. Adding Critical Pairs to Equations Since critical pairs are equational consequences, adding a critical pair to the set of equations does not change the induced equational theory. If E ′ is obtained from E by adding a critical pair, then . = E = . = E ′ . The idea of adding a critical pair as a new equation is called “completion”.

  46. Convergence Example ◮ Let E ′ := { f ( f ( x )) . = g ( x ) , f ( g ( x )) . = g ( f ( x )) } ◮ Let > be the LPO with f > g .

  47. Convergence Example ◮ Let E ′ := { f ( f ( x )) . = g ( x ) , f ( g ( x )) . = g ( f ( x )) } ◮ Let > be the LPO with f > g . ◮ E ′ has two critical pairs. Both are joinable: f ( f ( f ( x ))) f ( f ( g ( x ))) f ( g ( x )) g ( f ( x )) f ( g ( f ( x ))) g ( f ( f ( x ))) g ( g ( x ))

  48. Convergence Example ◮ Let E ′ := { f ( f ( x )) . = g ( x ) , f ( g ( x )) . = g ( f ( x )) } ◮ Let > be the LPO with f > g . ◮ E ′ has two critical pairs. Both are joinable: f ( f ( f ( x ))) f ( f ( g ( x ))) f ( g ( x )) g ( f ( x )) f ( g ( f ( x ))) g ( f ( f ( x ))) g ( g ( x )) ◮ E ′ is (ground) convergent.

  49. Ordered Completion Described as a set of inference rules. Parametrized by a reduction ordering > . Works on pairs ( E , R ) , where E is a set of equations and R is a set of rewrite rules. E ; R ⊢ E ′ ; R ′ means that E ′ ; R ′ can be obtained from E ; R by applying a completion inference.

  50. Ordered Completion: Notions Derivation: A (finite or countably infinite) sequence ( E 0 ; R 0 ) ⊢ ( E 1 ; R 1 ) · · · . Usually, E 0 is the set of initial equations and R 0 = ∅ . The limit of a derivation: the pair E ω ; R ω , where � � � � E ω := E j and R ω := R j . i � 0 j � i i � 0 j � i Goal: to obtain a limit system that is ground convergent.

  51. Ordered Completion: Notation ⊎ : Disjoint union s ⊲ t : Strict encompassment relation. An instance of t is a subterm of s , but not vice versa. s ≅ t stands for s . = t or t . = s . CP > ( E ∪ R ) : The set of all ordered critical pairs, with the ordering > , generated by equations in E and rewrite rules in R treated as equations.

  52. Ordered Completion: Rules E ; R ⊢ E ∪ { s . D EDUCTION : = t } ; R if s . = t ∈ CP > ( E ∪ R ) . O RIENTATION : E ⊎ { s ≅ t } ; R ⊢ E ; R ∪ { s → t } , if s > t . E ⊎ { s . D ELETION : = s } ; R ⊢ E ; R .

  53. Ordered Completion: Rules C OMPOSITION : E ; R ⊎ { s → t } ⊢ E ; R ∪ { s → r } , if t → R ∪ E > r . E ∪ { s ≅ t } ; R ⊢ E ∪ { u . S IMPLIFICATION : = t } ; R , if s → R u or s → E > u with σ ( l ) → σ ( r ) for l ≅ r ∈ E , s ⊲ l . E ; R ⊎ { s → t } ⊢ E ∪ { u . C OLLAPSE : = t } ; R , if s → R u or s → E > u with σ ( l ) → σ ( r ) for l ≅ r ∈ E , s ⊲ l .

  54. Ordered Completion: Properties Theorem Let ( E 0 ; R 0 ) , ( E 1 ; R 1 ) , . . . be an ordered completion derivation where all critical pairs are eventually generated (a fair derivation). Then these three properties are equivalent for all ground terms s and t : (1) E 0 � s . = t . (2) s ↓ E > ω ∪ R ω t . (3) s ↓ E > i ∪ R i t for some i � 0 . This theorem, in particular, asserts the refutational completeness of ordered completion.

  55. Proving by Ordered Completion: Example Given: 1. ( x · y ) · z . = x · ( y · z ) . 2. x · e . = x . 3. x · i ( x ) . = e . 4. x · x . = e . Prove Goal: x · y . = y · x .

  56. Proving by Ordered Completion: Example Proof by ordered completion: ◮ Skolemize the goal: a · b . = b · a . ◮ Take LPO as the reduction ordering with the precedence i > f > e > a > b ◮ E 0 := { ( x · y ) · z . = x · ( y · z ) , x · e . = x , x · i ( x ) . = e , x · x . = e } ◮ R 0 := ∅ ◮ Start applying the rules.

  57. Proving by Ordered Completion: Example E 0 = { ( x · y ) · z . = x · ( y · z ) , x · e . = x , x · i ( x ) . = e , x · x . = e } R 0 = ∅ Apply O RIENT 4 times: E 4 = ∅ R 4 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e }

  58. Proving by Ordered Completion: Example E 0 = { ( x · y ) · z . = x · ( y · z ) , x · e . = x , x · i ( x ) . = e , x · x . = e } R 0 = ∅ Apply O RIENT 4 times: E 4 = ∅ R 4 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e } Apply D EDUCE with the rules ( x · y ) · z → x · ( y · z ) and x · e → x to the overlapping term ( x · e ) · z , and then O RIENT : E 6 = ∅ R 6 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 }

  59. Proving by Ordered Completion: Example E 6 = ∅ R 6 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 } Apply D EDUCE with the rules x 1 · ( e · x 2 ) → x 1 · x 2 and x · i ( x ) → e to the overlapping term x 1 · ( e · i ( e )) : E 7 = { x 1 · i ( e ) . = x 1 · e } R 7 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 }

  60. Proving by Ordered Completion: Example E 7 = { x 1 · i ( e ) . = x 1 · e } R 7 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 } Apply O RIENT to x 1 · i ( e ) . = x 1 · e and then C OMPOSITION with the rule x · e → x : E 9 = ∅ R 9 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , x · i ( e ) → x }

  61. Proving by Ordered Completion: Example E 9 = ∅ R 9 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , x · i ( e ) → x } Apply D EDUCE with the rules x · x → e and x · i ( e ) → x to the overlapping term i ( e ) · i ( e ) , and then O RIENT : E 11 = ∅ R 11 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , x · i ( e ) → x , i ( e ) → e }

  62. Proving by Ordered Completion: Example E 11 = ∅ R 11 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , x · i ( e ) → x , i ( e ) → e } Apply C OLLAPSE to x · i ( e ) → x with i ( e ) → e : E 12 = { x · e . = x } R 12 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e }

  63. Proving by Ordered Completion: Example E 12 = { x · e . = x } R 12 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e } Apply S IMPLIFICATION to x · e . = x with x · e → x and then D ELETE to the obtained x . = x : E 14 = ∅ R 14 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e }

  64. Proving by Ordered Completion: Example E 14 = ∅ R 14 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e } Apply D EDUCE to ( x · y ) · z → x · ( y · z ) and x · i ( x ) → e with the overlapping term ( x · i ( x )) · z and then O RIENT : E 16 = ∅ R 16 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 }

  65. Proving by Ordered Completion: Example E 16 = ∅ R 16 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 } Apply D EDUCE to x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 and x · x → e with the overlapping term x 1 · ( i ( x 1 ) · i ( x 1 )) : E 17 = { e · i ( x ) . = x · e } R 17 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 }

  66. Proving by Ordered Completion: Example E 17 = { e · i ( x ) . = x · e } R 17 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 } Apply S IMPLIFICATION to e · i ( x ) . = x · e with x · e → x and then O RIENT : E 19 = ∅ R 19 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 , e · i ( x ) → x }

  67. Proving by Ordered Completion: Example E 19 = ∅ R 19 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 , e · i ( x ) → x } Apply D EDUCE to x 1 · ( e · x 2 ) → x 1 · x 2 and e · i ( x ) → x with the overlapping term x 1 · ( e · i ( x 2 )) and then O RIENT : E 21 = ∅ R 21 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 , e · i ( x ) → x , x 1 · i ( x 2 ) → x 1 · x 2 }

  68. Proving by Ordered Completion: Example E 21 = ∅ R 21 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · i ( x ) → e , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 , e · i ( x ) → x , x 1 · i ( x 2 ) → x 1 · x 2 } Applying C OLLAPSE , S IMPLIFICATION , and D ELETE , we get rid of x · i ( x ) → e : E 24 = ∅ R 24 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 , e · i ( x ) → x , x 1 · i ( x 2 ) → x 1 · x 2 }

  69. Proving by Ordered Completion: Example E 24 = ∅ R 24 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 , e · i ( x ) → x , x 1 · i ( x 2 ) → x 1 · x 2 } Applying C OLLAPSE and O RIENT , we replace e · i ( x ) → x with e · x → x : E 26 = ∅ R 26 = { ( x · y ) · z → x · ( y · z ) , x · e → x , x · x → e , x 1 · ( e · x 2 ) → x 1 · x 2 , i ( e ) → e , x 1 · ( i ( x 1 ) · x 2 ) → e · x 2 , e · x → x , x 1 · i ( x 2 ) → x 1 · x 2 }

Recommend


More recommend