src/ZF/UNITY/ListPlus.thy
author kleing
Mon, 12 May 2003 15:07:11 +0200
changeset 14014 f3f16f9f2030
parent 12197 d9320fb0a570
permissions -rw-r--r--
done

(*  Title:      ZF/UNITY/ListPlus.thy
    ID:         $Id$
    Author:     Sidi O Ehmety, Cambridge University Computer Laboratory
    Copyright   2001  University of Cambridge

More about lists

*)

ListPlus = NatPlus + 

constdefs
(* Function `take' returns the first n elements of a list *)
  take     :: [i,i]=>i
  "take(n, as) == list_rec(lam n:nat. [],
		%a l r. lam n:nat. nat_case([], %m. Cons(a, r`m), n), as)`n"
  
(* Function `nth' returns the (n+1)th element in a list (not defined at Nil) *)
  
  nth :: [i, i]=>i
  "nth(n, as) == list_rec(lam n:nat. 0,
		%a l r. lam n:nat. nat_case(a, %m. r`m, n), as)`n"

end