Term Rewriting Systems SS 11 Exercise Sheet 6 (due June 3rd, 2011) aa
Prof. Dr. Jürgen Giesl Marc Brockschmidt, Carsten Fuhs, Thomas Ströder
Notes:
• Please solve these exercises ingroups of two!
• The solutions must be handed in directly before (very latest: at the beginning of)the exercise course onFriday, June 3rd, 2011, in lecture hallAH 2. Alternatively you can drop your solutions into a box which is located right next to Prof. Giesl’s office (until the exercise course starts).
• Please write thenamesandimmatriculation numbersof all (two) students on your solution. Please staple the individual sheets!
Exercise 1 (Reduction and Simplification Orders): (2 + 8 = 10 points)
a) The following TRSRis terminating. Please show that there is no simplification order by which termination ofRcan be proved, i.e., for every simplification orderwe have→R*.
minus(x ,O) → x minus(s(x),s(O)) → x
minus(s(s(x)),s(s(y))) → minus(s(p(s(x))),s(p(s(y)))) p(s(x)) → x
b) Please prove or disprove the following propositions. Here,Bdenotes the subterm relation.
i For every well-founded relationwe have that ∪Bis well-founded.
ii For every reduction orderwe have that ∪Bis well-founded.
iii For every reduction orderwe have that ∪Bis a reduction order.
iv For every reduction orderwe have that ∪ emb is well-founded.
v Let be a stable and irreflexive relation withB⊆ . Then for every two termss andt with st we haveV(t)⊆ V(s).
Hints:
• You may use the previous exercise part.
Exercise 2 (Kruskal’s theorem): (2 points)
Consider the real numberπ= 3.14159. . ., describing the ratio of a circle’s circumference to its diameter. We use πn to denote the n-th digit ofπ, i.e.π=π1.π2π3. . ., whereπ1= 3,π2= 1 andπ3= 4. For two sequences of digitss =s1, . . . , sn and t=t1, . . . , tm withsi, ti ∈ {0, . . . ,9}, we calls a subsequence oft if for all 1≤i ≤n there is aki∈ {1, . . . , m}such thatsi=tki andki< kj for alli < j. For example,45is a subsequence of14159.
Use Kruskal’s theorem to show that for eachk≥1, there aren, mwithk ≤n < msuch thatπnπn+1. . . π2nis a subsequence ofπmπm+1. . . π2m.
1
Term Rewriting Systems SS 11 Exercise Sheet 6 (due June 3rd, 2011)
Exercise 3 (Termination Proofs with Simplification Orders): (1 + 2 + 3 = 6 points)
Please prove termination of the following TRSs using the embedding order. If this is not possible, use the LPO instead and explicitly state the precedence you are using. In this exercise, x, y, and z denote variables while all other identifiers denote function symbols.
To prove that for two terms t1 and t2 we have t1 emb t2 or t1 lpo t2, use a proof tree notation to indi- cate which case of the definition ofemb orlpo you are using. This is illustrated by the following example where we havet1=f(s(x),O), t2=f(x ,s(O)), andt1lpo t2:
Choose fAsAO. Then we have
xlpo x = s(x)lpo x 1
O lpo O = f(s(x),O)lpo O 1 f(s(x),O)lpos(O) 2 f(s(x),O)lpof(x ,s(O)) 3 a)
element(Cons(x , y)) → x
element(Cons(x , y)) → element(y)
b)
rev(rev(x)) → x rev(x) → r(x ,Nil) r(Nil, y) → y
r(Cons(x , z), y) → r(z ,Cons(x , y)))
c)
Dx(var(x)) → s(O) Dx(const(x)) → O
Dx(plus(x , y)) → plus(Dx(x),Dx(y))
Dx(times(x , y)) → plus(times(y ,Dx(x)),times(x ,Dx(y)))
2