Outline. Overview. Introduction. Well-Founded Monotone Algebras. Monotone algebras. Polynomial Interpretations. Dependency Pairs

Size: px
Start display at page:

Download "Outline. Overview. Introduction. Well-Founded Monotone Algebras. Monotone algebras. Polynomial Interpretations. Dependency Pairs"

Transcription

1 Overview Lecture 1: Introduction, Abstract Rewriting Lecture 2: Term Rewriting Lecture 3: Combinatory Logic Lecture 4: Termination Lecture 5: Matching, Unification Lecture 6: Equational Reasoning, Completion Lecture 7: Confluence Lecture 8: Modularity Lecture 9: Strategies Lecture 10: Decidability Lecture 11: Infinitary Rewriting Term Rewriting Systems - Lecture 4 1/71

2 Overview Outline Term Rewriting Subterm Systems Criterion - Lecture 4 2/71 Overview Introduction Well-Founded Monotone Algebras Monotone algebras Polynomial Interpretations Dependency Pairs Stepwise Termination Proofs Dependency Graphs

3 Overview Termination Term Rewriting Systems - Lecture 4 3/71

4 Introduction Termination, Example 1 Example A(x, s(y)) s(a(x, y)) A(x, 0) x A s s s s 0 s A A s s A R 0 A R 0 s R A R 0 s 0 s Looks terminating: second rule makes terms smaller first rule makes s move upwards Term Rewriting Systems - Lecture 4 4/71

5 Introduction Termination, Example 2 Example f(g(x)) g(f(x)) f(f(g(f(g(x))))) f(f(g(g(f(x))))) f(g(f(g(f(x))))) g(f(f(g(f(x))))) g(f(g(f(f(x))))) g(g(f(f(f(x))))) Looks terminating: f s move to the right g s move to the left Term Rewriting Systems - Lecture 4 5/71

6 Introduction Termination, Example 3 Example f(g(x)) g(g(f(f(x)))) Looks terminating: f s move to the right g s move to the left But we have an infinite rewrite sequence: f(g(g(x))) g(g(f(f(g(x))))) g(g(f(g(g(f(f(x)))))))... We need proofs of termination! Term Rewriting Systems - Lecture 4 6/71

7 Introduction Termination, Example 4 Example f(x, g(y)) f(x, x) Looks terminating: right side is smaller than the left side But we have an infinite rewrite sequence: f(g(x), g(x)) f(g(x), g(x))... We need proofs of termination! Term Rewriting Systems - Lecture 4 7/71

8 Introduction Definition (Termination SN(R)) A rewrite system R is terminating if there are no infinite rewrite sequences. Termination Methods Knuth-Bendix order, polynomial interpretations, multiset order, simple path order, lexicographic path order, semantic path order, recursive decomposition order, multiset path order, recursive path order, transformation order, elementary interpretations, type introduction, well-founded monotone algebras, general path order, semantic labeling, dummy elimination, dependency pairs, freezing, top-down labeling, monotonic semantic path order, context-dependent interpretations, match-bounds, size-change principle, matrix interpretations, predictive labeling, uncurrying, bounded increase, quasi-periodic interpretations, arctic interpretations, increasing interpretations, root-labeling,... Term Rewriting Systems - Lecture 4 8/71

9 Introduction Termination Research Termination Tools AProVE, Cariboo, CiME, Jambox, Termptation, Matchbox, MuTerm, NTI, Torpa, TPA, T T T 2, VMTL,... Term Rewriting Systems - Lecture 4 9/71

10 Well-Founded Monotone Algebras Outline Overview Introduction Well-Founded Monotone Algebras Monotone algebras Polynomial Interpretations Dependency Pairs Stepwise Termination Proofs Dependency Graphs Subterm Criterion Iterative Lexicographic Path Order Term Rewriting Systems - Lecture 4 10/71

11 Well-Founded Monotone Algebras Lemma TRS R is terminating well-founded order > on terms such that s > t whenever s R t Example TRS 0 + y y s(x) + y s(x + y) well-founded order > 1 if u = 0 ϕ(v) + 1 if u = s(v) s > t ϕ(s) > N ϕ(t) with ϕ(u) = 2ϕ(v) + ϕ(w) if u = v + w 0 otherwise Remark (very) inconvenient to check all rewrite steps Term Rewriting Systems - Lecture 4 11/71

12 Well-Founded Monotone Algebras Definitions A reduction order is well-founded order > on terms which is closed under contexts s > t = C[s] > C[t] closed under substitutions s > t = sσ > tσ Notation R > if l > r for all rules l r in R Theorem TRS R is terminating R > for reduction order > Term Rewriting Systems - Lecture 4 12/71

13 Well-Founded Monotone Algebras Theorem TRS R is terminating R > for reduction order > Proof. Let R be terminating. We define > =. Then: > is well-founded since R is terminating, > is closed under substitutions since is, and > is closed under contexts since is. Hence > is a reduction order. Moreover R. Term Rewriting Systems - Lecture 4 13/71

14 Well-Founded Monotone Algebras Theorem TRS R is terminating R > for reduction order > Proof. Let > be reduction order such that R >. Recall that is the smallest relation S such that: R S, S is closed under contexts, and S is closed under substitutions. Then > since > has these properties. Assume there exists an infinite rewrite sequence: t 0 t 1 t 2... Then also t 0 > t 1 > t 2... since > However, this contradicts well-foundedness of >. Term Rewriting Systems - Lecture 4 14/71

15 Monotone algebras Constructing Reduction Orders Idea: give semantics to terms by interpreting them into an algebra. Definition A Σ-algebra (A, [ ]) consists of: a non-empty set A, and for every f Σ an interpretation function [f ]: A ar(f ) A. Example (We use the Σ-algebra (N, [ ]) with) [0] = 1 [s](x) = x + 1 [A](x, y) = x + 2 y A s 5 A 4 s R s 10 A A 4 s R s 6 A s 2 R 0 1 s 5 s 4 A R s 3 s Term Rewriting Systems - Lecture 4 15/71

16 Monotone algebras Interpretation of terms Definition (Interpretation of Terms) Let α : X A be an interpretation of the variables. We define the evaluation of terms [, α] : T (Σ, X ) A inductively: [x, α] = α(x) [f (t 1,..., t n ), α] = [f ]([t 1, α],..., [t n, α]) if x X Example [0] = 1 [s](x) = x + 1 [A](x, y) = x + 2 y Let α(x) = 1, α(y) = 3, we calculate: [A(0, s(0)), α] = 5, [A(s(x), y), α] = 8. Term Rewriting Systems - Lecture 4 16/71

17 Monotone algebras Monotone Σ-algebras A function [f ] is monotone (w.r.t. >) if Definition a > b implies [f ](..., a,...) > [f ](..., b,...) A well-founded monotone Σ-algebra (A, [ ], >): a Σ-algebra (A, [ ]), a well-founded order > on A (no infinite chains a 1 > a 2 >...), such that for all f Σ the function [f ] A is monotone. Relation > A on terms: s > t if [s, α] > [t, α] for all assignments α. Lemma > A is a reduction order for every well-founded monotone Σ-algebra (A, [ ], >) Term Rewriting Systems - Lecture 4 17/71

18 Monotone algebras Lemma Let A well-founded monotone Σ-algebra. Then > A is closed under substitutions. Proof. Let s, t T (Σ, X ) such that t > A s. Let σ be a substitution. We show tσ > A sσ. That is: [tσ, α] > [sσ, α] for every α : X A. Define β : X A by β(x) = [σ(x), α]. Claim: [uσ, α] = [u, β] for all u. Proof of the claim by induction over the term structure of u: Hence [tσ, α] = [t, β] > [s, β] = [sσ, α]. [xσ, α] = [σ(x), α] = [x, β] [f (t 1,..., t n )σ, α] = [f ]([t 1 σ, α],..., [t n σ, α]) IH = [f ]([t 1, β],..., [t n, β]) = [f (t 1,..., t n ), β] Term Rewriting Systems - Lecture 4 18/71

19 Monotone algebras Lemma Let A well-founded monotone Σ-algebra. Then > A is closed under contexts. Proof. Let s, t T (Σ, X ) such that t > A s. We show C[s] > A C[t] for every C[ ]. That is: [C[t], α] > [C[s], α] for every α : X A. Let α : X A. We show [C[t], α] > [C[s], α] by induction over structure of C[ ]: C[ ] [ ] [C[t]] = [t] > [s] = [C[s]] C[ ] f (t 1,..., t n ) Let i such that t i contains the hole. Then C[u] = f (t 1,..., t i [u],..., t n ). Hence [C[s], α] = [f ]([t 1, α],..., [t i [s], α],..., [t n, α]). [C[t], α] = [f ]([t 1, α],..., [t i [t], α],..., [t n, α]). By IH [t i [t], α] > [t i [s], α]. By monotonicity [C[t], α] > [C[s], α]. Term Rewriting Systems - Lecture 4 19/71

20 Monotone algebras Lemma Let A well-founded monotone Σ-algebra. Then > A is well-founded. Proof. Assume there is an infinite sequence t 1 > A t 2 > A t 3 > A.... Let α : X A. Then by definition of > A : [t 1, α] > [t 2, α] > [t 3, α] >.... This infinite decreasing > chain contradicts well-foundedness of >. We have shown that: > A is closed under substitutions > A is closed under contexts > A is well-founded Hence we have proven that: Lemma > A is a reduction order for every well-founded monotone Σ-algebra (A, [ ], >) Term Rewriting Systems - Lecture 4 20/71

21 Monotone algebras Theorem TRS R is terminating R > A for well-founded monotone algebra (A, >) Proof. Follows since we have shown that > A is a reduction order. As Σ-algebra we take (A, [ ], >) with A = T (Σ, X ), [f ](t 1,..., t n ) = f (t 1,..., t n ), > :=. Then > is well-founded since R is terminating. Monotonicity of > follows from closure of under contexts: s > t [f ](..., s,...) = f (..., s,...) > f (..., t,...) = [f ](..., t,...) R > A since for all l r R and α : X A: [l, α] = lα > rα = [r, α]. Term Rewriting Systems - Lecture 4 21/71

22 Monotone algebras Well-Founded Monotone Algebras used in termination proofs/tools : polynomial interpretations over N polynomial interpretations over Q and R matrix interpretations over N matrix interpretations over N { } Term Rewriting Systems - Lecture 4 22/71

23 Polynomial Interpretations Outline Overview Introduction Well-Founded Monotone Algebras Monotone algebras Polynomial Interpretations Dependency Pairs Stepwise Termination Proofs Dependency Graphs Subterm Criterion Iterative Lexicographic Path Order Term Rewriting Systems - Lecture 4 23/71

24 Polynomial Interpretations Polynomial interpretations Definition A polynomial interpretations over N consists of: Σ-algebra is (N, [ ]), > defined as usual on N, the interpretations [f ] are polynomials. The first two conditions of well-founded monotone Σ-algebras are fulfilled: (N, [ ]) is a Σ-algebra > is well-founded However, to prove termination we need to check: monotonicity of the polynoms [f ], and R >, that is, [l, α] > [r, α] for all l r R and α : X A Term Rewriting Systems - Lecture 4 24/71

25 Polynomial Interpretations Example 1 Example f(g(x)) f(f(x)) Find a polynomial interpretation over N which proves termination: [f](x) = x [g](x) = x + 1 Are the functions [f ] monotone? Yes, since whenever a > b, then [f](a) = a > b = [f](b), [g](a) = a + 1 > b + 1 = [g](b), Does [l, α] > [r, α] hold? Yes since, [f(g(x)), α] = [f]([g](α(x))) = α(x) + 1 > α(x) = [f(f(x)), α] Hence we have proven termination. Term Rewriting Systems - Lecture 4 25/71

26 Polynomial Interpretations Example 2 Example f(g(x)) g(f(x)) Find a polynomial interpretation over N which proves termination: [f](x) = 2 x [g](x) = x + 1 Are the functions [f ] monotone? Yes, since whenever a > b, then [f](a) = 2 a > 2 b = [f](b), [g](a) = a + 1 > b + 1 = [g](b), Does [l, α] > [r, α] hold? Yes since, [f(g(x)), α] = 2 (α(x) + 1) > 2 α(x) + 1 = [g(f(x)), α] Hence we have proven termination. Term Rewriting Systems - Lecture 4 26/71

27 Polynomial Interpretations Example 3 Example A(x, 0) x A(x, s(y)) s(a(x, y)) Find a polynomial interpretation over N which proves termination: [0] = 1 [s](x) = x + 1 [A](x, y) = x + 2 y Are the functions [f ] monotone? Yes, since whenever a > b, then [s](a) = a + 1 > b + 1 = [s](b), [A](a, y) = a + 2 y > b + 2 y = [A](b, y), and [A](x, a) = x + 2 a > x + 2 b = [A](x, b), Hence we have proven termination. Term Rewriting Systems - Lecture 4 27/71

28 Polynomial Interpretations Why do we need the conditions? Example (> not well-founded) Let R = { f(x) f(f(x)) } with the Σ-algebra (Z, [ ]) and [f](x) = x 1 and > as usual on Z. Then R is not terminating f(x) f(f(x)) f(f(f(x)))... but [f ] is monotone, and [f(x), α] = α(x) 1 > α(x) 2 = [f(f(x)), α]. Hence > needs to be well-founded! Term Rewriting Systems - Lecture 4 28/71

29 Polynomial Interpretations Why do we need the conditions? Example ([f] not monotone) Let R = { f(x) g(f(x)) } with the Σ-algebra (N, [ ]) and [f](x) = x + 1 [g](x) = 0 and > as usual on N. Then R is not terminating f(x) g(f(x)) g(g(f(x)))... but > is well-founded, and [f(x), α] = α(x) + 1 > 0 = [g(f(x)), α]. Hence the functions [f ] need to be monotone! Term Rewriting Systems - Lecture 4 29/71

30 Polynomial Interpretations Question How to find suitable polynomials? Modern Approach (a) choose abstract polynomial interpretations (linear, quadratic,... ) (b) (c) (d) (e) transform rewrite rules into polynomial ordering constraints add monotonicity and well-definedness constraints eliminate universally quantified variables translate resulting constraints to SAT or SMT problem Term Rewriting Systems - Lecture 4 30/71

31 Polynomial Interpretations Example rewrite system interpretations 0 + y y s(x) + y s(x + y) 0 A = 0 s A (x) = x A (x, y) = 2x + y + 1 diophantine constraints x, y N e 1 0 da + f > 0 e be 0 dc + f bf c > 0 a 0 b 1 c 0 d 1 e 1 f 0 possible solution a = 0 b = 1 c = 1 d = 2 e = 1 f = 1 Term Rewriting Systems - Lecture 4 31/71

32 Polynomial Interpretations Example TRS 0 + y y 0 y 0 s(x) + y s(x + y) s(x) y y + (x y) interpretations in N 0 A = 1 + A (x, y) = 2x + y s A (x) = x + 1 A (x, y) = 2xy + x + y + 1 constraints x, y N 2 > 0 3y + 1 > 0 1 > 0 1 > 0 s(0) s(s(0)) s(s(0)) + (0 s(s(0))) s(s(0)) + 0 s(s(0) + 0) 18 > 17 > 7 > 6 s(s(0 + 0)) s(s(0)) > 5 > 3 Term Rewriting Systems - Lecture 4 32/71

33 Polynomial Interpretations Example TRS (x + y) (x) + (y) (α) = 1 (x y) (x) (y) (β) = 0 (x y) ( (x) y) + (x (y)) (x y) (( (x) y) (x (y))) (y y) interpretations in N α A = β A = 0 A = 1 A = 1 + A (x, y) = A (x, y) = A (x, y) = A (x, y) = x + y + 3 A (x) = x 2 + 6x + 6 constraints x, y N x 2 + y 2 + 2xy + 12x + 12y + 33 > x 2 + y 2 + 6x + 6y > 1 x 2 + y 2 + 2xy + 12x + 12y + 33 > x 2 + y 2 + 6x + 6y > 1 x 2 + y 2 + 2xy + 12x + 12y + 33 > x 2 + y 2 + 7x + 7y + 21 x 2 + y 2 + 2xy + 12x + 12y + 33 > x 2 + y 2 + 7x + 9y + 27 Term Rewriting Systems - Lecture 4 33/71

34 Polynomial Interpretations Remark Numerous terminating TRSs are not polynomially terminating. polynomial interpretations terminating TRSs Term Rewriting Systems - Lecture 4 34/71

35 Polynomial Interpretations A non-simply terminating TRS: f (f (x)) f (g(f (x))) Example (S = {f (f (x)) f (g(f (x)))}) There exists no monotone Σ-algebra A with A = N proving SN(S). Assume contrary it would exist. Let α : X A, then: [f (f (x)), α] > [f (g(f (x))), α]. But then also [f (x), α] > [g(f (x)), α] since otherwise: [f (x), α] = [g(f (x)), α] implies [f (f (x)), α] = [f (g(f (x))), α], [f (x), α] < [g(f (x)), α] implies [f (f (x)), α] < [f (g(f (x))), α] by monotonicity. But then A would also prove termination of f (x) g(f (x)). Thus we need another Σ-algebra, for example A = N 2. Term Rewriting Systems - Lecture 4 35/71

36 Polynomial Interpretations A non-simply terminating TRS: f (f (x)) f (g(f (x))) Example (S = {f (f (x)) f (g(f (x)))}) We choose the Σ-algebra (N 2, [ ]) with: ( ) ( ) [f]( x) = 0 0 x + [g]( x) = where > on N 2 is defined as follows: ( ) ( ) x1 y1 x > 2 y x 1 > y 1 and x 2 y 2 2 Let α: X A be arbitrary; write x = α(x). We obtain [f (f (x))] = Hence S is terminating. ( ) ( ) x + > ( ) ( ) x + ( ) ( ) x + = [f (g(f (x)))] Term Rewriting Systems - Lecture 4 36/71

37 Dependency Pairs Termination via Dependency Pairs Term Rewriting Systems - Lecture 4 37/71

38 Dependency Pairs Minimal Terms We call a term is minimal if all its strict subterms are terminating. Theorem Let R be a non-terminating TRS. Then there exists a minimal term which is non-terminating. Proof. Since R is non-terminating, there exists a non-terminating term t. We prove: every non-terminating term t contains a minimal subterm. We use induction on the term structure of t: Base case: all strict subterms of t are terminating. Then t is minimal itself. Induction step: t has a strict subterm t which is not terminating. Then by IH the term t contains a minimal, non-terminating subterm t. The term t is a minimal non-terminating subterm of t. Term Rewriting Systems - Lecture 4 38/71

39 Dependency Pairs Steps below the root do not change minimality: Lemma Let t be minimal and t s a rewrite step below the root. Then s is minimal. Proof. We have t = f (t 1,..., t n ) and s = f (s 1,..., s n ) and i N such that: t i s i, and t j = s j for all j i. Then since t is minimal, it follows that all t k are terminating. Since t k s k, we obtain s k is terminating for all 1 k n. Hence s is minimal. Term Rewriting Systems - Lecture 4 39/71

40 Dependency Pairs Dependency Pairs, Introduction Assume R is non-terminating. There exists a minimal, non-terminating term t 0. t 0 R t 1 R t 2 R... At some point there must be a root step t i t i+1. Proof. Assume all steps would be below the root. Then: all t i are minimal, all rewrite steps are in terminating terminating. Notation: we use top R to denote root rewrite steps. Term Rewriting Systems - Lecture 4 40/71

41 Dependency Pairs Dependency Pairs, Introduction Let t 0 be a minimal and t 0 R t 1 R t 2 R... an infinite rewrite sequence. We consider the first root rewrite step t i t i+1 : t i lσ l t i+1 rσ r SN SN & minimal SN σ s σ SN The temr t i+1 contains a minimal, non-terminating subterm s. The root of s lies in the pattern of r. Hence there exists a non-variable subterm r of r such that s = r σ. Idea: add a rule l r then t i s. Term Rewriting Systems - Lecture 4 41/71

42 Dependency Pairs Dependency Pairs For every f Σ let f # be a fresh symbol with the same arity as f. By t # we denote f # (t 1,..., t n ) for t = f (t 1,..., t n ) T (Σ, X ). Definition (Dependency Pairs) DP(R) = {l # r # l r R, r r with r X } Example R = { f(x) g(f(x)) } DP(R) = { f # (x) g # (f(x)), f # (x) f # (x) } Term Rewriting Systems - Lecture 4 42/71

43 Dependency Pairs Dependency Pairs Let t 0 be a minimal and t 0 R t 1 R t 2 R... an infinite rewrite sequence. We consider the first root rewrite step t i t i+1 : t i lσ l t i+1 rσ r SN SN & minimal SN σ s σ SN Then t 0,# R... R t i,# Repeating the construction with s yields: t 0,# R top DP(R) R top DP(R) s # top DP(R) R top DP(R)... an infinite rewrite sequence containing infinitely many DP(R) steps. Term Rewriting Systems - Lecture 4 43/71

44 Dependency Pairs Dependency Pairs Lemma Let R be a non-terminating TRS. Then there exists a rewrite sequence: such that: t 0,# R top DP(R) R top DP(R) R the sequence contains infinitely many DP(R) steps, all R steps are below the root, and all DP(R) steps are at the root. top DP(R)... Term Rewriting Systems - Lecture 4 44/71

45 Dependency Pairs Dependency Pairs, Examples Example R is non-terminating: R = { f(g(x)) g(g(f(f(x)))) } DP(R) = { f # (g(x)) g # (g(f(f(x)))), f # (g(x)) g # (f(f(x))), f # (g(x)) f # (f(x)), f # (g(x)) f # (x) } f(g(g(x))) g(g(f(f(g(x))))) g(g(f(g(g(f(f(x)))))))... How does an infinite R top DP(R) rewrite sequence look like? f # (g(g(x))) top DP(R) f # (f(g(x))) R f # (g(g(f(f(x))))... Term Rewriting Systems - Lecture 4 45/71

46 Dependency Pairs Dependency Pairs, Examples Example R = { A(x, s(y)) s(a(x, y)), A(x, 0) x } DP(R) = { A # (x, s(y)) s # (A(x, y)), A # (x, s(y)) A # (x, y) } Term Rewriting Systems - Lecture 4 46/71

47 Dependency Pairs Dependency Pairs, Main Theorem Definition (Relative Termination) A relation 1 is called terminating relative to 2, denoted SN( 1 / 2 ), if every 1 2 rewrite sequence contains only finitely many 1 steps. Lemma SN( 1 / 2 ) SN( 2 1 2) The main theorem from dependency pairs is: Theorem SN(R) SN(DP(R) top /R) That is, a TRS R is terminating if and only if top DP(R) terminates relative to R. Term Rewriting Systems - Lecture 4 47/71

48 Dependency Pairs Dependency Pairs, Termination Proofs Definition A well-founded weakly monotone Σ-algebra (A, [ ], >, ) consists of: a Σ-algebra (A, [ ]) with relations >, on A > is well-founded, > > (compatibility), for all f Σ the function [f ] is monotone w.r.t. Theorem SN(DP(R) top /R) if there exists a weakly monotone Σ-algebra s.t. DP(R) > that is, [l, α] > [r, α] α, l r DP(R) R that is, [l, α] [r, α] α, l r R Advantages: no monotonicity for >, and not well-founded. Term Rewriting Systems - Lecture 4 48/71

49 Dependency Pairs Frequently used are polynomial interpretations over N: > as usual on N and := the interpretations [f ] are polynomials We will see some examples... Term Rewriting Systems - Lecture 4 49/71

50 Dependency Pairs Example: f(f(x)) f(g(f(x))) Example DP(R) = { f # (f(x)) f # (g(f(x))), f # (f(x)) g # (f(x)), f # (f(x)) f # (x) } [f](x) = x + 1 [f # ](x) = x + 1 [g](x) = 0 [g # ](x) = 0 Are the functions [f ] monotone w.r.t.? Yes, since whenever a b, then [f](a) = a b = [f](b), [g](a) = 0 0 = [g](b), Hence we have proven termination. Term Rewriting Systems - Lecture 4 50/71

51 Stepwise Termination Proofs Stepwise Termination Proofs Stepwise termination proofs with monotone Σ-algebras: Theorem If there exists a monotone Σ-algebra (A, [ ], >) s.t. R, and R >, and where := > =. Then SN(R) = SN(R R ) This theorem allows us to stepwise remove rules until none are left. Remark Instead of we can more generally use a monotone relation with > > Term Rewriting Systems - Lecture 4 51/71

52 Stepwise Termination Proofs Example Example f(f(x)) g(x) f(g(x)) g(f(x)) We use the following interpretation: [f](x) = x + 1 [g](x) = x + 1 We get the following interpretation of rules: [f(g(x)), α] = α(x) + 2 > α(x) + 1 = [g(x), α] [f(g(x)), α] = α(x) + 2 α(x) + 2 = [g(f(x)), α] The first rule is strictly decreasing, hence we can remove it. Thus for termination it sufficies to show SN(f(g(x)) g(f(x))). We have already shown this a few slides ago. Hence we have proven termination. Term Rewriting Systems - Lecture 4 52/71

53 Stepwise Termination Proofs Stepwise Termination Proofs Stepwise termination proofs with dependency pairs: Theorem If there exists a weakly monotone Σ-algebra s.t. T 1 > T 2 R Then SN(T 2,top /R) = SN((T 1 T 2 ) top /R) That is, we may remove the strictly decreasing top-rules. Typically, T 1, T 2 DP(R). But we can also tackle other top-termination problems. We are not allowed to remove strictly decreasing rules in R! (for removing from R we need monotonic interpretations) Term Rewriting Systems - Lecture 4 53/71

54 Stepwise Termination Proofs Example minus(x, 0) x minus(s(x), s(y)) minus(x, y) quot(0, s(y)) 0 quot(s(x), s(y)) s(quot(minus(x, y), s(y))) DP(R) = { minus # (s(x), s(y)) minus # (x, y) We use the interpretation: quot # (0, s(y)) 0 # quot # (s(x), s(y)) s # (quot(minus(x, y), s(y))) quot # (s(x), s(y)) quot # (minus(x, y), s(y)) quot # (s(x), s(y)) minus # (x, y) quot # (s(x), s(y)) s # (y) } [minus # ](x, y) = 1 [quot # ](x, y) = 1 [minus](x, y) = x [s](x) = x [f]( x) = 0 for all other symbols f Term The Rewriting following Systems - Lecture interpretation 4 removes the remaining DP rules and proves: 54/71

55 Dependency Graphs Dependency Graphs Example minus(x, 0) x minus(s(x), s(y)) minus(x, y) quot(0, s(y)) 0 quot(s(x), s(y)) s(quot(minus(x, y), s(y))) Dependency graph: analysis which DP-rules may follow each other (1) minus # (s(x), s(y)) minus # (x, y) (2) quot # (s(x), s(y)) minus # (x, y) (3) quot # (s(x), s(y)) quot # (minus(x, y), s(y)) Idea: consider only strongly connected components SN({1} top /R), SN({3} top /R). Term Rewriting Systems - Lecture 4 55/71

56 Subterm Criterion Subterm Criterion Theorem (Subterm Criterion) Let R be a TRS, T 1, T 2 DP(R), and π : Σ # N such that: s π(f# ) t π(g# ) for every rule f # (s 1,..., s n ) g # (t 1,..., t m ) T 1 s π(f# ) = t π(g# ) for every rule f # (s 1,..., s n ) g # (t 1,..., t m ) T 2 Then: SN(T 2,top /R) = SN((T 1 T 2 ) top /R) Proof. After the dependency pairs transformation, we consider only minimal terms. We can only finitely often make a terminating term smaller ( ). Term Rewriting Systems - Lecture 4 56/71

57 Subterm Criterion Example: Ackermann function Example We use the interpretation: Ack(0, y) s(y) Ack(s(x), 0) Ack(x, s(0)) Ack(s(x), s(y)) Ack(x, Ack(s(x), y)) DP(R) = { Ack # (0, y) s # (y) Ack # (s(x), 0) Ack # (x, s(0)) Ack # (s(x), 0) s # (0) Ack # (s(x), 0) 0 # Ack # (s(x), s(y)) Ack # (x, Ack(s(x), y)) Ack # (s(x), s(y)) Ack # (s(x), y) Ack # (s(x), s(y)) s # (x) } [Ack # ](x, y) = 1 [Ack](x, y) = 0 [s](x) = 0 [0] = 0 s # (x) = 0 We use the subterm criterion: π(ack # ) = 1 Term Rewriting Systems - Lecture 4 57/71

58 Iterative Lexicographic Path Order Iterative Lexicographic Path Order (ILPO) Term Rewriting Systems - Lecture 4 58/71

59 Iterative Lexicographic Path Order ILPO... Historical overview Kamin and Lévy [1980] (lexicographic path order, LPO): Kruskal s Tree Theorem was used in the original proofs Buchholz [1995] simplified the proof: Kruskal not needed Bergsta and Klop [1985]: Iterative version of RPO: star method Operational definition of reduction order via an auxiliary term rewriting system (with stars) Klop, van Oostrom and de Vrijer [2005]: Extension of the star method to LPO Iterative lexicographic path order (ILPO) Term Rewriting Systems - Lecture 4 59/71

60 Iterative Lexicographic Path Order ILPO... The star TRS Lex Given a terminating relation on signature Σ, define TRS Lex Signature: Σ Σ, where Σ = {f f Σ} f is fresh and has the same arity as f Reduction rules (four types, for arbitrary f, g Σ): f ( x) put f ( x) f ( x) select x i f ( x) copy g(f ( x),..., f ( x)) f ( x, g( y), z) lex f ( x, g ( y), l,..., l) if f g where l = f ( x, g( y), z) Definition (ILPO) ilpo is the restriction of + Lex to terms over Σ, i.e. t ilpo s t + Lex s t, s T (Σ V ) Term Rewriting Systems - Lecture 4 60/71

61 Iterative Lexicographic Path Order ILPO Claim ilpo is a reduction order, that is: ilpo is well-founded, and closed under substitution and contexts The closure under substitutions and contexts is immediate since + Lex is. Only required: proof of termination of ilpo. Corollary A TRS R is terminating if R ilpo. Proof. ilpo is a reduction order with R ilpo. Term Rewriting Systems - Lecture 4 61/71

62 Iterative Lexicographic Path Order Example, Addition and multiplication A(x, 0) x A(x, S(y)) S(A(x, y)) M(x, 0) 0 M(x, S(y)) A(x, M(x, y)) Use relation R given by M A and A S. For each reduction rule a corresponding Lex-reductions: A(x, 0) put A (x, 0) select x A(x, S(y)) put A (x, S(y)) copy S(A (x, S(y))) lex S(A(x, S (y))) select S(A(x, y)) M(x, 0) put M (x, 0) select 0 M(x, S(y)) put M (x, S(y)) copy A(M (x, S(y)), M (x, S(y))) select A(x, M (x, S(y))) lex A(x, M(x, S (y))) select A(x, M(x, y)) Term Rewriting Systems - Lecture 4 62/71

63 Iterative Lexicographic Path Order Termination for ilpo via termination of Lex ω But Lex is in general not terminating, e.g. if A > S, then A(x, y) put A (x, y) copy S(A (x, y)) copy S(S(A (x, y)))... Starred symbol A is used infinitely often. This is essential in any infinite reduction! Idea: use numbers instead of stars, the numbers fix how often a symbol can be used. Yields a terminating TRS Lex ω. Term Rewriting Systems - Lecture 4 63/71

64 Iterative Lexicographic Path Order Auxiliary TRS with numerical control symbols Given a terminating relation on signature Σ, define TRS Lex ω Signature: Σ Σ ω, where Σ ω = {f n f Σ, n N} f n is fresh and has same arity as f Reduction rules: f ( x) put f n ( x) f n ( x) select x i f n+1 ( x) copy g(f n ( x),..., f n ( x)) f n+1 ( x, g( y), z) lex f ( x, g n ( y), l,..., l) if f g where l = f n ( x, g( y), z) Term Rewriting Systems - Lecture 4 64/71

65 Iterative Lexicographic Path Order Back and forth between Lex and Lex ω From Lex ω to Lex : every reduction can be transformed by replacing f n by f. From Lex to Lex ω: every finite reduction can be lifted, in particular every reduction between two starless terms can be lifted. For example: M(x, S(y)) put M (x, S(y)) copy A(M (x, S(y)), M (x, S(y))) becomes: select A(x, M (x, S(y))) lex A(x, M(x, S (y))) select A(x, M(x, y)) M(x, S(y)) put M 2 (x, S(y)) copy A(M 1 (x, S(y)), M 1 (x, S(y))) select A(x, M 1 (x, S(y))) lex A(x, M(x, S 0 (y))) select A(x, M(x, y)) Term Rewriting Systems - Lecture 4 65/71

66 Iterative Lexicographic Path Order Lex and Lex ω Theorem + Lex and + Lex ω coincide on T (Σ V ) Note that the infinite reduction cannot be lifted: A(x, y) put A (x, y) copy S(A (x, y)) copy S(S(A (x, y)))... A(x, y) put A? (x, y) copy S(A? 1 (x, y)) copy S(S(A? 2 (x, y)))... Term Rewriting Systems - Lecture 4 66/71

67 Iterative Lexicographic Path Order Termination of Lex ω à la Buchholz Prove the implication t 1,..., t n are terminating = f l (t 1,..., t n ) is terminating by induction on triple f, t, l in ordering, ( Lex ω ) n, >. Here ( Lex ω ) n is the lexicographic order on n-tuples No label l counts as with > n. In general a term is SN if all one-step reducts are SN. We check all one step reducts of f l (t 1,..., t n ). Term Rewriting Systems - Lecture 4 67/71

68 Iterative Lexicographic Path Order Termination of Lex ω à la Buchholz Prove the implication t 1,..., t n are terminating = f l (t 1,..., t n ) is terminating by induction on triple f, t, l in ordering, ( Lex ω ) n, >. Case 1. Internal step f l (..., t i,... ) f l (..., t i,... ). The triple decreases in the second component. Case 2. f (t 1,..., t n ) put f n (t 1,..., t n ). We have a decrease in the third component. Case 3. f (t 1,..., t n ) select t i. By assumption t i is SN. Term Rewriting Systems - Lecture 4 68/71

69 Iterative Lexicographic Path Order Termination of Lex and Lex ω Hence we have proven: Theorem Lex ω is terminating Corollary + Lex is terminating on T (Σ V ) Proof. + Lex and + Lexω coincide on T (Σ V ) Term Rewriting Systems - Lecture 4 69/71

70 Iterative Lexicographic Path Order Example, Ackermann Function Example Ack(0, y) s(y) Ack(s(x), 0) Ack(x, s(0)) Ack(s(x), s(y)) Ack(x, Ack(s(x), y)) Find an order on Σ which proves termination. Ack s We get the following derivations: Ack(0, y) put Ack (0, y) copy s(ack (0, y)) select s(y) Ack(s(x), 0) put Ack (s(x), 0) lex Ack(s (x), Ack (s(x), 0)) select Ack(x, Ack (s(x), 0)) copy Ack(x, s(ack (s(x), 0))) select Ack(x, s(0)) Hence we have proven termination. Term Rewriting Systems - Lecture 4 70/71

71 Iterative Lexicographic Path Order Recursive definition of LPO Let be a strict order on signature Σ Define lpo on T (Σ, V ) by: s lpo t iff (LPO1) (LPO2) t Var(s) and s t, or s = f (s 1,..., s m ), t = g(t 1,..., t n ), and (LPO2a) (LPO2b) (LPO2c) 1 i m, with s i = t or s i lpo t, or f g and s lpo t j for all 1 j n, or f = g, and s lpo t j for all 1 j n, and there exists 1 i m, s.t. s 1 = t 1,..., s i 1 = t i 1 and s i lpo t i. Theorem ilpo is equivalent with lpo Term Rewriting Systems - Lecture 4 71/71

Equational Logic. Chapter 4

Equational Logic. Chapter 4 Chapter 4 Equational Logic From now on First-order Logic is considered with equality. In this chapter, I investigate properties of a set of unit equations. For a set of unit equations I write E. Full first-order

More information

Theorem 4.18 ( Critical Pair Theorem ) A TRS R is locally confluent if and only if all its critical pairs are joinable.

Theorem 4.18 ( Critical Pair Theorem ) A TRS R is locally confluent if and only if all its critical pairs are joinable. 4.4 Critical Pairs Showing local confluence (Sketch): Problem: If t 1 E t 0 E t 2, does there exist a term s such that t 1 E s E t 2? If the two rewrite steps happen in different subtrees (disjoint redexes):

More information

Iterative Lexicographic Path Orders

Iterative Lexicographic Path Orders Iterative Leicographic Path Orders Jan Willem Klop 1,2,3, Vincent van Oostrom 4, and Roel de Vrijer 1 1 Vrije Universiteit, Department of Theoretical Computer Science, De Boelelaan 1081a, 1081 HV Amsterdam,

More information

Modular Termination Proofs for Rewriting Using Dependency Pairs

Modular Termination Proofs for Rewriting Using Dependency Pairs J. Symbolic Computation (2002) 34, 21 58 doi:10.1006/jsco.2002.0541 Available online at http://www.idealibrary.com on Modular Termination Proofs for Rewriting Using Dependency Pairs JÜRGEN GIESL, THOMAS

More information

Mechanizing and Improving Dependency Pairs

Mechanizing and Improving Dependency Pairs Mechanizing and Improving Dependency Pairs Jürgen Giesl (giesl@informatik.rwth-aachen.de), René Thiemann (thiemann@informatik.rwth-aachen.de) and Peter Schneider-Kamp (psk@informatik.rwth-aachen.de) LuFG

More information

Cheat Sheet Equational Logic (Spring 2013) Terms. Inductive Construction. Positions: Denoting Subterms TERMS

Cheat Sheet Equational Logic (Spring 2013) Terms. Inductive Construction. Positions: Denoting Subterms TERMS TERMS Cheat Sheet Equational Logic (Spring 2013) The material given here summarizes those notions from the course s textbook [1] that occur frequently. The goal is to have them at hand, as a quick reminder

More information

07 Equational Logic and Algebraic Reasoning

07 Equational Logic and Algebraic Reasoning CAS 701 Fall 2004 07 Equational Logic and Algebraic Reasoning Instructor: W. M. Farmer Revised: 17 November 2004 1 What is Equational Logic? Equational logic is first-order logic restricted to languages

More information

Termherschrijfsystemen 2003

Termherschrijfsystemen 2003 Termherschrijfsystemen 2003 Docent: Op basis van het boek Term Rewriting Systems van Terese voorjaar 2003 1 School arithmetic (3 + 5) (1 + 2) 8 (1 + 2) 8 3 24 Elementary steps: 3 + 5 8 1 + 2 3 8 3 24 Elementary

More information

Under consideration for publication in Theory and Practice of Logic Programming 1. AC-KBO Revisited AKIHISA YAMADA

Under consideration for publication in Theory and Practice of Logic Programming 1. AC-KBO Revisited AKIHISA YAMADA Under consideration for publication in Theory and Practice of Logic Programming 1 AC-KBO Revisited AKIHISA YAMADA Research Institute for Secure Systems, AIST, Japan SARAH WINKLER Institute of Computer

More information

Equational Reasoning and Completion. Dominik Klein

Equational Reasoning and Completion. Dominik Klein Equational Reasoning and Completion by Dominik Klein submitted to Japan Advanced Institute of Science and Technology in partial fulfillment of the requirements for the degree of Doctor of Philosophy Supervisor:

More information

Proving Termination by Bounded Increase. Jürgen Giesl, René Thiemann, Stephan Swiderski, Peter Schneider-Kamp

Proving Termination by Bounded Increase. Jürgen Giesl, René Thiemann, Stephan Swiderski, Peter Schneider-Kamp Aachen Department of Computer Science Technical Report Proving Termination by Bounded Increase Jürgen Giesl, René Thiemann, Stephan Swiderski, Peter Schneider-Kamp ISSN 0935 3232 Aachener Informatik Berichte

More information

Unifying the Knuth-Bendix, Recursive Path and Polynomial Orders

Unifying the Knuth-Bendix, Recursive Path and Polynomial Orders Unifying the Knuth-Bendix, Recursive Path and Polynomial Orders Akihisa Yamada Graduate School of Information Science Nagoya University Furo-cho, Chikusa-ku, Nagoya 4648603 Japan ayamada@sakabe.i.is.nagoya-u.ac.jp

More information

AC-KBO Revisited. 1 Introduction. Akihisa Yamada 1, Sarah Winkler 2, Nao Hirokawa 3, and Aart Middeldorp 2

AC-KBO Revisited. 1 Introduction. Akihisa Yamada 1, Sarah Winkler 2, Nao Hirokawa 3, and Aart Middeldorp 2 AC-KBO Revisited Akihisa Yamada 1, Sarah Winkler 2, Nao Hirokawa 3, and Aart Middeldorp 2 1 Graduate School of Information Science, Nagoya University, Japan 2 Institute of Computer Science, University

More information

Termination of term rewriting by semantic labelling H. Zantema Utrecht University, Department of Computer Science, P.O. box , 3508 TB Utrecht, T

Termination of term rewriting by semantic labelling H. Zantema Utrecht University, Department of Computer Science, P.O. box , 3508 TB Utrecht, T Termination of term rewriting by semantic labelling H. Zantema Utrecht University, Department of Computer Science, P.O. box 80.089, 3508 TB Utrecht, The Netherlands e-mail: hansz@cs.ruu.nl Abstract A new

More information

DYNAMIC DEPENDENCY PAIRS FOR ALGEBRAIC FUNCTIONAL SYSTEMS CYNTHIA KOP AND FEMKE VAN RAAMSDONK

DYNAMIC DEPENDENCY PAIRS FOR ALGEBRAIC FUNCTIONAL SYSTEMS CYNTHIA KOP AND FEMKE VAN RAAMSDONK Logical Methods in Computer Science Vol. 8 (2:10) 2012, pp. 1 51 www.lmcs-online.org Submitted Nov. 11, 2011 Published Jun. 19, 2012 DYNAMIC DEPENDENCY PAIRS FOR ALGEBRAIC FUNCTIONAL SYSTEMS CYNTHIA KOP

More information

The Weighted Path Order for Termination of Term Rewriting

The Weighted Path Order for Termination of Term Rewriting PhD Thesis The Weighted Path Order for Termination of Term Rewriting April 2014 Akihisa Yamada Graduate School of Information Science Nagoya University Abstract Termination of term rewrite systems (TRSs)

More information

Improving Dependency Pairs

Improving Dependency Pairs Improving Dependency Pairs Jürgen Giesl, René Thiemann, Peter Schneider-Kamp, Stephan Falke LuFG Informatik II, RWTH Aachen, Ahornstr. 55, 52074 Aachen, Germany {giesl thiemann}@informatik.rwth-aachen.de

More information

Quasi-interpretation Synthesis by Decomposition

Quasi-interpretation Synthesis by Decomposition Quasi-interpretation Synthesis by Decomposition Guillaume Bonfante, Jean-Yves Marion and Romain Péchoux { Guillaume.bontante, Jean-Yves.Marion, Romain.Pechoux }@loria.fr Carte project-loria,nancy,france

More information

A Polynomial Algorithm for Uniqueness of Normal Forms of Linear Shallow Term Rewrite Systems 1. Julian Zinn 2 and Rakesh Verma

A Polynomial Algorithm for Uniqueness of Normal Forms of Linear Shallow Term Rewrite Systems 1. Julian Zinn 2 and Rakesh Verma A Polynomial Algorithm for Uniqueness of Normal Forms of Linear Shallow Term Rewrite Systems 1 Julian Zinn 2 and Rakesh Verma Computer Science Department University of Houston Houston, TX, 77204, USA http://www.cs.uh.edu

More information

Proving Termination by Bounded Increase

Proving Termination by Bounded Increase Proving Termination by Bounded Increase Jürgen Giesl, René Thiemann, Stephan Swiderski, and Peter Schneider-Kamp LuFG Informatik, RWTH Aachen, Germany, {giesl,thiemann,swiderski,psk}@informatik.rwth-aachen.de

More information

Chapter 2. Unification. Foundations of Logic Programming

Chapter 2. Unification. Foundations of Logic Programming Chapter 2 1 Outline Understanding the need for unification Defining alphabets, terms, and substitutions Introducing the Martelli-Montanari Algorithm for unification Proving correctness of the algorithm

More information

Generalized and Formalized Uncurrying

Generalized and Formalized Uncurrying Generalized and Formalized Uncurrying Christian Sternagel and René Thiemann Institute of Computer Science, University of Innsbruck, Austria {christian.sternagel rene.thiemann}@uibk.ac.at Abstract Uncurrying

More information

Nominal Completion for Rewrite Systems with Binders

Nominal Completion for Rewrite Systems with Binders Nominal Completion for Rewrite Systems with Binders Maribel Fernández King s College London July 2012 Joint work with Albert Rubio Summary Motivations Nominal Rewriting Closed nominal rules Confluence

More information

Superposition for Fixed Domains. Matthias Horbach and Christoph Weidenbach

Superposition for Fixed Domains. Matthias Horbach and Christoph Weidenbach Superposition for Fixed Domains Matthias Horbach and Christoph Weidenbach MPI I 2009 RG1 005 Oct. 2009 Authors Addresses Matthias Horbach and Christoph Weidenbach Max Planck Institute for Informatics Campus

More information

Chapter 8. Exploring Polynomial Functions. Jennifer Huss

Chapter 8. Exploring Polynomial Functions. Jennifer Huss Chapter 8 Exploring Polynomial Functions Jennifer Huss 8-1 Polynomial Functions The degree of a polynomial is determined by the greatest exponent when there is only one variable (x) in the polynomial Polynomial

More information

Innermost Reductions Find All Normal Forms on Right-Linear Terminating Overlay TRSs

Innermost Reductions Find All Normal Forms on Right-Linear Terminating Overlay TRSs Innermost Reductions Find All Normal Forms on Right-Linear Terminating Overlay TRSs Masahiko Sakai,Kouji Okamoto,Toshiki Sakabe Graduate School of Information Science, Nagoya University, Furo-cho, Chikusa-ku,

More information

Non- -overlappings TRSs are UN. Stefan Kahrs and Connor Smith University of Kent

Non- -overlappings TRSs are UN. Stefan Kahrs and Connor Smith University of Kent Non- -overlappings TRSs are UN Stefan Kahrs and Connor Smith University of Kent This is about: When is the equational theory of a TRS consistent (CON), when does it have unique normal forms (UN), How can

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

Löwenheim-Skolem Theorems, Countable Approximations, and L ω. David W. Kueker (Lecture Notes, Fall 2007)

Löwenheim-Skolem Theorems, Countable Approximations, and L ω. David W. Kueker (Lecture Notes, Fall 2007) Löwenheim-Skolem Theorems, Countable Approximations, and L ω 0. Introduction David W. Kueker (Lecture Notes, Fall 2007) In its simplest form the Löwenheim-Skolem Theorem for L ω1 ω states that if σ L ω1

More information

Kreisel s Conjecture with minimality principle

Kreisel s Conjecture with minimality principle Kreisel s Conjecture with minimality principle Pavel Hrubeš November 9, 2008 Abstract We prove that Kreisel s Conjecture is true, if Peano arithmetic is axiomatised using minimality principle and axioms

More information

Deciding Confluence of Certain Term Rewriting Systems in Polynomial Time

Deciding Confluence of Certain Term Rewriting Systems in Polynomial Time Deciding Confluence of Certain Term Rewriting Systems in Polynomial Time Ashish Tiwari SRI International 333 Ravenswood Ave Menlo Park, CA, U.S.A tiwari@csl.sri.com Abstract We present a polynomial time

More information

A Semantic Criterion for Proving Infeasibility in Conditional Rewriting

A Semantic Criterion for Proving Infeasibility in Conditional Rewriting A Semantic Criterion for Proving Infeasibility in Conditional Rewriting Salvador Lucas and Raúl Gutiérrez DSIC, Universitat Politècnica de València, Spain 1 Introduction In the literature about confluence

More information

Termination of LCTRSs

Termination of LCTRSs Termination of LCTRSs Cynthia Kop 1 1 Department of Computer Science, University of Innsbruck Technikerstraße 21a, 6020 Innsbruck, Austria Cynthia.Kop@uibk.ac.at Abstract Logically Constrained Term Rewriting

More information

Termination of String Rewriting Proved Automatically

Termination of String Rewriting Proved Automatically Termination of String Rewriting Proved Automatically H. Zantema (h.zantema@tue.nl) Department of Computer Science, TU Eindhoven P.O. Box 513, 5600 MB, Eindhoven, The Netherlands Abstract. In this paper

More information

SAT Solving for Argument Filterings

SAT Solving for Argument Filterings SAT Solving for Argument Filterings Michael Codish 1, Peter Schneider Kamp 2, Vitaly Lagoon 3, René Thiemann 2, and Jürgen Giesl 2 1 Dept. of Computer Science, Ben-Gurion University, Israel, mcodish@cs.bgu.ac.il

More information

Abstract. We introduce a new technique for proving termination of. term rewriting systems. The technique, a specialization of Zantema's

Abstract. We introduce a new technique for proving termination of. term rewriting systems. The technique, a specialization of Zantema's Transforming Termination by Self-Labelling Aart Middeldorp, Hitoshi Ohsaki, Hans Zantema 2 Instite of Information Sciences and Electronics University of Tsukuba, Tsukuba 05, Japan 2 Department of Comper

More information

Polynomial Interpretations with Nega Coefficients. Lecture Notes in Computer Science,

Polynomial Interpretations with Nega Coefficients. Lecture Notes in Computer Science, JAIST Reposi https://dspace.j Title Polynomial Interpretations with Nega Coefficients Author(s)Hirokawa, Nao; Middeldorp, Aart Citation Lecture Notes in Computer Science, 3 185-198 Issue Date 2004 Type

More information

On tree automata that certify termination of left-linear term rewriting systems

On tree automata that certify termination of left-linear term rewriting systems Information and Computation 205 (2007) 512 534 www.elsevier.com/locate/ic On tree automata that certify termination of left-linear term rewriting systems Alfons Geser a, *, Dieter Hofbauer b Johannes Waldmann

More information

Denotational semantics: proofs

Denotational semantics: proofs APPENDIX A Denotational semantics: proofs We show that every closed term M has a computable functional [[M ] as its denotation. A.1. Unification We show that for any two constructor terms one can decide

More information

Integrating Linear Arithmetic into Superposition Calculus

Integrating Linear Arithmetic into Superposition Calculus Integrating Linear Arithmetic into Superposition Calculus Konstantin Korovin and Andrei Voronkov The University of Manchester {korovin voronkov}@cs.man.ac.uk Abstract. We present a method of integrating

More information

Math 110 Midterm 1 Study Guide October 14, 2013

Math 110 Midterm 1 Study Guide October 14, 2013 Name: For more practice exercises, do the study set problems in sections: 3.4 3.7, 4.1, and 4.2. 1. Find the domain of f, and express the solution in interval notation. (a) f(x) = x 6 D = (, ) or D = R

More information

Continuity. Chapter 4

Continuity. Chapter 4 Chapter 4 Continuity Throughout this chapter D is a nonempty subset of the real numbers. We recall the definition of a function. Definition 4.1. A function from D into R, denoted f : D R, is a subset of

More information

Course 212: Academic Year Section 1: Metric Spaces

Course 212: Academic Year Section 1: Metric Spaces Course 212: Academic Year 1991-2 Section 1: Metric Spaces D. R. Wilkins Contents 1 Metric Spaces 3 1.1 Distance Functions and Metric Spaces............. 3 1.2 Convergence and Continuity in Metric Spaces.........

More information

First Order Logic (FOL) 1 znj/dm2017

First Order Logic (FOL) 1   znj/dm2017 First Order Logic (FOL) 1 http://lcs.ios.ac.cn/ znj/dm2017 Naijun Zhan March 19, 2017 1 Special thanks to Profs Hanpin Wang (PKU) and Lijun Zhang (ISCAS) for their courtesy of the slides on this course.

More information

Rewriting, Explicit Substitutions and Normalisation

Rewriting, Explicit Substitutions and Normalisation Rewriting, Explicit Substitutions and Normalisation XXXVI Escola de Verão do MAT Universidade de Brasilia Part 1/3 Eduardo Bonelli LIFIA (Fac. de Informática, UNLP, Arg.) and CONICET eduardo@lifia.info.unlp.edu.ar

More information

First-Order Logic. Resolution

First-Order Logic. Resolution First-Order Logic Resolution 1 Resolution for predicate logic Gilmore s algorithm is correct and complete, but useless in practice. We upgrade resolution to make it work for predicate logic. 2 Recall:

More information

Techniques de réécriture et transformations

Techniques de réécriture et transformations Techniques de réécriture et transformations Horatiu CIRSTEA, Pierre-Etienne MOREAU Session 2008/2009 Horatiu CIRSTEA, Pierre-Etienne MOREAU Techniques de réécriture et transformations Session 2008/2009

More information

Maximal Termination. 1 Introduction. Carsten Fuhs 1, Jürgen Giesl 1, Aart Middeldorp 2, Peter Schneider-Kamp 1, René Thiemann 2, and Harald Zankl 2

Maximal Termination. 1 Introduction. Carsten Fuhs 1, Jürgen Giesl 1, Aart Middeldorp 2, Peter Schneider-Kamp 1, René Thiemann 2, and Harald Zankl 2 Maximal Termination Carsten Fuhs 1, Jürgen Giesl 1, Aart Middeldorp 2, Peter Schneider-Kamp 1, René Thiemann 2, and Harald Zankl 2 1 LuFG Informatik 2, RWTH Aachen University, Germany 2 Institute of Computer

More information

A strongly rigid binary relation

A strongly rigid binary relation A strongly rigid binary relation Anne Fearnley 8 November 1994 Abstract A binary relation ρ on a set U is strongly rigid if every universal algebra on U such that ρ is a subuniverse of its square is trivial.

More information

TERESE LITE. Excerpts from the book TERM REWRITING SYSTEMS by Terese

TERESE LITE. Excerpts from the book TERM REWRITING SYSTEMS by Terese TERESE LITE Excerpts from the book TERM REWRITING SYSTEMS by Terese For exclusive use with the course Term Rewriting Systems at the Vrije Universiteit, fall 2006. Do not copy or distribute. Contents Preface

More information

Immerse Metric Space Homework

Immerse Metric Space Homework Immerse Metric Space Homework (Exercises -2). In R n, define d(x, y) = x y +... + x n y n. Show that d is a metric that induces the usual topology. Sketch the basis elements when n = 2. Solution: Steps

More information

CS156: The Calculus of Computation

CS156: The Calculus of Computation Page 1 of 37 CS156: The Calculus of Computation Zohar Manna Winter 2010 Chapter 4: Induction Page 2 of 37 Induction Stepwise induction (for T PA, T cons ) Complete induction (for T PA, T cons ) Theoretically

More information

Between proof theory and model theory Three traditions in logic: Syntactic (formal deduction)

Between proof theory and model theory Three traditions in logic: Syntactic (formal deduction) Overview Between proof theory and model theory Three traditions in logic: Syntactic (formal deduction) Jeremy Avigad Department of Philosophy Carnegie Mellon University avigad@cmu.edu http://andrew.cmu.edu/

More information

Applications of Regular Algebra to Language Theory Problems. Roland Backhouse February 2001

Applications of Regular Algebra to Language Theory Problems. Roland Backhouse February 2001 1 Applications of Regular Algebra to Language Theory Problems Roland Backhouse February 2001 Introduction 2 Examples: Path-finding problems. Membership problem for context-free languages. Error repair.

More information

, g : x x 6, Sketch, in a single diagram, the graphs of y = f(x) and y = f -1 (x), making clear the

, g : x x 6, Sketch, in a single diagram, the graphs of y = f(x) and y = f -1 (x), making clear the PAST QUESTION ON FUNCTIONS 1. Express x + 4x in the form (x + a) + b, stating the numerical values of a and b. The functions f and g are defined as follows : f : x x 4x, x, g : x x 6, x R (ii) (iii) Show

More information

October 12, Complexity and Absoluteness in L ω1,ω. John T. Baldwin. Measuring complexity. Complexity of. concepts. to first order.

October 12, Complexity and Absoluteness in L ω1,ω. John T. Baldwin. Measuring complexity. Complexity of. concepts. to first order. October 12, 2010 Sacks Dicta... the central notions of model theory are absolute absoluteness, unlike cardinality, is a logical concept. That is why model theory does not founder on that rock of undecidability,

More information

COMP 409: Logic Homework 5

COMP 409: Logic Homework 5 COMP 409: Logic Homework 5 Note: The pages below refer to the text from the book by Enderton. 1. Exercises 1-6 on p. 78. 1. Translate into this language the English sentences listed below. If the English

More information

Static Problem Set 2 Solutions

Static Problem Set 2 Solutions Static Problem Set Solutions Jonathan Kreamer July, 0 Question (i) Let g, h be two concave functions. Is f = g + h a concave function? Prove it. Yes. Proof: Consider any two points x, x and α [0, ]. Let

More information

every symbol we can dene inside which of its arguments reduction is allowed or not. This kind of rewriting is called context-sensitive rewriting. It i

every symbol we can dene inside which of its arguments reduction is allowed or not. This kind of rewriting is called context-sensitive rewriting. It i Termination of context-sensitive rewriting H. Zantema Utrecht University, Department of Computer Science, P.O. box 80.089, 3508 TB Utrecht, The Netherlands e-mail: hansz@cs.ruu.nl Abstract Context-sensitive

More information

Order-Sorted Equality Enrichments Modulo Axioms

Order-Sorted Equality Enrichments Modulo Axioms Order-Sorted Equality Enrichments Modulo Axioms Raúl Gutiérrez, José Meseguer, and Camilo Rocha Department of Computer Science University of Illinois at Urbana-Champaign 201 N. Goodwin Ave., Urbana, IL

More information

Homework #5 Solutions

Homework #5 Solutions Homework #5 Solutions p 83, #16. In order to find a chain a 1 a 2 a n of subgroups of Z 240 with n as large as possible, we start at the top with a n = 1 so that a n = Z 240. In general, given a i we will

More information

Formal Methods for Java

Formal Methods for Java Formal Methods for Java Lecture 12: Soundness of Sequent Calculus Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg June 12, 2017 Jochen Hoenicke (Software Engineering) Formal Methods

More information

On the Complexity of the Reflected Logic of Proofs

On the Complexity of the Reflected Logic of Proofs On the Complexity of the Reflected Logic of Proofs Nikolai V. Krupski Department of Math. Logic and the Theory of Algorithms, Faculty of Mechanics and Mathematics, Moscow State University, Moscow 119899,

More information

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008 WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008 WHAT I LL TALK ABOUT Propositional Logic Terminology, Satisfiability, Decision Procedure First-Order Logic Terminology, Background Theories Satisfiability

More information

A Dependency Pair Framework for A C-Termination

A Dependency Pair Framework for A C-Termination A Dependency Pair Framework for A C-Termination Beatriz Alarcón Raúl Gutiérrez Salvador Lucas José Meseguer* DSIC, Universidad Politécnica de Valencia Camino de Vera s/n, E-46022 Valencia, Spain {balarcon,rgutierrez,slucas}@dsic.upv.es

More information

One Context Unification Problems Solvable in Polynomial Time

One Context Unification Problems Solvable in Polynomial Time One Context Unification Problems Solvable in Polynomial Time Adrià Gascón and Ashish Tiwari SRI International, Menlo Park, USA adriagascon@gmailcom, tiwari@cslsricom Manfred Schmidt-Schauss Goethe-Universität,

More information

Real Analysis. Joe Patten August 12, 2018

Real Analysis. Joe Patten August 12, 2018 Real Analysis Joe Patten August 12, 2018 1 Relations and Functions 1.1 Relations A (binary) relation, R, from set A to set B is a subset of A B. Since R is a subset of A B, it is a set of ordered pairs.

More information

ON FIRST-ORDER CONS-FREE TERM REWRITING AND PTIME

ON FIRST-ORDER CONS-FREE TERM REWRITING AND PTIME ON FIRST-ORDER CONS-FREE TERM REWRITING AND PTIME CYNTHIA KOP Department of Computer Science, Copenhagen University e-mail address: kop@diku.dk Abstract. In this paper, we prove that (first-order) cons-free

More information

KBO Orientability. Harald Zankl Nao Hirokawa Aart Middeldorp. Japan Advanced Institute of Science and Technology University of Innsbruck

KBO Orientability. Harald Zankl Nao Hirokawa Aart Middeldorp. Japan Advanced Institute of Science and Technology University of Innsbruck KBO Orientability Harald Zankl Nao Hirokawa Aart Middeldorp Japan Advanced Institute of Science and Technology University of Innsbruck KBO Orientability 1/32 Reference JAR 2009 Harald Zankl, Nao Hirokawa,

More information

Automated Complexity Analysis Based on the Dependency Pair Method

Automated Complexity Analysis Based on the Dependency Pair Method Automated Complexity Analysis Based on the Dependency Pair Method Nao Hirokawa 1 and Georg Moser 2 1 School of Information Science, Japan Advanced Institute of Science and Technology, Japan, hirokawa@jaist.ac.jp

More information

x x 1 x 2 + x 2 1 > 0. HW5. Text defines:

x x 1 x 2 + x 2 1 > 0. HW5. Text defines: Lecture 15: Last time: MVT. Special case: Rolle s Theorem (when f(a) = f(b)). Recall: Defn: Let f be defined on an interval I. f is increasing (or strictly increasing) if whenever x 1, x 2 I and x 2 >

More information

On Proving Operational Termination Incrementally with Modular Conditional Dependency Pairs

On Proving Operational Termination Incrementally with Modular Conditional Dependency Pairs On Proving Operational Termination Incrementally with Modular Conditional Dependency Pairs Masaki Nakamura, Kazuhiro Ogata and Kokichi Futatsugi Abstract OBJ algebraic specification languages support semi-automated

More information

Reachability Analysis with State-Compatible Automata

Reachability Analysis with State-Compatible Automata Reachability nalysis with State-Compatible utomata Bertram Felgenhauer and René Thiemann Institute of Computer Science, University of Innsbruck, Innsbruck, ustria {bertram.felgenhauer,rene.thiemann}@uibk.ac.at

More information

NOTES ON CONGRUENCE n-permutability AND SEMIDISTRIBUTIVITY

NOTES ON CONGRUENCE n-permutability AND SEMIDISTRIBUTIVITY NOTES ON CONGRUENCE n-permutability AND SEMIDISTRIBUTIVITY RALPH FREESE Abstract. In [1] T. Dent, K. Kearnes and Á. Szendrei define the derivative, Σ, of a set of equations Σ and show, for idempotent Σ,

More information

TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER

TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER Logical Methods in Computer Science Vol. 12(2:8)2016, pp. 1 31 www.lmcs-online.org Submitted Nov. 2, 2015 Published Jun. 23, 2016 TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER WITOLD CHARATONIK AND

More information

POLYNOMIAL INTERPRETATIONS OVER THE NATURAL, RATIONAL AND REAL NUMBERS REVISITED

POLYNOMIAL INTERPRETATIONS OVER THE NATURAL, RATIONAL AND REAL NUMBERS REVISITED Logical Methods in Computer Science Vol. 10(3:22)2014, pp. 1 28 www.lmcs-online.org Submitted Oct. 27, 2010 Published Sep. 18, 2014 POLYNOMIAL INTERPRETATIONS OVER THE NATURAL, RATIONAL AND REAL NUMBERS

More information

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P. First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable

More information

A GUIDE FOR MORTALS TO TAME CONGRUENCE THEORY

A GUIDE FOR MORTALS TO TAME CONGRUENCE THEORY A GUIDE FOR MORTALS TO TAME CONGRUENCE THEORY Tame congruence theory is not an easy subject and it takes a considerable amount of effort to understand it. When I started this project, I believed that this

More information

1 Strict local optimality in unconstrained optimization

1 Strict local optimality in unconstrained optimization ORF 53 Lecture 14 Spring 016, Princeton University Instructor: A.A. Ahmadi Scribe: G. Hall Thursday, April 14, 016 When in doubt on the accuracy of these notes, please cross check with the instructor s

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 1 Course Web Page www3.cs.stonybrook.edu/ cse303 The webpage contains: lectures notes slides; very detailed solutions to

More information

First-Order Formative Rules

First-Order Formative Rules First-Order Formative Rules Carsten Fuhs 1 and Cynthia Kop 2 1 University College London, Dept. of Computer Science, London WC1E 6BT, UK 2 University of Innsbruck, Institute of Computer Science, 6020 Innsbruck,

More information

Modularity of Confluence: A Simplified Proof

Modularity of Confluence: A Simplified Proof 1 Modularity of Confluence: A Simplified Proof Jan Willem Klop 1,2,5,6 Aart Middeldorp 3,5 Yoshihito Toyama 4,7 Roel de Vrijer 2 1 Department of Software Technology CWI, Kruislaan 413, 1098 SJ Amsterdam

More information

06 Recursive Definition and Inductive Proof

06 Recursive Definition and Inductive Proof CAS 701 Fall 2002 06 Recursive Definition and Inductive Proof Instructor: W. M. Farmer Revised: 30 November 2002 1 What is Recursion? Recursion is a method of defining a structure or operation in terms

More information

Learnability of Term Rewrite Systems from Positive Examples

Learnability of Term Rewrite Systems from Positive Examples Learnability of Term Rewrite Systems from Positive Examples M.R.K. Krishna Rao Information and Computer Science Department King Fahd University of Petroleum and Minerals, Dhahran 31261, Saudi Arabia. Email:

More information

Infinite and Finite Model Theory Part II

Infinite and Finite Model Theory Part II Infinite and Finite Model Theory Part II Anuj Dawar Computer Laboratory University of Cambridge Lent 2002 3/2002 0 Finite Model Theory Finite Model Theory motivated by computational issues; relationship

More information

Termination Proofs in the Dependency Pair Framework May Induce Multiple Recursive Derivational Complexity

Termination Proofs in the Dependency Pair Framework May Induce Multiple Recursive Derivational Complexity Termination Proofs in the Dependency Pair Framework May Induce Multiple Recursive Derivational Complexity Georg Moser 1 and Andreas Schnabl 1 1 Institute of Computer Science University of Innsbruck, Austria

More information

Data-Oblivious Stream Productivity

Data-Oblivious Stream Productivity Jörg Endrullis Clemens Grabmayer Dimitri Hendriks Vrije Universiteit Amsterdam Universiteit Utrecht Vrije Universiteit Amsterdam The Netherlands LPAR 2008, Doha, Qatar 23 27 Nov Overview streams, specifying

More information

Proving and Disproving Termination of Higher-Order Functions

Proving and Disproving Termination of Higher-Order Functions Proving and Disproving Termination of Higher-Order Functions Jürgen Giesl, René Thiemann, Peter Schneider-Kamp LuFG Informatik II, RWTH Aachen, Ahornstr. 55, 52074 Aachen, Germany {giesl thiemann psk}@informatik.rwth-aachen.de

More information

Primitive recursive functions: decidability problems

Primitive recursive functions: decidability problems Primitive recursive functions: decidability problems Armando B. Matos October 24, 2014 Abstract Although every primitive recursive (PR) function is total, many problems related to PR functions are undecidable.

More information

HORSes: format, termination and confluence

HORSes: format, termination and confluence HORSes: format, termination and confluence Jean-Pierre Jouannaud INRIA-LIAMA and singhua Software Chair Joint on-going work with Jianqi Li School of Software, singhua University Project CoqLF NList Cross-discipline

More information

Outline. Complexity Theory. Introduction. What is abduction? Motivation. Reference VU , SS Logic-Based Abduction

Outline. Complexity Theory. Introduction. What is abduction? Motivation. Reference VU , SS Logic-Based Abduction Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 7. Logic-Based Abduction Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien

More information

One Context Unification Problems Solvable in Polynomial Time

One Context Unification Problems Solvable in Polynomial Time One Context Unification Problems Solvable in Polynomial Time Adrià Gascón and Ashish Tiwari SRI International, Menlo Park, USA Manfred Schmidt-Schauss Goethe-Universität, Frankfurt, Germany Abstract One

More information

Mechanically proving termination using polynomial interpretations

Mechanically proving termination using polynomial interpretations Mechanically proving termination using polynomial interpretations Evelyne Contejean Claude Marché Xavier Urbain PCRI LRI (CNRS UMR 8623) & INRIA Futurs Bât. 490, Université Paris-Sud, Centre d Orsay 91405

More information

Lecture 1. (i,j) N 2 kx i y j, and this makes k[x, y]

Lecture 1. (i,j) N 2 kx i y j, and this makes k[x, y] Lecture 1 1. Polynomial Rings, Gröbner Bases Definition 1.1. Let R be a ring, G an abelian semigroup, and R = i G R i a direct sum decomposition of abelian groups. R is graded (G-graded) if R i R j R i+j

More information

4 Predicate / First Order Logic

4 Predicate / First Order Logic 4 Predicate / First Order Logic 4.1 Syntax 4.2 Substitutions 4.3 Semantics 4.4 Equivalence and Normal Forms 4.5 Unification 4.6 Proof Procedures 4.7 Implementation of Proof Procedures 4.8 Properties First

More information

3.17 Semantic Tableaux for First-Order Logic

3.17 Semantic Tableaux for First-Order Logic 3.17 Semantic Tableaux for First-Order Logic There are two ways to extend the tableau calculus to quantified formulas: using ground instantiation using free variables Tableaux with Ground Instantiation

More information

1 FUNCTIONS _ 5 _ 1.0 RELATIONS

1 FUNCTIONS _ 5 _ 1.0 RELATIONS 1 FUNCTIONS 1.0 RELATIONS Notes : (i) Four types of relations : one-to-one many-to-one one-to-many many-to-many. (ii) Three ways to represent relations : arrowed diagram set of ordered pairs graph. (iii)

More information

VAUGHT S THEOREM: THE FINITE SPECTRUM OF COMPLETE THEORIES IN ℵ 0. Contents

VAUGHT S THEOREM: THE FINITE SPECTRUM OF COMPLETE THEORIES IN ℵ 0. Contents VAUGHT S THEOREM: THE FINITE SPECTRUM OF COMPLETE THEORIES IN ℵ 0 BENJAMIN LEDEAUX Abstract. This expository paper introduces model theory with a focus on countable models of complete theories. Vaught

More information

Solutions to Homework Problems

Solutions to Homework Problems Solutions to Homework Problems November 11, 2017 1 Problems II: Sets and Functions (Page 117-118) 11. Give a proof or a counterexample of the following statements: (vi) x R, y R, xy 0; (x) ( x R, y R,

More information