

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Note: Answers to the exercises listed below should be handed to the instructor in hardcopy and in typewritten form (latex formatting preferred) by the deadline mentioned above. You should also email to ([email protected]) the Maude code for the exercises requiring that.
(fmod LIST is sort List. ops a b c nil : -> List [ctor]. op append : List List -> List [ctor]. vars L P Q : List. eq append(append(L, P), Q) = append(L, append(P, Q)). eq append(L, nil) = L. eq append(nil, L) = L. endfm)
In Homework 4 you were asked to use the Maude Church-Rosser Checker to establish the local confluence of this module (which with termination implies confluence). But can you do it yourself? That is: you are asked to:
fmod LIST-of-NAT is protecting NAT. sort List. subsort Nat < List. op nil : -> List [ctor]. op ; : List List -> List [ctor assoc]. op length : List -> Nat. var N : Nat. var L : List. eq nil ; L = L. eq L ; nil = L.
eq length(nil) = 0. eq length(N) = 1. eq length(N ; L) = 1 + length(L). endfm
use the ITP to prove the following theorem:
(goal listlength : LIST-of-NAT |- A{L:List ; L’:List} ((length(L ; L’)) = (length(L) + length(L’))) .)
Note: You can retrieve both the module and the goal from the course web page.