Pattern Matching with Dependent Types

For a more complete presentation of Martin-Lof's logical framework, which is implemented in ALF, we refer to the book \Programming in Martin-Lof's Type Theory" [16], chapter 19 and 20. We recall that each type T is of the form (x1 : A1; : : : ; xn : An)A where A is Set or of the form El(a): If A is of the form El(a); we say that T is an small type, and it is a large type otherwise if A is Set: If a type of a term is of the form (x1 : A1; : : : ; xn : An)A; we say that n is the arity of this term. An instance of a term u of arity n is a term de nitionally equal to a term of the form u(v1; : : : ; vn):