Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network

  Advanced Search  

Verifying Haskell Programs Using Constructive Type Theory

Summary: Verifying Haskell Programs
Using Constructive Type Theory
Andreas Abel Marcin Benke Ana Bove John Hughes
Ulf Norell
Haskell Workshop, 2005
1 Example: Queues
A Specification of Queues
∑ A queue is simply a list.
type Queue a = [a]
empty = []
add x q = q ++ [x]
isEmpty q = null q
front (x:q) = x
remove (x:q) = q
∑ Enqueueing has linear time complexity.
∑ Implementation should have amortized constant time operations.
An Implementation of Queues
∑ A queue consists of a front list and a reversed back list.
type QueueI a = ([a],[a])
retrieve :: QueueI a -> Queue a


Source: Abel, Andreas - Theoretische Informatik, Ludwig-Maximilians-Universit√§t M√ľnchen


Collections: Computer Technologies and Information Sciences