diff --git a/BUGS b/BUGS
new file mode 100644
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,27 @@
+* Pattern matching RHS doesn't deal with bindings properly (if there
+  are names bound on the RHS, anything could happen...)
+* Higher order recursive datatypes do not have induction hypothesis
+  generated for the higher order arguments.
+* Non-termination if trying to parse an expression with no closing bracket.
+* Tactics should know what level they operate at; currently we need to
+  allow escapes at the top level in the typechecker as a hack, and
+  trust people to get it right.
+* intro should check that the name it is introducing is not the name of
+  another goal, or we get confused.
+* Resuming an incomplete proof (e.g. created by suspend or axiomatise)
+  resumes it in the current global context, not the context at the
+  point when it was suspended. So if you're sneaky, you can make a
+  non-terminating definition this way.
+  Workaround: Please don't do that.
+* Refine tactic adds as many claims as possible, rather than adding
+  claims for one argument at a time then attempting to unify.
+  Workaround: Use intros before refining. You might then need to solve
+  some of the arguments explicitly.
+* No check for strict positivity.
+  Workaround: Don't use non positive types :).
+
+Recently fixed:
+
+* If a datatype has a placeholder in its indices, the value should
+  be inferred (i.e. it should be checked) otherwise we can't make a pattern
+  properly (and we'll certainly need this for optimisation).
diff --git a/INSTALL b/INSTALL
new file mode 100644
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,14 @@
+Requirements:
+   GHC version >= 6.4, 
+   happy
+
+To build and install:
+
+1. Edit the DB and PREFIX variables in the Makefile; DB should be
+   --user to install for a single user, or --global to install for all
+   users. PREFIX should point to the installation directory.
+2. Enter the following:
+   make
+   make install
+3. [optional] To build and install the driver/shell, enter the following:
+   make jones_install
diff --git a/IOvor/IOPrims.lhs b/IOvor/IOPrims.lhs
new file mode 100644
--- /dev/null
+++ b/IOvor/IOPrims.lhs
@@ -0,0 +1,69 @@
+> module IOPrims where
+
+> import System.IO
+> import System.IO.Unsafe
+> import Data.Typeable
+> import Debug.Trace
+
+> import Ivor.Primitives
+> import Ivor.TT
+
+IO primitives; adds 'RealWorld' and 'Handle'
+
+RealWorld is a dummy type representing the world state, Handle (from 
+System.IO) gives file handles.
+
+> data RealWorld = RW ()
+>    deriving Eq
+
+> instance Show RealWorld where
+>     show _ = "<<World>>"
+
+> rwName = name "RealWorld"
+
+> instance Typeable RealWorld where
+>     typeOf (RW ()) = mkTyConApp (mkTyCon "RW") []
+
+> instance ViewConst RealWorld where
+>     typeof x = rwName
+
+> instance ViewConst Handle where
+>     typeof x = (name "Handle")
+
+> addIOPrimTypes :: Monad m => Context -> m Context
+> addIOPrimTypes c = do c <- addPrimitives c
+>                       c <- addPrimitive c rwName
+>                       c <- addPrimitive c (name "Handle")
+>                       c <- addExternalFn c (name "initWorld") 1 initWorld
+>                              "True -> RealWorld"
+>                       return c
+
+> addIOPrimFns :: Monad m => Context -> m Context
+> addIOPrimFns c = do c <- addBinFn c (name "putStr") doPutStr
+>                             "String -> (IO True)"
+>                     c <- addPrimFn c (name "getLine") doGetLine
+>                             "(IO String)"
+>                     return c
+
+Make an instance of IOResult from the result of an IO action and a 
+value
+
+> mkIO :: () -> ViewTerm -> ViewTerm
+> mkIO t v = case (t,v) of -- make sure they get evaluated
+>               (tr,val) -> apply (Name DataCon (name "ioResult"))
+>                             [Placeholder, Constant (RW tr), val]
+
+> trueVal = Name DataCon (name "II")
+
+> {-# NOINLINE doPutStr #-}
+> doPutStr :: String -> RealWorld -> ViewTerm
+> doPutStr str w = mkIO () trueVal -- (unsafePerformIO (putStr str)) trueVal
+
+> {-# NOINLINE doGetLine #-}
+> doGetLine :: RealWorld -> ViewTerm
+> doGetLine w = mkIO () (Constant "foo") -- (unsafePerformIO getLine))
+
+Needs a dummy argument so that evaluator doesn't loop
+
+> initWorld :: [ViewTerm] -> ViewTerm
+> initWorld [_] = Constant (RW ())
diff --git a/IOvor/Main.lhs b/IOvor/Main.lhs
new file mode 100644
--- /dev/null
+++ b/IOvor/Main.lhs
@@ -0,0 +1,25 @@
+> module Main where
+
+Jones the Steam, with IO primitives.
+Simple program for starting up an interactive shell with Ivor library.
+
+> import Ivor.TT
+> import Ivor.Shell
+> import Ivor.Primitives
+
+> import IOPrims
+
+> main :: IO ()
+> main = do let shell = addModulePath (newShell emptyContext) 
+>                          (prefix ++ "/lib/ivor")
+>           shell <- importFile "basics.tt" shell
+>           primCtxt <- addIOPrimTypes (getContext shell)
+>           let shell' = addModulePath (newShell primCtxt) 
+>                          (prefix ++ "/lib/ivor")
+>           shell' <- importFile "iobasics.tt" shell'
+>           primFnCtxt <- addIOPrimFns (getContext shell')
+>           -- It is horrible to have to do this every time. Fix the API!
+>           let shell'' = addModulePath (newShell primFnCtxt) 
+>                          (prefix ++ "/lib/ivor")
+>           ctxt <- runShell "> " (extendParser shell'' parsePrimitives)
+>           putStrLn "Finished"
diff --git a/IOvor/iobasics.tt b/IOvor/iobasics.tt
new file mode 100644
--- /dev/null
+++ b/IOvor/iobasics.tt
@@ -0,0 +1,6 @@
+Data IOResult (A:*) :*  where
+   ioResult : (world:RealWorld)(a:A)(IOResult A);
+
+IO = [A:*](RealWorld -> (IOResult A));
+
+world = initWorld II;
diff --git a/Ivor/Bytecode.lhs b/Ivor/Bytecode.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Bytecode.lhs
@@ -0,0 +1,166 @@
+> module Ivor.Bytecode where
+
+Compilation of supercombinators to bytecode
+
+> import Ivor.SC
+> import Ivor.TTCore
+
+> type Arity = Int
+> type Tag = Int
+> type TmpVar = Int
+
+> type Bytecode = [ByteOp]
+
+> data ByteOp
+>     = STARTFN SCName Arity -- Needed?
+>     | DECLARE Int
+>     | TMP Int
+>     | RETURN TmpVar
+>     | CALL TmpVar SCName [TmpVar]
+>     | CON TmpVar Tag [TmpVar]
+>     | CLOSURE TmpVar SCName [TmpVar]
+>     | VAR TmpVar Int
+>     | GETARG TmpVar Int TmpVar
+>     | CLOSUREADD TmpVar TmpVar [TmpVar]
+>     | EVAL Int
+>     | EVALTMP TmpVar
+>     | TYPE TmpVar
+>     | TAILCALL SCName [TmpVar]
+>     | ALET Int TmpVar
+>     | CASE Int [Bytecode]
+>  deriving Show
+
+> data FunInfo
+>     = FI {
+>         bytecode :: Bytecode,
+>         cname :: String,
+>         ctag :: String,
+>         farity :: Int,
+>         ctagid :: Int
+>       }
+>   deriving Show
+
+> type ByteDef = [(SCName,FunInfo)]
+
+I wonder how generally useful this is...
+
+> mapInc :: (Int->a->b) -> [a] -> Int -> [b]
+> mapInc f [] i = []
+> mapInc f (x:xs) i = (f i x):(mapInc f xs (i+1))
+
+> compileAll :: SCs -> SCs -> ByteDef
+> compileAll ctxt group = mapInc scomp group ((length ctxt)-(length group))
+>    where scomp i (n,(a,sc)) = (n,FI (adddecls a (scompile n ctxt sc))
+>		                      (mkcname n)
+>		                      (mkctag n)
+>			              a
+>			              i)
+>          mkcname (N n) = "_EVM_"++show n
+>          mkcname (SN n i) = "_EVMSC_"++show i++"_"++show n
+>          mkctag  (N n) = "FTAG_EVM_"++show n
+>          mkctag  (SN n i) = "FTAG_EVMSC_"++show i++"_"++show n
+
+> scompile :: SCName -> SCs -> SC -> Bytecode
+> scompile name scs (SLam args body) =
+>    (STARTFN name (length args)):(bcomp (length args) 0 body)
+>   where
+>      getarity n = case lookup n scs of
+>		       (Just (a,d)) -> a
+>	               Nothing -> error $ "Can't happen (scompile, name "++show n++", " ++ show (map fst scs)++ ")"
+>      bcomp v t (SCase scr alts) = 
+>         (EVAL scr):
+>         [CASE scr (map (acomp v t) alts)]
+>      bcomp v t (SApp (SP n) as) 
+>             | getarity n == length as = 
+>	          concat (mapInc (ecomp v) as (t+1))
+>		     ++ [TAILCALL n (mktargs (length as) (t+1))]
+>      bcomp v t x = (ecomp v t x)++[RETURN t]
+
+>      mktargs 0 s = []
+>      mktargs n s = s:(mktargs (n-1) (s+1))
+
+>      acomp v t x = bcomp v t x -- Hmm. Well, maybe alts will get more complex
+
+>      ecomp :: Int -> TmpVar -> SCBody -> Bytecode
+>      ecomp v t (SP n) | getarity n == 0 = [CALL t n []]
+>		        | otherwise = [CLOSURE t n []]
+>   --   ecomp v (SElim n) | getarity n == 0 = CALL n []
+>   --		         | otherwise = CLOSURE n []
+>      ecomp v t (SV i) = [VAR t i]
+>      ecomp v t (SCon tag n as) 
+>	          = concat (mapInc (ecomp v) as (t+1))
+>		     ++ [CON t tag (mktargs (length as) (t+1))]
+
+>      ecomp v t (SApp f as) = fcomp v t f as
+>      ecomp v t (SLet val ty b) = 
+>                (ecomp v (t+1) val) ++
+>	         (ALET v (t+1)):
+>	         (ecomp (v+1) (t+2) b)
+>      ecomp v t (SProj i b) = (ecomp v (t+1) b) ++
+>		       [GETARG  t i (t+1)]
+>      ecomp v t (SPi e ty) = [TYPE t]
+>      ecomp v t SStar = [TYPE t]
+>      ecomp v t (SConst c) = error "Can't compile constants yet"
+>      ecomp v t _ = [TYPE t]
+
+>      fcomp v t (SP n) as 
+>          | getarity n == length as
+>               = concat (mapInc (ecomp v) as (t+1))
+>                   ++ [CALL t n (mktargs (length as) (t+1))]
+>          | otherwise 
+>               = concat (mapInc (ecomp v) as (t+1))
+>                   ++ [CLOSURE t n (mktargs (length as) (t+1))]
+
+>      fcomp v t f as 
+>	          = (ecomp v (t+1) f) ++
+>	             concat (mapInc (ecomp v) as (t+2))
+>		     ++ [CLOSUREADD t (t+1) (mktargs (length as) (t+2))]
+
+>      -- ccomp Star t = [TYPE t]
+
+Add type declarations to the top of bytecode, for the benefit of C/C--.
+
+> adddecls :: Int -> Bytecode -> Bytecode
+> adddecls arity bc = let (tmps,vars) = fd (-1,-1) bc in
+>                         ad (tmps+1) (vars+1) ++ bc
+>   where ad 0 n | n<=arity = []
+>         ad 0 n = (DECLARE (n-1)):(ad 0 (n-1))
+>         ad m n = (TMP (m-1)):(ad (m-1) n)
+
+>         fd (t,v) [] = (t,v)
+>         fd (t,v) (c:cs) = let (t',v') = fd' (t,v) c in
+>				fd (t',v') cs
+
+>         fd' (t,v) (RETURN rt) | rt>t = (rt,v)
+>			        | otherwise = (t,v)
+>         fd' (t,v) (CALL tv _ _)
+>               | tv > t = (tv,v)
+>		| otherwise = (t,v)	    
+>         fd' (t,v) (CON tv _ _)
+>               | tv > t = (tv,v)
+>		| otherwise = (t,v)	    
+>         fd' (t,v) (CLOSURE tv _ _)
+>               | tv > t = (tv,v)
+>		| otherwise = (t,v)	    
+>         fd' (t,v) (CLOSUREADD tv _ _)
+>               | tv > t = (tv,v)
+>		| otherwise = (t,v)	    
+>         fd' (t,v) (VAR tv _)
+>               | tv > t = (tv,v)
+>		| otherwise = (t,v)	    
+>         fd' (t,v) (GETARG tv _ _)
+>               | tv > t = (tv,v)
+>		| otherwise = (t,v)	    
+>         fd' (t,v) (TYPE tv)
+>               | tv > t = (tv,v)
+>		| otherwise = (t,v)	    
+>         fd' (t,v) (ALET vv _)
+>               | vv > v = (t,vv)
+>	        | otherwise = (t,v)
+>	  fd' (t,v) (CASE _ bs) = fdcs (t,v) bs
+>         fd' ts _ = ts
+
+>         fdcs (t,v) [] = (t,v)
+>	  fdcs (t,v) (c:cs) = let (t',v') = fd (t,v) c in
+>				  fdcs (t',v') cs
+
diff --git a/Ivor/CodegenC.lhs b/Ivor/CodegenC.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/CodegenC.lhs
@@ -0,0 +1,161 @@
+> module Ivor.CodegenC where
+
+Spit out C. I think this is write-only code...
+
+> import Ivor.Bytecode
+> import Ivor.SC
+
+Some useful gadgets
+
+> getTag :: ByteDef -> SCName -> String
+> getTag scs n = case lookup n scs of
+>		    Just (FI _ _ tag _ _) -> tag
+>	            Nothing -> error "Can't happen (getTag)"
+
+> getCName :: ByteDef -> SCName -> String
+> getCName scs n = case lookup n scs of
+>		      Just (FI _ cname _ _ _) -> cname
+>	              Nothing -> error "Can't happen (getTag)"
+
+Make the module's eval function, which checks the function tag on the
+closure it is passed, and runs the appropriate function.
+
+> mkEval :: ByteDef -> String
+> mkEval scs = evalHead ++ "\n" ++ concat (map (mke'.snd) scs) ++ evalTail
+>   where
+>     evalHead = "VAL eval(VAL x) {" ++
+>                "\n    if (x->ty != FUN) return x;" ++
+>                "\n    else {" ++
+>	         "\n        function* f = (function*)(x -> info);" ++
+>	         "\n        switch(f->ftag) {"
+>     evalTail = "        }" ++
+>	         "\n    }" ++
+>		 "\n    return x;" ++
+>		 "\n}\n"
+
+>     mke' (FI _ name tag arity _) = "            EVALCASE("++tag++","++
+>			             show arity ++ "," ++ name ++ "("
+>				     ++ showargs arity ++ "));\n"
+>     showargs 0 = ""
+>     showargs 1 = "FARG(0)"
+>     showargs n = showargs (n-1) ++ "," ++ "FARG("++show (n-1)++")"
+
+Make the header, including definitions of all the function tags and
+function prototypes.
+
+> mkHeaders :: ByteDef -> String
+> mkHeaders scs = fileHeader ++ concat (map (mkh'.snd) scs)
+>   where fileHeader = "#include \"closure.h\"\n"++
+>	               "#include <stdio.h>\n\n"
+
+>         mkh' (FI _ name tag arity tagid) =
+>            "#define "++ tag ++ " " ++ show tagid ++"\n" ++
+>	     "VAL "++ name ++ "(" ++ showargs arity ++");\n"
+>	  showargs 0 = ""
+>         showargs 1 = "VAL v0"
+>         showargs n = showargs (n-1) ++ "," ++ "VAL v"++show (n-1)
+
+Output C code for each supercombinator.
+
+> mkCode :: ByteDef -> String
+> mkCode scs = concat (map (mhc'.snd) scs)
+>   where mhc' (FI bc name _ arity _) = 
+>            let code = writeCode scs bc in
+>	     "VAL "++ name ++ "(" ++ showargs arity ++") {\n"
+>	      ++ "\n" ++ code ++ "}\n\n"
+
+>         declaretmps 0 = "VAL tmp0;"
+>         declaretmps n = declaretmps (n-1) ++ "\nVAL tmp" ++ show n ++";"
+>	  showargs 0 = ""
+>         showargs 1 = "VAL v0"
+>         showargs n = showargs (n-1) ++ "," ++ "VAL v"++show (n-1)
+
+
+> writeCode :: ByteDef -> Bytecode -> String
+> writeCode scs [] = ""
+> writeCode scs (c:cs) = "    " ++ wc c ++ "\n" ++ writeCode scs cs
+>   where wc (STARTFN _ _) = "VAL* args;"
+>         wc (DECLARE i) = "VAL v"++show i++";"
+>         wc (TMP i) = "VAL tmp"++show i++";"
+>         wc (RETURN i) = "return tmp"++show i++";"
+>	  wc (CALL t n vs) = "tmp"++show t++ " = "++ getCName scs n ++
+>		             "(" ++ showargs vs ++ ");"
+>         wc (CON t tag as) 
+>             | length as == 0 =
+>		 "tmp"++show t++ " = MKCON0("++show tag++");"
+>             | length as < 2 =
+>		 "tmp"++show t++ " = MKCON"++show (length as)++
+>		      "("++show tag++"," ++ showargs as++");"
+>	      | otherwise = "args = MKARGS(" ++ show (length as) ++ 
+>		    ");\n    " ++ mkargs as 0 ++ "tmp"++show t++ 
+>		    " = MKCONN("++show tag ++",args,"++show (length as)++");"
+>         wc (CLOSURE t n as) 
+>             | length as == 0 = 
+>	              "tmp"++show t++ " = CLOSURE0("++
+>		      getTag scs n++","++show (length as)++");"
+>             | length as < 6 = 
+>	              "tmp"++show t++ " = CLOSURE"++show (length as)++
+>		      "("++getTag scs n++","++show (length as)++","++showargs as++");"
+>	      | otherwise = "args = MKARGS(" ++ show (length as) ++ 
+>		      ");\n    " ++ mkargs as 0 ++ "tmp"++show t++
+>		    " = CLOSUREN("++getTag scs n ++","++show (length as)++",args,"++ 
+>		    show (length as)++");"
+>	  wc (VAR t i) = "tmp"++show t++" = v" ++ show i ++ ";"
+>         wc (GETARG t i v) = "tmp"++show t++" = GETCONARG(tmp"++show v++","
+>		              ++show i++");"
+>         wc (CLOSUREADD t tf as) 
+>             | length as < 6 = "tmp"++show t++ " = CLOSUREADD"++
+>			          show (length as)++"(tmp"++show tf++","++
+>			          showargs as++");"
+>	      | otherwise = "args = MKARGS(" ++ show (length as) ++ 
+>		      ");\n    " ++ mkargs as 0 ++ "tmp"++show t++
+>		    " = CLOSUREADDN(tmp"++ show tf ++",args,"++ 
+>		    show (length as)++");"
+>         wc (EVAL i) = "eval(v" ++ show i ++");"
+>         wc (EVALTMP i) = "eval(tmp" ++ show i ++");"
+>         wc (TYPE t) = "tmp"++show t++" = MKTYPE;"
+>         wc (TAILCALL n vs) = "return "++getCName scs n ++ "(" ++ showargs vs ++ ");"
+>	  wc (ALET i t) = "v"++show i++" = tmp"++show t++";"
+>         wc (CASE v cs) = "switch(TAG(v"++show v++")) {\n" ++
+>		   cc cs 0 ++ "    }"
+
+>         cc [] i = "    default:\n    return NULL;\n"
+>         cc (c:cs) i = "    case "++show i++":\n" ++
+>		writeCode scs c ++ "\n" ++ cc cs (i+1)
+
+>         mkargs [] _ = ""
+>	  mkargs (a:as) i = "args["++show i++"] = tmp"++show a ++ ";"
+>		            ++ "\n    " ++ mkargs as (i+1)
+
+>         showargs [] = ""
+>         showargs [x] = "tmp"++show x
+>         showargs (x:xs) = "tmp"++show x++","++showargs xs
+
+ writeCode bc t [] = ("",t)
+ writeCode bc tmp (c:cs) = let (code,tmp') = opc tmp c
+			        (code',tmp'') = writeCode bc tmp' cs in
+			("\t" ++ code ++ "\n" ++ code', tmp'')
+    where opc t (STARTFN _ _) = ("VAL* args;",t)
+          opc t (DECLARE x) = ("VAL v"++show x++";",t)
+          opc t (RETURN e) = let (code,tmp') = ecomp (t+1) e in
+			       (code ++ "return t"++show t,tmp')
+	   opc t (TAILCALL n es) 
+                 = let (code,tmp',ts) = argcode (t+1) es [] "" in
+              (code ++ "return "++ getCName bc n ++ "(" ++ arglist ts ++ ")",tmp')
+          opc t (ALET x e) = error "Not done Let yet"
+          opc t (CASE e es) = ("CASE foo;",t)
+          ecomp t e = ("expression",t)
+              | length es < 2 = "MKCON"++show (length es)++"("++show t++","++
+			         argcode es++")"
+              | otherwise = mkArgList (length es) ++ "MKCONN("++show t++
+		             ",args,"++length es++");"
+		             
+
+          argcode t [] l code = (code,t,l)
+	   argcode t (e:es) as c
+               = let (ecode,t') = ecomp (t+1) e
+		      code = "tmp"++show t++ " = " ++ ecode ++ ";" in
+		    argcode t' es (t:as) (c++code)
+          arglist [] = ""
+          arglist [e] = "tmp"++show e
+          arglist (e:es) = arglist es ++ "," ++ "tmp"++show e
diff --git a/Ivor/Compiler.lhs b/Ivor/Compiler.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Compiler.lhs
@@ -0,0 +1,191 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Compiler(compile) where
+
+> import Ivor.RunTT
+> import Ivor.State
+> import Ivor.Nobby
+> import Ivor.Datatype
+> import Ivor.TTCore
+> import Ivor.ICompile
+
+> import System.IO
+> import Control.Monad
+
+> compile :: IState -> String -> IO ()
+> compile st froot = fail "Deprecated"
+
+
+>  {-   do h <- openFile (froot++".hs") WriteMode
+>        hPutStr h (header froot)
+>        compileData (defs st) (datadefs st) st h
+>        compileGamma (defs st) st h
+>        hFlush h
+>        hClose h
+
+FIXME! Only does elim, not case.
+
+> compileData :: Gamma Name -> [(Name,Datatype Name)] -> IState ->
+>                Handle -> IO ()
+> compileData gam [] st h = return ()
+> compileData gam ((n,dt):xs) st h =
+>     do let caseexp = compileSchemes (e_ischemes dt)
+>        let arity = getArity (e_ischemes dt)
+>        rn <- rulename
+>        if (length (datacons dt)>0) then
+>           hPutStrLn h $ "data TT_" ++ exportName n ++ " = " ++ compileCons (datacons dt)
+>           else hPutStrLn h $ "data TT_" ++ exportName n ++ " = TT_" ++ exportName n
+>        let inst = projInstance (datacons dt)
+>        when ((length (words inst))>0)
+>           $ hPutStrLn h $ "\ninstance Project TT_"++ exportName n ++
+>                 " where\n" ++ inst
+>        let rtt = mkRTElim n arity caseexp
+>        let fn = mkGHC st rn arity rtt
+>        hPutStrLn h fn
+>        --putStrLn $ elimInterface n (snd (erule dt))
+>        --putStrLn $ elimBody n rn (snd (erule dt))
+>        --hPutStrLn h $ show rtt
+>        compileData gam xs st h
+>  where rulename = case lookupval n gam of
+>                      (Just (TCon _ (Elims x _ _))) -> return x
+>                      Nothing -> fail "No such type"
+
+This creation of elim rule interfaces only works for completely simple types!
+
+> elimInterface :: Name -> Indexed Name -> String
+> elimInterface n (Ind ty) = "elim_" ++ exportName n ++ " :: " ++ mkET ty
+>    where mkET (Bind _ (B Pi ty) (Sc sc)) = mkArg ty ++ mkET sc
+>          mkET _ = "a"
+>          mkArg ty | Star <- getReturnType ty = "" -- Skip Phi
+>                   | TyCon x _ <- getFun ty
+>                        = "TT_" ++ exportName x ++ " -> "
+>                   | otherwise = "(" ++ mkET ty ++ ") -> "
+
+> elimBody :: Name -> Name -> Indexed Name -> String
+> elimBody n rn (Ind ty) = "elim_" ++ exportName n ++ " = " ++ mkLams ty 0 ++
+>                          "(coerce (fn_" ++ exportName rn ++ " " ++ mkET ty 0
+>                          ++ "))::a"
+>    where
+>          mkET (Bind _ (B Pi ty) (Sc sc)) n | Star <- getReturnType ty
+>                                                = mkArg ty n ++ mkET sc n
+>          mkET (Bind _ (B Pi ty) (Sc sc)) n = mkArg ty n ++ mkET sc (n+1)
+>          mkET _ _ = ""
+>          mkLams (Bind _ (B Pi ty) (Sc sc)) n | Star <- getReturnType ty
+>                                                = mkLams sc n
+>          mkLams (Bind _ (B Pi ty) (Sc sc)) n = "\\x"++show n ++ " -> "
+>                                                ++ mkLams sc (n+1)
+>          mkLams _ _ = ""
+
+>          mkArg ty n | Star <- getReturnType ty = "((coerce Type)::val)"
+>                     | otherwise = "((coerce x"++show n++")::val)"
+
+> compileCons :: [(Name,Gval Name)] -> String
+> compileCons [] = ""
+> compileCons [x] = compileCon x
+> compileCons (x:xs) = compileCon x ++ "| " ++ compileCons xs
+
+> compileCon (n,G (DCon _ _) (Ind t) _) =
+>     foralls numargs ++ "TT_" ++ show n ++ " " ++ showargs numargs
+>   where numargs = length (getExpected t)
+>         foralls n | n == 0 = ""
+>                   | otherwise = "forall arg. "
+>         showargs 0 = ""
+>         showargs n = "arg " ++ showargs (n-1)
+
+> projInstance :: [(Name,Gval Name)] -> String
+> projInstance [] = ""
+> projInstance (x:xs) =
+>     let xp = projAll x in
+>        if (length (words xp)>0) then xp ++ "\n" ++ projInstance xs
+>           else projInstance xs
+
+> projAll (n,G (DCon _ _) (Ind t) _) =
+>     project numargs
+>   where numargs = length (getExpected t)
+>         project 0 = "\n"
+>         project k = "    project "++show (k-1)++" (TT_" ++ exportName n ++
+>                     " " ++ showargs numargs++") = ((coerce a" ++ show (k-1)
+>                         ++ ")::val)\n" ++ project (k-1)
+>         showargs 0 = ""
+>         showargs n = showargs (n-1) ++ " a" ++ show (n-1)
+
+> compileGamma :: Gamma Name -> IState -> Handle -> IO ()
+> compileGamma gam@(Gam g) st h = cg g where
+>   cg [] = return ()
+>   cg ((n,G (Fun _ ind) indty _):xs) =
+>       do -- putStrLn $ "Compiling " ++ show n
+>          let nind = normalise (Gam []) ind
+>          let rtt = mkRTFun gam (levelise nind)
+>          let (Ind ty) = normalise gam indty
+>          let arity = length (getExpected ty)
+>          let fn = mkGHC st n arity rtt
+>          hPutStrLn h fn
+>          cg xs
+>   cg (x:xs) = do -- putStrLn $ "Skipping " ++ show x
+>                  cg xs
+
+> mkGHC :: IState -> Name -> Int -> RunTT -> String
+> mkGHC st n arity tm = "fn_" ++ exportName n ++ " :: " ++ mkSig arity ++ "\n" ++
+>                       "fn_" ++ exportName n ++ " = " ++ mkBody 0 tm ++ "\n"
+>    where mkSig 0 = "val"
+>          mkSig n = "val -> " ++ mkSig (n-1)
+>          mkBody l (RTVar i) = "v"++show i
+>          mkBody l (RTFun n) = "fn_" ++ exportName n
+>          mkBody l (RTCon _ n args) = "(coerce (TT_" ++ exportName n ++ " " ++ showargs l args ++ ")::val)"
+>          mkBody l (RTElim n t m ms) = "(fn_" ++ exportName n ++ " " ++ showarg l t ++
+>                                     " ((coerce Type)::val) " ++ showargs l ms
+>          mkBody l (RTApp f xs) = "(" ++ showfun l f (length xs) ++ " " ++ showargs l xs ++ ")"
+>          mkBody l (RTBind (RTLam,_) (sc,_)) = "(\\v"++show l ++" -> " ++ mkBody (l+1) sc ++ ")"
+>          mkBody l (RTBind (RTLet (v,_),_) (sc,_)) = "(let v"++show l ++" = " ++ "(" ++ mkBody l v ++ ") in (" ++ mkBody (l+1) sc ++ "))"
+>          mkBody l (RTBind (RTPi,_) (sc,_)) = "((coerce Type)::val)"
+>          mkBody l RTypeVal = "((coerce Type)::val)"
+>          mkBody l RTCantHappen = "error \"Impossible\""
+>          mkBody l (RTProj ty i (v,_)) = "(project " ++ show i ++
+>                                      "((coerce " ++ mkBody l v ++")::TT_"++show ty++"))"
+>          mkBody l (RTCase ty (v,_) xs) = "(case ((coerce "++mkBody l v++")::TT_"++show ty++") of { " ++ doCaseBody l (getCons (datadefs st) ty) xs ++ "})"
+>          mkBody l (RTConst c) = error "Sorry, can't compile constants yet"
+>          -- mkBody l x = "[[Not done "++show x++"]]"
+
+>          doCaseBody l [] [] = ""
+>          doCaseBody l ((n,ar):ns) (i:is) = doCase l n ar i ++ " ; " ++ doCaseBody l ns is
+>          doCase l n ar (i,_) = "TT_"++exportName n++" "++caseargs ar++" -> " ++ mkBody l i
+>          caseargs 0 = ""
+>          caseargs n = "_ "++caseargs (n-1)
+
+>          showargs l [] = ""
+>          showargs l (x:xs) = showarg l x ++ " " ++ showargs l xs
+>          showarg l (x,_) = "((coerce "++mkBody l x++")::val)"
+>          showfun l (f,_) n = "((coerce "++mkBody l f++")::"++mkty n++")"
+
+>          mkty 0 = "val"
+>          mkty n = "val->"++mkty (n-1)
+
+Given a type name, get all the constructors and their arities
+
+> getCons :: [(Name,Datatype Name)] -> Name -> [(Name,Int)]
+> getCons ds n = case lookup n ds of
+>                  Nothing -> []
+>                  Just dt -> map (\ (x,y) -> (x, arity y)) (datacons dt)
+>     where arity (G _ (Ind ty) _) = length (getExpected ty)
+
+> header mod = "{-# OPTIONS_GHC -fglasgow-exts #-} \n\
+>               \\n\
+>               \module " ++ mod ++ " where\n\
+>               \\n\
+>               \import GHC.Base\n\
+>               \\n\
+>               \coerce :: a -> b\n\
+>               \coerce = unsafeCoerce#\n\
+>               \\n\
+>               \data Type = forall a. Type a\n\
+>               \data Val = Val\n\
+>               \\n\
+>               \class Project x where\n\
+>               \    project :: forall val. Int -> x -> val\n\n"
+
+> exportName :: Name -> String
+> exportName (UN n) = show $ UN (okch n)
+>    where okch [] = []
+>          okch ('\'':xs) = "_AP_"++okch xs
+>          okch (x:xs) = x:(okch xs)
+> -}
diff --git a/Ivor/Constant.lhs b/Ivor/Constant.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Constant.lhs
@@ -0,0 +1,7 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Constant where
+
+> import Data.Typeable
+
+
diff --git a/Ivor/Construction.lhs b/Ivor/Construction.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Construction.lhs
@@ -0,0 +1,100 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> -- | 
+> -- Module      : Ivor.Construction
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> -- 
+> -- Some generic tactics for solving goals by applying constructors
+
+> module Ivor.Construction(auto,split,left,right,useCon,exists,
+>                          isItJust) where
+
+> import Ivor.TT
+> import Debug.Trace
+
+> -- | Tries to solve a simple goal automatically by trying each of these 
+> --   in turn:
+> --  * Looking for an assumption ('trivial')
+> --  * 'intros' everything then solve by 'auto'
+> --  * Splitting the goal, then solving each subgoal by 'auto'
+> --  * If the goal is of a type with more than one constructor, try 'auto'
+> --    on each constructor in turn.
+> -- FIXME: not that this actually works yet.
+
+> auto :: Int -- ^ Search depth
+>         -> Tactic
+> auto 0 = \g ctxt -> fail "auto got bored, try a bigger search depth"
+> auto n = \g ctxt -> if (allSolved ctxt) then return ctxt else
+>            trace ("Auto "++ show n) $
+>            ((trivial >+> (auto n)) >|>
+>            (intros1 >+> (auto n)) >|>
+>            (split >+> (auto n)) >|>
+>            (left >+> (auto (n-1))) >|>
+>            (right >+> (auto (n-1)))) g ctxt
+
+> -- | Split a goal into subgoals. Type of goal must be a one constructor
+> -- family, with constructor @c@, then proceeds by 'refine' @c@.
+> split :: Tactic
+> split  = useCon 1 0
+
+> -- | Split a goal into subgoals. Type of goal must be a two constructor
+> -- family, with constructors @l@ and @r@, then proceeds by 'refine' @l@.
+> left :: Tactic
+> left = useCon 2 0
+
+> -- | Split a goal into subgoals. Type of goal must be a two constructor
+> -- family, with constructors @l@ and @r@, then proceeds by 'refine' @r@.
+> right :: Tactic
+> right = useCon 2 1
+
+Get the goal, look at the type. Refine by the constructor of that type -
+check that there is the right number (num).
+
+> -- | Solve the goal by applying a numbered constructor
+> useCon :: Int -- ^ Ensure at least this number of constructors (0 for no constraint)
+>           -> Int -- ^ Use this constructor (0 based, order of definition)
+>           -> Tactic
+> useCon num use g ctxt = do
+>     goal <- goalData ctxt False g
+>     let ty = getApp (view (goalType goal))
+>     case ty of
+>       (Name _ n) -> do cons <- getConstructors ctxt n
+>                        splitnCon cons g ctxt
+>       _ -> fail "Not a type constructor"
+>    where splitnCon cs | length cs >= num || num == 0
+>              = refine (Name DataCon (cs!!use))
+>          splitnCon _ = \g ctxt -> fail $ "Not a " ++ show num ++ " constructor family"
+
+> -- | Solve an existential by providing a witness.
+> -- More generally; apply the first constructor of the 
+> -- goal's type and provide the witness as its first non-inferrable argument.
+> exists :: IsTerm a => a -- ^Witness 
+>                       -> Tactic
+> exists t = useCon 1 0 >+> fill t
+
+
+> -- | Try to solve a goal @A@ by evaluating a term of type @Maybe A@. If the
+> -- answer is @just a@, fill in the goal with the proof term @a@.
+> isItJust :: IsTerm a => a -> Tactic
+> isItJust tm g ctxt = do 
+>     gd <- goalData ctxt False g 
+>     let gty = view $ goalType gd
+>     vtm <- evalCtxt ctxt g tm
+>     let (prf, ty) = (view vtm, viewType vtm)
+>     -- make sure type is 'Maybe'
+>     case ty of
+>        (App (Name _ m) a) | m == (name "Maybe") 
+>           -> do case prf of
+>                  (App (Name _ n) _) | n == (name "nothing")
+>                      -> fail "No solution found"
+>                  (App (App (Name _ j) _) p) | j == (name "just")
+>                      -> fill p g ctxt
+>                  tm -> fail $ "Evaluated to " ++ show tm
+>        _ -> fail $ "Type of decision procedure must be ++ " ++ 
+>                       show (App (Name Unknown (name "Maybe")) gty)
+
diff --git a/Ivor/Datatype.lhs b/Ivor/Datatype.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Datatype.lhs
@@ -0,0 +1,177 @@
+> module Ivor.Datatype where
+
+> import Ivor.TTCore
+> import Ivor.Gadgets
+> import Ivor.Typecheck
+> import Ivor.Nobby
+> import Ivor.PatternDefs
+
+> import Debug.Trace
+
+> data Datadecl = Datadecl {
+>                           datatycon :: Name,
+>                           params :: [(Name,Raw)],
+>                           tycontype :: Raw,
+>                           constructors :: [(Name,Raw)]
+>                          }
+
+Elaborated version with elimination rule and iota schemes.
+
+> data RawDatatype = 
+>	   RData { rtycon :: (Name,Raw),
+>	           rdatacons :: [(Name,Raw)],
+>                  rnum_params :: Int,
+>	           rerule :: (Name,Raw),
+>                  rcrule :: (Name,Raw),
+>	           re_ischemes :: [RawScheme],
+>	           rc_ischemes :: [RawScheme]
+>	   }
+>   deriving Show
+
+> data Datatype n =
+>	   Data { tycon :: (n, Gval n),
+>	          datacons :: [(n, Gval n)],
+>                 num_params :: Int,
+>	          erule :: (n, Indexed n),
+>                 crule :: (n, Indexed n),
+>	          e_ischemes :: PMFun Name,
+>	          c_ischemes :: PMFun Name,
+>	          e_rawschemes :: [RawScheme],
+>	          c_rawschemes :: [RawScheme]
+>	        }
+>       deriving Show
+
+> getPat (Sch p i) = p
+> getRed (Sch p i) = i
+
+> getArity [] = 2 -- empty data type should have elim rule of arity 2!
+>                 -- (actually not if they're dependent. Fix this.)
+> getArity ss = length (getPat (ss!!0))
+
+checkType checks a raw data type, with its elimination rule and iota
+schemes, and returns a DataType, ready for compilation to entries in
+the context and an executable elimination rule.
+
+> checkType :: Monad m => Gamma Name -> RawDatatype -> m (Datatype Name)
+> checkType gamma (RData (ty,kind) cons numps (er,erty) (cr,crty) eschemes cschemes) = 
+>     do (kv, _) <- typecheck gamma kind
+>        let erdata = Elims er cr (map fst cons)
+>	 let gamma' = extend gamma (ty,G (TCon (arity gamma kv) erdata) kv defplicit)
+>	 (consv,gamma'') <- checkCons gamma' 0 cons
+>	 (ev, _) <- typecheck gamma'' erty
+>	 (cv, _) <- typecheck gamma'' crty
+>	 -- let gamma''' = extend gamma'' (er,G (ElimRule dummyRule) ev defplicit)
+>        (esch, _) <- checkDef gamma'' er erty eschemes False False
+>        (csch, _) <- checkDef gamma'' cr crty cschemes False False
+>	 return (Data (ty,G (TCon (arity gamma kv) erdata) kv defplicit) consv numps
+>                    (er,ev) (cr,cv) esch csch eschemes cschemes)
+
+>    where checkCons gamma t [] = return ([], gamma)
+>          checkCons gamma t ((cn,cty):cs) = 
+>              do (cv,_) <- typecheck gamma cty
+>		  let ccon = G (DCon t (arity gamma cv)) cv defplicit
+>		  let gamma' = extend gamma (cn,ccon)
+>		  (rest,gamma'') <- checkCons gamma' (t+1) cs
+>	          return (((cn,ccon):rest), gamma'')
+
+checkScheme takes a raw iota scheme and returns a scheme with a well-typed
+RHS (or fails if there is a type error).
+
+For a scheme of the form
+
+foo p0 p1 ... pn = t
+
+we get V 0 = pn ... V n = p0
+then pattern variables are retrieved by projection with Proj in typechecked t.
+
+> checkScheme :: Monad m =>
+>	          Gamma Name -> Name -> RawScheme -> m (Scheme Name)
+> checkScheme gamma n (RSch pats ret) = 
+>     do let ps = map (mkPat gamma) pats
+>	 let rhsvars = getPatVars gamma ps
+>        let rhs = substVars gamma n rhsvars ret
+>	 return (Sch (reverse ps) (Ind rhs))
+
+Make a pattern from a raw term. Anything weird, just make it a "PTerm".
+
+> mkPat :: Gamma Name -> Raw -> Pattern Name
+> mkPat gam (Var n) = mkPatV n (lookupval n gam)
+>        where mkPatV n (Just (DCon t x)) = PCon t n tyname []
+>              mkPatV n (Just (TCon x _)) = PCon 0 n (UN "Type") []
+>              mkPatV n _ = PVar n
+>              tyname = case (getTyName gam n) of
+>                         Just x -> x
+> mkPat gam (RApp f a) = pat' (unwind f a)
+>   where unwind (RApp f s) a = let (f',as) = unwind f s in
+>				    (f',(mkPat gam a):as)
+>	  unwind t a = (t, [mkPat gam a])
+>         pat' (Var n, as) = mkPatV n (lookupval n gam) (reverse as)
+>         pat' _ = PTerm
+
+>         mkPatV n (Just (DCon t x)) as = PCon t n tyname as
+>         mkPatV n (Just (TCon x _)) as = PCon 0 n (UN "Type") as
+>         mkPatV _ _ _ = PTerm
+>         tyname = case (getTyName gam (getname (getappfun f))) of
+>                    Just x -> x
+>         getname (Var n) = n
+> mkPat gam _ {-(RBind _ _ _)-} = PTerm
+> {-
+> TODO: If a datatype has a placeholder in its indices, the value should
+> be inferred (i.e. it should be checked) otherwise we can't make a pattern
+> properly (and we'll certainly need this for optimisation)
+> mkPat gam x = error $ "Can't make a pattern from " ++ show x
+> -}
+
+Get the pattern variables from the patterns, and work out what the projection 
+function for each name is.
+
+> getPatVars :: Gamma Name ->[Pattern Name] -> [(Name, TT Name)]
+> getPatVars gam xs = pv' 0 (reverse xs)
+>   where pv' i [] = []
+>         pv' i (x:xs) = (project gam i x) ++ (pv' (i+1) xs)
+
+	  indexify (n,t) = (n,Ind t)
+
+Projection.
+
+> project :: Gamma Name -> Int -> Pattern Name -> [(Name, TT Name)]
+> project gam n x = project' n (\i -> V i) x
+>   where project' n f (PVar x) = [(x,f n)]
+>         project' n f (PCon _ fn ty es) = projargs n f 0 es ty
+>         project' n f (PMarkCon fn es) = projargs n f 0 es (UN "FOO")
+>         project' n f _ = [] -- Can't project from terms or marked vars.
+>         projargs n f i [] _ = []
+>         projargs n f i (PMark _:xs) ty = projargs n f i xs ty
+>         projargs n f i (x:xs) ty
+>             = (project' n ((\a -> (Proj ty i a)).f) x)
+>               ++ projargs n f (i+1) xs ty
+
+-- >         argtypes ty = case lookuptype ty gam of
+-- >                          (Just (Ind ty)) -> map (getFnName.snd)
+-- >                                               $ getExpected ty
+-- >         getFnName (TyCon x _) = x
+-- >         getFnName (App f x) = getFnName f
+-- >         getFnName (Bind _ _ (Sc x)) = getFnName x
+-- >         getFnName x = MN ("Dunno: "++show x, 0)
+
+Make a RHS of an iota scheme, substituting names with projection operations.
+ASSUMPTION: No bindings on the RHS. This should be true of all iota schemes.
+Takes the name of the elimination rule and assumes any reference to an
+elimination rule is a reference to this
+
+> substVars :: Gamma Name -> Name -> [(Name,TT Name)] -> Raw -> TT Name
+> substVars gam er ns r = sv' r
+>    where sv' (Var x) = case (lookup x ns) of
+>			    Nothing -> mkGood x
+>			    (Just i) -> i
+>	   sv' (RApp f a) = App (sv' f) (sv' a)
+>          sv' (RConst c) = Const c
+
+>          mkGood x = case (lookupval x gam) of
+>	       (Just (DCon t i)) -> Con t x i
+>              (Just (TCon i _)) -> TyCon x i
+>              (Just (ElimRule _)) -> Elim er
+>	       _ -> P x
+
+> dummyRule :: ElimRule
+> dummyRule _ = Nothing
diff --git a/Ivor/Display.lhs b/Ivor/Display.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Display.lhs
@@ -0,0 +1,26 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}  {- -*-literate-haskell-*- -}
+
+Functions for displaying proof state "helpfully".
+
+> module Ivor.Display where
+
+> import Ivor.Tactics
+> import Ivor.TTCore
+> import Ivor.Typecheck
+> import Ivor.Nobby
+
+> displayHoleContext :: Gamma Name -> [Name] -> Name -> Indexed Name -> String
+> displayHoleContext gam hidden h tm = 
+>     case (findhole gam (Just h) tm (displayHole hidden)) of
+>             Just x -> x
+>             Nothing -> ""
+
+> displayHole :: [Name] -> Gamma Name -> Env Name -> Indexed Name -> String
+> displayHole hidden gam hs tm = dh hs ++ 
+>                         "\n=======================================\n" ++
+>                         show (normaliseEnv hs (Gam []) tm) ++ "\n"
+>    where dh [] = ""
+>          dh ((n,B _ ty):xs) 
+>              | n `elem` hidden = dh xs
+>              | otherwise = dh xs ++ (show n)++" : "++show ty++"\n"
+
diff --git a/Ivor/Equality.lhs b/Ivor/Equality.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Equality.lhs
@@ -0,0 +1,22 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> -- | 
+> -- Module      : Ivor.Equality
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> -- 
+> -- Tactics for Heterogeneous Equality (injectivity, disjointness, etc)
+
+> module Ivor.Equality where
+
+> import Ivor.TTCore as TTCore
+> import Ivor.TT
+> import Ivor.TermParser
+> import Ivor.State
+> import Ivor.Gadgets
+> import Ivor.Nobby
+
diff --git a/Ivor/Evaluator.lhs b/Ivor/Evaluator.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Evaluator.lhs
@@ -0,0 +1,127 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Evaluator(eval_whnf) where
+
+> import Ivor.TTCore
+> import Ivor.Gadgets
+> import Ivor.Constant
+> import Ivor.Nobby
+
+> import Debug.Trace
+> import Data.Typeable
+
+ data Machine = Machine { term :: (TT Name),
+                          mstack :: [TT Name],
+                          menv :: [(Name, Binder (TT Name))] }
+
+> eval_whnf :: Gamma Name -> Indexed Name -> Indexed Name
+> eval_whnf gam (Ind tm) = let res = makePs (evaluate False gam tm)
+>                              in finalise (Ind res)
+
+> type Stack = [TT Name]
+> type SEnv = [(Name, TT Name, TT Name)]
+
+> getEnv i env = (\ (_,_,val) -> val) (env!!i)
+
+Code			Stack	Env	Result
+
+[[x{global}]]		xs	es	(lookup x), xs, es
+[[x{local}]]		xs	es	(es!!x), xs, es
+[[f a]]			xs	es	[[f]], a:xs, es
+[[\x . e]]		(x:xs)	es	[[e]], xs, (x:es)
+[[\x . e]]		[]	es	\x . [[e]], xs, (Lam x: es)
+(or leave alone for whnf)
+[[let x = t in e]]	xs	es	[[e]], xs, (Let x t: es)
+
+> evaluate :: Bool -> -- under binders? 'False' gives WHNF
+>             Gamma Name -> TT Name -> TT Name
+> evaluate open gam tm = eval tm [] [] []
+>   where
+>     eval :: TT Name -> Stack -> SEnv -> [(Name, TT Name)] -> TT Name
+>     eval (P x) xs env pats 
+>         = case lookup x pats of
+>              Nothing -> evalP x (lookupval x gam) xs env pats
+>              Just val -> eval val xs env pats
+>     eval (V i) xs env pats = if (length env>i) 
+>                                then eval (getEnv i env) xs env pats
+>                                else unload (V i) xs pats env -- blocked, so unload
+>     eval (App f a) xs env pats = eval f ((eval a [] env pats):xs) env pats
+>     eval (Bind n (B Lambda ty) (Sc sc)) xs env pats =
+>         let ty' = eval ty [] env pats in
+>             evalScope n ty' sc xs env pats
+>     eval (Bind n (B Pi ty) (Sc sc)) xs env pats =
+>         let ty' = eval ty [] env pats in
+>            unload (Bind n (B Pi ty') (Sc sc)) [] pats env
+>     eval (Bind n (B (Let val) ty) (Sc sc)) xs env pats =
+>         eval sc xs ((n,ty,eval val [] env pats):env) pats
+>     eval (Bind n (B bt ty) (Sc sc)) xs env pats =
+>         let ty' = eval ty [] env pats in
+>            unload (Bind n (B bt ty') (Sc sc)) [] pats env
+>     eval x stk env pats = unload x stk pats env
+
+>     evalP n (Just v) xs env pats 
+>        = case v of
+>             Fun opts (Ind v) -> eval v xs env pats
+>             PatternDef p -> pmatch n p xs env pats
+>             PrimOp _ f -> case f xs of
+>                             Nothing -> unload (P n) xs pats env
+>                             Just v -> eval v [] env pats
+>             _ -> unload (P n) xs pats env
+>     evalP n Nothing xs env pats = unload (P n) xs pats env -- blocked, so unload stack
+
+>     evalScope n ty sc (x:xs) env pats = eval sc xs ((n,ty,x):env) pats
+>     evalScope n ty sc [] env pats
+>               | open = error "Normalising not implemented"
+>               | otherwise 
+>                   = buildenv env $ unload (Bind n (B Lambda ty) (Sc sc)) [] pats env -- in Whnf
+>     unload x [] pats env 
+>                = foldl (\tm (n,val) -> substName n val (Sc tm)) x pats
+>     unload x (a:as) pats env = unload (App x a) as pats env
+
+>     buildenv [] t = t
+>     buildenv ((n,ty,tm):xs) t 
+>                 = buildenv xs (subst tm (Sc t))
+>     --            = buildenv xs (Bind n (B (Let tm) ty) (Sc t))
+
+>     pmatch n (PMFun i clauses) xs env pats = 
+>         case matches clauses xs env pats of
+>           Nothing -> unload (P n) xs pats env
+>           Just (rhs, pbinds, stk) -> eval rhs stk env pbinds
+
+>     matches [] xs env pats = Nothing
+>     matches (c:cs) xs env pats 
+>        = case (match c xs env pats) of
+>            Just v -> Just v
+>            Nothing -> matches cs xs env pats
+
+>     match :: Scheme Name -> [TT Name] -> SEnv -> [(Name, TT Name)] ->
+>              Maybe (TT Name, [(Name, TT Name)], Stack)
+>     match (Sch pats rhs) xs env patvars 
+>               = matchargs pats xs rhs env patvars
+>     matchargs [] xs (Ind rhs) env patvars = Just (rhs, patvars, xs)
+>     matchargs (p:ps) (x:xs) rhs env patvars
+>               = case matchPat p (eval x [] env patvars) patvars of
+>                   Just patvars' -> matchargs ps xs rhs env patvars'
+>                   Nothing -> Nothing
+>     matchargs _ _ _ _ _ = Nothing
+
+>     matchPat PTerm x patvars = Just patvars
+>     matchPat (PVar n) x patvars = Just ((n,x):patvars)
+>     matchPat (PConst t) (Const t') patvars
+>                  = do tc <- cast t
+>                       if (tc == t') then Just patvars
+>                                else Nothing
+>     matchPat pc@(PCon t _ _ args) app patvars
+>              | Just (tag, cargs) <- getConArgs app [] =
+>                     if (tag == t) then matchPats args cargs patvars
+>                        else Nothing
+>         where matchPats [] [] patvars = Just patvars
+>               matchPats (a:as) (b:bs) patvars
+>                   = do vs' <- matchPat a b patvars
+>                        matchPats as bs vs'
+>               matchPats _ _ _ = Nothing
+>     matchPat _ _ _ = Nothing
+
+>     getConArgs (Con t _ _) args = Just (t, args)
+>     getConArgs (App f a) args = getConArgs f (a:args)
+>     getConArgs _ _ = Nothing
diff --git a/Ivor/Gadgets.lhs b/Ivor/Gadgets.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Gadgets.lhs
@@ -0,0 +1,83 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Gadgets where
+
+> class Forget a b | a->b where
+>     forget :: a -> b
+
+> traceIndex :: [a] -> Int -> String -> a
+> traceIndex xs i str | length xs <= i = error $ " !! index too large: " ++ str
+>                     | otherwise = xs!!i
+
+> safeIndex :: [a] -> Int -> a -> a
+> safeIndex xs i def | length xs <= i = def
+>                    | otherwise = xs!!i
+
+=================== Result Monad ========================
+
+> data Result r 
+>     = Success r
+>     | Failure String
+>  deriving (Show, Eq)
+
+> instance Monad Result where
+>     (Success r)   >>= k = k r
+>     (Failure err) >>= k = Failure err
+>     return              = Success
+>     fail s              = Failure s
+
+> instance Functor Result where
+>     fmap f (Failure str) = Failure str
+>     fmap f (Success s) = Success (f s)
+
+====================== Snoc Lists ===========================
+
+> data Spine x = Empty | Snoc (Spine x) x
+
+> infix 5 ??
+> (??) :: Spine x -> Int -> x
+> (Snoc _ x) ?? 0 = x
+> (Snoc xs _) ?? n | n>0 = xs ?? (n-1)
+> (Snoc _ _) ?? _ = error "?? - negative index"
+
+> end (Snoc sp x) = x
+> start (Snoc sp x) = sp
+
+> size :: Spine x -> Int
+> size Empty = 0
+> size (Snoc xs x) = 1+(size xs)
+
+> lose :: Int -> Spine x -> Spine x
+> lose 0 (Snoc xs x) = xs
+> lose n (Snoc xs x) = (Snoc (lose (n-1) xs) x)
+
+> listify :: Spine x -> [x]
+> listify xs = list' [] xs
+>   where list' acc Empty = acc
+>         list' acc (Snoc xs x) = list' (x:acc) xs
+
+> revlistify :: Spine x -> [x]
+> revlistify Empty = []
+> revlistify (Snoc xs x) = x:(revlistify xs)
+
+> instance Functor Spine where
+>     fmap f Empty = Empty
+>     fmap f (Snoc sp x) = Snoc (fmap f sp) (f x)
+
+========= Functions I want in the standard library... =========
+
+> lookupM :: (Monad m, Eq a) => a -> [(a,b)] -> m b
+> lookupM y [] = fail "Not found"
+> lookupM y ((x,v):xs) | x == y = return v
+>                      | otherwise = lookupM y xs
+
+Look for a file in the current directory, then each directory listed
+in turn. If present, return the contents, otherwise fail
+
+> findFile :: [FilePath] -> FilePath -> IO String
+> findFile fp fn = ff' (".":fp) fn
+>   where ff' [] fn = fail "File not found in search path"
+>         ff' (d:ds) fn = do
+>                         catch (do content <- readFile $ d ++ "/" ++ fn
+>                                   return content)
+>                               (\e -> ff' ds fn)
diff --git a/Ivor/Grouper.lhs b/Ivor/Grouper.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Grouper.lhs
@@ -0,0 +1,59 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Grouper where
+
+> import Ivor.TTCore
+> import Ivor.Nobby
+> import Ivor.Constant
+
+TT expressions with lambdas/function arguments grouped, for better lambda
+lifting.
+
+> data GroupTT n
+>    = GP n
+>    | GV Int
+>    | GCon Int n [GroupTT n] -- Saturated now
+>    | GTyCon n Int
+>    | GElim n
+>    | GApp (GroupTT n) [GroupTT n]
+>    | GLam [GroupTT n] Int (GroupTT n) -- Variables and level
+>    | GLet (GroupTT n) (GroupTT n) (GroupTT n)
+>    | GPi (GroupTT n) (GroupTT n)
+>    | GProj Int (GroupTT n)
+>    | forall c. Constant c => GConst c
+>    | GStar
+>    | GCant
+>  -- deriving Show
+
+> group :: Show n => Levelled n -> GroupTT n
+> group (Lev term) = gr 0 term where
+>    gr l (P n) = GP n
+>    gr l (V i) = GV i
+>    gr l c@(Con t n a) = mkApp l c []
+>    gr l (TyCon n a) = GTyCon n a
+>    gr l (Elim n) = GElim n
+>    gr l c@(App f a) = mkApp l c []
+>    gr l (Bind n (B Lambda t) (Sc sc)) = mkLam (l+1) [gr l t] sc
+>    gr l (Bind n (B Pi t) (Sc sc)) = GPi (gr l t) (gr (l+1) sc)
+>    gr l (Bind n (B (Let v) t) (Sc sc)) 
+>		      = GLet (gr l v) (gr l t) (gr (l+1) sc)
+>    gr l (Proj _ i t) = GProj i (gr l t)
+>    gr l (Const c) = GConst c
+>    gr l (Label t _) = gr l t
+>    gr l (Call _ t) = gr l t
+>    gr l (Return t) = gr l t
+>    gr l Star = GStar
+>    gr _ _ = GCant
+
+>    mkApp l (App f a) sp = mkApp l f ((gr l a):sp)
+>    mkApp l (Con t n a) sp | length sp == a = GCon t n sp
+>		            | otherwise = saturate l t n a sp
+>    mkApp l x sp = GApp (gr l x) sp
+
+>    mkLam l xs (Bind n (B Lambda t) (Sc sc)) 
+>            = mkLam (l+1) (xs++[gr l t]) sc
+>    mkLam l xs sc = GLam xs (l-length xs) (gr l sc)
+
+>    saturate lev tag name arity sp 
+>            = error $ "Constructor saturation unimplemented " ++ show term
+
diff --git a/Ivor/ICompile.lhs b/Ivor/ICompile.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/ICompile.lhs
@@ -0,0 +1,90 @@
+> module Ivor.ICompile where
+
+> import Ivor.TTCore
+> import Ivor.Datatype
+> import Ivor.Nobby
+> import Ivor.Gadgets
+
+> import Data.List
+> import Debug.Trace
+
+Structure of simple case expressions, from which we can build actual code for
+elimination rules in whatever form we like, eg for NBE or compiled code.
+
+> data SimpleCase = Case Name Int [SimpleCase] -- case x::ty of xs, x is a local var
+>                 | IReduce (Indexed Name) -- Found a reduction!
+>	          | Impossible -- No well-typed term can get here
+>   deriving Show
+
+Compile a set of iota schemes to simple case structure.
+
+TMP ASSUMPTION: There is always one argument where all cases are disjoint.
+We can make sure this is always the case even for detaggable/collapsible
+families, although we should do better later.
+
+> compileSchemes :: [Scheme Name] -> SimpleCase
+> compileSchemes [] = Impossible
+> compileSchemes ss = icomp ss [0..(length (getPat (ss!!0)))-1]
+>    where icomp ss es = let pats = transpose (map getPat ss) in
+>			 let (pats',es') = unzip $ orderPatts (zip pats es) in
+>			 let ss' = mangleArgOrder ss (reverse es') in
+>			 let top = map schhead ss'
+>			     rest = map schtail ss' in
+>			 icomp' top rest es'
+>          schhead (Sch x red) = (head x, red)
+>          schtail (Sch x red) = Sch (tail x) red
+>          icomp' x xs (e:es) | allDisjoint (map fst x) = doCase1 e x
+>		              | otherwise = error "Can't find a scrutinee"
+>          orderPatts = sortBy cmpPat
+>          cmpPat (p,v) (p',v') = compare (numDisjoint p') (numDisjoint p)
+
+I wish I'd written a comment here when I wrote this...
+
+> mangleArgOrder :: [Scheme Name] -> [Int] -> [Scheme Name]
+> mangleArgOrder [] _ = []
+> mangleArgOrder (x:xs) es = (ma' x es):(mangleArgOrder xs es)
+>    where ma' (Sch ps ired) es = Sch (reorder ps es) ired
+>          reorder ps xs = foldl (\ih x -> (ps!!x):ih) [] xs
+
+> allDisjoint ps = numDisjoint ps == length ps
+
+> numDisjoint :: [Pattern n] -> Int
+> numDisjoint [] = 0
+> numDisjoint (x:xs) | x `djWith` xs = 1+(numDisjoint xs)
+>	             | otherwise = numDisjoint xs
+>   where djWith (PCon _ _ _ _) [] = True
+>         djWith _ [] = False
+>         djWith x (y:ys) | dj x y = djWith x ys
+>		          | otherwise = False
+>         dj (PCon x _ _ _) (PCon y _ _ _) = x /= y
+>         dj _ _ = False
+
+Case 1: All patterns are disjoint.
+
+> doCase1 :: Int -> [(Pattern Name, Indexed Name)] -> SimpleCase
+> doCase1 x ps = Case (ty ps) x (order ps)
+>    where order ps = insertDefaults
+>	                  (sortBy (\ (x,y) (x',y') -> compare x x') ps)
+>	   insertDefaults ps = id' 0 ps
+>          id' n [] = []
+>	   id' n allps@((PCon i _ _ _,t):ps)
+>             | n == i = (IReduce t):(id' (n+1) ps)
+>             | otherwise = Impossible:(id' (n+1) allps)
+>          ty ((PCon _ _ tyname _, _):xs) = tyname
+
+
+Make an elimination rule implementation from a simple case expression.
+
+> mkElim :: Name -> (Indexed Name) -> Int -> SimpleCase -> ElimRule
+> mkElim ename ty arity cs sp | size sp /= arity = Nothing
+>		              | otherwise = doElim sp cs
+>   where doElim sp Impossible = Nothing
+>         doElim sp (Case _ x cs) = let xval = (sp??x) in
+>                    case xval of
+>		      (MR (RCon tag _ _)) -> doElim sp (cs!!tag)
+>		      _ -> Nothing
+>         doElim sp (IReduce (Ind t))
+>                = let recrule = mkElim ename ty arity cs
+>		       gam = Gam ((ename,G (ElimRule recrule) ty defplicit):[])
+>		       red = (nf gam (VG (revlistify sp)) [] False t)
+>			 in (Just red)
diff --git a/Ivor/MakeData.lhs b/Ivor/MakeData.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/MakeData.lhs
@@ -0,0 +1,128 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.MakeData where
+
+> import Ivor.TTCore
+> import Ivor.Datatype
+
+> import Debug.Trace
+
+Transform a raw data declaration (just parameters and constructors)
+into a full data definition with iota schemes.
+
+FIXME: Throughout all this, need to ensure that the elimination operator name,
+the target, methods and the motives are unique.
+
+> type Params = [(Name,Raw)]
+> type Constructors = [(Name,Raw)]
+
+> mkRawData :: Monad m =>
+>              Name -> Params -> Raw -> Constructors -> m RawDatatype
+> mkRawData name params contype cons = 
+>     let ecasetype = mkCaseType True name params contype cons 
+>                                motiveName methNames
+>         ccasetype = mkCaseType False name params contype cons 
+>                                motiveName methNames
+>         datacons = mkDatacons params cons
+>         eischemes = mkSchemes True name (ruleName name "Elim") 
+>                               params datacons motiveName methNames
+>         cischemes = mkSchemes False name (ruleName name "Case") 
+>                               params datacons motiveName methNames
+>         tycontype = mkCon params contype in
+>         return $ --(trace (show ischemes)) $  
+>          RData (name,tycontype) datacons (length params)
+>                    (ruleName name "Elim", ecasetype) -- elim rule
+>                    (ruleName name "Case", ccasetype) -- case rule
+>                    eischemes -- elim rule iota schemes
+>                    cischemes -- case rule iota schemes
+
+>    where ruleName (UN n) suff = (UN (n++suff)) -- TMP HACK!
+>          motiveName = (UN "Phi")
+>          methName (UN n) = (UN ("meth_"++n))
+>          methNames = map (methName.fst) cons
+ 
+> mkSchemes :: Bool -> Name -> Name -> Params -> Constructors -> Name -> 
+>              [Name] -> [RawScheme]
+> mkSchemes rec n ername ps cs motive mns = mks cs mns mns 
+>    where mks [] [] mns = [] 
+>          mks ((c,cty):cs) (m:ms) mns 
+>              = (mkScheme rec n ername ps c cty motive mns m):(mks cs ms mns)
+
+> mkScheme rec n ername ps c cty motive mns meth 
+>     = RSch (mkIArgs ps c cty motive mns) 
+>            (mkIRet rec n ername meth motive mns ps cty)
+
+> mkIArgs ps c cty motive mns = getappargs (getrettype cty) ++
+>                               [mkapp (Var c) (map Var (getargnames cty))] ++
+>                               (map Var (motive:mns))
+
+> mkIRet rec tyname ername meth motive mns ps cty = 
+>     mkapp (Var meth) (drop (length ps) (mkArgs cty))
+>   where mkArgs (RBind n (B Pi ty) sc) 
+>            | isrec ty tyname && rec 
+>                = (Var n):(mkRecApp ername ty n motive mns):(mkArgs sc)
+>            | otherwise = (Var n):(mkArgs sc)
+>         mkArgs _ = []
+>         mkRecApp en ty n motive mns = 
+>             mkapp (Var en) $ (getappargs ty)++(map Var (n:motive:mns))
+
+
+> mkCon :: Params -> Raw -> Raw
+> mkCon [] ty = ty
+> mkCon ((x,xty):xs) ty = RBind x (B Pi xty) (mkCon xs ty)
+
+> mkDatacons :: Params -> Constructors -> Constructors
+> mkDatacons _ [] = []
+> mkDatacons ps ((x,xty):xs) = (x,(mkCon ps xty)):(mkDatacons ps xs)
+
+> mkCaseType :: Bool -> Name -> Params -> Raw -> Constructors -> Name -> 
+>               [Name] -> Raw
+> mkCaseType rec n ps ty cs motiveName mns 
+>     = bindParams ps $
+>       bindIndices ty $
+>       bindTarget targetName n ps ty $
+>       bindMotive motiveName targetName n ps ty $
+>       bindMethods rec n motiveName ps cs mns $
+>       applyMethod motiveName targetName ty
+>    where targetName = UN "target" -- TMP HACK!
+
+> bindParams [] rest = rest
+> bindParams ((n,ty):xs) rest = RBind n (B Pi ty) (bindParams xs rest)
+
+> bindIndices (RBind n (B Pi ty) sc) rest 
+>     = (RBind n (B Pi ty) (bindIndices sc rest))
+> bindIndices sc rest = rest
+
+> bindTarget x n ps ty rest 
+>     = RBind x 
+>       (B Pi (mkapp (Var n) (map Var ((map fst ps)++(getargnames ty)))))
+>       rest
+
+> bindMotive p x n ps ty rest
+>     = RBind p
+>       (B Pi (bindIndices ty $
+>              bindTarget x n ps ty $
+>              RStar)) rest
+
+> bindMethods rec tyname p ps [] [] rest = rest
+> bindMethods rec tyname p ps ((n,ty):cs) (mn:mns) rest 
+>     = RBind mn (B Pi (methtype ty)) (bindMethods rec tyname p ps cs mns rest)
+>  where methtype (RBind a (B Pi argtype) sc) 
+>            | isrec argtype tyname && rec
+>                = (RBind a (B Pi argtype) (mkrec a argtype sc))
+>            | otherwise = (RBind a (B Pi argtype) (methtype sc))
+>        methtype sc = mkapp (Var p) $ (getindices sc)++
+>              [mkapp (Var n) (map Var ((map fst ps)++(getargnames ty)))]
+>        mkrec a argtype sc = (RBind (ih a) (B Pi (rectype a argtype p)) 
+>                                        (methtype sc))
+>        getindices x = drop (length ps) (getappargs x)
+>        ih (UN a) = UN (a++"_IH")
+>        rectype a aty p = mkapp (Var p) ((drop (length ps) (getappargs aty)++[Var a]))
+
+> applyMethod p x ty = mkapp (Var p) ((map Var (getargnames ty)) ++ [Var x])
+
+
+> isrec t tyname = (Var tyname) == getappfun t
+
+> placeholder = Var (UN "Waitforit")
+
diff --git a/Ivor/Nobby.lhs b/Ivor/Nobby.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Nobby.lhs
@@ -0,0 +1,686 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Nobby where
+
+> import Ivor.TTCore
+> import Ivor.Gadgets
+> import Ivor.Constant
+
+> import Data.List
+> import Control.Monad
+> import Data.Typeable
+
+> import Debug.Trace
+
+To begin, we need to define the context in which normalisation takes place.
+The context maps names to user defined functions, constructors and
+elimination rules.
+
+Global represents all possible global names --- if it's a user defined
+name, hold its definition, otherwise hold what it is so we know what
+to do with it, when the time comes.
+
+> data Global n
+>     = Fun [FunOptions] (Indexed n)    -- User defined function
+>     | Partial (Indexed n) [n] -- Unfinished definition
+>     | PatternDef (PMFun n) -- Pattern matching definition
+>     | ElimRule ElimRule  -- Elimination Rule
+>     | PrimOp PrimOp EvPrim     -- Primitive function
+>     | DCon Int Int       -- Data Constructor, tag and arity
+>     | TCon Int (Elims n) -- Type Constructor and arity, elim rule name
+>     | Unreducible        -- Unreducible name
+>     | Undefined          -- Declared but undefined name
+
+> data Elims n = Elims { elimRuleName :: n,
+>                        caseRuleName :: n,
+>                        constructors :: [n] }
+>              | NoConstructorsYet
+
+> data FunOptions = Frozen | Recursive
+>   deriving Eq
+
+> instance Show n => Show (Global n) where
+>     show (Fun opts t) = "Fun " ++ show t
+>     show (ElimRule _) = "<<elim rule>>"
+>     show (PrimOp _ _) = "<<primitive operator>>"
+>     show (DCon x t) = "DCon " ++ show x ++ "," ++show t
+>     show (TCon x (Elims e c cons)) = "TCon " ++ show x
+>     show Unreducible = "Unreducible"
+>     show Undefined = "Undefined"
+
+> type Plicity = Int
+
+> defplicit = 0
+
+> data Gval n = G (Global n) (Indexed n) Plicity
+>    deriving Show
+
+> getglob (G v t p) = v
+> gettype (G v t p) = t
+> getplicity (G v t p) = p
+
+> newtype Gamma n = Gam [(n,Gval n)]
+>     deriving Show
+
+> extend (Gam x) (n,v) = Gam ((n,v):x)
+
+> emptyGam = Gam []
+
+> lookupval :: Eq n => n -> Gamma n -> Maybe (Global n)
+> lookupval n (Gam xs) = fmap getglob (lookup n xs)
+
+> lookuptype :: Eq n => n -> Gamma n -> Maybe (Indexed n)
+> lookuptype n (Gam xs) = fmap gettype (lookup n xs)
+
+> glookup ::  Eq n => n -> Gamma n -> Maybe (Global n,Indexed n)
+> glookup n (Gam xs) = fmap (\x -> (getglob x,gettype x)) (lookup n xs)
+
+Get a type name from the context
+
+> getTyName :: Monad m => Gamma Name -> Name -> m Name
+> getTyName  gam n = case lookuptype n gam of
+>                            Just (Ind ty) -> return $ getFnName ty
+>                            Nothing -> fail $ "No such name " ++ show n
+>   where getFnName (TyCon x _) = x
+>         getFnName (App f x) = getFnName f
+>         getFnName (Bind _ _ (Sc x)) = getFnName x
+>         getFnName x = MN ("Dunno: "++show x, 0)
+
+Return whether a name is a recursive constructor (i.e, its family name
+occurs anywhere in its arguments).
+
+> recCon :: Name -> Gamma Name -> Bool
+> recCon n gam = case glookup n gam of
+>                  (Just (DCon _ t, Ind ty)) ->
+>                      checkRec (conFamily ty) (map snd (getExpected ty))
+>                  _ -> False
+>    where conFamily t = fname (getFun (getReturnType t))
+>          fname (TyCon n _) = n
+>          fname _ = MN ("ERROR!",0)
+>          checkRec n [] = False
+>          checkRec n (x:xs) = nameOccurs n (forget x) || checkRec n xs
+
+> insertGam :: n -> Gval n -> Gamma n -> Gamma n
+> insertGam nm val (Gam gam) = Gam $ (nm,val):gam
+
+> concatGam :: Gamma n -> Gamma n -> Gamma n
+> concatGam (Gam x) (Gam y) = Gam (x++y)
+
+> setFrozen :: Eq n => n -> Bool -> Gamma n -> Gamma n
+> setFrozen n freeze (Gam xs) = Gam $ sf xs where
+>    sf [] = []
+>    sf ((p,G (Fun opts v) ty plicit):xs)
+>        | n == p = (p,G (Fun (doFreeze freeze opts) v) ty plicit):xs
+>    sf (x:xs) = x:(sf xs)
+>    doFreeze True opts = nub (Frozen:opts)
+>    doFreeze False opts = opts \\ [Frozen]
+
+> setRec :: Eq n => n -> Bool -> Gamma n -> Gamma n
+> setRec n frec (Gam xs) = Gam $ sf xs where
+>    sf [] = []
+>    sf ((p,G (Fun opts v) ty plicit):xs)
+>        | n == p = (p,G (Fun (doFrec frec opts) v) ty plicit):xs
+>    sf (x:xs) = x:(sf xs)
+>    doFrec True opts = nub (Recursive:opts)
+>    doFrec False opts = opts \\ [Recursive]
+
+
+> freeze :: Eq n => n -> Gamma n -> Gamma n
+> freeze n gam = setFrozen n True gam
+
+> thaw :: Eq n => n -> Gamma n -> Gamma n
+> thaw n gam = setFrozen n False gam
+
+Remove a name from the middle of the context - should only be valid
+if it's a partial definition or an axiom which is about to be replaced.
+
+> remove :: Eq n => n -> Gamma n -> Gamma n
+> remove n (Gam xs) = Gam $ rm n xs where
+>    rm n [] = []
+>    rm n (d@(p,_):xs) | n==p = xs
+>                      | otherwise = d:(rm n xs)
+
+Insert a name into the context. If the name is already there, this
+is an error *unless* the old definition was 'Undefined', in which case
+the name is replaced.
+
+> gInsert :: (Monad m, Eq n, Show n) => n -> Gval n -> Gamma n -> m (Gamma n)
+> gInsert nm val (Gam xs) = do xs' <- ins nm val xs []
+>                              return $ Gam xs'
+>   where ins n val [] acc = return $ (n,val):(reverse acc)
+>         -- FIXME: Check ty against val
+>         ins n val (d@(p,G Undefined ty _):xs) acc
+>             | n == p = return $ (n,val):(reverse acc) ++ xs
+>         ins n val (d@(p,G (TCon _ NoConstructorsYet) ty _):xs) acc
+>             | n == p = return $ (n,val):(reverse acc) ++ xs
+>         ins n val (d@(p,_):xs) acc
+>             | n == p = fail $ "Name " ++ show p ++ " is already defined"
+>             | otherwise = ins n val xs (d:acc)
+
+An ElimRule is a Haskell implementation of the iota reductions of
+a family.
+
+> type ElimRule = Spine Value -> Maybe Value
+
+A PrimOp is an external operation
+
+> type PrimOp = Spine Value -> Maybe Value
+> type EvPrim = [TT Name] -> Maybe (TT Name) -- same, but with tt terms rather than values
+
+Model represents normal forms, including Ready (reducible) and Blocked
+(non-reducible) forms.
+
+> data Model s = MR (Ready s)
+>              | MB (Blocked s, Model s) (Spine (Model s))
+
+> data Ready s
+>     = RdBind Name (Binder (Model s)) (s (Model s))
+>     | RCon Int Name (Spine (Model s))
+>     | RTyCon Name (Spine (Model s))
+>     | forall c. Constant c => RdConst c
+>     | RdStar
+>     | RdLabel (Model s) (MComp s)
+>     | RdCall (MComp s) (Model s)
+>     | RdReturn (Model s)
+>     | RdCode (Model s)
+>     | RdQuote (Model s) -- (TT Name)
+>     | RdInfer
+
+> data Blocked s
+>     = BCon Int Name Int
+>     | BTyCon Name Int
+>     | BElim ElimRule Name
+>     | BPatDef (PMFun Name) Name
+>     | BPrimOp PrimOp Name
+>     | BRec Name Value
+>     | BP Name
+>     | BV Int
+>     | BEval (Model s) (Model s)
+>     | BEscape (Model s) (Model s)
+
+> data MComp s = MComp Name [Model s]
+
+> newtype Weakening = Wk Int
+
+Second weakening is cached to prevent function composition in the weaken
+class.
+
+> newtype Kripke x = Kr (Weakening -> x -> x, Weakening)
+
+> type Value = Model Kripke
+> type Normal = Model Scope
+
+> newtype Ctxt = VG [Value]
+
+> type PatVals = [(Name, Value)]
+
+The normalisation function itself.
+
+We take a flag saying whether this is for conversion checking or not. This is
+necessary because staged evaluation will not reduce things inside a quote
+to normal form, but we need a normal form to compare.
+
+> nf :: Gamma Name -> Ctxt
+>    -> PatVals
+>    -> Bool -- ^ For conversion
+>    -> TT Name -> Value
+> nf g c patvals conv t = eval 0 g c t where
+
+Get the type of a given name in the context
+
+>  pty n = case lookuptype n g of
+>             (Just (Ind ty)) -> nf g c [] conv ty
+>             Nothing -> error "Can't happen, no such name, Nobby.lhs"
+
+Do the actual evaluation
+
+>  eval stage gamma (VG g) (V n)
+>      | (length g) <= n = MB (BV n, MR RdInfer) Empty -- error $ "Reference out of context! " ++ show n ++ ", " ++ show (length g) --
+>      | otherwise = g!!n
+>  eval stage gamma g (P n)
+>      = case lookup n patvals of
+>           Just val -> val
+>           Nothing -> evalP (lookupval n gamma)
+>    where evalP (Just Unreducible) = (MB (BP n,pty n) Empty)
+>          evalP (Just Undefined) = (MB (BP n, pty n) Empty)
+>          evalP (Just (PatternDef p@(PMFun 0 pats))) =
+>              case patmatch gamma g pats [] of
+>                 Nothing ->  (MB (BPatDef p n, pty n) Empty)
+>                 Just v -> v
+>          evalP (Just (PatternDef p)) = (MB (BPatDef p n, pty n) Empty)
+>          evalP (Just (Partial (Ind v) _)) = (MB (BP n, pty n) Empty)
+>          evalP (Just (PrimOp f _)) = (MB (BPrimOp f n, pty n) Empty)
+>          evalP (Just (Fun opts (Ind v)))
+> --               | Frozen `elem` opts && not conv = MB (BP n) Empty
+>                -- recursive functions don't reduce in conversion check, to
+>                -- maintain decidability of typechecking
+>                  | Recursive `elem` opts  && conv
+>                    = MB (BP n, pty n) Empty
+>                  | otherwise
+>                    = eval stage gamma g v
+>          evalP _ = (MB (BP n, pty n) Empty)
+>              --error $ show n ++
+>	         --      " is not a function. Something went wrong."
+>                    -- above error is unsound; if names are rebound.
+>  eval stage gamma g (Con tag n 0) = (MR (RCon tag n Empty))
+>  eval stage gamma g (Con tag n i) = (MB (BCon tag n i, pty n) Empty)
+>  eval stage gamma g (TyCon n 0) = (MR (RTyCon n Empty))
+>  eval stage gamma g (TyCon n i) = (MB (BTyCon n i, pty n) Empty)
+>  eval stage gamma g (Const x) = (MR (RdConst x))
+>  eval stage gamma g Star = MR RdStar
+>  eval stage gamma (VG g) (Bind n (B Lambda ty) (Sc sc)) =
+>      (MR (RdBind n (B Lambda (eval stage gamma (VG g) ty))
+>         (Kr (\w x -> eval stage gamma (VG (x:(weaken w g))) sc,Wk 0))))
+>  eval stage gamma (VG g) (Bind n (B (Let val) ty) (Sc sc)) =
+>      eval stage gamma (VG ((eval stage gamma (VG g) val):g)) sc
+>  eval stage gamma (VG g) (Bind n (B Pi ty) (Sc sc)) =
+>      (MR (RdBind n (B Pi (eval stage gamma (VG g) ty))
+>         (Kr (\w x -> eval stage gamma (VG (x:(weaken w g))) sc,Wk 0))))
+>  eval stage gamma (VG g) (Bind n (B Hole ty) (Sc sc)) =
+>      (MR (RdBind n (B Hole (eval stage gamma (VG g) ty))
+>         (Kr (\w x -> eval stage gamma (VG (x:(weaken w g))) sc,Wk 0))))
+>  eval stage gamma (VG g) (Bind n (B (Guess v) ty) (Sc sc)) =
+>      (MR (RdBind n (B (Guess (eval stage gamma (VG g) v)) (eval stage gamma (VG g) ty))
+>         (Kr (\w x -> eval stage gamma (VG (x:(weaken w g))) sc,Wk 0))))
+>  eval stage gamma g (Proj _ x t) = case (eval stage gamma g t) of
+>			 MR (RCon _ _ sp) -> traceIndex (listify sp) x "Nobby.lhs, Proj"
+>			 _ -> error "Foo" -- MB (BProj x (eval stage gamma g t))
+>  eval stage gamma g (App f a) = apply gamma g (eval stage gamma g f) (eval stage gamma g a)
+>  eval stage gamma g (Call c t) = docall g (evalcomp stage gamma g c) (eval stage gamma g t)
+>  eval stage gamma g (Label t c) = MR (RdLabel (eval stage gamma g t) (evalcomp stage gamma g c))
+>  eval stage gamma g (Return t) = MR (RdReturn (eval stage gamma g t))
+>  eval stage gamma g (Elim n) = MB (BElim (getelim (lookupval n gamma)) n, pty n) Empty
+>    where getelim Nothing = \sp -> Nothing
+>          getelim (Just (ElimRule x)) = x
+>          getelim y = error $ show n ++
+>            " is not an elimination rule. Something went wrong." ++ show y
+>  eval stage gamma g (Stage s) = evalStage stage gamma g s
+
+>  evalcomp stage gamma g (Comp n ts) = MComp n (map (eval stage gamma g) ts)
+
+>  evalStage stage gamma g (Code t) = MR (RdCode (eval stage gamma g t))
+>  evalStage stage gamma g (Quote t) = if conv
+>     then -- let cd = (forget ((quote (eval stage gamma g t)::Normal))) in
+>          --             MR (RdQuote cd)
+>          MR (RdQuote (eval (stage+1) gamma g t))
+>     -- This is again a bit of a hack, just evaluating without any definitions
+>     -- but it is a nice cheap way of seeing what we'd have to generate code
+>     -- for at run-time.
+>     else MR (RdQuote (eval (stage+1) (Gam []) g t))
+>     -- else let cd = (forget ((quote (eval (Gam []) g t)::Normal))) in
+>        --               MR (RdQuote cd)
+>        -- MR (RdQuote (substV g t)) --(splice t)) -- broken
+>  evalStage stage gamma g (Eval t ty) = case (eval (stage+1) gamma g t) of
+>                            (MR (RdQuote t')) -> eval stage gamma g
+>                                                   (forget ((quote t')::Normal))
+>                            x -> MB (BEval x bty, bty) Empty
+>     where bty = eval stage gamma g ty
+>  evalStage stage gamma g (Escape t ty) = case (eval (stage+1) gamma g t) of
+>                            (MR (RdQuote t')) ->
+>                                if (stage>0)
+>                                   then t'
+>                                   else eval stage gamma g (forget ((quote t')::Normal))
+>                            x -> MB (BEscape x bty, bty) Empty -- needed for conversion check
+>     where bty = eval stage gamma g ty
+
+>                            --_ -> error $ "Can't escape something non quoted " ++ show t
+
+> docall :: Ctxt -> MComp Kripke -> Value -> Value
+> docall g _ (MR (RdReturn v)) = v
+> docall g c v = MR (RdCall c v)
+
+> apply :: Gamma Name -> Ctxt -> Value -> Value -> Value
+> apply gam = app where
+>  app g (MR (RdBind _ (B Lambda ty) k)) v = krApply k v
+>  app g (MB (BElim e n, ty) sp) v = error "Elimination rules are eliminated"
+>  {-    case e (Snoc sp v) of
+>         Nothing -> (MB (BElim e n, ty) (Snoc sp v))
+>         (Just v) -> v -}
+>  app g (MB pat@(BPatDef (PMFun ar pats) n, ty) sp) v
+>      | size (Snoc sp v) == ar =
+>         case patmatch gam g pats (listify (Snoc sp v)) of
+>           Nothing -> (MB pat (Snoc sp v))
+>           Just v -> v
+>      | otherwise = MB pat (Snoc sp v)
+>  app g (MB (BPrimOp e n, ty) sp) v
+>    = case e (Snoc sp v) of
+>        Nothing -> (MB (BPrimOp e n, ty) (Snoc sp v))
+>        (Just v) -> v
+>  app g (MB (BCon tag n i, ty) sp) v
+>      | size (Snoc sp v) == i = (MR (RCon tag n (Snoc sp v)))
+>      | otherwise = (MB (BCon tag n i, ty) (Snoc sp v))
+>  app g (MB (BTyCon n i, ty) sp) v
+>      | size (Snoc sp v) == i = (MR (RTyCon n (Snoc sp v)))
+>      | otherwise = (MB (BTyCon n i, ty) (Snoc sp v))
+>  app g (MB bl sp) v = MB bl (Snoc sp v)
+>  app g v a = error $ "Can't apply a non function " ++ show (forget ((quote v)::Normal)) ++ " to argument " ++ show (forget ((quote a)::Normal))
+
+  constructorsIn Empty = False
+  constructorsIn (Snoc xs (MR (RCon _ _ _))) = True
+  constructorsIn (Snoc xs _) = constructorsIn xs
+
+> krApply :: Kripke Value -> Value -> Value
+> krApply (Kr (f,w)) x = f w x
+
+> patmatch :: Gamma Name -> Ctxt -> [PMDef Name] -> [Value] -> Maybe Value
+> patmatch gam g [] _ = Nothing
+> patmatch gam g ((Sch pats ret):ps) vs = case pm gam g pats vs ret [] of
+>                         Nothing -> patmatch gam g ps vs
+>                         Just v -> Just v
+
+> pm :: Gamma Name -> Ctxt -> [Pattern Name] -> [Value] -> Indexed Name ->
+>       [(Name, Value)] -> -- matches so far
+>       Maybe Value
+> pm gam g [] [] (Ind ret) vals = Just $ nf gam g vals False ret
+> pm gam g (pat:ps) (val:vs) ret vals
+>    = do newvals <- pmatch pat val vals
+>         newvals <- checkdups newvals
+>         pm gam g ps vs ret newvals
+
+> checkdups v = Just v
+
+> pmatch :: Pattern Name -> Value -> [(Name,Value)] -> Maybe [(Name, Value)]
+> pmatch PTerm x vs = Just vs
+> pmatch (PVar n) v vs = Just ((n,v):vs)
+> pmatch (PConst t) (MR (RdConst t')) vs = do tc <- cast t
+>                                             if tc == t' then Just vs
+>                                                    else Nothing
+> pmatch (PCon t _ _ args) (MR (RCon t' _ sp)) vs | t == t' =
+>    pmatches args (listify sp) vs
+>   where pmatches [] [] vs = return vs
+>         pmatches (a:as) (b:bs) vs = do vs' <- pmatch a b vs
+>                                        pmatches as bs vs'
+>         pmatches _ _ _ = Nothing
+> pmatch _ _ _ = Nothing
+
+
+ RCon Int Name (Spine (Model s))
+
+ applySpine :: Ctxt -> Value -> Spine Value -> Value -> Value
+ applySpine g fn Empty v = apply g fn v
+ applySpine g fn (Snoc sp x) v = apply g (applySpine g fn sp x) v
+
+Splice the escapes inside a term
+
+> splice :: TT Name -> TT Name
+> splice = mapSubTerm (splice.st) where
+>   st (Stage (Escape (Stage (Quote t)) _)) = (splice t)
+>   st x = x
+
+> class Weak x where
+>     weaken :: Weakening -> x -> x
+>     weaken (Wk 0) x = x
+>     weaken (Wk n) x = weakenp n x
+>     weakenp :: Int -> x -> x
+
+> instance Weak Int where
+>     weakenp i j = i + j
+
+> instance (Weak a, Weak b) => Weak (a,b) where
+>     weakenp i (x,y) = (weakenp i x, weakenp i y)
+
+> instance Weak Weakening where
+>     weakenp i (Wk j) = Wk (i + j)
+
+> instance Weak (Model Kripke) where
+>     weakenp i (MR r) = MR (weakenp i r)
+>     weakenp i (MB b sp) = MB (weakenp i b) (fmap (weakenp i) sp)
+
+> instance Weak (Ready Kripke) where
+>     weakenp i (RdBind n bind sc) = RdBind n (weakenp i bind) (weakenp i sc)
+>     weakenp i (RdConst x) = RdConst x
+>     weakenp i RdStar = RdStar
+>     weakenp i (RCon t n sp) = RCon t n (fmap (weakenp i) sp)
+>     weakenp i (RTyCon n sp) = RTyCon n (fmap (weakenp i) sp)
+>     weakenp i (RdLabel t c) = RdLabel (weakenp i t) (weakenp i c)
+>     weakenp i (RdCall c t) = RdCall (weakenp i c) (weakenp i t)
+>     weakenp i (RdReturn t) = RdReturn (weakenp i t)
+>     weakenp i (RdCode t) = RdCode (weakenp i t)
+>     weakenp i (RdQuote t) = RdQuote (weakenp i t)
+
+> instance Weak (TT Name) where
+>     weakenp i t = vapp (\ (ctx,v) -> V (weakenp i v)) t
+
+> instance Weak (MComp Kripke) where
+>     weakenp i (MComp n ts) = MComp n (fmap (weakenp i) ts)
+
+> instance Weak n => Weak (Binder n) where
+>     weakenp i (B (Let v) ty) = B (Let (weakenp i v)) (weakenp i ty)
+>     weakenp i (B (Guess v) ty) = B (Guess (weakenp i v)) (weakenp i ty)
+>     weakenp i (B b ty) = B b (weakenp i ty)
+
+> instance Weak (Blocked Kripke) where
+>     weakenp i (BCon t n j) = BCon t n j
+>     weakenp i (BTyCon n j) = BTyCon n j
+>     weakenp i (BElim e n) = BElim e n
+>     weakenp i (BPatDef p n) = BPatDef p n
+>     weakenp i (BRec n v) = BRec n v
+>     weakenp i (BPrimOp e n) = BPrimOp e n
+>     weakenp i (BP n) = BP n
+>     weakenp i (BV j) = BV (weakenp i j)
+>     weakenp i (BEval t ty) = BEval (weakenp i t) (weakenp i ty)
+>     weakenp i (BEscape t ty) = BEscape (weakenp i t) (weakenp i ty)
+
+> instance Weak (Kripke x) where
+>     weakenp i (Kr (f,w)) = Kr (f,weakenp i w)
+
+> instance Weak Ctxt where
+>     weakenp i (VG g) = VG (weakenp i g)
+
+> instance Weak x => Weak [x] where
+>     weakenp i xs = fmap (weakenp i) xs
+
+> class Quote x y where
+>     quote :: x -> y
+>     quote' :: [Name] -> x -> y
+>     quote = quote' []
+
+> instance Quote Value Normal where
+>     quote' ns (MR r) = MR (quote' ns r)
+>     quote' ns (MB (b, ty) sp) = MB (quote' ns b, quote' ns ty)
+>                                    (fmap (quote' ns) sp)
+
+> instance Quote (Ready Kripke) (Ready Scope) where
+>     quote' ns (RdConst x) = RdConst x
+>     quote' ns RdStar = RdStar
+>     quote' ns (RdBind n b@(B _ ty) sc)
+>             = let n' = mkUnique n ns in
+>                        RdBind n' (quote' ns b)
+>                                   (Sc (quote' (n':ns) (krquote ty sc)))
+>        where mkUnique n ns | n `elem` ns =
+>                                case n of
+>                                   (UN nm) -> (mkUnique (MN (nm, 0)) ns)
+>                                   (MN (nm,i)) -> (mkUnique (MN (nm, i+1)) ns)
+>                            | otherwise = n
+
+>     quote' ns (RCon t c sp) = RCon t c (fmap (quote' ns) sp)
+>     quote' ns (RTyCon c sp) = RTyCon c (fmap (quote' ns) sp)
+>     quote' ns (RdLabel t c) = RdLabel (quote' ns t) (quote' ns c)
+>     quote' ns (RdCall c t) = RdCall (quote' ns c) (quote' ns t)
+>     quote' ns (RdReturn t) = RdReturn (quote' ns t)
+>     quote' ns (RdCode t) = RdCode (quote' ns t)
+>     quote' ns (RdQuote t) = RdQuote (quote' ns t)
+
+> instance Quote (Blocked Kripke) (Blocked Scope) where
+>     quote' ns (BCon t n j) = BCon t n j
+>     quote' ns (BTyCon n j) = BTyCon n j
+>     quote' ns (BElim e n) = BElim e n
+>     quote' ns (BPatDef p n) = BPatDef p n
+>     quote' ns (BRec n v) = BRec n v
+>     quote' ns (BPrimOp e n) = BPrimOp e n
+>     quote' ns (BP n) = BP n
+>     quote' ns (BV j) = BV j
+>     quote' ns (BEval t ty) = BEval (quote' ns t) (quote' ns ty)
+>     quote' ns (BEscape t ty) = BEscape (quote' ns t) (quote' ns ty)
+
+> instance Quote (MComp Kripke) (MComp Scope) where
+>     quote' ns (MComp n ts) = MComp n (fmap (quote' ns) ts)
+
+> krquote :: Value -> Kripke Value -> Value
+> krquote t (Kr (f,w)) = f (weaken w (Wk 1)) (MB (BV 0, t) Empty)
+
+> instance Quote n m => Quote (Binder n) (Binder m) where
+>     quote' ns (B b ty) = B (quote' ns b) (quote' ns ty)
+
+> instance Quote n m => Quote (Bind n) (Bind m) where
+>     quote' ns (Let v) = Let (quote' ns v)
+>     quote' ns (Guess v) = Guess (quote' ns v)
+>     quote' ns Lambda = Lambda
+>     quote' ns Pi = Pi
+>     quote' ns Hole = Hole
+
+Quotation to eta long normal form. DOESN'T WORK YET!
+
+-- > instance Quote (Value, Value) Normal where
+-- >     quote (v@(MR (RdBind n (B Lambda _) _)),
+-- >                 (MR (RdBind _ (B Pi ty) (Kr (f,w)))))
+-- >         = (MR (RdBind n (B Lambda (quote ty))
+-- >                (Sc (quote ((apply (VG []) (v) v0),
+-- >                      (f w v0))))))
+-- >       where v0 = MB (BV 0, ty) Empty
+-- >     quote (v, (MR (RdBind n (B Pi ty) (Kr (f,w)))))
+-- >         = (MR (RdBind n (B Lambda (quote ty))
+-- >                (Sc (quote ((apply (VG []) (weaken (Wk 1) v) v0),
+-- >                      (f w v0))))))
+-- >       where v0 = MB (BV 0, ty) Empty
+-- >     quote ((MB (bl,ty) sp), _)
+-- >         = MB (quote bl, quote ty) (fst (qspine sp))
+-- >        where qspine Empty = (Empty, ty)
+-- >              qspine (Snoc sp v)
+-- >                  | (sp', MR (RdBind _ (B Pi t) (Kr (f,w)))) <- qspine sp
+-- >                      = (Snoc sp' (quote (v,weaken (Wk 1) t)),
+-- >                           f w v)
+-- >                  | (sp', t) <- qspine sp
+-- >                      = (Snoc sp' (quote v), t)
+-- > --error $ show (forget ((quote t)::Normal))
+-- >              v0 t = MB (BV 0, t) Empty
+-- >     quote (v, t) = quote v
+
+> instance Forget Normal (TT Name) where
+>     forget (MB (b, _) sp) = makeApp (forget b) (fmap forget sp)
+>     forget (MR r) = forget r
+
+> instance Forget (Blocked Scope) (TT Name) where
+>     forget (BCon t n j) = Con t n j
+>     forget (BTyCon n j) = TyCon n j
+>     forget (BElim e n) = Elim n
+>     forget (BPatDef p n) = P n
+>     forget (BRec n v) = P n
+>     forget (BPrimOp f n) = P n
+>     forget (BP n) = P n
+>     forget (BV i) = V i
+>     forget (BEval t ty) = Stage (Eval (forget t) (forget ty))
+>     forget (BEscape t ty) = Stage (Escape (forget t) (forget ty))
+
+> instance Forget (Ready Scope) (TT Name) where
+>     forget (RdBind n b (Sc sc)) = Bind n (forget b) (Sc (forget sc))
+>     forget (RdConst x) = (Const x)
+>     forget RdStar = Star
+>     forget (RCon t c sp) = makeApp (Con t c (size sp)) (fmap forget sp)
+>     forget (RTyCon c sp) = makeApp (TyCon c (size sp)) (fmap forget sp)
+>     forget (RdLabel t c) = Label (forget t) (forget c)
+>     forget (RdCall c t) = Call (forget c) (forget t)
+>     forget (RdReturn t) = Return (forget t)
+>     forget (RdCode t) = Stage (Code (forget t))
+>     forget (RdQuote t) = Stage (Quote (forget t))
+
+> instance Forget (MComp Scope) (Computation Name) where
+>     forget (MComp n ts) = Comp n (fmap forget ts)
+
+> instance Forget (Binder (Model Scope)) (Binder (TT Name)) where
+>     forget (B b ty) = B (forget b) (forget ty)
+
+> instance Forget (Bind (Model Scope)) (Bind (TT Name)) where
+>     forget (Let v) = Let (forget v)
+>     forget (Guess v) = Guess (forget v)
+>     forget Lambda = Lambda
+>     forget Pi = Pi
+>     forget Hole = Hole
+
+> makeApp :: TT Name -> Spine (TT Name) -> TT Name
+> makeApp f Empty = f
+> makeApp f (Snoc xs x) = (App (makeApp f xs)) x
+
+> normalise :: Gamma Name -> (Indexed Name) -> (Indexed Name)
+> normalise g (Ind t) = Ind (forget (quote (nf g (VG []) [] False t)::Normal))
+
+WARNING: quotation to eta long normal form doesn't work yet.
+
+> etaNormalise :: Gamma Name -> (Indexed Name, Indexed Name) -> (Indexed Name)
+> etaNormalise g (Ind tm, Ind ty) = undefined
+
+-- >     let vtm = (nf g (VG []) [] False tm)
+-- >         vty = (nf g (VG []) [] False ty) in
+-- >       Ind (forget (quote (vtm, vty)::Normal))
+
+> convNormalise :: Gamma Name -> (Indexed Name) -> (Indexed Name)
+> convNormalise g (Ind t)
+>     = Ind (forget (quote (nf g (VG []) [] True t)::Normal))
+
+> normaliseEnv :: Env Name -> Gamma Name -> Indexed Name -> Indexed Name
+> normaliseEnv env g t
+>     = normalise (addenv env g) t
+>   where addenv [] g = g
+>         addenv ((n,B (Let v) ty):xs) (Gam g)
+>             = addenv xs (Gam ((n,G (Fun [] (Ind v)) (Ind ty) defplicit):g))
+>         addenv (_:xs) g = addenv xs g
+
+> convNormaliseEnv :: Env Name -> Gamma Name -> Indexed Name -> Indexed Name
+> convNormaliseEnv env g t
+>     = convNormalise (addenv env g) t
+>   where addenv [] g = g
+>         addenv ((n,B (Let v) ty):xs) (Gam g)
+>             = addenv xs (Gam ((n,G (Fun [] (Ind v)) (Ind ty) defplicit):g))
+>         addenv (_:xs) g = addenv xs g
+
+     = Ind (forget (quote (nf g (VG (valenv env [])) t)::Normal))
+    where valenv [] env = trace (show (map forget ((map quote env)::[Normal]))) $ env
+          valenv ((n,B (Let v) ty):xs) env = valenv xs ((eval env v):env)
+          valenv ((n,B _ ty):xs) env = valenv xs ((MB (BP n) Empty):env)
+          eval env v = nf g (VG env) v
+
+-- > natElim :: ElimRule
+-- > natElim (Snoc args@(Snoc (Snoc (Snoc Empty phi) phiZ) phiS)
+-- >            (MR (RCon 0 (UN "O") sp)))
+-- >      = return phiZ
+-- > natElim (Snoc args@(Snoc (Snoc (Snoc Empty phi) phiZ) phiS)
+-- >            (MR (RCon 1 (UN "S") (Snoc Empty n))))
+-- >      = return (apply (VG []) (apply (VG []) phiS n)
+-- >                  (apply (VG []) rec n))
+-- >    where rec = (MB (BElim natElim (UN "nateElim")) args)
+-- > natElim _ = Nothing
+
+-- > genElim :: Int -> Int -> [(Name,Ctxt -> Value)] -> ElimRule
+-- > genElim arity con red sp
+-- >   | size sp < arity = Nothing
+-- >   | otherwise = case (sp??con) of
+-- >        (MR (RCon t n args)) ->
+-- >              do v <- lookup n red
+-- >                 let ctx = VG $ (makectx args)++(makectx (lose con sp))
+-- >                 return $ v ctx
+-- >        _ -> Nothing
+-- >   where makectx (Snoc xs x) = x:(makectx xs)
+-- >         makectx Empty = []
+
+
+====================== Functors for contexts ===============================
+
+> instance Functor Gamma where
+>     fmap f (Gam xs) = Gam (fmap (\ (x,y) -> (f x,fmap f y)) xs)
+
+> instance Functor Gval where
+>     fmap f (G g i p) = G (fmap f g) (fmap f i) p
+
+> instance Functor Global where
+>     fmap f (Fun opts n) = Fun opts $ fmap f n
+>     fmap f (ElimRule e) = ElimRule e
+>     fmap f (DCon t i) = DCon t i
+>     fmap f (TCon i (Elims en cn cons))
+>              = TCon i (Elims (f en) (f cn) (fmap f cons))
+
+
+> arity :: Gamma Name -> Indexed Name -> Int
+> arity g t = ca (normalise g t)
+>    where ca (Ind t) = ca' t
+>          ca' (Bind _ (B Pi _) (Sc r)) = 1+(ca' r)
+>          ca' _ = 0
diff --git a/Ivor/PatternDefs.lhs b/Ivor/PatternDefs.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/PatternDefs.lhs
@@ -0,0 +1,368 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.PatternDefs where
+
+> import Ivor.Gadgets
+> import Ivor.TTCore
+> import Ivor.Nobby
+> import Ivor.Typecheck
+> import Ivor.Unify
+
+> import Debug.Trace
+> import Data.List
+> import Control.Monad
+
+Use the iota schemes from Datatype to represent pattern matching definitions.
+
+> checkDef :: Monad m => Gamma Name -> Name -> Raw -> [PMRaw] ->
+>             Bool -> -- Check for coverage
+>             Bool -> -- Check for well-foundedness
+>             m (PMFun Name, Indexed Name)
+> checkDef gam fn tyin pats cover wellfounded = do
+>   --x <- expandCon gam (mkapp (Var (UN "S")) [mkapp (Var (UN "S")) [Var (UN "x")]])
+>   --x <- expandCon gam (mkapp (Var (UN "vcons")) [RInfer,RInfer,RInfer,mkapp (Var (UN "vnil")) [Var (UN "foo")]])
+>   clausesIn <- mapM (expandClause gam) pats
+>   let clauses = nub (concat clausesIn)
+>   let clauses' = filter (mostSpecClause clauses) clauses
+>   (ty@(Ind ty'),_) <- typecheck gam tyin
+>   let arity = length (getExpected ty')
+>   checkNotExists fn gam
+>   gam' <- gInsert fn (G Undefined ty defplicit) gam
+>   clauses' <- validClauses gam' fn ty clauses'
+>   pmdef <- matchClauses gam' fn pats tyin cover clauses'
+>   when wellfounded $ checkWellFounded gam fn [0..arity-1] pmdef
+>   return (PMFun arity pmdef, ty)
+>     where checkNotExists n gam = case lookupval n gam of
+>                                 Just Undefined -> return ()
+>                                 Just _ -> fail $ show n ++ " already defined"
+>                                 Nothing -> return ()
+
+
+1) A definition is well founded if, for every clause, there is an argument
+position i such that all recursive calls have an argument in position i
+which is structurally smaller than the pattern in position i.
+
+An argument position is considered 'well-founded' if
+in any recursive call, it has a structurally smaller argument.
+
+A clause is well-founded if there are no recursive calls, or it has a
+well-founded argument in common with all other recursive calls. We keep a list
+of which arguments are well-founded
+
+[REMOVED: Nested recursive calls are not allowed]
+[They are allowed as long as they are also well-founded]
+
+2) Alternatively, a definition is well founded if in every recursive call
+there are no increasing arguments and at least one decreasing argument.
+
+> checkWellFounded :: Monad m =>
+>                     Gamma Name ->
+>                     Name -> -- recursive function name
+>                     [Int] -> -- set of well founded args
+>                     [PMDef Name] -> m ()
+> checkWellFounded gam fn args cs = case cwf1 fn args cs of
+>                                     Failure err -> cwf2 fn cs err
+>                                     Success v -> return ()
+>   where cwf1 fn args [] = return ()
+>         cwf1 fn args (c:cs) = do args <- wfClause args c
+>                                  cwf1 fn args cs
+>
+>         cwf2 fn [] _ = return ()
+>         cwf2 fn (c:cs) err = do allDec c err
+>                                 cwf2 fn cs err
+
+Check for definition 1 above: one argument position is well founded
+
+>         wfClause args (Sch pats (Ind t)) = do
+>            let recs = findRec [] t
+>            case recs of
+>               [] -> return args
+>               _ ->  wfRec args pats recs Nothing
+
+Check for definition 2 above: all recursive calls have a decreasing argument
+and no increasing arguments
+
+>         allDec (Sch pats (Ind t)) err = do
+>            let recs = findRec [] t
+>            case allRecDec pats recs of
+>              Success v -> return v
+>              _ -> fail err
+
+Check each recursive call has at least one decreasing argument and no
+increasing arguments (iterature through calls)
+
+>         allRecDec _ [] = return ()
+>         allRecDec pats (r:rs) = do oneDec pats r 0 False
+>                                    allRecDec pats rs
+
+Check each recursive call has at least one decreasing argument and no
+increasing arguments (iterature through arguments in a call)
+
+>         oneDec [] [] i True = return ()
+>         oneDec [] [] i False = fail "No decreasing arguments"
+>         oneDec (p:ps) (c:cs) i smaller
+>                | structurallySmaller c p = oneDec ps cs (i+1) True
+>                | ss True c p = oneDec ps cs (i+1) smaller
+>                | otherwise = fail $ show c ++ " bigger than " ++ show p
+
+>         findRec args (App f a) = findRec (a:args) f
+>         findRec args (P n) | n == fn = [args] ++
+>                                        -- find nested calls too
+>                                        (concat $ map (findRec []) args)
+>         findRec args (Label t _) = findRec [] t
+>                                    ++ (concat (map (findRec []) args))
+>         findRec args (Bind _ (B (Let v) _) (Sc sc)) = findRec [] v ++
+>                                                     findRec [] sc
+>                                    ++ (concat (map (findRec []) args))
+>         findRec args (Bind _ _ (Sc sc)) = findRec [] sc
+>                                    ++ (concat (map (findRec []) args))
+>         findRec args _ = concat $ map (findRec []) args
+
+>         wfRec [] _ _ (Just last) = fail $ "Not a well-founded call: "
+>                                             ++ show last
+>         wfRec args pats [] _ = return args
+>         wfRec args pats (a:as) _ =
+>             {- case concat (map (findRec []) a) of
+>                (_:_) -> fail $ "Nested recursive calls not allowed "
+>                                ++ show (mkRec a)
+>                _ -> -}
+>               do args <- wfRec1 args 0 pats a
+>                  wfRec args pats as (Just (mkRec a))
+
+>         mkRec as = appArgs (P fn) as
+
+>         wfRec1 args i [] [] = return args
+>         wfRec1 args i (p:ps) (a:as)
+>             | structurallySmaller a p = wfRec1 args (i+1) ps as
+>             | otherwise = wfRec1 (args \\ [i]) (i+1) ps as
+>         wfRec1 args i _ _ = return args -- variadic function, just stop looking
+
+A non-recursive constructor application is structurally smaller than
+anything.
+
+>         structurallySmaller n p = ss False n p
+>         ss True n p | pattEq n p = True -- inside, check for equality
+>         ss _ n (PCon _ _ _ ps) = any (ss True n) ps -- look under cons
+>         ss _ n p | isNonrec (getFun n) = True
+>         ss _ _ _ = False
+
+>         pattEq (P n) (PVar n') = n == n'
+>         pattEq (Con t _ _) (PCon t' _ _ []) = t == t'
+>         pattEq (App f a) (PCon t' _ _ xs) = eqApp t' (App f a) (reverse xs)
+>             where eqApp t (App f a) (x:xs) = pattEq a x && eqApp t f xs
+>                   eqApp t (Con t' _ _) [] = t == t'
+>                   eqApp _ _ _ = False
+>         pattEq _ _ = False
+
+>         isNonrec (Con _ n _) = not (recCon n gam)
+>         isNonrec _ = False
+
+For each Raw clause, try to match it against a generated and checked clause.
+Match up the inferred arguments to the names (so getting the types of the
+names bound in patterns) then type check the right hand side.
+
+> matchClauses :: Monad m => Gamma Name -> Name -> [PMRaw] -> Raw ->
+>                 Bool -> -- Check coverage
+>                 [(Indexed Name, Indexed Name)] -> m [PMDef Name]
+> matchClauses gam fn pats tyin cover gen = do
+>    let raws = zip (map mkRaw pats) (map getRet pats)
+>    checkpats <- mapM (mytypecheck gam) raws
+>    when cover $ checkCoverage (map fst checkpats) (map fst gen)
+>    return $ map (mkScheme gam) checkpats
+
+    where mkRaw (RSch pats r) = mkPBind pats tyin r
+          mkPBind [] _ r = r
+          mkPBind (p:ps) (RBind n (B _ t) tsc) r
+              = RBind n (B (Pattern p) t) (mkPBind ps tsc r)
+
+>   where mkRaw (RSch pats r) = mkapp (Var fn) pats
+>         getRet (RSch pats r) = r
+>         mytypecheck gam (clause, ret) =
+>             do (tm@(Ind tmtt), pty,
+>                 rtm@(Ind rtmtt), rty, env) <-
+>                   checkAndBindPair gam clause ret
+>                unified <- unifyenv gam env pty rty
+>                let rtmtt' = substNames unified rtmtt
+>                -- checkConvEnv env gam pty rty $ "Pattern error: " ++ show pty ++ " and " ++ show rty ++ " are not convertible " ++ show unify
+>                let namesret = filter notGlobal $ getNames (Sc rtmtt')
+>                let namesbound = getNames (Sc tmtt)
+>                checkAllBound namesret namesbound (Ind rtmtt') tmtt
+>                return (tm, Ind rtmtt')
+>         notGlobal n = case lookupval n gam of
+>                         Nothing -> True
+>                         _ -> False
+>         checkAllBound r b rhs clause = do
+>              let unbound = filter (\y -> not (elem y b)) r
+>              if (length unbound == 0)
+>                 then return ()
+>                 else fail $ "Unbound names in clause for " ++ show clause ++ ":\n" ++ show rhs ++ "\n"
+>                             ++ show unbound ++ "\n"
+
+> mkScheme :: Gamma Name -> (Indexed Name, Indexed Name) -> PMDef Name
+> mkScheme gam (Ind pat, ret) = Sch (map mkpat (getPatArgs pat)) ret
+>   where mkpat (P n) = PVar n
+>         mkpat (App f a) = addPatArg (mkpat f) (mkpat a)
+>         mkpat (Con i nm ar) = mkPatV nm (lookupval nm gam)
+>         mkpat (Const c) = PConst c
+>         mkpat _ = PTerm
+
+>         mkPatV n (Just (DCon t x)) = PCon t n (tyname n) []
+>         mkPatV n _ = PVar n
+>         tyname n = case (getTyName gam n) of
+>                         Just x -> x
+
+>         addPatArg (PCon i t ty args) arg = PCon i t ty (args++[arg])
+>         addPatArg _ _ = PTerm
+
+>         getPatArgs (App (P f) a) = [a]
+>         getPatArgs (App f a) = getPatArgs f ++ [a]
+>         getPatArgs _ = []
+
+Return whether the patterns in the first argument cover the necessary
+cases in the second argument. Each of the necessary cases in 'covering'
+must match one of 'pats'.
+fails, reporting which case isn't matched, if patterns don't cover.
+
+> checkCoverage :: Monad m => [Indexed Name] -> [Indexed Name] -> m ()
+> checkCoverage pats [] = return ()
+> checkCoverage pats (c:cs)
+>     | length (filter (matches c) pats) > 0 = checkCoverage pats cs
+>     | otherwise = fail $ "Missing clause: " ++ show c
+
+> matches (Ind p) (Ind t) = matches' p t
+> matches' (App f a) (App f' a') = matches' f f' && matches' a a'
+> matches' (Con _ x _) (Con _ y _) | x == y = True
+> matches' (TyCon x _) (TyCon y _) | x == y = True
+> matches' (P x) (P y) | x == y = True
+> matches' (P (MN ("INFER",_))) _ = True
+> matches' _ (P _) = True
+> matches' x y = x == y
+
+
+> expandClause :: Monad m => Gamma Name -> RawScheme -> m [RawScheme]
+> expandClause gam (RSch ps ret) = do
+>   expanded <- mapM (expandCon gam) ps
+>   return $ map (\p -> RSch p ret) (combine expanded)
+
+Remove the clauses which can't possibly be type correct.
+
+> validClauses :: Monad m => Gamma Name -> Name -> Indexed Name ->
+>                 [RawScheme] -> m [(Indexed Name, Indexed Name)]
+> validClauses gam fn ty cs = do
+>     -- add fn:ty to the context as an axiom
+>     checkValid gam [] cs
+>  where checkValid gam acc [] = return acc
+>        checkValid gam acc ((RSch c r):cs)
+>           = do let app = mkapp (Var fn) c
+>                case typecheck gam app of
+>                  Nothing -> checkValid gam acc cs
+>                  Just (v,t) -> checkValid gam ((v,t):acc) cs
+
+
+Return true if the given pattern clause is the most specific in a list
+
+> mostSpecClause :: [RawScheme] -> RawScheme -> Bool
+> mostSpecClause cs c = msc c (filter (/= c) cs)
+>    where msc c [] = True
+>          msc c (x:xs) | moreSpecClause x c = False
+>                       | otherwise = msc c xs
+
+> moreSpecClause (RSch pa _) (RSch pb _)
+>    = moreSpecClause' pa pb
+
+> moreSpecClause' :: [Raw] -> [Raw] -> Bool
+> moreSpecClause' [] [] = True
+> moreSpecClause' (x:xs) (y:ys)
+>       | moreSpec x y = moreSpecClause' xs ys
+>       | x == y = moreSpecClause' xs ys
+>       | otherwise = False
+> -- Differing numbers of arguments; ignore it, it'll be caught as a type
+> -- error elsewhere
+> moreSpecClause' _ _ = False
+
+
+> showClauses [] = ""
+> showClauses ((x,r):xs) = show x ++ " -> " ++ show r ++ "\n" ++ showClauses xs
+
+
+Given a raw term, recursively expand all of its arguments which are in
+constructor form
+
+> expandCon :: Monad m => Gamma Name -> Raw -> m [Raw]
+> expandCon gam r = do
+>     let f = getappfun r
+>     let as = getappargs r
+>     expandas <- mapM (expandCon gam) as
+>     -- expandas contains all the possibilites for each argument
+>     -- [[arg1poss1,arg1poss2,...], [arg2poss1,arg2pss2,...], ...]
+>     case isConPatt gam f of
+>         Nothing -> return.mostSpec $ expandf RInfer expandas
+>         Just ns -> return.mostSpec $ (expandf f expandas) ++ (mkConPatts ns)
+>   where expandf :: Raw -> [[Raw]] -> [Raw]
+>         expandf f args = map (mkapp f) (combine args)
+>         mkConPatts [] = []
+>         mkConPatts ((n,ar):xs)
+>            = (mkapp (Var n) (take ar (repeat RInfer))):(mkConPatts xs)
+
+Turn a list of possibilities for each argument into a list of all
+possible applications
+
+> combine :: [[a]] -> [[a]]
+> combine [] = [[]]
+> combine [arg] = map (\x -> [x]) arg
+> combine (arg:rest) = addEach arg (combine rest)
+>     where addEach [] rest = []
+>           addEach (x:xs) rest = (map (x:) rest) ++ (addEach xs rest)
+
+Filter out more general entries; e.g. if (c _ _) and (c_ (d _)) keep the latter
+only
+
+> mostSpec :: [Raw] -> [Raw]
+> mostSpec xs = ms' xs []
+>   where ms' [] acc = acc
+>         ms' (x:xs) acc | x `lessSpec` xs || x `lessSpec` acc = ms' xs acc
+>                        | otherwise = ms' xs (x:acc)
+>         lessSpec x [] = False
+>         lessSpec x (y:ys) = (moreSpec y x) || x==y || (lessSpec x ys)
+
+> moreSpec :: Raw -> Raw -> Bool
+> moreSpec (Var _) (Var _) = False
+> moreSpec RInfer RInfer = False
+> moreSpec _ RInfer = True
+> moreSpec (RApp x y) (RApp x2 y2) = moreSpec x x2 || (x==x2 && moreSpec y y2)
+> moreSpec _ _ = False
+
+Given a raw term, return whether it is a constructor pattern. If so,
+return all of the constructor names and arities
+
+> isConPatt :: Gamma Name -> Raw -> Maybe [(Name, Int)]
+> isConPatt gam r | (Var name) <- getappfun r = do
+>     conty <- lookuptype name gam
+>     case getappfun (getrettype (forget conty)) of
+>          (Var tyname) -> do
+>              TCon i (Elims _ _ cons) <- lookupval tyname gam
+>              return $ map (\n -> (n, arity n)) cons
+>          _ -> Nothing
+>                 | otherwise = Nothing
+>   where arity nm = case lookuptype nm gam of
+>                      Just (Ind ty) -> length (getExpected ty)
+>                      -- Nothing can't happen
+
+ checkClause gam n (RSch pats ret) =
+
+ generateAll :: Monad m => Gamma Name -> Name -> Raw -> [PMRaw] -> m [PMRaw]
+ generateAll gam n tyin pats = do
+   (Ind ty, tyty) <- typecheck gam tyin
+   checkConv gam tyty (Ind Star) "Type of function must be of type *"
+   let args = getPatPos (length (getArgs ty)) pats
+   trace (show args) $ fail "unfinished"
+
+Get the argument positions which have patterns in them (rather than match
+anything or just variables)
+
+ getPatPos :: Int -> [PMRaw] -> [Int]
+ getPatPos numargs [] = [0..numargs-1]
+ getPatPos numargs ((RSch pats ret):xs) =
+     union (gpp 0 pats) (getPatPos numargs xs)
+   where gpp pos [] = []
+         gpp pos ((PCon _ _ _ _):xs) = pos:(gpp (pos+1) xs)
diff --git a/Ivor/Plugin.lhs b/Ivor/Plugin.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Plugin.lhs
@@ -0,0 +1,82 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> -- | 
+> -- Module      : Ivor.Plugin
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : portable
+> -- 
+> -- Plugin loader
+
+> module Ivor.Plugin(Ivor.Plugin.load) where
+
+> import Ivor.TT
+> import Ivor.ShellState
+
+> import System.Plugins as Plugins
+> import Text.ParserCombinators.Parsec
+
+> -- | Load the given plugin file (which should be a full path to a .o or
+> -- .hs file) and update the Context. If it is a .hs file, it will be
+> -- compiled if necessary.
+> -- Plugins must contain the symbol
+> -- @plugin_context :: Monad m => Context -> m Context@
+> -- which updates the context. It may optionally contain symbols
+> -- @plugin_parser :: Parser ViewTerm@
+> -- which adds new parsing rules,
+> -- @plugin_shell :: ShellState -> IO ShellState@
+> -- which updates the shell
+> -- @plugin_commands :: IO [(String, String -> COntext -> IO (String, Context))]@
+> -- which adds new user defined commands (which may need to do some setting up themselves, hence the IO)
+> -- Returns the new context and the extra parsing rules and commands, if any.
+
+> load :: FilePath -> Context -> IO (Context, 
+>               Maybe (Parser ViewTerm),
+>               Maybe (ShellState -> IO ShellState),
+>               Maybe (IO [(String, String -> Context -> IO (String, Context))]))
+> load fn ctxt = do 
+>          objIn <- compilePlugin fn
+>          obj <- case objIn of
+>                    Left errs -> fail errs
+>                    Right ok -> return ok
+>          contextMod <- Plugins.load_ obj [] "plugin_context"
+>          -- mv <- Plugins.load fn [] ["/Users/edwin/.ghc/i386-darwin-6.6.1/package.conf"] "initialise"
+>          (mod, contextFn) <- case contextMod of
+>                  LoadFailure msg -> fail $ "Plugin loading failed: " ++
+>                                              show msg
+>                  LoadSuccess mod v -> return (mod, v)
+>          parserMod <- Plugins.reload mod "plugin_parser"
+>          parserules <- case parserMod of
+>                  LoadFailure msg -> return Nothing
+>                  LoadSuccess _ v -> return $ Just v
+>          cmdMod <- Plugins.reload mod "plugin_commands"
+>          cmds <- case cmdMod of
+>                  LoadFailure msg -> return Nothing
+>                  LoadSuccess _ v -> return $ Just v
+>          shellMod <- Plugins.reload mod "plugin_shell"
+>          shellfn <- case shellMod of
+>                  LoadFailure msg -> return Nothing
+>                  LoadSuccess _ v -> return $ Just v
+>          ctxt' <- case contextFn ctxt of
+>                      Just x -> return x
+>                      Nothing -> fail "Error in running plugin_context"
+>          return $ (ctxt', parserules, shellfn, cmds)
+
+Make a .o from a .hs, so that we can load Haskell source as well as object
+files
+
+> compilePlugin :: FilePath -> IO (Either String FilePath)
+> compilePlugin hs 
+>     | isExt ".hs" hs || isExt ".lhs" hs =
+>         do status <- makeAll hs []
+>            case status of
+>               MakeSuccess c out -> return $ Right out
+>               MakeFailure errs -> return $ Left (concat (map (++"\n") errs))
+>     | isExt ".o" hs = return $ Right hs
+>     | elem '.' hs = return (Left $ "unrecognised file type " ++ hs)
+>     | otherwise = compilePlugin (hs++".o")
+>   where isExt ext fn = case span (/='.') fn of
+>                           (file, e) -> ext == e
diff --git a/Ivor/Prefix.hs b/Ivor/Prefix.hs
new file mode 100644
--- /dev/null
+++ b/Ivor/Prefix.hs
@@ -0,0 +1,1 @@
+module Ivor.Prefix where prefix = "/usr/local"
diff --git a/Ivor/Primitives.lhs b/Ivor/Primitives.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Primitives.lhs
@@ -0,0 +1,137 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> -- | 
+> -- Module      : Ivor.Primitives
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> -- 
+> -- Some basic primitive types. Importing this module adds instances
+> -- of 'ViewConst' for Int, Float and String (Float is represented by
+> -- Haskell Double). 'addPrimitives' should be
+> -- used to add these type constructors to the context.
+
+> module Ivor.Primitives(addPrimitives, parsePrimitives, 
+>                          parsePrimTerm) 
+>     where
+
+> import Ivor.TT hiding (try)
+> import Ivor.TermParser
+> import Ivor.ViewTerm
+
+> import Text.ParserCombinators.Parsec
+> import Text.ParserCombinators.Parsec.Language
+> import qualified Text.ParserCombinators.Parsec.Token as PTok
+> import Data.Typeable
+
+> type TokenParser a = PTok.TokenParser a
+
+> lexer :: TokenParser ()
+> lexer  = PTok.makeTokenParser haskellDef
+
+> whiteSpace= PTok.whiteSpace lexer
+> lexeme    = PTok.lexeme lexer
+> symbol    = PTok.symbol lexer
+> natural   = PTok.natural lexer
+> parens    = PTok.parens lexer
+> semi      = PTok.semi lexer
+> identifier= PTok.identifier lexer
+> reserved  = PTok.reserved lexer
+> operator  = PTok.operator lexer
+> reservedOp= PTok.reservedOp lexer
+> stringlit = PTok.stringLiteral lexer
+> float     = PTok.float lexer
+> lchar = lexeme.char
+
+> instance ViewConst Int where
+>     typeof x = (name "Int")
+
+> instance ViewConst Double where
+>     typeof x = (name "Float")
+
+> instance ViewConst String where
+>     typeof x = (name "String")
+
+> -- | Add primitive types for Int, Float and String, and some
+> -- primitive operations [add,sub,mult,div][int,float] and concat.
+
+> addPrimitives :: Monad m => Context -> m Context
+> addPrimitives c = do c <- addPrimitive c (name "Int")
+>                      c <- addPrimitive c (name "Float")
+>                      c <- addPrimitive c (name "String")
+>                      c <- addBinOp c (name "addInt") ((+)::Int->Int->Int) 
+>                               "(x:Int)(y:Int)Int"
+>                      c <- addBinOp c (name "subInt") ((-)::Int->Int->Int) 
+>                               "(x:Int)(y:Int)Int"
+>                      c <- addBinOp c (name "multInt") ((*)::Int->Int->Int) 
+>                               "(x:Int)(y:Int)Int"
+>                      c <- addBinOp c (name "divInt") 
+>                               ((div)::Int->Int->Int) 
+>                               "(x:Int)(y:Int)Int"
+>                      c <- addBinOp c (name "addFloat") 
+>                               ((+)::Double->Double->Double) 
+>                               "(x:Float)(y:Float)Float"
+>                      c <- addBinOp c (name "subFloat") 
+>                               ((-)::Double->Double->Double) 
+>                               "(x:Float)(y:Float)Float"
+>                      c <- addBinOp c (name "multFloat") 
+>                                ((*)::Double->Double->Double) 
+>                               "(x:Float)(y:Float)Float"
+>                      c <- addBinOp c (name "divFloat") 
+>                                ((/)::Double->Double->Double) 
+>                               "(x:Float)(y:Float)Float"
+>                      c <- addBinOp c (name "concat") 
+>                               ((++)::String->String->String) 
+>                               "(x:String)(y:String)String"
+>                      c <- addPrimFn c (name "intToNat") intToNat
+>                               "(x:Int)Nat"
+>                      c <- addPrimFn c (name "intToString") 
+>                               intToString
+>                               "(x:Int)String"
+>                      c <- addExternalFn c (name "stringEq") 2
+>                               stringEq
+>                               "(x,y:String)Bool"
+>                      return c
+
+> intToNat :: Int -> ViewTerm
+> intToNat 0 = Name DataCon (name "O")
+> intToNat n = App (Name DataCon (name "S")) (intToNat (n-1))
+
+> intToString :: Int -> ViewTerm
+> intToString n = Constant (show n)
+
+> stringEq :: [ViewTerm] -> Maybe ViewTerm
+> stringEq [Constant x, Constant y] 
+>     = case cast x of
+>          Just x' -> if (x' == y) 
+>                       then Just $ Name DataCon (name "true")
+>                       else Just $ Name DataCon (name "false")
+>          _ -> Just $ Name DataCon (name "false")
+> stringEq [_, _] = Nothing
+
+
+> -- | Parse a primitive constant
+
+> parsePrimitives :: Parser ViewTerm
+> parsePrimitives = try (do x <- float
+>                           return $ Constant x)
+>               <|> do x <- stringlit
+>                      return $ Constant x
+>               <|> do x <- parseInt
+>                      return $ Constant x
+
+> parseInt :: Parser Int
+> parseInt = lexeme $ fmap read (many1 digit)
+
+> -- | Parse a term including primitives
+> parsePrimTerm :: Monad m => String -> m ViewTerm
+> parsePrimTerm str
+>     = case parse (do t <- pTerm (Just parsePrimitives) ; eof ; return t) 
+>                  "(input)" str of
+>           Left err -> fail (show err)
+>           Right tm -> return tm
+
+ 
diff --git a/Ivor/RunTT.lhs b/Ivor/RunTT.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/RunTT.lhs
@@ -0,0 +1,104 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.RunTT where
+
+Representation of the run-time language.
+Used for spitting out GHC core.
+
+> import Ivor.TTCore
+> import Ivor.Gadgets
+> import Ivor.ICompile
+> import Ivor.Nobby
+
+When we compile, we need to know the term as well as bits of info about
+its type, ie its arity and emptiness.
+
+> type RunValue = (RunTT, TypeInfo)
+
+> data RunTT =
+>        RTVar Int -- de Bruijn level
+>      | RTFun Name
+>      | RTCon Int Name [RunValue] -- Fully applied, Name is for display only
+>      | RTElim Name RunValue RunValue [RunValue] -- Fully applied, with
+>                               -- target, motive, methods
+>      | RTApp RunValue [RunValue]
+>      | RTBind (RTBinder,TypeInfo) RunValue 
+>      | RTCase Name RunValue [RunValue] -- name is type case is on
+>      | RTProj Name Int RunValue -- name is type we're projecting from
+>      | forall c. Constant c => RTConst c
+>      | RTypeVal -- Useless, uninspectable type value
+>      | RTCantHappen -- Flag on unexecutable code
+>   -- deriving Show
+
+> data RTBinder = RTLam
+>	        | RTPi
+>	        | RTLet RunValue
+> --  deriving Show
+
+> data TypeInfo = TI Int Bool -- Arity, emptiness (whether its the empty type)
+>   deriving Show
+
+> newtype RunTTs = RGam [(Name,RunTT)]
+
+Make a term in RunTT from a de Bruijn levelled representation
+
+> mkRTFun :: Gamma Name -> Levelled Name -> RunTT
+> mkRTFun gam (Lev term) = mkrt 0 term where
+>    mkrt l (P n) = RTFun n
+>    mkrt l (V x) = RTVar x
+>    mkrt l (Con t n 0) = RTCon t n []
+>    mkrt l c@(Con t n a) = mkApp l c []
+>    mkrt l (TyCon n x) = RTypeVal
+>    mkrt l (Elim n) = RTFun n
+>    mkrt l c@(App f a) = mkApp l c []
+>    mkrt l (Bind n b (Sc sc)) = RTBind (mkBinder l b) 
+>			            ((mkrt (l+1) sc), TI 0 False)
+>    mkrt l (Proj n i t) = RTProj n i (mkrt l t, TI 0 False)
+>    mkrt l (Label t _) = mkrt l t
+>    mkrt l (Call _ t) = mkrt l t
+>    mkrt l (Return t) = mkrt l t
+>    mkrt l (Const c) = RTConst c -- error "Sorry, I don't know how to compile constants yet"
+>    mkrt l (Stage _) = error "Sorry, I can't compile multi-stage programs."
+>    mkrt l Star = RTypeVal
+
+>    mkBinder l (B Lambda t) = (RTLam, TI 0 False)
+>    mkBinder l (B (Let v) t) = (RTLet (mkrt l v, TI 0 False), TI 0 False)
+>    mkBinder l (B Pi t) = (RTPi, TI 0 False)
+
+>    mkApp l (App f a) sp = mkApp l f ((mkrt l a, TI 0 False):sp)
+>    mkApp l (Con t n a) sp | length sp == a = RTCon t n sp
+>		            | otherwise = saturate l a (length sp) 
+>                                            (RTCon t n sp) (RTCon t n sp)
+>    mkApp l x sp = RTApp (mkrt l x, TI (length sp) False) sp
+
+>    saturate lev arity splen acc (RTCon t n sp) -- cached inner constructor
+>        | splen == arity = acc
+>        | otherwise = let newcon = RTCon t n (sp++[(RTVar lev, TI 0 False)]) in
+>            saturate (lev+1) arity (splen+1)
+>               (RTBind (RTLam, TI 0 False) (newcon, TI 0 False)) 
+>                  newcon
+>    
+
+let c = mkRawApp (Con tag naem arity) sp in
+                  error $ "Saturate " ++ show c
+
+    mkRawApp = forget mr
+      where mr f [] = f
+            mr f (x:xs) = mr (App f x) xs
+
+
+error "Constructor saturation unimplemented"
+
+Make an elimination rule in RunTT from a simple case expression
+
+> mkRTElim :: Name -> Int -> SimpleCase -> RunTT
+> mkRTElim ename arity es = fst $ abstract arity (mkrt es)
+>    where mkrt Impossible = RTCantHappen
+>          mkrt (IReduce t) = mkRTFun (Gam []) (mkvarnum t)
+>          mkrt (Case ty x cs) = RTCase ty (RTVar (arity-x-1), TI 0 False)
+>		                  (map mkcase cs)
+>	   mkcase c = (mkrt c, TI 0 False)
+>          mkvarnum (Ind t) = Lev $ vapp (\ (ctx,i) -> V (arity-i-1)) t
+
+>          abstract 0 t = (t, TI 0 False)
+>          abstract n t = (RTBind (RTLam, TI 0 False) (abstract (n-1) t), TI 0 False)
diff --git a/Ivor/SC.lhs b/Ivor/SC.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/SC.lhs
@@ -0,0 +1,174 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.SC where
+
+Lambda lifter. Two bits:
+
+lift: Takes a TT function definition and returns a set of supercombinators.
+elimSC: Takes a simple case expression and returns a supercombinator.
+
+> import Ivor.Grouper
+> import Ivor.TTCore
+> import Ivor.Nobby
+> import Ivor.ICompile
+> import Ivor.Constant
+
+> import Debug.Trace
+
+> data SCName = N Name
+>             | SN Name Int
+>   deriving Eq
+
+> instance Show SCName where
+>     show (N n) = show n
+>     show (SN n i) = "$"++show n ++show i
+
+> type SCs = [(SCName, (Int, SC))]
+
+> data SC = SLam [SCBody] SCBody
+
+> data SCBody
+>     = SP SCName
+>     | SV Int
+>     | SCon Int SCName [SCBody]
+>     | STyCon SCName Int
+> {-     | SElim SCName -}
+>     | SApp SCBody [SCBody]
+>     | SLet SCBody SCBody SCBody
+>     | SPi SCBody SCBody
+>     | SProj Int SCBody
+>     | forall c. Constant c => SConst c
+>     | SStar
+>     | SCase Int [SCBody]
+>     | SCantHappen
+>     | SSomeType
+>  -- deriving Show
+
+Turn a well typed term with de Bruijn levels into a set of supercombinators.
+The main supercombinator will have the given name
+
+> lift :: Name -> Levelled Name -> SCs
+> lift basename t = collect basename (group (fmap N t))
+
+> collect :: Name -> GroupTT SCName -> [(SCName,(Int,SC))]
+> collect basename g = snd $ sc (N basename) [] 0 [] g where
+>    sc name args next scs (GLam args' lev body)
+>        = let (next',scs',scargs) = sclist args next scs args'
+>              (next'',scs'',scb) = scbody (args++scargs) next' scs' body 
+>              newsc = SLam (args++scargs) scb in
+>              (next'',((name, (length (args++scargs),newsc)):scs''))
+>    sc name args next scs body
+>        = let (next',scs',scb) = scbody [] next scs body
+>              newsc = SLam [] scb in
+>	       (next',((name,(0,newsc)):scs'))
+
+Do the tricky case first.  
+This is the quick hack version; it ought to
+check that previously bound variables are actually used.
+
+>    scbody args next scs b@(GLam args' l body) 
+>        = let (next',scs') = sc (SN basename next) args (next+1) scs
+>		                 (GLam args' 0 body) in
+>          (next',scs',mkapp (SP (SN basename next)) (argvals args))
+>      where mkapp x [] = x
+>            mkapp x as = SApp x as
+>            argvals xs = map SV [0..(length xs)-1]
+
+Everything else is pretty much structural...
+
+>    scbody args next scs (GP n) = (next, scs, SP n)
+>    scbody args next scs (GV i) = (next, scs, SV i)
+>    scbody args next scs (GCon i n as) =
+>             let (next',scs',scas) = sclist args next scs as in
+>	      (next',scs',SCon i n scas)
+>    scbody args next scs (GTyCon n i) = (next,scs,STyCon n i)
+>    scbody args next scs (GElim n) = (next, scs, SP n)
+>    scbody args next scs (GApp f as) =
+>             let (next',scs',scf) = scbody args next scs f 
+>                 (next'',scs'',scas) = sclist args next' scs' as in
+>	      (next'',scs'',SApp scf scas)
+>    scbody args next scs (GLet t v sc) =
+>             let (next',scs',sct) = scbody args next scs t
+>                 (next'',scs'',scv) = scbody args next' scs' v
+>                 (next''',scs''',scsc) = scbody (args++[sct]) next'' scs'' sc in
+>	      (next''',scs''',SLet sct scv scsc)
+>    scbody args next scs (GPi t sc) =
+>             let (next',scs',sct) = scbody args next scs t
+>                 (next'',scs'',scsc) = scbody args next' scs' sc in
+>	      (next'',scs'',SPi sct scsc)
+>    scbody args next scs (GProj i t) =
+>             let (next',scs',sct) = scbody args next scs t in
+>	      (next',scs',SProj i sct)
+>    scbody args next scs (GConst c) = (next,scs,SConst c)
+>    scbody args next scs GStar = (next,scs,SStar)
+>    scbody _ next scs GCant = (next,scs,SCantHappen)
+
+>    sclist args next scs [] = (next,scs,[])
+>    sclist args next scs (x:xs) 
+>          = let (next',scs',xsc) = scbody args next scs x
+>                (next'',scs'',xscs) = sclist args next' scs' xs in
+>                (next'',scs'',xsc:xscs)
+
+
+Turn a simple case tree into a supercombinator
+
+> elimSC :: Name -> Levelled Name -> SimpleCase -> SC
+> elimSC ename (Lev rtype) es = SLam (mkargs rtype) (mksc es)
+>    where mksc Impossible = SCantHappen
+>          mksc (IReduce t) = mkreduce (mkvarnum t)
+>          mksc (Case _ x cs) = SCase (arity-x-1)
+>		                  (map mksc cs)
+>          mkvarnum (Ind t) = vapp (\ (ctx,i) -> V (arity-i-1)) t
+>          args = mkargs rtype
+>          arity = length args
+
+    Reductions will have no lambdas, so an easy, boring, structural job.
+   
+>          mkreduce (P n) = SP (N n)
+>          mkreduce (Elim n) = SP (N n)
+>          mkreduce (V x) = SV x
+>	   mkreduce ap@(App f a) = mkapp ap []
+>          mkreduce (Proj _ i t) = SProj i (mkreduce t)
+>          mkreduce (TyCon n i) = STyCon (N n) i
+>          mkreduce (Con i t a) = SSomeType
+>          mkreduce x = SSomeType
+
+>          mkapp (App f a) sp = mkapp f ((mkreduce a):sp)
+>          mkapp x sp = SApp (mkreduce x) sp
+
+>          mkargs (Bind n (B Pi t) (Sc sc)) = (mkreduce t):(mkargs sc)
+>          mkargs t = []
+
+Ugly printer
+
+> instance Show SC where
+>     show = showSC
+
+
+> showSCs :: SCs -> String
+> showSCs [] = ""
+> showSCs ((n,(a,sc)):xs) = show n ++ "("++show a++") = " ++ showSC sc ++ "\n" ++ showSCs xs
+
+> showSC (SLam args body) = "\\" ++ showargs 0 args ++ " -> " ++ showBody body
+>   where showargs i [] = ""
+>         showargs i (x:xs) = "v" ++ show i ++ ":" ++ showBody x ++ " " ++ showargs (i+1) xs
+
+> showBody (SP n) = show n
+> showBody (SV i) = "v"++show i
+> showBody (SCon i n bs) = show n ++ "<" ++ showBs bs ++ ">"
+> showBody (STyCon n i) = show n
+> --showBody (SElim n) = show n
+> showBody (SApp f as) = showBody f ++ "(" ++ showBs as ++ ")"
+> showBody (SLet t v b) = "let " ++ showBody v ++ ":" ++ showBody t ++ " in "
+>					   ++ showBody b
+> showBody (SPi t sc) = "{"++showBody t++"}"++showBody sc
+> showBody (SProj i sc) = "("++showBody sc++")!"++show i
+> showBody (SConst c) = show c
+> showBody (SCantHappen) = "Impossible"
+> showBody (SSomeType) = "Unknown"
+> showBody (SCase e cs) = "case v" ++ show e ++ " {" ++ showBs cs ++ "}"
+> showBody (SStar) = "*"
+
+> showBs [] = ""
+> showBs [x] = showBody x
+> showBs (x:xs) = showBody x ++ "," ++ showBs xs
diff --git a/Ivor/Shell.lhs b/Ivor/Shell.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Shell.lhs
@@ -0,0 +1,433 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> -- |
+> -- Module      : Ivor.Shell
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> --
+> -- Shell interface to theorem prover
+
+> module Ivor.Shell(ShellState,
+>                     runShell, importFile, addModulePath, addStdlibPath,
+>                     prefix, getContext, newShell, updateShell,
+>                     sendCommand, sendCommandIO, addTactic, addCommand,
+>                     extendParser, configureEq,
+>                     shellParseTerm, showProofState, response) where
+
+> import Ivor.ShellState
+> import Ivor.ShellParser
+> import Ivor.TermParser
+> import Ivor.TT as TT
+> import Ivor.Construction
+> import Ivor.Equality
+> import Ivor.Gadgets
+> import Ivor.Primitives
+> import qualified Ivor.Prefix
+> import Ivor.Plugin
+
+> import System.Exit
+> import System.Environment
+> import System.Directory
+> import System.IO
+> import Data.Char
+> import Debug.Trace
+
+> import Text.ParserCombinators.Parsec
+
+> respond, respondLn :: ShellState -> String -> ShellState
+> respond st str = st { response = (response st) ++ str }
+> respondLn st str = st { response = (response st) ++ str ++ "\n" }
+
+> clearResponse st = st { response = "" }
+
+> -- | Create a new shell state.
+> newShell :: Context -- ^ Initial system state
+>          -> ShellState
+> newShell ctxt = Shell Nothing "> " False ctxt "" [] [] [] Nothing []
+
+> -- | Update the context in a shell
+> updateShell :: Monad m =>
+>                (Context -> m Context) -- ^ Function to update context
+>                -> ShellState -> m ShellState
+> updateShell fctxt (Shell r p f c resp tacs coms imp ext path)
+>     = do ctxt <- fctxt c
+>          return (Shell r p f ctxt resp tacs coms imp ext path)
+
+> -- | Add a user defined tactic to the shell.
+> addTactic :: String -- ^ Tactic name.
+>           -> (String -> Tactic) -- ^ Tactic function. The argument is whatever was input on the shell; the function is responsible for parsing this.
+>           -> ShellState -- ^ Shell to which to add the tactic.
+>           -> ShellState
+> addTactic nm tac st = st { usertactics = (nm,tac):(usertactics st) }
+
+> -- | Add a user defined command to the shell.
+> addCommand :: String -- ^ Command name.
+>            -> (String -> Context -> IO (String, Context)) -- ^ Command function. The argument is whatever was input on the shell; the function is responsible for parsing this. The command returns a string (the response) and a possibly updated context.
+>            -> ShellState -- ^ Shell to which to add the command.
+>            -> ShellState
+> addCommand nm com st = st { usercommands = (nm, com):(usercommands st) }
+
+> -- | Add another parsing rule for parsing terms.
+> extendParser :: ShellState -> Parser ViewTerm -> ShellState
+> extendParser st ext = case (extensions st) of
+>                          Nothing -> st { extensions = Just ext }
+>                          Just p -> st { extensions = Just (p <|> ext) }
+
+> -- | Parse a term using the shell's current parser extensions
+> shellParseTerm :: ShellState -> Parser ViewTerm
+> shellParseTerm st = pTerm (extensions st)
+
+> -- | Get the system state from a finished shell
+> getContext :: ShellState -> Context
+> getContext = context
+
+> readToSemi :: IO String
+> readToSemi =
+>   do c <- getChar
+>      if (c==';')
+>         then return ";"
+>         else do s <- readToSemi
+>                 return (c:s)
+
+ output st = hPutStr (outputstream st)
+ outputLn st x = output st (x++"\n")
+
+> runCommand :: (Monad m) => Command -> ShellState -> m ShellState
+> runCommand (Def nm tm) st = do let (_, tm') = addImplicit (context st) tm
+>                                ctxt <- addDef (context st) (name nm) tm'
+>                                return st { context = ctxt }
+> runCommand (TypedDef nm tm ty) st = do
+>     ctxt <- addTypedDef (context st) (name nm) tm ty
+>     return st { context = ctxt }
+> runCommand (PatternDef nm ty pats opts) st = do
+>     ctxt <- addPatternDef (context st) (name nm) ty pats opts
+>     return st { context = ctxt }
+> runCommand (Data dat) st = do ctxt <- addData (context st) dat
+>                               return st { context = ctxt }
+> runCommand (Axiom nm tm) st = do ctxt <- addAxiom (context st) (name nm) tm
+>                                  return st { context = ctxt }
+> runCommand (Declare nm tm) st = do ctxt <- declare (context st) (name nm) tm
+>                                    return st { context = ctxt }
+> runCommand (DeclareData nm tm) st
+>                = do ctxt <- declareData (context st) (name nm) tm
+>                     return st { context = ctxt }
+> runCommand (Theorem nm ty) st = do ctxt <- theorem (save (context st))
+>                                                    (name nm) ty
+>                                    let st' = respond st $
+>                                          showProofState st { context = ctxt }
+>                                    return st' { context = ctxt }
+> runCommand (Interactive nm ty) st = do
+>     ctxt <- interactive (save (context st))
+>                 (name nm) ty
+>     let st' = respond st $
+>           showProofState st { context = ctxt }
+>     return st' { context = ctxt }
+> runCommand (Forget n) st = do
+>     ctxt <- forgetDef (context st) (name n)
+>     return $ (respondLn st ("Forgotten back to " ++ n))
+>                { context = ctxt }
+> runCommand (EvalTerm exp) st
+>        | proving (context st) = do
+>                       tm <- evalCtxt (context st) defaultGoal exp
+>                       return (respondLn st (show tm))
+>        | otherwise = do
+>                       tm <- check (context st) exp
+>                       return (respondLn st (show (eval (context st) tm)))
+> runCommand (WHNF exp) st
+> {-        | proving (context st) = do
+>                       tm <- newevalCtxt (context st) defaultGoal exp
+>                       return (respondLn st (show tm))
+>        | otherwise -}
+>                    = do
+>                       tm <- check (context st) exp
+>                       return (respondLn st (show (whnf (context st) tm)))
+> runCommand (Print n) st = do
+>     case (getDef (context st) (name n)) of
+>       Just tm -> return (respondLn st (show (view tm)))
+>       _ -> case (getPatternDef (context st) (name n)) of
+>             Just pats -> return (respondLn st (printPats pats))
+>             _ -> do tm <- check (context st) n
+>                     case view tm of
+>                         (Name TypeCon _) -> return (respondLn st "Type constructor")
+>                         (Name ElimOp _) -> return (respondLn st "Elimination operator")
+>                         (Name Free _) -> return (respondLn st "Undefined function")
+>                         (Name DataCon _) -> return (respondLn st "Data constructor")
+>                         _ -> fail "Unknown definition"
+>     where printPats (Patterns cs) = unlines (map printClause cs)
+>           printClause (PClause args ret) = n ++ " " ++
+>                                            unwords (map argshow args) ++
+>                                            " = " ++ show ret
+>           argshow x | ' ' `elem` show x = "(" ++ show x ++ ")"
+>                     | otherwise = show x
+
+> runCommand (Check exp) st = do
+>     tm <- check (context st) exp
+>     return (respondLn st (show (viewType tm)))
+> runCommand (Freeze n) st = do ctxt <- freeze (context st) (name n)
+>                               return st { context = ctxt }
+> runCommand (Thaw n) st = do ctxt <- thaw (context st) (name n)
+>                             return st { context = ctxt }
+> runCommand (Focus n) st = do ctxt <- focus (goal n) (context st)
+>                              return st { context = ctxt }
+> runCommand (Dump n) st = do
+>     let ds = getAllDefs (context st)
+>     return (respondLn st (dumpAll n ds))
+> runCommand (ReplData eq repl sym) st
+>     = return st { repldata = Just (eq, repl, sym) }
+> runCommand Prf st = do
+>     tm <- proofterm (context st)
+>     return (respondLn st (show tm))
+> runCommand PrfState st = do let st' = respond st $ showProofState st
+>                             return st'
+> runCommand Qed st = do ctxt <- qed (context st)
+>                        return st { context = (clearSaved ctxt) }
+> runCommand Suspend st = do let st' = respondLn st "Suspending Proof"
+>                            return st' { context = suspend (context st) }
+> runCommand (Resume n) st = do ctxt <- resume (context st) (name n)
+>                               let st' = respondLn st $ "Resuming proof of " ++ n
+>                               ctxt <- if (numUnsolved ctxt) == 1
+>                                        then attack defaultGoal ctxt
+>                                        else return ctxt
+>                               let st'' = respond st' $
+>                                          showProofState st' { context = ctxt }
+>                               return st'' { context = ctxt }
+> runCommand Undo st = do ctxt <- restore (context st)
+>                         let st' = respondLn st $
+>                                      showProofState st { context = ctxt }
+>                         return st' { context = ctxt }
+> runCommand (Ivor.ShellParser.GenRec n) st
+>     = do ctxt <- addGenRec (context st) (name n)
+>          let st' = respondLn st $ "Added general recursion rule"
+>          return st' { context = ctxt }
+> runCommand (JMEq n c) st = do ctxt <- addEquality (context st) (name n)
+>                                         (name c)
+>                               let st' = respondLn st $ "Added dependent equality"
+>                               return st' { context = ctxt }
+> runCommand Primitives st = do let st' = extendParser st parsePrimitives
+>                               ctxt <- addPrimitives (context st')
+>                               return st' { context = ctxt }
+> runCommand Drop st = return st { finished = True }
+> runCommand (Load f) st = fail "Can only load in a shell -- use importFile instead"
+> runCommand (Plugin f) st = fail "Can only load plugin in a shell -- use Plugin.load instead"
+> runCommand (Compile f) st = fail "Can only Compile in a shell -- use 'compile' function instead"
+> runCommand (UserCommand _ _) st = fail "Can only run user commands in a shell"
+
+> runTactic _ _ Attack = attack
+> runTactic _ _ (AttackWith n) = attackWith (name n)
+> runTactic _ _ (Claim n tm) = claim (name n) tm
+> runTactic _ _ (Local n tm) = \g ctxt -> do
+>                            ctxt <- claim (name n) tm g ctxt
+>                            focus (goal n) ctxt
+> runTactic _ _ (Refine tm args) = refineWith tm args
+> runTactic _ _ Solve = solve
+> runTactic _ _ (Fill tm) = fill tm
+> runTactic _ _ ReturnTac = returnComputation
+> runTactic _ _ QuoteTac = quoteVal
+> runTactic _ _ (CallTac tm) = call tm
+> runTactic _ _ Abandon = abandon
+> runTactic _ _ (Rename n) = rename (name n)
+> runTactic _ _ Intro = intro
+> runTactic _ _ (IntroName n) = introName (name n)
+> runTactic _ _ Intros = intros
+> runTactic _ _ (IntrosNames ns) = introsNames (map name ns)
+> runTactic _ _ (Equiv tm) = equiv tm
+> runTactic _ _ (AddArg nm tm) = addArg (name nm) tm
+> runTactic _ _ (Generalise False tm) = generalise tm
+> runTactic _ _ (Generalise True tm) = dependentGeneralise tm
+> runTactic _ (Just (eq,repl,sym)) (Replace tm f)
+>     = replace eq repl sym tm f
+> runTactic _ Nothing (Replace _ _) = fail "replace not configured"
+> runTactic _ _ (Axiomatise n ns) = axiomatise (name n) (map name ns)
+> runTactic _ _ Normalise = compute
+> runTactic _ _ (Unfold n) = unfold (name n)
+> runTactic _ _ Trivial = trivial
+> runTactic _ _ Split = split
+> runTactic _ _ LeftCon = left
+> runTactic _ _ RightCon = right
+> runTactic _ _ AutoSolve = auto 20
+> runTactic _ _ (Exists tm) = exists tm
+> runTactic _ _ (By tm) = by tm
+> runTactic _ _ (Induction tm) = induction tm
+> runTactic _ _ (Cases tm) = cases tm
+> runTactic _ _ (Decide me) = isItJust me
+> runTactic tacs _ (UserTactic tac tm)  = \g ctxt -> do
+>     case lookup tac tacs of
+>          (Just t) -> t tm g ctxt
+>          Nothing -> fail $ "User tactic "++tac++" undefined"
+
+> dumpAll :: String -> [(Name,Term)] -> String
+> dumpAll pat [] = ""
+> dumpAll pat ((n,ty):xs)
+>         | sublist pat (length pat) (show n) =
+>             show n ++" : " ++ show (view ty) ++ "\n" ++ dumpAll pat xs
+>         | otherwise = dumpAll pat xs
+>    where sublist pat i xs | i > length xs = False
+>                           | take i xs == pat = True
+>          sublist pat i (x:xs) = sublist pat i xs
+
+Deal with commands that do IO here, so we can have a separate processing
+function which doesn't need to be in the IO Monad.
+
+> process :: Result Input -> ShellState -> IO ShellState
+> process (Failure err) st = return $ respondLn st err
+> process (Success (Command (Load f))) st = do importFile f st
+> process (Success (Command (Plugin f))) st = do
+>     (ctxt, exts, shell, cmds) <- load f (context st)
+>     let st' = st { context = ctxt }
+>     let st'' = case exts of
+>                    Nothing -> st'
+>                    Just p -> extendParser st' p
+>     st''' <- case cmds of
+>                    Nothing -> return st''
+>                    Just c -> do newcmds <- c
+>                                 return $ st'' { usercommands = usercommands st'' ++ newcmds }
+>     case shell of
+>       Nothing -> return st'''
+>       Just shfn -> shfn st'''
+> process (Success (Command (Compile f))) st = do compile (context st) f
+>                                                 putStrLn $ "Output " ++ f ++ ".hs"
+>                                                 return st
+> process (Success (Command (UserCommand c arg))) st = do
+>     let Just fn = lookup c (usercommands st) -- can't fail if parser succeeds
+>     (resp, ctxt) <- fn arg (context st)
+>     let st' = st { context = ctxt, response = resp }
+>     return st'
+> process x st = processInput x st
+
+> processInput :: Monad m => Result Input -> ShellState -> m ShellState
+> processInput (Failure err) st = return $ respondLn st err
+> processInput (Success (Command cmd)) st = runCommand cmd st
+> processInput (Success (Tactic goal tac)) st
+>     = do let ctxt = save (context st)
+>          ctxt <- runTactic (usertactics st) (repldata st)
+>                     tac goal ctxt
+>          ctxt <- keepSolving defaultGoal ctxt
+>          ctxt <- if ((numUnsolved ctxt) > 0)
+>                    then beta defaultGoal ctxt
+>                    else return ctxt
+>          let st' = respond st $ showProofState $ st { context = ctxt }
+>          return st' { context = ctxt }
+
+> -- | Get a string representation of the current proof state
+> showProofState :: ShellState -> String
+> showProofState st
+>     | not (proving ctxt) = ""
+>     | null $ getGoals ctxt = "\nNo more goals\n\n"
+>     | otherwise = let (g:gs) = getGoals ctxt in
+>                      "\n" ++ showGoalState g ++
+>                      "\nOther goals: " ++ show gs ++ "\n\n"
+>  where
+>   ctxt = context st
+>   showGoalState :: Goal -> String
+>   showGoalState g = let (Just gd) = goalData ctxt True g
+>                         env = bindings gd
+>                         ty = goalType gd
+>                         nm = goalName gd in
+>                        showEnv (reverse env) ++ "\n" ++
+>                        "--------------------------------\n" ++
+>                        show nm ++ " ? " ++ show (view ty) ++ "\n"
+>   showEnv [] = ""
+>   showEnv ((n,ty):xs) = show n ++ " : " ++ show (view ty) ++ "\n" ++
+>                            showEnv xs
+
+> loop :: ShellState -> IO ShellState
+> loop st = do putStr (prompt st)
+>              hFlush stdout
+>              inp <- readToSemi
+>              st' <- catch (process (parseInput (extensions st)
+>                                     (gettacs (usertactics st))
+>                                     (map fst (usercommands st)) inp) st)
+>                      (\e -> do return $ respondLn st (show e))
+>              putStr $ (response st')
+>              if (finished st')
+>                 then return (clearResponse st')
+>                 else catch (loop (clearResponse st'))
+>                          (\e -> return st')
+
+> -- | Set up the equality type, for use by the 'replace' tactic
+> configureEq :: String
+>             -> String
+>             -> String
+>             -> ShellState -> ShellState
+> configureEq eq repl sym shell = shell { repldata = Just (eq,repl,sym) }
+
+> -- | Run a command shell.
+> runShell :: String -- ^ Prompt string
+>          -> ShellState -- ^ Initial state
+>          -> IO ShellState
+> runShell p shell =
+>     do st <- loop shell { prompt = p }
+>        return st
+
+> -- | Send a command directly to a shell
+> sendCommand :: Monad m => String -> ShellState -> m ShellState
+> sendCommand str st = processInput
+>                        (parseInput (extensions st)
+>                                    (gettacs (usertactics st))
+>                                    (map fst (usercommands st)) str) $
+>                          clearResponse st
+
+Special case for importFile. Grr.
+
+> -- | Send a command directly to a shell, allowing commands which might
+> -- do IO actions.
+> sendCommandIO :: String -> ShellState -> IO ShellState
+> sendCommandIO str st = process
+>                        (parseInput (extensions st)
+>                                    (gettacs (usertactics st))
+>                                    (map fst (usercommands st)) str) $
+>                          clearResponse st
+
+> gettacs :: [(String, String -> Goal -> Context -> IO Context)] -> [String]
+> gettacs = map fst
+
+> -- | Get the install prefix of the library
+> prefix :: FilePath
+> prefix = Ivor.Prefix.prefix
+
+If the given file is already loaded, do nothing.
+
+> -- | Import a file of shell commands; fails if the module does not exist
+> -- in the current directory or search path, does nothing if already loaded.
+> importFile :: FilePath -> ShellState -> IO ShellState
+> importFile fp st
+>     | fp `elem` imported st = return st
+>     | otherwise = do inp <- findFile (modulePath st) fp
+>                      st' <- processFile [] inp st
+>                      --resp <- readFile tmpf
+>                      return $ st' { imported = fp:(imported st') }
+>   where processFile acc (';':rest) st =
+>             do --putStrLn ("processing"++acc)
+>                st' <- sendCommandIO (acc++";") st
+>                processFile [] rest st'
+>         processFile acc (x:xs) st = processFile (acc++[x]) xs st
+>         processFile [] [] st = return st
+>         -- Now eat the whitespace at the end
+>         processFile (x:xs) [] st | isSpace x = processFile xs [] st
+>                                  | otherwise = fail "Unexpected end of file"
+
+> -- | Add a directory to the module search path
+> addModulePath :: ShellState -> FilePath -> ShellState
+> addModulePath shell fp = shell { modulePath = fp:(modulePath shell) }
+
+> -- | Add the standard library path to the module search path
+> addStdlibPath :: ShellState -> ShellState
+> addStdlibPath shell
+>     = shell { modulePath = (prefix++"/lib/ivor"):(modulePath shell) }
+
+> environment :: String -> IO (Maybe String)
+> environment x = catch (do e <- getEnv x
+>                           return (Just e))
+>                       (\_ -> return Nothing)
+
+> tempfile :: IO (FilePath, Handle)
+> tempfile = do env <- environment "TMPDIR"
+>               let dir = case env of
+> 		     Nothing -> "/tmp"
+> 		     (Just d) -> d
+>               openTempFile dir "humett.out"
+
diff --git a/Ivor/ShellParser.lhs b/Ivor/ShellParser.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/ShellParser.lhs
@@ -0,0 +1,418 @@
+> module Ivor.ShellParser(Command(..),
+>                           RunTactic(..),
+>                           Input(..),
+>                           parseInput) where
+
+> import Ivor.TT hiding (try,check,eval)
+> import Ivor.TermParser
+
+> import Text.ParserCombinators.Parsec
+> import Text.ParserCombinators.Parsec.Language
+> import qualified Text.ParserCombinators.Parsec.Token as PTok
+> import Control.Monad
+
+> import Debug.Trace
+
+> type TokenParser a = PTok.TokenParser a
+
+> lexer :: TokenParser ()
+> lexer = PTok.makeTokenParser haskellDef
+
+> whiteSpace= PTok.whiteSpace lexer
+> lexeme    = PTok.lexeme lexer
+> symbol    = PTok.symbol lexer
+> natural   = PTok.natural lexer
+> parens    = PTok.parens lexer
+> semi      = PTok.semi lexer
+> identifier= PTok.identifier lexer
+> reserved  = PTok.reserved lexer
+> operator  = PTok.operator lexer
+> reservedOp= PTok.reservedOp lexer
+> lchar = lexeme.char
+
+> readToEnd :: Parser String
+> readToEnd = do term <- many1 $ noneOf ";"
+>                return term
+>
+
+> data Command = Def String ViewTerm
+>              | TypedDef String ViewTerm ViewTerm
+>              | PatternDef String ViewTerm Patterns [PattOpt]
+>              | Data Inductive
+>              | Axiom String ViewTerm
+>              | Declare String ViewTerm
+>              | DeclareData String ViewTerm
+>              | Theorem String ViewTerm
+>              | Interactive String ViewTerm
+>              | Forget String
+>              | EvalTerm ViewTerm
+>              | WHNF ViewTerm
+>              | Print String
+>              | Check ViewTerm
+>              | ReplData String String String
+>              | Freeze String
+>              | Thaw String
+>              | Suspend
+>              | Resume String
+>              | Load FilePath
+>              | Plugin FilePath
+>              | Compile String
+>              | Focus String
+>              | Dump String
+>              | Undo
+>              | Prf
+>              | PrfState
+>              | Qed
+>              | GenRec String
+>              | JMEq String String
+>              | Primitives
+>              | Drop
+>              | UserCommand String String
+
+> data RunTactic = Attack
+>                | AttackWith String
+>                | Claim String ViewTerm
+>                | Local String ViewTerm
+>                | Refine ViewTerm [ViewTerm]
+>                | Solve
+>                | Fill ViewTerm
+>                | ReturnTac
+>                | QuoteTac
+>                | CallTac ViewTerm
+>                | Abandon
+>                | Rename String
+>                | Intro
+>                | IntroName String
+>                | Intros
+>                | IntrosNames [String]
+>                | AddArg String ViewTerm
+>                | Equiv ViewTerm
+>                | Generalise Bool ViewTerm
+>                | Replace ViewTerm Bool
+>                | Axiomatise String [String]
+>                | Normalise
+>                | Unfold String
+>                | Trivial
+>                | Split | LeftCon | RightCon | AutoSolve
+>                | Exists ViewTerm
+>                | By ViewTerm
+>                | Induction ViewTerm
+>                | Cases ViewTerm
+>                | Decide ViewTerm
+>                | UserTactic String String
+
+A user defined tactic is a pair of the tactic name, and the function
+which runs it.
+
+> data Input = Command Command
+>            | Tactic Goal RunTactic
+
+> def :: Maybe (Parser ViewTerm) -> Parser Command
+> def ext
+>     = do name <- identifier
+>          lchar '='
+>          term <- pTerm ext ; semi
+>          return $ Def name term
+
+> typeddef :: Maybe (Parser ViewTerm) -> Parser Command
+> typeddef ext
+>     = do reserved "Let"
+>          name <- identifier ; lchar ':'; ty <- pTerm ext
+>          lchar '=' ; term <- pTerm ext ; semi
+>          return $ TypedDef name term ty
+
+> pclause :: String -> Maybe (Parser ViewTerm) -> Parser PClause
+> pclause nm ext
+>     = do name <- identifier;
+>          when (name /= nm) $ fail $ show nm ++ " & " ++ show name ++ " do not match"
+>          args <- many (pNoApp ext)
+>          lchar '=' ;
+>          ret <- pTerm ext
+>          return $ PClause args ret
+
+> ppatterns :: String -> Maybe (Parser ViewTerm) -> Parser Patterns
+> ppatterns name ext
+>     = do clauses <- sepBy (pclause name ext) (lchar '|' )
+>          return $ Patterns clauses
+
+> pPattOpt :: Parser PattOpt
+> pPattOpt = do reserved "Partial"
+>               return Partial
+>            <|> do reserved "Rec"
+>                   return Ivor.TT.GenRec
+
+> ppatternDef :: Maybe (Parser ViewTerm) -> Parser Command
+> ppatternDef ext
+>     = do reserved "Match"
+>          opts <- many pPattOpt
+>          name <- identifier ; lchar ':' ; ty <- pTerm ext
+>          lchar '='
+>          patts <- ppatterns name ext
+>          semi
+>          return $ PatternDef name ty patts opts
+
+> pdata :: Maybe (Parser ViewTerm) -> Parser Command
+> pdata ext = do reserved "Data"
+>                datadef <- pInductive ext ; semi
+>                return $ Data datadef
+
+> plata :: Maybe (Parser ViewTerm) -> Parser Command
+> plata ext = do reserved "Data"
+>                name <- identifier
+>                lchar ':'
+>                term <- pTerm ext ; semi
+>                return $ DeclareData name term
+
+> axiom :: Maybe (Parser ViewTerm) -> Parser Command
+> axiom ext
+>       = do reserved "Axiom"
+>            name <- identifier
+>            lchar ':'
+>            term <- pTerm ext ; semi
+>            return $ Axiom name term
+
+> pdeclare :: Maybe (Parser ViewTerm) -> Parser Command
+> pdeclare ext
+>       = do reserved "Declare"
+>            name <- identifier
+>            lchar ':'
+>            term <- pTerm ext ; semi
+>            return $ Declare name term
+
+> ptheorem :: Maybe (Parser ViewTerm) -> Parser Command
+> ptheorem ext
+>          = do name <- identifier
+>               lchar ':'
+>               term <- pTerm ext ; semi
+>               return $ Theorem name term
+
+> pinter :: Maybe (Parser ViewTerm) -> Parser Command
+> pinter ext
+>          = do reserved "Rec"
+>               name <- identifier
+>               lchar ':'
+>               term <- pTerm ext ; semi
+>               return $ Interactive name term
+
+> pforget :: Parser Command
+> pforget = do reserved "Forget"
+>              name <- identifier ; semi
+>              return $ Forget name
+
+> eval :: Maybe (Parser ViewTerm) -> Parser Command
+> eval ext
+>      = do reserved "Eval"
+>           term <- pTerm ext ; semi
+>           return $ EvalTerm term
+
+> pwhnf :: Maybe (Parser ViewTerm) -> Parser Command
+> pwhnf ext
+>      = do reserved "Whnf"
+>           term <- pTerm ext ; semi
+>           return $ WHNF term
+
+> pprint :: Parser Command
+> pprint = do reserved "Print"
+>             term <- identifier ; semi
+>             return $ Print term
+
+> check :: Maybe (Parser ViewTerm) -> Parser Command
+> check ext
+>       = do reserved "Check"
+>            term <- pTerm ext ; semi
+>            return $ Check term
+
+> pdrop :: Parser Command
+> pdrop = do reserved "Drop" ; semi
+>            return Drop
+
+> pprims :: Parser Command
+> pprims = do reserved "Primitives" ; semi
+>             return Primitives
+
+> pqed :: Parser Command
+> pqed = do reserved "Qed" ; semi
+>           return Qed
+
+> pgenrec :: Parser Command
+> pgenrec = do reserved "General" ;
+>              nm <- identifier ; semi
+>              return $ Ivor.ShellParser.GenRec nm
+
+> pjme :: Parser Command
+> pjme = do reserved "Equality" ;
+>           nm <- identifier
+>           con <- identifier
+>           semi
+>           return $ JMEq nm con
+
+> pprf :: Parser Command
+> pprf = do reserved "ProofTerm" ; semi
+>           return Prf
+
+> pprfstate :: Parser Command
+> pprfstate = do reserved "State" ; semi
+>                return PrfState
+
+> pundo :: Parser Command
+> pundo = do reserved "Undo" ; semi
+>            return Undo
+
+> repldata :: Parser Command
+> repldata = do reserved "Repl"
+>               eq <- identifier
+>               repl <- identifier
+>               sym <- identifier
+>               return $ ReplData eq repl sym
+
+> pfreeze :: Parser Command
+> pfreeze = do reserved "Freeze"
+>              term <- identifier ; semi
+>              return $ Freeze term
+
+> pthaw :: Parser Command
+> pthaw = do reserved "Thaw"
+>            term <- identifier ; semi
+>            return $ Thaw term
+
+> pfocus :: Parser Command
+> pfocus = do reserved "Focus"
+>             name <- identifier ; semi
+>             return $ Focus name
+
+> pdump :: Parser Command
+> pdump = do reserved "Dump"
+>            name <- option "" identifier ; semi
+>            return $ Dump name
+
+> psuspend :: Parser Command
+> psuspend = do reserved "Suspend" ; semi
+>               return Suspend
+
+> presume :: Parser Command
+> presume = do reserved "Resume"
+>              nm <- identifier ; semi
+>              return $ Resume nm
+
+> pload :: Parser Command
+> pload = do reserved "Load"
+>            lchar '"' ; rest <- many $ noneOf ['"'] ; lchar '"' ;
+>            whiteSpace ; semi
+>            return $ Load rest
+
+> pplugin :: Parser Command
+> pplugin = do reserved "Plugin"
+>              lchar '"' ; rest <- many $ noneOf ['"'] ; lchar '"' ;
+>              whiteSpace ; semi
+>              return $ Plugin rest
+
+> pcompile :: Parser Command
+> pcompile = do reserved "Compile"
+>               lchar '"' ; rest <- many $ noneOf ['"'] ; lchar '"' ;
+>               whiteSpace ; semi
+>               return $ Compile rest
+
+> puser :: [String] -> Parser Command
+> puser coms = do com <- identifier ;
+>                 if (com `elem` coms)
+>                    then do tm <- readToEnd ; semi
+>                            return $ UserCommand com tm
+>                    else fail "No such command"
+
+> tryall :: [Parser a] -> Parser a
+> tryall [x] = x
+> tryall (x:xs) = try x <|> tryall xs
+
+> command :: Maybe (Parser ViewTerm) -> [String] -> Parser Command
+> command ext user
+>             = tryall [def ext, typeddef ext, pdata ext, plata ext,
+>                       axiom ext,
+>                       ptheorem ext, pdeclare ext, pinter ext, pforget,
+>                       eval ext, pwhnf ext, check ext, ppatternDef ext,
+>                       pdrop, repldata, pqed, pprint, pfreeze, pthaw, pprf,
+>                       pundo, psuspend, presume, pgenrec, pjme,
+>                       pload, pcompile, pfocus, pdump, pprfstate, pprims,
+>                       pplugin, puser user]
+
+> tactic :: Maybe (Parser ViewTerm) -> [String] -> Parser RunTactic
+> tactic ext usertacs
+>        = do reserved "attack" ; semi ; return Attack
+>      <|> do reserved "attack" ; nm <- identifier ; semi ;
+>             return $ AttackWith nm
+>      <|> do reserved "claim" ; name <- identifier ; lchar ':' ;
+>             tm <- pTerm ext ; semi ; return $ Claim name tm
+>      <|> do reserved "local" ; name <- identifier ; lchar ':' ;
+>             tm <- pTerm ext ; semi ; return $ Local name tm
+>      <|> do reserved "refine" ; nm <- pNoApp ext ;
+>             args <- many (pNoApp ext) ;
+>             return $ Refine nm args
+>      <|> do reserved "solve" ; semi ; return Solve
+>      <|> do reserved "fill" ; tm <- pTerm ext ; semi ;
+>             return $ Fill tm
+>      <|> do reserved "return" ; semi ; return ReturnTac
+>      <|> do reserved "quote" ; semi ; return QuoteTac
+>      <|> do reserved "call" ; tm <- pTerm ext ; semi ;
+>             return $ CallTac tm
+>      <|> do reserved "abandon" ; semi ; return Abandon
+>      <|> do reserved "rename" ; nm <- identifier ; semi ;
+>             return $ Rename nm
+>      <|> try (do reserved "intro" ; nms <- many1 identifier; semi
+>                  return $ IntrosNames nms)
+>      <|> do reserved "intro" ; semi ; return Intro
+>      <|> do reserved "intros" ; semi ; return Intros
+>      <|> do reserved "arg"; nm <- identifier ; lchar ':';
+>             tm <- pTerm ext ; semi ;
+>             return $ AddArg nm tm
+>      <|> do reserved "equiv" ; tm <- pTerm ext ; semi ;
+>             return $ Equiv tm
+>      <|> do reserved "generalise" ; dep <- possible "dependent";
+>             tm <- pTerm ext ; semi ;
+>             return $ Generalise dep tm
+>      <|> do reserved "replace" ; sym <- possible "sym";
+>             tm <- pTerm ext ; semi ;
+>             return $ Replace tm (not sym)
+>      <|> do reserved "axiomatise" ; nm <- identifier ;
+>             nms <- many identifier; semi ;
+>             return $ Axiomatise nm nms
+>      <|> do reserved "compute" ; semi ; return Normalise
+>      <|> do reserved "unfold" ; nm <- identifier ;
+>             semi ; return $ Unfold nm
+>      <|> do reserved "trivial" ; semi ; return Trivial
+>      <|> do reserved "split" ; semi ; return Split
+>      <|> do reserved "left" ; semi ; return LeftCon
+>      <|> do reserved "right" ; semi ; return RightCon
+>      <|> do reserved "exists" ; tm <- pTerm ext ; semi ;
+>             return $ Exists tm
+>      <|> do reserved "auto" ; semi ; return AutoSolve
+>      <|> do reserved "by" ; tm <- pTerm ext ; semi ;
+>             return $ By tm
+>      <|> do reserved "induction" ; tm <- pTerm ext ; semi ;
+>             return $ Induction tm
+>      <|> do reserved "case" ; tm <- pTerm ext ; semi ;
+>             return $ Cases tm
+>      <|> do reserved "decide" ; tm <- pTerm ext ; semi ;
+>             return $ Decide tm
+>      <|> do tac <- identifier ;
+>             if (tac `elem` usertacs)
+>                then do tm <- readToEnd ; semi
+>                        return $ UserTactic tac tm
+>                else fail "No such tactic"
+
+> possible :: String -> Parser Bool
+> possible word = option False (do reserved word ; return True)
+
+> input :: Maybe (Parser ViewTerm) -> [String] -> [String] -> Parser Input
+> input ext usertacs usercoms
+>           = try (do whiteSpace
+>                     cmd <- command ext usercoms
+>                     return $ Command cmd)
+>             <|> (do whiteSpace
+>                     tac <- tactic ext usertacs
+>                     return $ Tactic defaultGoal tac)
+
+> parseInput :: Monad m => Maybe (Parser ViewTerm) ->
+>                          [String] -> [String] -> String -> m Input
+> parseInput ext usertacs usercoms str
+>     = case parse (input ext usertacs usercoms) "(input)" str of
+>                 Left err -> fail (show err)
+>                 Right inp -> return inp
diff --git a/Ivor/ShellState.lhs b/Ivor/ShellState.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/ShellState.lhs
@@ -0,0 +1,34 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> -- | 
+> -- Module      : Ivor.Shell
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> -- 
+> -- Shell interface to theorem prover
+
+> module Ivor.ShellState(ShellState(..)) where
+
+> import Ivor.TT as TT
+> import Text.ParserCombinators.Parsec
+
+> data ShellState = Shell {
+>                          repldata :: Maybe (String, String, String),
+>                          prompt :: String,
+>                          finished :: Bool,
+>                          context :: !Context,
+>                          -- | Get reply from last shell command
+>                          response :: String,
+>                          usertactics :: forall m.Monad m => [(String, String -> Goal -> Context -> m Context)],
+>                          usercommands :: [(String, String -> Context -> IO (String, Context))],
+>                          imported :: [String],
+>                          extensions :: Maybe (Parser ViewTerm),
+>                          -- search path for modules to load
+>                          modulePath :: [FilePath]
+>                          }
+
+
diff --git a/Ivor/State.lhs b/Ivor/State.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/State.lhs
@@ -0,0 +1,200 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.State where
+
+> import Ivor.TTCore
+> import Ivor.Nobby
+> import Ivor.Gadgets
+> import Ivor.Typecheck
+> import Ivor.Datatype
+> import Ivor.MakeData
+> import Ivor.ICompile
+> import Ivor.Grouper
+> import Ivor.SC
+> import Ivor.Bytecode
+> import Ivor.CodegenC
+> import Ivor.Tactics as Tactics
+> import Ivor.Display
+> import Ivor.Unify
+
+> import System.Environment
+> import Data.List
+> import Debug.Trace
+
+State of the system, include all definitions, pattern matching rules,
+compiled terms, etc.
+
+> data IState = ISt {
+>            -- All definitions
+>	     defs :: !(Gamma Name),
+>            -- All datatype definitions
+>            datadefs :: [(Name,Datatype Name)],
+>            -- All elimination rules in their pattern matching form
+>            -- (with type)
+>            eliminators :: [(Name, (Indexed Name,
+>                                    ([RawScheme], PMFun Name)))],
+>            -- Supercombinators for each definition
+>            runtt :: SCs,
+>            -- Bytecode for each definitions
+>            bcdefs :: ByteDef,
+>            -- List of holes to be solved in proof state
+>            holequeue :: ![Name],
+>            -- Premises we're not interested in, so don't show
+>            hidden :: [Name],
+>            -- Current proof term (FIXME: Combine with holequeue, and make it efficient)
+>            proofstate :: !(Maybe (Indexed Name)),
+>            -- Actions required of last tactic
+>            actions :: ![TacticAction],
+>            -- List of fresh names for tactics to use
+>            namesupply :: [Name],
+>            -- Output from last operation
+>            response :: String,
+>            -- Previous state
+>            undoState :: !(Maybe IState)
+>        }
+
+> initstate = ISt (Gam []) [] [] [] [] [] [] Nothing [] mknames "" Nothing
+>   where mknames = [MN ("myName",x) | x <- [1..]]
+
+> respond :: IState -> String -> IState
+> respond st str = st { response = (response st) ++ str }
+
+> gensym :: IState -> (Name, IState)
+> gensym st = (head (namesupply st),
+>              st { namesupply = tail (namesupply st) })
+
+> jumpqueue hole q = nub (hole: (q \\ [hole]))
+> stail (x:xs) = xs
+> stail [] = []
+
+> prf st = case (proofstate st) of
+>           Nothing -> error "Can't happen"
+>           (Just x) -> x
+
+> saveState st = let st' = st in
+>                    st { undoState = Just st' }
+
+Take a data type definition and add constructors and elim rule to the context.
+
+> doData :: Monad m => IState -> Name -> RawDatatype -> m IState
+> doData st n r = do
+>            let ctxt = defs st
+>            let runtts = runtt st
+>            let bcs = bcdefs st
+>            dt <- checkType (defs st) r -- Make iota schemes
+>            ctxt <- gInsert (fst (tycon dt)) (snd (tycon dt)) ctxt
+>                        -- let ctxt' = (tycon dt):ctxt
+>            ctxt <- addCons (datacons dt) ctxt
+>            (ctxt, newruntts, newbc) <-
+>                addElim ctxt runtts bcs (erule dt) (e_ischemes dt)
+>            (newdefs, newruntts, newbc) <-
+>                addElim ctxt newruntts newbc (crule dt) (c_ischemes dt)
+>            let newelims = (fst (erule dt), (snd (erule dt),
+>                              (e_rawschemes dt, e_ischemes dt))):
+>                           (fst (crule dt), (snd (crule dt),
+>                              (c_rawschemes dt, c_ischemes dt))):
+>                           eliminators st
+>            let newdatadefs = (n,dt):(datadefs st)
+>            return $ st { defs = newdefs, datadefs = newdatadefs,
+>                          eliminators = newelims,
+>                          bcdefs = newbc, runtt = newruntts }
+>    where addCons [] ctxt = return ctxt
+>          addCons ((n,gl):xs) ctxt = do
+>              ctxt <- addCons xs ctxt
+>              gInsert n gl ctxt
+>          addElim ctxt runtts bcdefs erule schemes = do
+>            newdefs <- gInsert (fst erule)
+>                               (G (PatternDef schemes) (snd erule) defplicit)
+>                               ctxt
+>            return (newdefs, runtts, bcdefs)
+
+> doMkData :: Monad m => IState -> Datadecl -> m IState
+> doMkData st (Datadecl n ps rawty cs)
+>     = do (gty,_) <- checkIndices (defs st) ps [] rawty
+>          let ty = forget (normalise (defs st) gty)
+>          -- TMP HACK: Do it twice, to fill in _ placeholders.
+>          rd1 <- mkRawData n ps ty cs
+>          dt1 <- checkType (defs st) rd1
+>          let csfilled = map (forgetcon (length ps)) (datacons dt1)
+>          rd <- mkRawData n ps ty csfilled
+>          doData st n rd
+>  where checkIndices gam [] env rawty = check gam env rawty Nothing
+>        checkIndices gam ((n,nrawty):xs) env rawty = do
+>            (Ind nty,_) <- check gam env nrawty Nothing
+>            checkIndices gam xs (env++[(n,B Pi nty)]) rawty
+>        -- also need to strip parameters
+>        forgetcon numps (n, (G _ (Ind t) _)) = (n, (stripps numps (forget t)))
+>        stripps 0 t = t
+>        stripps n (RBind _ _ sc) = stripps (n-1) sc
+
+> suspendProof :: Monad m => IState -> m IState
+> suspendProof st = do case proofstate st of
+>                        (Just prf) -> do
+>                          let (Gam olddefs) = defs st
+>                          newdef <- suspendFrom (defs st) prf (holequeue st)
+>                          return $ st { proofstate = Nothing,
+>                                        defs = Gam (newdef:olddefs),
+>                                        holequeue = []
+>                                      }
+>                        _ -> fail "No proof in progress"
+
+> suspendFrom gam (Ind (Bind x (B (Guess v) ty) (Sc (P n)))) q | n == x =
+>               return $ (x, G (Partial (Ind v) q) (finalise (Ind ty)) defplicit)
+> suspendFrom _ _ _ = fail "Not a suspendable proof"
+
+> resumeProof :: Monad m => IState -> Name -> m IState
+> resumeProof st n = case (proofstate st) of
+>      Nothing ->
+>          case glookup n (defs st) of
+>             Just ((Partial (Ind v) q),(Ind ty)) -> do
+>                 -- recheck in case any of the names have changed 'status'
+>                 -- (e.g., from undefined to defined type constructors)
+>                 let vraw = forget v
+>                 let traw = forget ty
+>                 (Ind vrecheck, _) <- typecheck (defs st) vraw
+>                 (Ind trecheck, _) <- typecheck (defs st) traw
+>                 return $ st
+>                    { proofstate = Just
+>                        (Ind (Bind n (B (Guess (makePs vrecheck))
+>                                               (makePs trecheck))
+>                               (Sc (P n)))),
+>                      defs = remove n (defs st),
+>                      holequeue = q
+>                    }
+>             _ -> fail "Not a suspended proof"
+>      (Just _) -> fail "Already a proof in progress"
+
+And an argument to the current proof (after any dependencies)
+e.g. adding z:C x to foo : (x:A)(y:B)Z = [x:A][y:B]H
+ becomes foo : (x:A)(z:C x)(y:B) = [x:A][z:C x][y:B]H.
+
+> addArg :: Monad m => IState -> Name -> TT Name -> m IState
+> addArg st n ty =
+>     case proofstate st of
+>         Just (Ind (Bind n (B (Guess v) t) sc)) -> do
+>            (v',t') <- addArgTy v t (getDeps ty)
+>            return $ st { proofstate = Just (Ind (Bind n (B (Guess v') t') sc)) }
+>         _ -> fail "Can't add argument now"
+>   where
+>      getDeps ty = filter (nonfree (defs st)) (getNames (Sc ty))
+>      nonfree gam n | Nothing <- lookupval n gam = True
+>                    | otherwise = False
+>      addArgTy v t [] = return (Bind n (B Lambda ty) (Sc v),
+>                                Bind n (B Pi ty) (Sc t))
+>      addArgTy (Bind n (B Lambda nty) (Sc v))
+>               (Bind n' (B Pi nty') (Sc t)) ds
+>          | n == n' = do (v',t') <- addArgTy v t (ds \\ [n])
+>                         return (Bind n (B Lambda nty) (Sc v'),
+>                                 Bind n (B Pi nty) (Sc t'))
+>      addArgTy _ _ _ = fail "Can't add argument here"
+
+
+
+> dumpState :: IState -> String
+> dumpState st = dumpProofstate (proofstate st)
+>  where dumpProofstate Nothing = ""
+>        dumpProofstate (Just p) = dhole p (holequeue st)
+>
+>        dhole p [] = show p
+>        dhole p (n:ns) = displayHoleContext (defs st) (hidden st) n p ++
+>                           "Next holes: " ++ show ns++"\n"
diff --git a/Ivor/TT.lhs b/Ivor/TT.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/TT.lhs
@@ -0,0 +1,1441 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> -- |
+> -- Module      : Ivor.TT
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> --
+> -- Public interface for theorem proving gadgets.
+
+> module Ivor.TT(-- * System state
+>               emptyContext, Context,
+>               Ivor.TT.check,
+>               checkCtxt,converts,
+>               Ivor.TT.compile,
+>               -- * Exported view of terms
+>               module VTerm, IsTerm, IsData,
+>               -- * Definitions and Theorems
+>               addDef,addTypedDef,addData,addAxiom,declare,declareData,
+>               theorem,interactive,
+>               addPrimitive,addBinOp,addBinFn,addPrimFn,addExternalFn,
+>               addEquality,forgetDef,addGenRec,addImplicit,
+>               -- * Pattern matching definitions
+>               PClause(..), Patterns(..),PattOpt(..),addPatternDef,
+>               -- * Manipulating Proof State
+>               proving,numUnsolved,suspend,resume,
+>               save, restore, clearSaved,
+>               proofterm, getGoals, getGoal, uniqueName, -- getActions
+>               allSolved,qed,
+>               -- * Examining the Context
+>               eval, whnf, evalCtxt, getDef, defined, getPatternDef,
+>               getAllDefs, getConstructors,
+>               Rule(..), getElimRule,
+>               Ivor.TT.freeze,Ivor.TT.thaw,
+>               -- * Goals, tactic types
+>               Goal,goal,defaultGoal,
+>               Tactic, --Tactics.TacticAction(..),
+>               GoalData, bindings, goalName, goalType,
+>               goalData, subGoals,
+>               -- * Primitive Tactics
+>               -- ** Basics
+>               intro,
+>               introName,
+>               intros,intros1,
+>               introsNames,
+>               Ivor.TT.addArg,
+>               generalise,
+>               dependentGeneralise,
+>               claim,
+>               -- ** Proof navigation
+>               focus,
+>               rename,
+>               attack, attackWith,
+>               solve,
+>               trySolve,
+>               keepSolving,
+>               abandon,
+>               hide,
+>               -- ** Introductions
+>               fill,
+>               refine,
+>               basicRefine,
+>               refineWith,
+>               trivial,
+>               axiomatise,
+>               -- ** Eliminations
+>               by,
+>               induction,
+>               cases,
+>               -- ** Conversions
+>               equiv,
+>               compute,
+>               beta,
+>               unfold,
+>               -- ** Equality
+>               replace,
+>               -- ** Computations
+>               call,
+>               returnComputation,
+>               -- ** Staging
+>               quoteVal,
+>               -- ** Tactic combinators
+>               idTac, tacs,
+>               (>->), (>=>), (>+>), (>|>), try,
+>               traceTac)
+
+>     where
+
+> import Ivor.TTCore as TTCore
+> import Ivor.State
+> import Ivor.Typecheck
+> import Ivor.Gadgets
+> import Ivor.Nobby
+> import Ivor.Evaluator
+> import Ivor.SC
+> import Ivor.Bytecode
+> import Ivor.Datatype
+> import Ivor.Constant
+> import Ivor.ViewTerm as VTerm
+> import Ivor.TermParser
+> import qualified Ivor.Tactics as Tactics
+> import Ivor.Compiler as Compiler
+> import Ivor.CodegenC
+> import Ivor.PatternDefs
+
+> import Data.List
+> import Debug.Trace
+> import Data.Typeable
+
+> -- | Abstract type representing state of the system.
+> newtype Context = Ctxt IState
+
+> -- | Abstract type representing goal or subgoal names.
+> data Goal = Goal Name | DefaultGoal
+>     deriving Eq
+
+> instance Show Goal where
+>     show (Goal g) = show g
+>     show (DefaultGoal) = "Default Goal"
+
+> goal :: String -> Goal
+> goal g = Goal $ UN g
+
+> defaultGoal :: Goal
+> defaultGoal = DefaultGoal
+
+> -- |A tactic is any function which manipulates a term at the given goal
+> -- binding. Tactics may fail, hence the monad.
+> type Tactic = forall m.Monad m => Goal -> Context -> m Context
+
+> -- | Initialise a context, with no data or definitions and an
+> -- empty proof state.
+> emptyContext :: Context
+> emptyContext = Ctxt initstate
+
+> class IsTerm a where
+>     -- | Typecheck a term
+>     check :: Monad m => Context -> a -> m Term
+>     raw :: Monad m => a -> m Raw
+
+> class IsData a where
+>     addData :: Monad m => Context -> a -> m Context
+
+> instance IsTerm Term where
+>     check _ tm = return tm
+>     raw tm = return $ forget (view tm)
+
+> instance IsTerm ViewTerm where
+>     check ctxt tm = Ivor.TT.check ctxt (forget tm)
+>     raw tm = return $ forget tm
+
+> instance IsTerm String where
+>     check ctxt str = case parseTermString str of
+>          (Success tm) -> Ivor.TT.check ctxt (forget tm)
+>          (Failure err) -> fail err
+>     raw str = case parseTermString str of
+>          (Success tm) -> return $ forget tm
+>          (Failure err) -> fail err
+
+> instance IsTerm Raw where
+>     check (Ctxt st) t = do
+>        case (typecheck (defs st) t) of
+>           (Success (t, ty)) -> return $ Term (t,ty)
+>           (Failure err) -> fail err
+>     raw t = return t
+
+> -- | Parse and typecheck a data declaration, of the form
+> -- "x:Type = c1:Type | ... | cn:Type"
+> instance IsData String where
+>     addData (Ctxt st) str = do
+>         case (parseDataString str) of
+>             Success ind -> addData (Ctxt st) ind
+>             Failure err -> fail err
+
+> instance IsData Inductive where
+>     addData (Ctxt st) ind = do st' <- doMkData st (datadecl ind)
+>                                return (Ctxt st')
+>       where
+>         datadecl (Inductive n ps inds cty cons) =
+>             Datadecl n (map (\ (n,ty) -> (n, forget ty)) ps)
+>                        (mkTycon inds cty)
+>                        (map (\ (n,ty) -> (n, forget ty)) cons)
+>         mkTycon [] rty = forget rty
+>         mkTycon ((n,ty):ts) rty = RBind n (B Pi (forget ty)) (mkTycon ts rty)
+
+> checkNotExists n gam = case lookupval n gam of
+>                                 Just Undefined -> return ()
+>                                 Just (TCon _ NoConstructorsYet) -> return ()
+>                                 Just _ -> fail $ show n ++ " already defined"
+>                                 Nothing -> return ()
+
+> data PClause = PClause {
+>                         arguments :: [ViewTerm],
+>                         returnval :: ViewTerm
+>                        }
+>    deriving Show
+
+> data Patterns = Patterns [PClause]
+>    deriving Show
+
+> mkRawClause :: PClause -> RawScheme
+> mkRawClause (PClause args ret) =
+>     RSch (map forget args) (forget ret)
+
+> data PattOpt = Partial -- ^ No need to cover all cases
+>              | GenRec -- ^ No termination checking
+>   deriving Eq
+
+> -- |Add a new definition to the global state.
+> -- By default, these definitions must cover all cases and be well-founded,
+> -- but can be optionally partial or general recursive
+> addPatternDef :: (IsTerm ty, Monad m) =>
+>                Context -> Name -> ty -- ^ Type
+>                  -> Patterns -- ^ Definition
+>                -> [PattOpt] -- ^ Options to set which definitions will be accepted
+>                -> m Context
+> addPatternDef (Ctxt st) n ty pats opts = do
+>         checkNotExists n (defs st)
+>         inty <- raw ty
+>         let (Patterns clauses) = pats
+>         (pmdef, fty) <- checkDef (defs st) n inty (map mkRawClause clauses)
+>                            (not (elem Ivor.TT.Partial opts))
+>                            (not (elem GenRec opts))
+>         newdefs <- gInsert n (G (PatternDef pmdef) fty defplicit) (defs st)
+>         return $ Ctxt st { defs = newdefs }
+
+> -- |Add a new definition, with its type to the global state.
+> -- These definitions can be recursive, so use with care.
+> addTypedDef :: (IsTerm term, IsTerm ty, Monad m) =>
+>                Context -> Name -> term -> ty -> m Context
+> addTypedDef (Ctxt st) n tm ty = do
+>         checkNotExists n (defs st)
+>         (Term (inty,_)) <- Ivor.TT.check (Ctxt st) ty
+>         (Ctxt tmpctxt) <- declare (Ctxt st) n ty
+>         let Gam tmp = defs tmpctxt
+>         let Gam ctxt = defs st
+>         let runtts = runtt st
+>         term <- raw tm
+>         case (checkAndBind (Gam tmp) [] term (Just inty)) of
+>              (Success (v,t@(Ind sc),_)) -> do
+>                 if (convert (defs st) inty t)
+>                     then (do
+>                       checkBound (getNames (Sc sc)) t
+>                       newdefs <- gInsert n (G (Fun [Recursive] v) t defplicit) (Gam ctxt)
+>                               -- = Gam ((n,G (Fun [] v) t):ctxt)
+>                       let scs = lift n (levelise (normalise (Gam []) v))
+>                       let bc = compileAll (runtts++scs) scs
+>                       let newbc = bc++(bcdefs st)
+>                       return $ Ctxt st { defs = newdefs, bcdefs = newbc,
+>                                    runtt = (runtts++scs) })
+>                     else (fail $ "The given type and inferred type do not match, inferred " ++ show t)
+>              (Failure err) -> fail err
+
+
+> -- |Add a new definition to the global state.
+> addDef :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+> addDef (Ctxt st) n tm = do
+>         checkNotExists n (defs st)
+>         v <- raw tm
+>         let Gam ctxt = defs st
+>         let runtts = runtt st
+>         case (typecheck (Gam ctxt) v) of
+>             (Success (v,t@(Ind sc))) -> do
+>                 checkBound (getNames (Sc sc)) t
+>                 newdefs <- gInsert n (G (Fun [] v) t defplicit) (Gam ctxt)
+>                 -- let newdefs = Gam ((n,G (Fun [] v) t):ctxt)
+>                 let scs = lift n (levelise (normalise (Gam []) v))
+>                 let bc = compileAll (runtts++scs) scs
+>                 let newbc = bc++(bcdefs st)
+>                 return $ Ctxt st { defs = newdefs, bcdefs = newbc,
+>                                    runtt = (runtts++scs) }
+>             (Failure err) -> fail err
+
+> checkBound :: Monad m => [Name] -> (Indexed Name) -> m ()
+> checkBound [] t = return ()
+> checkBound (nm@(MN ("INFER",_)):ns) t
+>                = fail $ "Can't infer value for " ++ show nm ++ " in " ++ show t
+> checkBound (_:ns) t = checkBound ns t
+
+> -- |Forget a definition and all following definitions.
+> forgetDef :: Monad m => Context -> Name -> m Context
+> forgetDef (Ctxt st) n = do let (Gam olddefs) = defs st
+>                            newdefs <- f olddefs n
+>                            return $ Ctxt st { defs = Gam newdefs }
+>   where f [] n = fail "No such name"
+>         f (def@(x,_):xs) n | x == n = return xs
+>                            | otherwise = f xs n
+
+> -- |Add the general recursion elimination rule, thus making all further
+> -- definitions untrustworthy :).
+> addGenRec :: Monad m => Context -> Name -- ^ Name to give recursion rule
+>                      -> m Context
+> addGenRec (Ctxt st) n
+>     = do checkNotExists n (defs st)
+>          (Ctxt tmpctxt) <- addAxiom (Ctxt st) n
+>                              "(P:*)(meth_general:(p:P)P)P"
+>          let Gam tmp = defs tmpctxt
+>          let Gam ctxt = defs st
+>          let runtts = runtt st
+>          general <- raw $ "[P:*][meth_general:(p:P)P](meth_general (" ++
+>                            show n ++ " P meth_general))"
+>          case (typecheck (Gam tmp) general) of
+>              (Success (v,t)) -> do
+>                 -- let newdefs = Gam ((n,G (Fun [] v) t):ctxt)
+>                 newdefs <- gInsert n (G (Fun [] v) t defplicit) (Gam ctxt)
+>                 let scs = lift n (levelise (normalise (Gam []) v))
+>                 let bc = compileAll (runtts++scs) scs
+>                 let newbc = bc++(bcdefs st)
+>                 return $ Ctxt st { defs = newdefs, bcdefs = newbc,
+>                                    runtt = (runtts++scs) }
+>              (Failure err) -> fail $ "Can't happen (general): "++err
+
+> -- | Add the heterogenous (\"John Major\") equality rule and its reduction
+> addEquality :: Monad m => Context -> Name -- ^ Name to give equality type
+>             -> Name -- ^ Name to give constructor
+>             -> m Context
+> addEquality ctxt@(Ctxt st) ty con = do
+>     checkNotExists ty (defs st)
+>     checkNotExists con (defs st)
+>     rtycon <- eqTyCon ty
+>     rdatacon <- eqCon (show ty) con
+>     rerule <- eqElimType (show ty) (show con) "Elim"
+>     rcrule <- eqElimType (show ty) (show con) "Case"
+>     rischeme <- eqElimSch (show con)
+>     let rdata = (RData rtycon [rdatacon] 2 rerule rcrule [rischeme] [rischeme])
+>     st <- doData st ty rdata
+>     return $ Ctxt st
+
+> -- eqElim : (A:*)(a:A)(b:A)(q:JMEq A A a a)
+> --       (Phi:(a':A)(target:JMEq A A a a')*)
+> --       (meth_refl:(a:A)(Phi a (refl A a)))(Phi a q);
+> -- eqelim A a Phi meth_refl a (refl A a) => meth_refl a
+
+> eqTyCon jmeq = do ty <- raw $ "(A:*)(B:*)(a:A)(b:B)*"
+>                   return (jmeq, ty)
+
+> eqCon jmeq refl = do ty <- raw $ "(A:*)(a:A)" ++ jmeq ++ " A A a a"
+>                      return (refl, ty)
+
+> eqElimType jmeq refl nm
+>     = do ty <- raw $
+>                 "(A:*)(a:A)(b:A)(q:" ++ jmeq ++
+>                 " A A a b)(Phi:(a':A)(target:" ++
+>                 jmeq ++ " A A a a')*)(meth_" ++
+>                 refl ++ ":Phi a (" ++ refl ++ " A a))(Phi b q)"
+>          return (name (jmeq++nm), ty)
+
+> eqElimSch refl = do aty <- raw "A"
+>                     a <- raw "a"
+>                     b <- raw "_"
+>                     phi <- raw "phi"
+>                     mrefl <- raw "meth_refl"
+>                     arg <- raw $ refl ++ " A a"
+>                     ret <- raw "meth_refl"
+>                     return $ RSch [aty,a,b,arg,phi,mrefl] ret
+
+> -- | Declare a name which is to be defined later
+> declare :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+> declare ctxt n tm = addUn Undefined ctxt n tm
+
+> -- | Declare a type constructor which is to be defined later
+> declareData :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+> declareData ctxt@(Ctxt st) n tm = do
+>   let gamma = defs st
+>   Term (ty, _) <- Ivor.TT.check ctxt tm
+>   addUn (TCon (arity gamma ty) NoConstructorsYet) ctxt n tm
+
+> -- | Add a new axiom to the global state.
+> addAxiom :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+> addAxiom ctxt n tm = addUn Unreducible ctxt n tm
+
+> addUn und (Ctxt st) n tm = do
+>        checkNotExists n (defs st)
+>        t <- raw tm
+>        let Gam ctxt = defs st
+>        case (typecheck (defs st) t) of
+>           (Success (t, ty)) ->
+>              do checkConv (defs st) ty (Ind TTCore.Star) "Not a type"
+>                 -- let newdefs = Gam ((n, (G und (finalise t))):ctxt)
+>                 newdefs <- gInsert n (G und (finalise t) defplicit) (Gam ctxt)
+>                 return $ Ctxt st { defs = newdefs }
+>           (Failure err) -> fail err
+
+> -- | Add a new primitive type. This should be done in assocation with
+> -- creating an instance of 'ViewConst' for the type, and creating appropriate
+> -- primitive functions.
+> addPrimitive :: Monad m => Context -> Name -- ^ Type name
+>                 -> m Context
+> addPrimitive (Ctxt st) n = do
+>        checkNotExists n (defs st)
+>        let Gam ctxt = defs st
+>        let elims = Elims (MN ("none",0)) (MN ("none",0)) []
+>        -- let newdefs = Gam ((n, (G (TCon 0 elims) (Ind TTCore.Star))):ctxt)
+>        newdefs <- gInsert n (G (TCon 0 elims) (Ind TTCore.Star) defplicit) (Gam ctxt)
+>        return $ Ctxt st { defs = newdefs }
+
+> -- | Add a new binary operator on constants. Warning: The type you give
+> -- is not checked!
+> addBinOp :: (ViewConst a, ViewConst b, ViewConst c, IsTerm ty, Monad m) =>
+>             Context -> Name -> (a->b->c) -> ty -> m Context
+> addBinOp (Ctxt st) n f tyin = do
+>        checkNotExists n (defs st)
+>        Term (ty, _) <- Ivor.TT.check (Ctxt st) tyin
+>        let fndef = PrimOp mkfun mktt
+>        let Gam ctxt = defs st
+>        -- let newdefs = Gam ((n,(G fndef ty)):ctxt)
+>        newdefs <- gInsert n (G fndef ty defplicit) (Gam ctxt)
+>        return $ Ctxt st { defs = newdefs }
+>    where mkfun :: Spine Value -> Maybe Value
+>          mkfun (Snoc (Snoc Empty (MR (RdConst x))) (MR (RdConst y)))
+>              = case cast x of
+>                   Just x' -> case cast y of
+>                      Just y' -> Just $ MR (RdConst $ f x' y')
+>                      Nothing -> Nothing
+>                   Nothing -> Nothing
+>          mkfun _ = Nothing
+>          mktt :: [TT Name] -> Maybe (TT Name)
+>          mktt [Const x, Const y]
+>               = case cast x of
+>                   Just x' -> case cast y of
+>                      Just y' -> Just $ Const (f x' y')
+>                      Nothing -> Nothing
+>          mktt _ = Nothing
+
+> -- | Add a new binary function on constants. Warning: The type you give
+> -- is not checked!
+> addBinFn :: (ViewConst a, ViewConst b, IsTerm ty, Monad m) =>
+>             Context -> Name -> (a->b->ViewTerm) -> ty -> m Context
+> addBinFn (Ctxt st) n f tyin = do
+>        checkNotExists n (defs st)
+>        Term (ty, _) <- Ivor.TT.check (Ctxt st) tyin
+>        let fndef = PrimOp mkfun mktt
+>        let Gam ctxt = defs st
+>        -- let newdefs = Gam ((n,(G fndef ty)):ctxt)
+>        newdefs <- gInsert n (G fndef ty defplicit) (Gam ctxt)
+>        return $ Ctxt st { defs = newdefs }
+>    where mkfun :: Spine Value -> Maybe Value
+>          mkfun (Snoc (Snoc Empty (MR (RdConst x))) (MR (RdConst y)))
+>              = case cast x of
+>                   Just x' -> case cast y of
+>                      Just y' -> case Ivor.TT.check (Ctxt st) $ f x' y' of
+>                          Just (Term (Ind v,_)) ->
+>                              Just $ nf (Gam []) (VG []) [] False v
+>                      Nothing -> Nothing
+>                   Nothing -> Nothing
+>          mkfun _ = Nothing
+>          mktt :: [TT Name] -> Maybe (TT Name)
+>          mktt [Const x, Const y]
+>              = case cast x of
+>                   Just x' -> case cast y of
+>                      Just y' -> case Ivor.TT.check (Ctxt st) $ f x' y' of
+>                          Just (Term (Ind v,_)) ->
+>                              Just v
+>                      Nothing -> Nothing
+>                   Nothing -> Nothing
+>          mktt _ = Nothing
+
+
+> -- | Add a new primitive function on constants, usually used for converting
+> -- to some form which can be examined in the type theory itself.
+> -- Warning: The type you give is not checked!
+> addPrimFn :: (ViewConst a, IsTerm ty, Monad m) =>
+>             Context -> Name -> (a->ViewTerm) -> ty -> m Context
+> addPrimFn (Ctxt st) n f tyin = do
+>        checkNotExists n (defs st)
+>        Term (ty, _) <- Ivor.TT.check (Ctxt st) tyin
+>        let fndef = PrimOp mkfun mktt
+>        let Gam ctxt = defs st
+>        -- let newdefs = Gam ((n,(G fndef ty)):ctxt)
+>        newdefs <- gInsert n (G fndef ty defplicit) (Gam ctxt)
+>        return $ Ctxt st { defs = newdefs }
+>    where mkfun :: Spine Value -> Maybe Value
+>          mkfun (Snoc Empty (MR (RdConst x)))
+>              = case cast x of
+>                   Just x' -> case Ivor.TT.check (Ctxt st) $ f x' of
+>                                  Just (Term (Ind v,_)) ->
+>                                      Just $ nf (Gam []) (VG []) [] False v
+>                                  Nothing -> Nothing
+>                   Nothing -> Nothing
+>          mkfun _ = Nothing
+>          mktt :: [TT Name] -> Maybe (TT Name)
+>          mktt [Const x]
+>               = case cast x of
+>                   Just x' -> case Ivor.TT.check (Ctxt st) $ f x' of
+>                                  Just (Term (Ind v,_)) ->
+>                                      Just v
+>                                  Nothing -> Nothing
+>                   Nothing -> Nothing
+>          mktt _ = Nothing
+
+> -- | Add a new externally defined function.
+> -- Warning: The type you give is not checked!
+> addExternalFn :: (IsTerm ty, Monad m) =>
+>                  Context -> Name -> Int -- ^ arity
+>                  -> ([ViewTerm] -> Maybe ViewTerm) -- ^ The function, which must
+>                     -- accept a list of the right length given by arity.
+>                  -> ty -> m Context
+> addExternalFn (Ctxt st) n arity f tyin = do
+>        checkNotExists n (defs st)
+>        Term (ty, _) <- Ivor.TT.check (Ctxt st) tyin
+>        let fndef = PrimOp mkfun mktt
+>        let Gam ctxt = defs st
+>        -- let newdefs = Gam ((n,(G fndef ty)):ctxt)
+>        newdefs <- gInsert n (G fndef ty defplicit) (Gam ctxt)
+>        return $ Ctxt st { defs = newdefs }
+>    where mkfun :: Spine Value -> Maybe Value
+>          mkfun sx | xs <- listify sx
+>            = if (length xs) /= arity then Nothing
+>               else case runf xs of
+>                      Just res ->
+>                          case (Ivor.TT.check (Ctxt st) res) of
+>                             Nothing -> Nothing
+>                             Just (Term (Ind tm, _)) ->
+>                                 Just $ nf (Gam []) (VG []) [] False tm
+>                      Nothing -> Nothing
+>          mktt :: [TT Name] -> Maybe (TT Name)
+>          mktt xs
+>            = if (length xs) /= arity then Nothing
+>               else case f (map viewtt xs) of
+>                      Just res ->
+>                          case (Ivor.TT.check (Ctxt st) res) of
+>                             Nothing -> Nothing
+>                             Just (Term (Ind tm, _)) ->
+>                                 Just tm
+>                      Nothing -> Nothing
+
+Using 'Star' here is a bit of a hack; I don't want to export vt from
+ViewTerm, and I don't want to cut&paste code, and it's thrown away anyway...
+Slightly annoying, but we'll cope.
+
+>          runf spine = f (map viewValue spine)
+>          viewValue x = view (Term (Ind (forget ((quote x)::Normal)),
+>                                 Ind TTCore.Star))
+>          viewtt x = view (Term (Ind x, Ind TTCore.Star))
+
+
+> -- |Add implicit binders for names used in a type, but not declared.
+> -- |Returns the new type and the number of implicit names bound.
+
+Search for all unbound names and reverse the list so that we bind them
+in left to right order. (Not that this really matters but I find it more
+intuitive)
+
+> addImplicit :: Context -> ViewTerm -> (Int, ViewTerm)
+> addImplicit ctxt tm = bind 0 (reverse (namesIn tm)) tm
+>   where bind i [] tm = (i,tm)
+>         bind i (n:ns) tm | defined ctxt n = bind i ns tm
+>                          | otherwise = bind (i+1) ns
+>                                           (Forall n Placeholder tm)
+
+> -- |Begin a new proof.
+> theorem :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+> theorem (Ctxt st) n tm = do
+>        checkNotExists n (defs st)
+>        rawtm <- raw tm
+>        (tv,tt) <- tcClaim (defs st) rawtm
+>        case (proofstate st) of
+>            Nothing -> do
+>                       let thm = Tactics.theorem n tv
+>                       attack defaultGoal
+>                                  $ Ctxt st { proofstate = Just $ thm,
+>                                              holequeue = [n],
+>                                              hidden = []
+>                                              }
+>            (Just t) -> fail "Already a proof in progress"
+
+> -- |Begin a new interactive definition.
+> -- Actually, just the same as 'theorem' but this version allows you to
+> -- make recursive calls, which should of course be done with care.
+> interactive :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+> interactive (Ctxt st) n tm = do
+>        checkNotExists n (defs st)
+>        (Ctxt st') <- declare (Ctxt st) n tm
+>        rawtm <- raw tm
+>        (tv,tt) <- tcClaim (defs st) rawtm
+>        case (proofstate st) of
+>            Nothing -> do
+>                       let thm = Tactics.theorem n tv
+>                       attack defaultGoal
+>                                  $ Ctxt st' { proofstate = Just $ thm,
+>                                               holequeue = [n],
+>                                               hidden = []
+>                                               }
+>            (Just t) -> fail "Already a proof in progress"
+
+> -- |Suspend the current proof. Clears the current proof state; use 'resume'
+> -- to continue the proof.
+> suspend :: Context -> Context
+> suspend (Ctxt st) = case (suspendProof st) of
+>                        (Just st') -> Ctxt st'
+>                        Nothing -> Ctxt st
+
+> -- |Resume an unfinished proof, suspending the current one if necessary.
+> -- Fails if there is no such name. Can also be used to begin a
+> -- proof of an identifier previously claimed as an axiom.
+> -- Remember that you will need to 'attack' the goal if you are resuming an
+> -- axiom.
+> resume :: Monad m => Context -> Name -> m Context
+> resume ctxt@(Ctxt st) n =
+>     case glookup n (defs st) of
+>         Just ((Ivor.Nobby.Partial _ _),_) -> do let (Ctxt st) = suspend ctxt
+>                                                 st' <- resumeProof st n
+>                                                 return (Ctxt st')
+>         Just (Unreducible,ty) ->
+>             do let st' = st { defs = remove n (defs st) }
+>                theorem (Ctxt st') n (Term (ty, Ind TTCore.Star))
+>         _ -> fail "No such suspended proof"
+
+> -- | Freeze a name (i.e., set it so that it does not reduce)
+> -- Fails if the name does not exist.
+> freeze :: Monad m => Context -> Name -> m Context
+> freeze (Ctxt st) n
+>      = case glookup n (defs st) of
+>           Nothing -> fail $ show n ++ " is not defined"
+>           _ -> return $ Ctxt st { defs = Ivor.Nobby.freeze n (defs st) }
+
+> -- | Unfreeze a name (i.e., allow it to reduce).
+> -- Fails if the name does not exist.
+> thaw :: Monad m => Context -> Name -> m Context
+> thaw (Ctxt st) n
+>      = case glookup n (defs st) of
+>           Nothing -> fail $ show n ++ " is not defined"
+>           _ -> return $ Ctxt st { defs = Ivor.Nobby.thaw n (defs st) }
+
+
+> -- | Save the state (e.g. for Undo)
+> save :: Context -> Context
+> save (Ctxt st) = Ctxt $ saveState st
+
+> -- | Clears the saved state (e.g. if undo no longer makes sense, like when
+> -- a proof has been completed)
+> clearSaved :: Context -> Context
+> clearSaved (Ctxt st) = Ctxt st { undoState = Nothing }
+
+> -- | Restore a saved state; fails if none have been saved.
+> restore :: Monad m => Context -> m Context
+> restore (Ctxt st) = case undoState st of
+>                        Nothing -> fail "No saved state"
+>                        (Just st') -> return $ Ctxt st'
+
+
+Give a parseable but ugly representation of a term.
+
+> uglyPrint :: ViewTerm -> String
+> uglyPrint t = show (forget t)
+
+ -- |Parse and typecheck a term
+ newTerm :: Monad m => Context -> String -> m Term
+ newTerm (Ctxt st) str = do
+     case (parseterm str) of
+         Success raw -> do (tm,ty) <- typecheck (defs st) raw
+                           return $ Term (tm, ty)
+         Failure err -> fail err
+
+> -- |Normalise a term and its type
+> eval :: Context -> Term -> Term
+> eval (Ctxt st) (Term (tm,ty)) = Term (normalise (defs st) tm,
+>                                       normalise (defs st) ty)
+
+> -- |Reduce a term and its type to Weak Head Normal Form
+> whnf :: Context -> Term -> Term
+> whnf (Ctxt st) (Term (tm,ty)) = Term (eval_whnf (defs st) tm,
+>                                          eval_whnf (defs st) ty)
+
+> -- |Check a term in the context of the given goal
+> checkCtxt :: (IsTerm a, Monad m) => Context -> Goal -> a -> m Term
+> checkCtxt (Ctxt st) goal tm =
+>     do rawtm <- raw tm
+>        prf <- case proofstate st of
+>                 Nothing -> fail "No proof in progress"
+>                 Just x -> return x
+>        let h = case goal of
+>                (Goal x) -> x
+>                DefaultGoal -> head (holequeue st)
+>        case (Tactics.findhole (defs st) (Just h) prf holeenv) of
+>          (Just env) -> do t <- Ivor.Typecheck.check (defs st) env rawtm Nothing
+>                           return $ Term t
+>          Nothing -> fail "No such goal"
+>  where holeenv :: Gamma Name -> Env Name -> Indexed Name -> Env Name
+>        holeenv gam hs _ = Tactics.ptovenv hs
+
+> -- |Evaluate a term in the context of the given goal
+> evalCtxt :: (IsTerm a, Monad m) => Context -> Goal -> a -> m Term
+> evalCtxt (Ctxt st) goal tm =
+>     do rawtm <- raw tm
+>        prf <- case proofstate st of
+>                 Nothing -> fail "No proof in progress"
+>                 Just x -> return x
+>        let h = case goal of
+>                (Goal x) -> x
+>                DefaultGoal -> head (holequeue st)
+>        case (Tactics.findhole (defs st) (Just h) prf holeenv) of
+>          (Just env) -> do (tm, ty) <- Ivor.Typecheck.check (defs st) env rawtm Nothing
+>                           let tnorm = normaliseEnv env (defs st) tm
+>                           return $ Term (tnorm, ty)
+>          Nothing -> fail "No such goal"
+>  where holeenv :: Gamma Name -> Env Name -> Indexed Name -> Env Name
+>        holeenv gam hs _ = Tactics.ptovenv hs
+
+
+> -- |Check whether the conversion relation holds between two terms, in the
+> -- context of the given goal
+
+> converts :: (Monad m, IsTerm a, IsTerm b) =>
+>             Context -> Goal -> a -> b -> m Bool
+> converts ctxt@(Ctxt st) goal a b
+>     = do atm <- checkCtxt ctxt goal a
+>          btm <- checkCtxt ctxt goal b
+>          prf <- case proofstate st of
+>                 Nothing -> fail "No proof in progress"
+>                 Just x -> return x
+>          let (Term (av,_)) = atm
+>          let (Term (bv,_)) = btm
+>          let h = case goal of
+>                (Goal x) -> x
+>                DefaultGoal -> head (holequeue st)
+>          case (Tactics.findhole (defs st) (Just h) prf holeenv) of
+>                (Just env) -> case checkConvEnv env (defs st) av bv "" of
+>                     Just _ -> return True
+>                     _ -> return False
+>                Nothing -> fail "No such goal"
+>  where holeenv :: Gamma Name -> Env Name -> Indexed Name -> Env Name
+>        holeenv gam hs _ = Tactics.ptovenv hs
+
+> -- |Lookup a definition in the context.
+> getDef :: Monad m => Context -> Name -> m Term
+> getDef (Ctxt st) n = case glookup n (defs st) of
+>                         Just ((Fun _ tm),ty) -> return $ Term (tm,ty)
+>                         _ -> fail "Not a function name"
+
+> -- |Check whether a name is defined
+> defined :: Context -> Name -> Bool
+> defined (Ctxt st) n = case glookup n (defs st) of
+>                          Just _ -> True
+>                          _ -> False
+
+> -- |Lookup a pattern matching definition in the context.
+> getPatternDef :: Monad m => Context -> Name -> m Patterns
+> getPatternDef (Ctxt st) n
+>     = case glookup n (defs st) of
+>           Just ((PatternDef pmf),ty) ->
+>               return $ Patterns (map mkPat (getPats pmf))
+>           Nothing -> fail "Not a pattern matching definition"
+>    where getPats (PMFun _ ps) = ps
+>          mkPat (Sch ps ret) = PClause (map viewPat ps) (view (Term (ret, (Ind TTCore.Star))))
+>
+>          viewPat (PVar n) = Name Bound (name (show n))
+>          viewPat (PCon t n ty ts) = VTerm.apply (Name Bound (name (show n))) (map viewPat ts)
+>          viewPat (PConst c) = Constant c
+>          viewPat _ = Placeholder
+
+> -- |Get all the names and types in the context
+> getAllDefs :: Context -> [(Name,Term)]
+> getAllDefs (Ctxt st) = let (Gam ds) = defs st in
+>                            reverse (map info ds) -- input order!
+>    where info (n,G _ ty _) = (n, Term (ty, Ind TTCore.Star))
+
+> -- | Get the names of all of the constructors of an inductive family
+> getConstructors :: Monad m => Context -> Name -> m [Name]
+> getConstructors (Ctxt st) n
+>      = case glookup n (defs st) of
+>           Just ((TCon _ (Elims _ _ cs)),ty) -> return cs
+>           _ -> fail "Not a type constructor"
+
+Examine pattern matching elimination rules
+
+> -- | Types of elimination rule
+> data Rule = Case | Elim
+
+> -- | Get the pattern matching elimination rule for a type
+> getElimRule :: Monad m => Context -> Name -- ^ Type
+>                  -> Rule -- ^ Which rule to get patterns for (case or elim)
+>                  -> m Patterns
+> getElimRule (Ctxt st) nm r =
+>     case (lookupval nm (defs st)) of
+>       Just (TCon _ (Elims erule crule cons)) ->
+>          do let rule = case r of -- rule :: Name
+>                          Case -> crule
+>                          Ivor.TT.Elim -> erule
+>             elim <- lookupM rule (eliminators st)
+>             return $ Patterns $ map mkRed (fst $ snd elim)
+>       Nothing -> fail $ (show nm) ++ " is not a type constructor"
+>  where mkRed (RSch pats ret) = PClause (map viewRaw pats) (viewRaw ret)
+>         -- a reduction will only have variables and applications
+>        viewRaw (Var n) = Name Free n
+>        viewRaw (RApp f a) = VTerm.App (viewRaw f) (viewRaw a)
+>        viewRaw _ = VTerm.Placeholder
+
+Get the actions performed by the last tactic
+
+ getActions :: Context -> [Tactics.TacticAction]
+ getActions (Ctxt st) = actions st
+
+> getResponse :: Context -> String
+> getResponse (Ctxt st) = response st
+
+> -- |Get the goals still to be solved.
+> getGoals :: Context -> [Goal]
+> getGoals (Ctxt st) = map Goal (holequeue st)
+
+> -- |Return whether all goals have been solved.
+> allSolved :: Context -> Bool
+> allSolved (Ctxt st) = null $ holequeue st
+
+> -- |Get the number of unsolved goals
+> numUnsolved :: Context -> Int
+> numUnsolved (Ctxt st) =
+>     case proofstate st of
+>         Nothing -> 0
+>         (Just t) -> length $ Tactics.allholes (defs st) False t
+
+> -- |Return whether we are in the middle of proving something.
+> proving :: Context -> Bool
+> proving (Ctxt st) = case proofstate st of
+>                        Nothing -> False
+>                        _ -> True
+
+> -- |Get the current proof term, if we are in the middle of a proof.
+> proofterm :: Monad m => Context -> m Term
+> proofterm (Ctxt st) = case proofstate st of
+>                         Nothing -> fail "No proof in progress"
+>                         Just (Ind (Bind _ (B (Guess v) t) _)) ->
+>                             return $ Term (Ind v,Ind t)
+>                         Just t -> fail $ "Proof finished; " ++ show t
+
+> -- |Get the type and context of the given goal, if it exists
+> getGoal :: Monad m => Context -> Goal -> m ([(Name,Term)], Term)
+> getGoal (Ctxt st) goal =
+>     let h = case goal of
+>                   (Goal x) -> x
+>                   DefaultGoal -> head (holequeue st) in
+>       case (proofstate st) of
+>         Nothing -> fail "No proof in progress"
+>         (Just tm) ->
+>             case (Tactics.findhole (defs st) (Just h) tm getHoleTerm) of
+>               Just x -> return x
+>               Nothing -> fail "No such goal"
+
+> getHoleTerm gam hs tm = (getctxt hs,
+>                          Term (normaliseEnv hs (Gam []) (binderType tm),
+>                                Ind TTCore.Star))
+>    where getctxt [] = []
+>          getctxt ((n,B _ ty):xs) = (n,Term (Ind ty,Ind TTCore.Star)):
+>                                    getctxt xs
+>          binderType (Ind (Bind _ (B _ ty) _)) = (Ind ty)
+>          binderType _ = error "Can't happen (binderType)"
+
+> -- |Environment and goal type for a given subgoal
+> data GoalData = GoalData {
+>                  bindings :: [(Name,Term)],
+>                      -- ^ Get the premises of the goal
+>                  goalName :: Goal,
+>                      -- ^ Get the name of the goal
+>                  goalType :: Term
+>                      -- ^ Get the type of the goal
+>                  }
+
+
+> -- |Get information about a subgoal.
+> goalData :: Monad m => Context -> Bool -- ^ Get all bindings (True), or
+>                                        -- just lambda bindings (False)
+>          -> Goal -> m GoalData
+> goalData (Ctxt st) all goal = case proofstate st of
+>         Nothing -> fail "No proof in progress"
+>         (Just prf) ->
+>             let h = case goal of
+>                           (Goal x) -> x
+>                           DefaultGoal -> head (holequeue st) in
+>               case (Tactics.findhole (defs st) (Just h) prf holedata) of
+>                  (Just x) -> return x
+>                  Nothing -> fail "No such goal"
+>  where holedata :: Gamma Name -> Env Name -> Indexed Name -> GoalData
+>        holedata gam hs tm = hd' (Tactics.ptovenv hs) (finalise tm) -- (normaliseEnv hs (Gam []) (finalise tm))
+>        hd' hs (Ind (Bind n (B _ tm) _))
+>            = GoalData (getbs hs) (Goal n)
+>                  (Term (Ind tm,
+>                         (Ind TTCore.Star)))
+>        getbs [] = []
+>        getbs ((n,B b ty):xs)
+>            | (b == TTCore.Lambda || all) && (not (n `elem` (hidden st)))
+>                = (n, (Term (Ind ty, Ind TTCore.Star))):
+>                  getbs xs
+>        getbs (_:xs) = getbs xs
+
+> -- | Get the names and types of all goals
+> subGoals :: Monad m => Context -> m [(Name,Term)]
+> subGoals (Ctxt st) = case proofstate st of
+>         Nothing -> fail "No proof in progress"
+>         (Just prf) -> return $
+>                        map (\ (x,ty) -> (x,Term (ty,Ind TTCore.Star)))
+>                         $ Tactics.allholes (defs st) True prf
+
+> -- | Create a name unique in the proof state
+> uniqueName :: Monad m => Context -> Name -- ^ Suggested name
+>            -> m Name -- ^ Unique name based on suggested name
+> uniqueName (Ctxt st) n = case proofstate st of
+>         Nothing -> fail "No proof in progress"
+>         (Just (Ind prf)) -> return $ uniqify n $ getBoundNames (Sc prf)
+
+Tactics
+
+ newTheorem :: Monad m => Context -> Name -> String -> m Context
+ newTheorem (Ctxt st) n str = do
+    rawtm <- case parseterm str of
+                    (Success x) -> return x
+                    (Failure err) -> fail err
+    (tv,tt) <- tcClaim (defs st) rawtm
+    case (proofstate st) of
+        Nothing -> do let thm = Tactics.theorem n tv
+                      (start, _) <- Tactics.runtactic (defs st) n thm
+                                       (Tactics.attack (fH tt))
+                      return $ Ctxt st { proofstate = Just $ start,
+                                         holequeue =
+                                             (fH tt):n:(holequeue st) }
+        (Just t) -> fail "Already a proof in progress"
+   where fH (Ind tt) = uniqify (UN "H") [n]
+
+
+> -- |Lift a finished proof into the context
+> qed :: Monad m => Context -> m Context
+> qed (Ctxt st)
+>     = do case proofstate st of
+>            Just prf -> do
+>              newdef@(name,val@(G (Fun _ ind) _ _)) <-
+>                  qedLift (defs st) False prf
+>              let isrec = rec name
+>              let (Gam olddefs) = remove name (defs st)
+>              let runtts = runtt st
+>              let scs = lift name (levelise (normalise (Gam []) ind))
+>              let bc = compileAll (runtts++scs) scs
+>              let newbc = bc++(bcdefs st)
+>              defs' <- gInsert name val (defs st)
+>              let newdefs = setRec name isrec defs'
+>              return $ Ctxt st { proofstate = Nothing,
+>                             bcdefs = newbc,
+>                             runtt = runtts ++ scs,
+>                             defs = newdefs } -- Gam (newdef:olddefs) }
+>            Nothing -> fail "No proof in progress"
+>  where rec nm = case lookupval nm (defs st) of
+>                   Nothing -> False
+>                   _ -> True
+
+> qedLift :: Monad m => Gamma Name -> Bool -> Indexed Name ->
+>                       m (Name, Gval Name)
+> qedLift gam freeze
+>             (Ind (Bind x (B (TTCore.Let v) ty) (Sc (P n)))) | n == x =
+>     do let (Ind vnorm) = convNormalise (Gam []) (finalise (Ind v))
+>        verify gam (Ind v)
+>        return $ (x, G (Fun opts (Ind vnorm)) (finalise (Ind ty)) defplicit)
+>   where opts = if freeze then [Frozen] else []
+> qedLift _ _ tm = fail $ "Not a complete proof " ++ show tm
+
+> -- | Focus on a different hole, i.e. set the default goal.
+> focus :: Tactic
+> focus (Goal n) (Ctxt st)
+>    | n `elem` holequeue st
+>        = attack (Goal n) $ Ctxt st { holequeue = jumpqueue n (holequeue st) }
+>    | otherwise = fail "No such goal"
+> focus _ x = return x -- Default goal already first
+
+> -- | Hide a premise
+> hide :: Tactic
+> hide (Goal n) (Ctxt st)
+>    = return $ Ctxt st { hidden = nub (n:(hidden st)) }
+
+> -- | The Identity tactic, does nothing.
+> idTac :: Tactic
+> idTac goal ctxt = return ctxt
+
+> -- | The Tracing tactic; does nothing, but uses 'trace' to dump the
+> -- current proof state
+> traceTac :: Tactic
+> traceTac goal ctxt@(Ctxt st) = trace ("Proofstate: " ++
+>                                       (show (proofstate st) ++ "\nHoles" ++
+>                                       (show (holequeue st)))) $ return ctxt
+
+> infixl 5 >->, >=>, >+>, >|>
+
+Apply two tactics consecutively to the same goal.
+
+> seqTac :: Tactic -> Tactic -> Tactic
+> seqTac tac1 tac2 goalin ctxt@(Ctxt st) = do
+> -- In case the default goal changes, remember where we are
+>     let goal = case goalin of
+>                     DefaultGoal -> Goal $ head (holequeue st)
+>                     x -> x
+>     ctxt' <- tac1 goal ctxt
+>     tac2 goal ctxt'
+
+> -- | Sequence two tactics; applies two tactics sequentially to the same goal
+> (>->) :: Tactic -> Tactic -> Tactic
+> (>->) x y = seqTac x y
+
+> thenTac :: Tactic -> Tactic -> Tactic
+> thenTac tac1 tac2 goal ctxt@(Ctxt st) = do
+>     let hq = holequeue st
+>     (Ctxt st') <- tac1 goal ctxt
+>     let newholes = (holequeue st') \\ hq
+>     -- Why reverse? Because then the new hole queue is the right order.
+>     runThen (map Goal (reverse newholes)) tac2 (Ctxt st')
+>   where runThen [] _ ctxt = return ctxt
+>         runThen (x:xs) tac ctxt = do ctxt' <- tac x ctxt
+>                                      runThen xs tac ctxt'
+
+> -- | Apply a tactic, then apply another to each subgoal generated.
+> (>=>) :: Tactic -> Tactic -> Tactic
+> (>=>) x y = thenTac x y
+
+
+> nextTac :: Tactic -> Tactic -> Tactic
+> nextTac tac1 tac2 goal ctxt = do
+>     ctxt' <- tac1 goal ctxt
+>     tac2 DefaultGoal ctxt'
+
+> -- | Apply a sequence of tactics to the default goal. Read the type
+> -- as ['Tactic'] -> 'Tactic'
+> tacs :: Monad m => [Goal -> Context -> m Context] ->
+>         Goal -> Context -> m Context
+> tacs [] = idTac
+> tacs (t:ts) = \g ctxt -> do ctxt <- t g ctxt
+>                             tacs ts DefaultGoal ctxt
+
+> -- | Apply a tactic, then apply the next tactic to the next default subgoal.
+> (>+>) :: Tactic -> Tactic -> Tactic
+> (>+>) x y = nextTac x y
+
+> -- | Try a tactic.
+> try :: Tactic -- ^ Tactic to apply
+>     -> Tactic -- ^ Apply if first tactic succeeds
+>     -> Tactic -- ^ Apply if first tactic fails.
+>     -> Tactic
+> try tac success failure goal ctxt =
+>     case tac goal ctxt of
+>         Just ctxt' -> success goal ctxt'
+>         Nothing -> failure goal ctxt
+
+> -- | Tries the left tactic, if that fails try the right one. Shorthand for
+> -- 'try' x 'idTac' y.
+> (>|>) :: Tactic -> Tactic -> Tactic
+> (>|>) x y = try x idTac y
+
+Convert an internal tactic into a publicly available tactic.
+
+> runTac :: Tactics.Tactic -> Tactic
+> runTac tac goal (Ctxt st) | null (holequeue st) = fail "No more goals"
+> runTac tac goal (Ctxt st) = do
+>     let hole = case goal of
+>                     (Goal x) -> x
+>                     DefaultGoal -> head (holequeue st)
+>     let (Just prf) = proofstate st
+>     (prf', act) <- Tactics.runtactic (defs st) hole prf tac
+>     let st' = addgoals act st
+>     return $ Ctxt st' { proofstate = Just prf',
+>                         --holequeue = jumpqueue hole
+>                         --       (holequeue st'),
+>                         actions = act
+>                       }
+>     where addgoals [] st = st
+>           addgoals ((Tactics.AddGoal n):xs) st
+>               = addgoals xs (st { holequeue = nub (n:(holequeue st)) })
+>           addgoals ((Tactics.NextGoal n):xs) st
+>               = addgoals xs (st { holequeue = nub (second n (holequeue st)) })
+>           addgoals ((Tactics.AddAxiom n ty):xs) st
+>               = let Gam ctxt = defs st in
+>                     addgoals xs (st
+>                        { defs = Gam ((n,G Unreducible (finalise (Ind ty)) defplicit):ctxt) })
+>           addgoals ((Tactics.HideGoal n):xs) st
+>               = addgoals xs (st { hidden = nub (n:(hidden st)) })
+>           addgoals (_:xs) st = addgoals xs st
+>           second n (x:xs) = x:n:xs
+>           second n [] = [n]
+
+> -- | Prepare a goal for introduction.
+> attackWith :: Name -- ^ Name for new goal
+>            -> Tactic
+> attackWith n goal ctxt =
+>     do (Ctxt st) <- runTac (Tactics.attack n) goal ctxt
+>        return $ Ctxt st { holequeue = nub (n:(holequeue st)) }
+
+> -- | Prepare a goal for introduction.
+> attack :: Tactic
+> attack goal (Ctxt st) = do n <- getName
+>                            attackWith n goal (Ctxt st)
+>    where getName = do allnames <- case (proofstate st) of
+>                             Nothing -> fail "No proof in progress"
+>                             Just (Ind tm) ->
+>                                 return $ binderMap (\n _ _ -> n) tm
+>                       return $ uniqify (name "H") ((holequeue st)++allnames)
+
+> -- | Make a local claim
+> claim :: IsTerm a => Name -> a -> Tactic
+> claim name ty = claim' name ty >+> keepSolving
+> claim' name ty g ctxt = do rawty <- raw ty
+>                            name' <- uniqueName ctxt name
+>                            runTac (Tactics.claim name' rawty) g ctxt
+
+> -- | Solve a goal by applying a function.
+> -- If the term given has arguments, attempts to fill in these arguments
+> -- by unification and solves them (with 'solve').
+> -- See 'refineWith' and 'basicRefine' for slight variations.
+> refine :: IsTerm a => a -> Tactic
+> refine tm = (basicRefine tm >=> trySolve) >+> keepSolving
+
+> -- | Solve a goal by applying a function.
+> -- If the term given has arguments, this will create a subgoal for each.
+> -- Some arguments may be solved by unification, in which case they will
+> -- already have a guess attached after refinement, but the guess will not
+> -- be solved (via 'solve').
+> basicRefine :: IsTerm a => a -> Tactic
+> basicRefine tm = do rawtm <- raw tm
+>                     runTac (Tactics.refine rawtm [])
+
+> -- | Solve a goal by applying a function with some arguments filled in.
+> -- See 'refine' for details.
+> refineWith :: IsTerm a => a -> [a] -> Tactic
+> refineWith tm args = (refineWith' tm args >=> trySolve) >+> keepSolving
+
+> refineWith' tm args = do rawtm <- raw tm
+>                          rawargs <- mapM raw args
+>                          runTac (Tactics.refine rawtm rawargs)
+
+> -- | Finalise a goal's solution.
+> solve :: Tactic
+> solve goal ctxt
+>     = do (Ctxt st') <- runTac (Tactics.solve) goal ctxt
+>          return $ Ctxt st' { holequeue =
+>                                  removeGoal goal (holequeue st') }
+>   where removeGoal DefaultGoal xs = stail xs
+>         removeGoal (Goal x) xs = xs \\ [x]
+
+> -- | If the goal has a solution, finalise it, otherwise prepare the
+> -- goal (with attack).
+> -- Typically, could be used on the subgoals generated by refinement, where
+> -- some may have solutions attached already, and others will need to be
+> -- prepared.
+> trySolve :: Tactic
+> trySolve = try solve idTac attack
+
+> -- | Finalise as many solutions of as many goals as possible.
+> keepSolving :: Tactic
+> keepSolving goal ctxt
+>     | allSolved ctxt = return ctxt
+> keepSolving goal ctxt = trySolve (getGoals ctxt) ctxt
+>    where trySolve [] ctxt = return ctxt
+>          trySolve (x:xs) ctxt
+>              = case solve x ctxt of
+>                   Just ctxt' -> trySolve xs ctxt'
+>                   Nothing -> trySolve xs ctxt
+
+-- > keepSolving goal ctxt
+-- >   | not (null (getGoals ctxt)) =
+-- >     case solve goal ctxt of
+-- >        (Just ctxt') -> keepSolving defaultGoal ctxt'
+-- >        Nothing -> return ctxt
+-- >   | otherwise = return ctxt
+
+> -- | Attach a solution to a goal.
+> fill :: IsTerm a => a -> Tactic
+> fill guess = fill' guess >+> keepSolving
+
+> fill' guess = do rawguess <- raw guess
+>                  runTac (Tactics.fill rawguess)
+
+> -- | Remove a solution from a goal.
+> abandon :: Tactic
+> abandon = runTac (Tactics.regret)
+
+> -- | Remove all claims with no guesses attached and which are unused in
+> -- their scope.
+> tidy :: Tactic
+> tidy = runTac (Tactics.tidy)
+
+> -- | Substitute a let bound value into its scope.
+> cut :: Tactic
+> cut goal ctxt = do (Ctxt st) <- runTac (Tactics.cut) goal ctxt
+>                    return $ Ctxt st { holequeue = stail (holequeue st) }
+
+> -- | Rename the outermost binder in the given goal
+> rename :: Name -> Tactic
+> rename n = runTac (Tactics.rename n)
+
+FIXME: Choose a sensible name here
+
+> -- | Introduce an assumption (i.e. a lambda binding)
+> intro :: Tactic
+> intro = runTac (Tactics.intro)
+
+> -- | Introduce an assumption (i.e. a lambda binding)
+> introName :: Name -- ^ Name for the assumption
+>                -> Tactic
+> introName n = (rename n >-> intro)
+
+> -- | Keep introducing things until there's nothing left to introduce.
+> intros :: Tactic
+> intros goal ctxt = do_intros goal ctxt
+>   where do_intros :: Tactic
+>         do_intros = try intro do_intros idTac
+
+> -- | Keep introducing things until there's nothing left to introduce,
+> -- Must introduce at least one thing.
+> intros1 :: Tactic
+> intros1 goal ctxt =
+>     do ctxt <- intro goal ctxt -- Must be at least one thing
+>        do_intros goal ctxt
+>   where do_intros :: Tactic
+>         do_intros = try intro do_intros idTac
+
+> -- | As 'intros', but with names, and stop when we've run out of names.
+> -- Fails if too many names are given.
+
+> introsNames :: [Name] -> Tactic
+> introsNames [] = idTac
+> introsNames (n:ns) = \goal ctxt ->
+>     do ctxt <- introName n goal ctxt
+>        introsNames ns goal ctxt
+
+> -- | Check that the goal is definitionally equal to the given term,
+> -- and rewrite the goal accordingly.
+> equiv :: IsTerm a => a -> Tactic
+> equiv ty = do rawty <- raw ty
+>               runTac (Tactics.equiv rawty)
+
+> -- | Abstract over the given term in the goal.
+> generalise :: IsTerm a => a -> Tactic
+> generalise tm = generalise' tm >-> attack
+
+> generalise' tm = do rawtm <- raw tm
+>                     runTac (Tactics.generalise rawtm)
+
+> -- | Abstract over the given term in the goal, and also all variables
+> -- appearing in the goal whose types depend on it.
+> dependentGeneralise :: IsTerm a => a -> Tactic
+> dependentGeneralise tm = dependentGeneralise' tm
+
+> dependentGeneralise' tm g ctxt =
+>     do gd <- goalData ctxt False g
+>        vtm <- checkCtxt ctxt g tm
+>        ctxt <- gDeps (filter ((occursIn (view vtm)).(view.snd))
+>                                  (bindings gd))
+>                   ctxt (view (goalType gd))
+>        generalise tm g ctxt
+>   where gDeps [] ctxt gty = return ctxt
+>         gDeps (x:xs) ctxt gty
+>           | freeIn (fst x) gty
+>               = do ctxt <- generalise (Name Free (fst x)) g ctxt
+>                    gDeps xs ctxt gty
+>           | otherwise = gDeps xs ctxt gty
+
+> -- | Add a new top level argument after the arguments its type depends on
+> -- (changing the type of the theorem). This can be useful if, for example,
+> -- you find you need an extra premise to prove a goal.
+> addArg :: IsTerm a => Name -> a -> Tactic
+> addArg n ty g ctxt@(Ctxt st)
+>     = do rawty <- raw ty
+>          Term (Ind tm, _) <- checkCtxt ctxt g rawty
+>          st' <- Ivor.State.addArg st n tm
+>          return $ Ctxt st'
+
+> -- | Replace a term in the goal according to an equality premise. Any
+> -- equality type with three arguments is acceptable (i.e. the type,
+> -- and the two values),
+> -- provided there are suitable replacement and symmetry lemmas.
+> -- Heterogeneous equality as provided by 'addEquality' is acceptable
+> -- (if you provide the lemmas!).
+> replace :: (IsTerm a, IsTerm b, IsTerm c, IsTerm d) =>
+>            a -- ^ Equality type (e.g. @Eq : (A:*)(a:A)(b:A)*@)
+>         -> b -- ^ replacement lemma (e.g. @repl : (A:*)(a:A)(b:A)(q:Eq _ a b)(P:(a:A)*)(p:P a)(P b)@)
+>         -> c -- ^ symmetry lemma (e.g. @sym : (A:*)(a:A)(b:A)(p:Eq _ a b)(Eq _ b a)@)
+>         -> d -- ^ equality premise
+>         -> Bool -- ^ apply premise backwards (i.e. apply symmetry)
+>         -> Tactic
+> replace eq repl sym tm flip = replace' eq repl sym tm flip >+> attack
+> replace' eq repl sym tm flip =
+>     do rawtm <- raw tm
+>        raweq <- raw eq
+>        rawrepl <- raw repl
+>        rawsym <- raw sym
+>        runTac (Tactics.replace raweq rawrepl rawsym rawtm flip)
+
+> -- | Add an axiom to the global context which would solve the goal,
+> -- and apply it.
+> -- FIXME: This tactic doesn't pick up all dependencies on types, but is
+> -- okay for simply typed axioms, e.g. equations on Nats.
+> axiomatise :: Name -- ^ Name to give axiom
+>            -> [Name] -- ^ Premises to pass to axiom
+>            -> Tactic
+> axiomatise n ns = runTac (Tactics.axiomatise n ns)
+
+> -- | Normalise the goal
+> compute :: Tactic
+> compute = runTac Tactics.evalGoal
+
+> -- | Beta reduce in the goal
+> beta :: Tactic
+> beta = runTac Tactics.betaReduce
+
+> -- | Beta reduce the goal, unfolding the given function
+> unfold :: Name -> Tactic
+> unfold nm = runTac (Tactics.reduceWith nm)
+
+> -- | Prepare to return a value in a computation
+> returnComputation :: Tactic
+> returnComputation g ctxt = do
+>     (_, gtype) <- getGoal ctxt g
+>     rtype <- getRType (view gtype)
+>     name <- uniqueName ctxt (name "returnval")
+>     ctxt <- claim name rtype g ctxt
+>     fill (VTerm.Return (Name Bound name)) g ctxt
+>  where getRType (VTerm.Label _ _ ty) = return ty
+>        getRType _ = fail "Not a labelled type"
+
+> -- | Prepare to return a quoted value
+> quoteVal :: Tactic
+> quoteVal = runTac Tactics.quote
+
+> -- | Apply an eliminator.
+> by :: IsTerm a => a -- ^ An elimination rule applied to a target.
+>        -> Tactic
+> by rule = (by' rule >=> attack) >+> keepSolving
+
+> by' rule = do rawrule <- raw rule
+>               runTac (Tactics.by rawrule)
+
+> -- | Apply the appropriate induction rule to the term.
+> induction :: IsTerm a => a -- ^ target of the elimination
+>                -> Tactic
+> induction tm = (induction' tm >=> attack) >+> keepSolving
+
+> induction' tm = do rawtm <- raw tm
+>                    runTac (Tactics.casetac True rawtm)
+
+> -- | Apply the appropriate case analysis rule to the term.
+> -- Like 'induction', but no induction hypotheses generated.
+> cases :: IsTerm a => a -- ^ target of the case analysis
+>                -> Tactic
+> cases tm = (cases' tm >=> attack) >+> keepSolving
+> cases' tm = do rawtm <- raw tm
+>                runTac (Tactics.casetac False rawtm)
+
+> -- | Find a trivial solution to the goal by searching through the context
+> -- for a premise which solves it immediately by refinement
+> trivial :: Tactic
+> trivial g ctxt
+>     = do gd <- goalData ctxt False g
+>          let ps = bindings gd
+>          tryall ps g ctxt
+>    where tryall [] g ctxt = fail "No trivial solution found"
+>          tryall ((x,ty):xs) g ctxt
+>              = do ctxt' <- ((refine (Name Free x)) >|> (fill (Name Free x))
+>                                 >|> idTac)  g ctxt
+>                   if (numUnsolved ctxt' < numUnsolved ctxt)
+>                      then return ctxt'
+>                      else tryall xs g ctxt
+
+Spot the allowed recursive calls in a proof state. This is quite basic,
+and only spots primitive recursion for the moment, rather than any
+particularly cunning induction hypotheses like those living in memos etc.
+
+> data RecAllowed = Rec { flexible :: [Name], -- arguments that can be anything
+>                         function :: Name, -- function to call
+>                         args :: [ViewTerm], -- arguments to function
+>                         hypothesis :: ViewTerm -- hypothesis which calls it
+>                       }
+>   deriving Show
+
+> allowedrec :: Monad m => Goal -> Context -> m [RecAllowed]
+> allowedrec g ctxt = do
+>     gd <- goalData ctxt False g
+>     return $ findRec $ bindings gd
+>  where
+>    findRec [] = []
+>    findRec ((n,t):ts) = case isCall (Name Bound n) [] (view t) of
+>                           Just v -> v:(findRec ts)
+>                           _ -> findRec ts
+
+>    isCall n env (VTerm.Label name args _) = Just (Rec env name args n)
+>    isCall n env (Forall name _ scope) = isCall n (name:env) scope
+>    isCall _ _ _ = Nothing
+
+> -- | Make a recursive call of a computation. The term must be an
+> -- allowed recursive call, identified in the context by having a
+> -- labelled type.
+
+FIXME: This function is horrible. Redo it at some point...
+
+> call :: IsTerm a => a -> Tactic
+> call tm g ctxt = do tm <- raw tm
+>                     allowed <- allowedrec g ctxt
+>                     rec <- {- trace (show allowed) $ -} findRec allowed tm
+>                     fill rec g ctxt
+>   where
+>     findRec :: Monad m => [RecAllowed] -> Raw -> m ViewTerm
+>     findRec [] tm = fail "This recursive call not allowed"
+>     findRec ((Rec fs nm args hyp):rs) tm =
+>         case mkRec fs nm args hyp tm of
+>            Just x -> return x
+>            _ -> findRec rs tm
+>     mkRec fs nm args hyp tm = do
+>          let (tmf,tmas) = getfa tm []
+>          ttmas <- mapM (checkCtxt ctxt g) tmas
+>          let vtmas = map view ttmas
+>          if (nm==tmf) then do
+>             ihargs <- getIH fs args vtmas
+>             return $ VTerm.Call nm vtmas (VTerm.apply hyp ihargs)
+>           else fail "Not this one"
+>     getfa (RApp f a) args = getfa f (a:args)
+>     getfa (Var x) args = (x,args)
+>     getIH fs [] [] = return []
+>     getIH (f:fs) (x:xs) (y:ys)
+>         | Just f == tryvar x = -- x is pi bound, so better get an ih arg.
+>                    do ycheck <- checkCtxt ctxt g y
+>                       rest <- getIH fs xs ys
+>                       return ((view ycheck):rest)
+>     getIH fs (x:xs) (y:ys)
+>         | tryvareq x y
+>              = getIH fs xs ys -- x not pi bound, but names okay.
+>     getIH _ _ _ = fail "Not this one" -- Something doesn't match up.
+
+>     tryvar (Name _ x) = Just x
+>     tryvar _ = Nothing
+>     tryvareq x y = let jx = tryvar x
+>                        jy = tryvar y in
+>                        jx /= Nothing && jx == jy
+
+> -- | Create a .hs file containing (unreadable) Haskell code implementing
+> -- all of the definitions.
+> -- (TODO: Generate a more readable, usable interface)
+> compile :: Context -- ^ context to compile
+>            -> String -- ^ root of filenames to generate
+>            -> IO ()
+> compile (Ctxt st) froot
+>     = do let hd = mkHeaders (bcdefs st)
+>          let ev = mkEval (bcdefs st)
+>          let cd = mkCode (bcdefs st)
+>          Compiler.compile st froot
+>          -- writeFile (froot++".c") $ hd ++ ev ++ cd
+
+
diff --git a/Ivor/TTCore.lhs b/Ivor/TTCore.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/TTCore.lhs
@@ -0,0 +1,831 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.TTCore where
+
+> import Ivor.Gadgets
+> import Ivor.Constant
+
+> import Data.List
+> import Data.Char
+> import Control.Monad.State
+> import Data.Typeable
+> import Debug.Trace
+
+Raw terms are those read in directly from the user, and may be badly typed.
+(Need to add marked up terms for optimisation).
+
+> data Raw
+>     = Var Name
+>     | RApp Raw Raw
+>     | RBind Name (Binder Raw) Raw
+>     | forall c.(Constant c) => RConst !c
+>     | RStar
+>     | RInfer -- Term to be inferred by the typechecker
+>     | RMeta Name -- a metavariable, to be implemented separately
+>     | RLabel Raw RComputation
+>     | RCall RComputation Raw
+>     | RReturn Raw
+>     | RAnnot String -- Debugging hack
+>     | RStage RStage
+
+> data RComputation = RComp Name [Raw]
+>   deriving Eq
+
+> data RStage = RQuote Raw
+>             | RCode Raw
+>             | REval Raw
+>             | REscape Raw
+>   deriving Eq
+
+TT represents terms in the core type theory, parametrised by the
+representation of the names
+
+> data TT n
+>     = P n
+>     | V Int
+>     | Con Int n Int -- Tag, name and arity
+>     | TyCon n Int  -- Name and arity
+>     | Elim n
+>     | App (TT n) (TT n)
+>     | Bind n (Binder (TT n)) (Scope (TT n))
+>     | Proj n Int (TT n) -- Projection in iota schemes (carries type name)
+>     | Label (TT n) (Computation n)
+>     | Call (Computation n) (TT n)
+>     | Return (TT n)
+>     | forall c. Constant c => Const !c
+>     | Star
+>     | Stage (Stage n)
+
+> data Computation n = Comp n [TT n]
+
+Stage gives staging annotations
+
+> data Stage n = Quote (TT n)
+>              | Code (TT n)
+>              | Eval (TT n) (TT n) -- term, type
+>              | Escape (TT n) (TT n) -- term, type
+>  deriving Show
+
+Constants
+
+> class (Typeable c, Show c, Eq c) => Constant c where
+>     constType :: c -> TT Name
+
+> newtype Scope n = Sc n
+>    deriving (Show, Eq)
+
+> data Binder n = B (Bind n) n
+>    deriving (Show, Eq)
+
+> data Bind n
+>     = Lambda
+>     | Pi
+>     | Let n
+>     | Hole
+>     | Guess n
+>     | Pattern n
+>     | MatchAny
+>    deriving (Show, Eq)
+
+Local environments
+
+> type Env n = [(n,Binder (TT n))]
+
+Separate types for de Bruijn indexed terms and de Bruijn levelled terms
+
+> newtype Levelled n = Lev (TT n) deriving Eq
+> newtype Indexed n = Ind (TT n) deriving Eq
+
+Pattern represents the patterns used to define iota schemes.
+
+> data Pattern n =
+>	 PVar n  -- Variable
+>      | PCon Int n n [Pattern n] -- Constructor, with tag and type
+>      | forall c.(Constant c) => PConst !c
+>      | PMarkCon n [Pattern n] -- Detagged constructor
+>      | PTerm -- Presupposed term (don't care what it is)
+>      | PMark n  -- Marked variable
+
+> instance Show n => Show (Pattern n) where
+>     show (PVar n) = show n
+>     show (PCon t n ty ts) = show n ++ show ts
+>     show (PConst c) = show c
+>     show (PMarkCon n ts) = show n ++ show ts
+>     show PTerm = "_"
+>     show (PMark n) = "[" ++ show n ++ "]"
+
+> instance Eq n => Eq (Pattern n) where
+>     (==) (PVar x) (PVar y) = x == y
+>     (==) (PCon t1 n1 ty1 ts1) (PCon t2 n2 ty2 ts2) = t1 == t2 &&
+>                                                      n1 == n2 &&
+>                                                      ty1 == ty2 &&
+>                                                      ts1 == ts2
+>     (==) (PConst x) (PConst y) = case cast x of
+>                                     Just x' -> x' == y
+>                                     _ -> False
+>     (==) (PMarkCon n1 ts1) (PMarkCon n2 ts2) = n1 == n2 && ts1 == ts2
+>     (==) PTerm PTerm = True
+>     (==) (PMark x) (PMark y) = x == y
+>     (==) _ _ = False
+
+      {- | forall c. Constant c => PConst c -- Constant (don't think it makes sense) -}
+
+> instance Eq n => Ord (Pattern n) where
+>     compare (PCon x _ _ _) (PCon y _ _ _) = compare x y
+>     compare _ _ = EQ -- Don't care!
+
+UN covers names defined by users, MN covers names invented by the system.
+This keeps both namespaces separate.
+
+> data Name
+>     = UN String
+>     | MN (String,Int)
+>   deriving Eq
+
+Data declarations and pattern matching
+
+> data RawScheme = RSch [Raw] Raw
+>   deriving Show
+
+> data Scheme n = Sch [Pattern n] (Indexed n)
+>         deriving Show
+
+> type PMRaw = RawScheme
+
+For equality of patterns, we're only interested in whether the LHS are
+equal. This is so that we can easily filter out overlapping cases when
+generating cases for coverage/type checking. Checking for overlapping
+is dealt with later.
+
+> instance Eq PMRaw where
+>     (==) (RSch ps r) (RSch ps' r') = ps == ps'
+
+> type PMDef n = Scheme n
+
+> data PMFun n = PMFun Int -- arity
+>                      [PMDef n] -- patterns
+>    deriving Show
+
+====================== Functors ===============================
+
+> instance Functor Scope where
+>     fmap f (Sc x) = Sc (f x)
+
+> instance Functor Binder where
+>     fmap f (B b x) = B (fmap f b) (f x)
+
+> instance Functor Bind where
+>     fmap f Lambda = Lambda
+>     fmap f Pi = Pi
+>     fmap f (Let x) = Let (f x)
+>     fmap f Hole = Hole
+>     fmap f (Guess x) = Guess (f x)
+>     fmap f (Pattern x) = Pattern (f x)
+>     fmap f MatchAny = MatchAny
+
+> instance Functor TT where
+>     fmap f (P x) = P (f x)
+>     fmap f (V i) = V i
+>     fmap f (Con t x i) = Con t (f x) i
+>     fmap f (TyCon x i) = TyCon (f x) i
+>     fmap f (Elim x) = Elim (f x)
+>     fmap f (App tf a) = App (fmap f tf) (fmap f a)
+>     fmap f (Bind n b sc) = Bind (f n) (fmap (fmap f) b) (fmap (fmap f) sc)
+>     fmap f (Proj n i x) = Proj (f n) i (fmap f x)
+>     fmap f (Const x) = Const x
+>     fmap f (Label t c) = Label (fmap f t) (fmap f c)
+>     fmap f (Call c t) = Call (fmap f c) (fmap f t)
+>     fmap f (Return t) = Return (fmap f t)
+>     fmap f (Stage t) = Stage (fmap f t)
+>     fmap f Star = Star
+
+> instance Functor Stage where
+>     fmap f (Quote t) = Quote (fmap f t)
+>     fmap f (Code t) = Code (fmap f t)
+>     fmap f (Eval t ty) = Eval (fmap f t) (fmap f ty)
+>     fmap f (Escape t ty) = Escape (fmap f t) (fmap f ty)
+
+> sLift :: (TT a -> TT b) -> Stage a -> Stage b
+> sLift f (Quote t) = Quote (f t)
+> sLift f (Code t) = Code (f t)
+> sLift f (Eval t ty) = Eval (f t) (f ty)
+> sLift f (Escape t ty) = Escape (f t) (f ty)
+
+> sLiftf :: (TT a -> b) -> Stage a -> b
+> sLiftf f (Quote t) = f t
+> sLiftf f (Code t) = f t
+> sLiftf f (Eval t ty) = f t
+> sLiftf f (Escape t ty) = f t
+
+> sLiftM :: Monad m => (TT a -> m (TT b)) -> Stage a -> m (Stage b)
+> sLiftM f (Quote t) = do x <- f t
+>                         return $ Quote x
+> sLiftM f (Code t) = do x <- f t
+>                        return $ Code x
+> sLiftM f (Eval t ty) = do x <- f t
+>                           xty <- f ty
+>                           return $ Eval x xty
+> sLiftM f (Escape t ty) = do x <- f t
+>                             xty <- f ty
+>                             return $ Escape x xty
+
+> instance Functor Computation where
+>     fmap f (Comp n ts) = Comp (f n) (fmap (fmap f) ts)
+
+> instance Functor Indexed where
+>     fmap f (Ind t) = Ind $ fmap f t
+
+> instance Functor Levelled where
+>     fmap f (Lev t) = Lev $ fmap f t
+
+====================== Gadgets for TT =============================
+
+Do something hairy to all the Vs in a TT term. Kind of like fmap, only on
+the variable numbers rather than the names.
+
+Each V is processed with a function taking the context and the index.
+
+> vapp :: (([n],Int) -> (TT n)) -> TT n -> TT n
+> vapp f t = v' [] t
+>   where
+>     v' ctx (V i) = f (ctx,i)
+>     v' ctx (App f' a) = (App (v' ctx f') (v' ctx a))
+>     v' ctx (Bind n b (Sc sc)) = (Bind n (fmap (v' ctx) b)
+>			          (Sc (v' (n:ctx) sc)))
+>     v' ctx (Proj n i x) = Proj n i (v' ctx x)
+>     v' ctx (Label t (Comp n cs))
+>         = Label (v' ctx t) (Comp n (fmap (v' ctx) cs))
+>     v' ctx (Call (Comp n cs) t)
+>         = Call (Comp n (fmap (v' ctx) cs)) (v' ctx t)
+>     v' ctx (Return t) = Return (v' ctx t)
+>     v' ctx (Stage t) = Stage (sLift (v' ctx) t)
+>     v' ctx x = x
+
+> indexise :: Levelled n -> Indexed n
+> indexise (Lev t) = Ind $ vapp (\ (ctx,i) -> V (i-((length ctx)-1))) t
+
+> levelise :: Indexed n -> Levelled n
+> levelise (Ind t) = Lev $ vapp (\ (ctx,i) -> V ((length ctx)-i-1)) t
+
+Same, but for Ps
+
+> papp :: (n -> (TT n)) -> TT n -> TT n
+> papp f t = v' t
+>   where
+>     v' (P n) = f n
+>     v' (V i) = V i
+>     v' (App f' a) = (App (v' f') (v' a))
+>     v' (Bind n b (Sc sc)) = (Bind n (fmap (v') b)
+>			          (Sc (v' sc)))
+>     v' (Proj n i x) = Proj n i (v' x)
+>     v' (Label t (Comp n cs))
+>         = Label (v' t) (Comp n (fmap (v') cs))
+>     v' (Call (Comp n cs) t)
+>         = Call (Comp n (fmap (v') cs)) (v' t)
+>     v' (Return t) = Return (v' t)
+>     v' (Stage t) = Stage (sLift (v') t)
+>     v' x = x
+
+FIXME: This needs to rename all duplicated binder names first, otherwise
+we get a duff term when we go back to the indexed version.
+
+> makePs :: TT Name -> TT Name
+> makePs t = let t' = evalState (uniqifyAllState t) [] in
+>                 vapp (\ (ctx,i) -> P (traceIndex ctx i "makePsEnv")) t'
+>                            --if (i<length ctx) then P (ctx!!i)
+>                              --           else V i) t'
+
+> makePsEnv env t = let t' = evalState (uniqifyAllState t) env in
+>                       vapp (\ (ctx,i) -> P (traceIndex ctx i "makePsEnv")) t'
+
+
+> uniqifyAllState :: TT Name -> State [Name] (TT Name)
+> uniqifyAllState (Bind n b (Sc sc)) =
+>     do names <- get
+>        let n' = uniqify n names
+>        put $ nub (n':names)
+>        b' <- uniqifyAllStateB b
+>        sc' <- uniqifyAllState sc
+>        return (Bind n' b' (Sc sc'))
+> uniqifyAllState (App f a) =
+>     do f' <- uniqifyAllState f
+>        a' <- uniqifyAllState a
+>        return (App f' a')
+> uniqifyAllState (Proj n i t) =
+>     do t' <- uniqifyAllState t
+>        return (Proj n i t')
+> uniqifyAllState (Label t c) =
+>     do t' <- uniqifyAllState t
+>        c' <- uniqifyAllStateC c
+>        return (Label t' c')
+> uniqifyAllState (Call c t) =
+>     do t' <- uniqifyAllState t
+>        c' <- uniqifyAllStateC c
+>        return (Call c' t')
+> uniqifyAllState (Return t) =
+>     do t' <- uniqifyAllState t
+>        return (Return t')
+> uniqifyAllState (Stage t) =
+>     do t' <- sLiftM uniqifyAllState t
+>        return (Stage t')
+> uniqifyAllState x = return $ x
+
+> uniqifyAllStateB (B Lambda ty) =
+>     do ty' <- uniqifyAllState ty
+>        return (B Lambda ty')
+> uniqifyAllStateB (B Pi ty) =
+>     do ty' <- uniqifyAllState ty
+>        return (B Pi ty')
+> uniqifyAllStateB (B Hole ty) =
+>     do ty' <- uniqifyAllState ty
+>        return (B Hole ty')
+> uniqifyAllStateB (B (Let v) ty) =
+>     do ty' <- uniqifyAllState ty
+>        v' <- uniqifyAllState v
+>        return (B (Let v') ty')
+> uniqifyAllStateB (B (Guess v) ty) =
+>     do ty' <- uniqifyAllState ty
+>        v' <- uniqifyAllState v
+>        return (B (Guess v') ty')
+> uniqifyAllStateB (B (Pattern v) ty) =
+>     do ty' <- uniqifyAllState ty
+>        v' <- uniqifyAllState v
+>        return (B (Pattern v') ty')
+> uniqifyAllStateB (B MatchAny ty) =
+>     do ty' <- uniqifyAllState ty
+>        return (B MatchAny ty')
+> uniqifyAllStateC (Comp n cs) =
+>     do cs' <- mapM uniqifyAllState cs
+>        return (Comp n cs')
+
+
+Take a term with explicit names and convert it to a term with
+de Bruijn indices
+
+> finalise :: Eq n => Indexed n -> Indexed n
+> finalise (Ind tm) = Ind (pv [] tm)
+>   where
+>    pv env (P n) | Just i <- lookupidx 0 n env = V i
+>                 | otherwise = P n
+>    pv env (App f a) = App (pv env f) (pv env a)
+>    pv env (Proj n i t) = Proj n i (pv env t)
+>    pv env (Bind n b@(B _ ty) (Sc t))
+>        = Bind n (fmap (pv env) b) (Sc (pv ((n,(pv env ty)):env) t))
+>    pv env (Label t (Comp n cs))
+>       = Label (pv env t) (Comp n (fmap (pv env) cs))
+>    pv env (Call (Comp n cs) t)
+>       = Call (Comp n (fmap (pv env) cs)) (pv env t)
+>    pv env (Return t) = Return (pv env t)
+>    pv env (Stage t) = Stage (sLift (pv env) t)
+>    pv env x = x
+>
+>    lookupidx i n ((x,_):xs) | n==x = Just i
+>                             | otherwise = lookupidx (i+1) n xs
+>    lookupidx i n [] = Nothing
+
+Check the purity of a term; a term is pure iff it has no holes.
+
+> pure :: TT Name -> Bool
+> pure (Bind _ (B b ty) (Sc sc)) = purebind b && pure ty && pure sc
+> pure (App f a) = pure f && pure a
+> pure (Proj _ _ t) = pure t
+> pure (Label t (Comp n cs)) = pure t && and (map pure cs)
+> pure (Call (Comp n cs) t) = pure t && and (map pure cs)
+> pure (Return t) = pure t
+> pure (Stage t) = sLiftf pure t
+> pure _ = True
+>
+> purebind Hole = False -- Seems a bit OTT to use a type class just for this...
+> purebind (Guess _) = False
+> purebind (Let t) = pure t
+> purebind _ = True
+
+Map a function across all binders in a term
+
+> binderMap :: (Name -> Bind (TT Name) -> TT Name -> a) -> TT Name -> [a]
+> binderMap f (Bind n (B b@(Let v) ty) (Sc sc))
+>     = (f n b ty):(binderMap f v) ++ (binderMap f ty) ++ (binderMap f sc)
+> binderMap f (Bind n (B b@(Guess v) ty) (Sc sc))
+>     = (f n b ty):(binderMap f v) ++ (binderMap f ty) ++ (binderMap f sc)
+> binderMap f (Bind n (B b@(Pattern v) ty) (Sc sc))
+>     = (f n b ty):(binderMap f v) ++ (binderMap f ty) ++ (binderMap f sc)
+> binderMap f (Bind n (B b ty) (Sc sc))
+>     = (f n b ty):(binderMap f ty) ++ (binderMap f sc)
+> binderMap bf (App f a) = binderMap bf f ++ binderMap bf a
+> binderMap f (Proj _ _ t) = binderMap f t
+> binderMap f (Label t (Comp n cs)) = binderMap f t ++
+>                                     concat (fmap (binderMap f) cs)
+> binderMap f (Call (Comp n cs) t) = concat (fmap (binderMap f) cs) ++
+>                                    binderMap f t
+> binderMap f (Return t) = binderMap f t
+> binderMap f (Stage t) = sLiftf (binderMap f) t
+> binderMap f _ = []
+
+Substitute a term into V 0 in the scope (and weaken other indices)
+I think this works! But de Bruijn index mangling breaks my brain, so
+maybe find a better way, or think carefully about why this is okay...
+
+> subst :: TT n -> Scope (TT n) -> TT n
+> subst tm (Sc x) = vapp weakenv $ vapp subv x
+>   where subv (xs,i) | i == length xs = (vinc tm)
+>                     | otherwise = V i
+>         weakenv (xs,i) | i > length xs = V (i-1)
+>                        | otherwise = V i
+>         vinc (V n) = V (n+1) -- So that we weakenv it correctly
+>         vinc x = x
+
+Return all the names used in a scope
+
+> getNames :: Eq n => Scope (TT n) -> [n]
+> getNames (Sc x) = nub $ p' x where
+>     p' (P x) = [x]
+>     p' (App f' a) = (p' f')++(p' a)
+>     p' (Bind n b (Sc sc))
+>      | scnames <- p' sc = (scnames \\ [n]) ++ pb' b
+>     p' (Proj _ i x) = p' x
+>     p' (Label t (Comp n cs)) = p' t ++ concat (map p' cs)
+>     p' (Call (Comp n cs) t) = concat (map p' cs) ++ p' t
+>     p' (Return t) = p' t
+>     p' (Stage t) = sLiftf p' t
+>     p' x = []
+>     pb' (B (Let v) ty) = p' v ++ p' ty
+>     pb' (B (Guess v) ty) = p' v ++ p' ty
+>     pb' (B (Pattern v) ty) = p' v ++ p' ty
+>     pb' (B _ ty) = p' ty
+
+Return all the bound names used in a scope
+
+> getBoundNames :: Eq n => Scope (TT n) -> [n]
+> getBoundNames (Sc x) = nub $ p' x where
+>     p' (P x) = []
+>     p' (App f' a) = (p' f')++(p' a)
+>     p' (Bind n b (Sc sc)) = n:(p' sc) ++ pb' b
+>     p' (Proj _ i x) = p' x
+>     p' (Label t (Comp n cs)) = p' t ++ concat (map p' cs)
+>     p' (Call (Comp n cs) t) = concat (map p' cs) ++ p' t
+>     p' (Return t) = p' t
+>     p' (Stage t) = sLiftf p' t
+>     p' x = []
+>     pb' (B (Let v) ty) = p' v ++ p' ty
+>     pb' (B (Guess v) ty) = p' v ++ p' ty
+>     pb' (B (Pattern v) ty) = p' v ++ p' ty
+>     pb' (B _ ty) = p' ty
+
+The following gadgets expect a fully explicitly named term, rather than
+with de Bruijn indices or levels. We need a newtype Named n.
+
+> substName :: (Show n, Eq n) => n -> TT n -> Scope (TT n) -> TT n
+> substName p tm (Sc x) = p' x where
+>     p' (P x) | x == p = tm
+>     p' (App f' a) = (App (p' f') (p' a))
+>     p' (Bind n b (Sc sc)) = (Bind n (fmap p' b) (Sc (p' sc)))
+>      --   | n == p = (Bind n (fmap p' b) (Sc sc))
+>      --   | otherwise
+>     p' (Proj n i x) = Proj n i (p' x)
+>     p' (Label t (Comp n cs)) = Label (p' t) (Comp n (map p' cs))
+>     p' (Call (Comp n cs) t) = Call (Comp n (map p' cs)) (p' t)
+>     p' (Return t) = Return (p' t)
+>     p' (Stage t) = Stage (sLift p' t)
+>     p' x = x
+
+Look for a specific term and replace it.
+Probably hopelessly inefficient.
+
+> substTerm :: (Show n, Eq n) => TT n -> TT n -> Scope (TT n) -> TT n
+> substTerm p tm (Sc x) = p' x where
+>     p' x | x == p = tm
+>     p' (App f' a) = (App (p' f') (p' a))
+>     p' (Bind n b (Sc sc)) = (Bind n (fmap p' b) (Sc (p' sc)))
+>      --   | n == p = (Bind n (fmap p' b) (Sc sc))
+>      --   | otherwise
+>     p' (Proj n i x) = Proj n i (p' x)
+>     p' (Label t (Comp n cs)) = Label (p' t) (Comp n (map p' cs))
+>     p' (Call (Comp n cs) t) = Call (Comp n (map p' cs)) (p' t)
+>     p' (Return t) = Return (p' t)
+>     p' (Stage t) = Stage (sLift p' t)
+>     p' x = x
+
+> getSc (Sc x) = x
+
+Apply a function (non-recursively) to every sub term.
+
+> mapSubTerm :: (TT Name -> TT Name) -> TT Name -> TT Name
+> mapSubTerm f = mst where
+>    mst (App ff s) = App (f ff) (f s)
+>    mst (Bind x b (Sc sc)) = Bind x (fmap f b) (Sc (f sc))
+>    mst (Proj n i ty) = Proj n i (f ty)
+>    mst (Stage t) = Stage (sLift f t)
+>    mst x = x
+
+Get the arguments of an application
+
+> getArgs :: TT Name -> [TT Name]
+> getArgs (App f a) = getArgs f ++ [a]
+> getArgs _ = []
+
+Get the function being applied in an application
+
+> getFun :: TT Name -> TT Name
+> getFun (App f a) = getFun f
+> getFun x = x
+
+Get the expected arguments of a function type
+
+> getExpected :: TT Name -> [(Name,TT Name)]
+> getExpected (Bind n (B Pi ty) (Sc sc)) = (n,ty):(getExpected sc)
+> getExpected _ = []
+
+Get the return type of a function type
+
+> getReturnType :: TT Name -> TT Name
+> getReturnType (Bind n (B Pi ty) (Sc sc)) = getReturnType sc
+> getReturnType x = x
+
+Make a name unique in the given environment
+
+> uniqify :: Name -> [Name] -> Name
+> uniqify x env | x `elem` env = uniqify (mangleName x) env
+>               | otherwise = x
+
+x -> x0, x1 -> x2, etc. Increments an index at the end of a name, in order
+to generate a new and hopefully unique name.
+
+> mangleName :: Name -> Name
+> mangleName (MN (n,i)) = MN (n,i+1)
+> mangleName (UN n) = UN (incName n)
+>    where incName x | (num, name) <- span isDigit (reverse x)
+>                        = (reverse name)++show (inc num)
+>
+>          inc :: String -> Int
+>          inc "" = 0
+>          inc xs = (read (reverse xs)) + 1
+
+Bind a list of things
+
+> bind :: Bind (TT Name) -> [(Name,TT Name)] -> Scope (TT Name) -> TT Name
+> bind binder [] sc = getSc sc
+> bind binder ((n,ty):xs) sc = Bind n (B binder ty) (Sc (bind binder xs sc))
+
+Apply a function to a list of arguments
+
+> appArgs :: TT n -> [TT n] -> TT n
+> appArgs f [] = f
+> appArgs f (x:xs) = appArgs (App f x) xs
+
+====================== Show instances =============================
+
+> instance Show Name where
+>     show = forget
+
+> instance Show n => Show (TT n) where
+>     show x = forget (forget x)
+
+> instance Show Raw where
+>     show = forget
+
+> instance Show n => (Show (Levelled n)) where
+>     show = show.indexise
+
+> instance Show n => (Show (Indexed n)) where
+>     show (Ind t) = show t
+
+===================== Eq instances ================================
+
+> instance Eq Raw where
+>     (==) (Var x) (Var y) = x==y
+>     (==) (RApp f a) (RApp f' a') = f==f' && a==a'
+>     (==) (RBind n b sc) (RBind n' b' sc') = n==n' && b==b' && sc==sc'
+>     (==) (RConst x) (RConst y) = case cast x of
+>                                    Just x' -> x'==y
+>                                    Nothing -> False
+>     (==) RStar RStar = True
+>     (==) (RLabel t (RComp n cs)) (RLabel t' (RComp n' cs')) =
+>         t==t' && n==n' && cs == cs'
+>     (==) (RCall (RComp n cs) t) (RCall (RComp n' cs') t') =
+>         t==t' && n==n' && cs == cs'
+>     (==) (RReturn t) (RReturn t') = t == t'
+>     (==) (RStage t) (RStage t') = t == t'
+>     (==) RInfer RInfer = True
+>     (==) (RMeta x) (RMeta x') = x == x'
+>     (==) _ _ = False
+
+> instance Eq n => Eq (TT n) where
+>     (==) (P x) (P y) = x==y
+>     (==) (V i) (V j) = i==j
+>     (==) (Con t x i) (Con t' y j) = x==y
+>     (==) (TyCon x i) (TyCon y j) = x==y
+>     (==) (Elim x) (Elim y) = x==y
+>     (==) (App f a) (App f' a') = f==f' && a==a'
+>     (==) (Bind _ b sc) (Bind _ b' sc') = b==b' && sc==sc'
+>     (==) (Proj _ i x) (Proj _ j y) = i==j && x==y
+>     (==) (Const x) (Const y) = case cast x of
+>                                   Just x' -> x'==y
+>                                   Nothing -> False
+>     (==) Star Star = True
+>     (==) (Label t (Comp n cs)) (Label t' (Comp n' cs')) =
+>         t==t' -- && n==n' && cs == cs'
+>     (==) (Call (Comp n cs) t) (Call (Comp n' cs') t') =
+>         t==t' -- && n==n' && cs == cs'
+>     (==) (Return t) (Return t') = t == t'
+>     (==) (Stage t) (Stage t') = t == t'
+>     (==) _ _ = False
+
+> instance Eq n => Eq (Stage n) where
+>     (==) (Quote t) (Quote t') = t == t'
+>     (==) (Code t) (Code t') = t == t'
+>     (==) (Eval t _) (Eval t' _) = t == t'
+>     (==) (Escape t _) (Escape t' _) = t == t'
+>     (==) _ _ = False
+
+===================== Forgetful maps ==============================
+
+> instance Forget Name String where
+>     forget (UN n) = n
+>     forget (MN ("INFER",i)) = "y"++show i
+>     forget (MN ("T",i)) = "z"++show i
+>     forget (MN (x,i)) = x ++ "[" ++ show i ++ "]"
+
+> instance Forget Raw String where
+>     forget x = fPrec 10 x where
+>       fPrec :: Int -> Raw -> String
+>       fPrec _ (Var n) = forget n
+>       fPrec x (RApp f a) = bracket x 1 $ fPrec 1 f ++ " " ++ fPrec 0 a
+>       fPrec x (RBind n (B Lambda t) sc) = bracket x 2 $
+>           "["++forget n ++":"++fPrec 10 t++"]" ++ fPrec 10 sc
+>       fPrec x (RBind n (B Pi t) sc)
+>           | nameOccurs n sc = bracket x 2 $
+>              "("++forget n ++":"++fPrec 10 t++") -> " ++ fPrec 10 sc
+>           | otherwise = bracket x 2 $
+>              (fPrec 1 t) ++" -> " ++ fPrec 10 sc
+>       fPrec x (RBind n (B (Let v) t) sc) = bracket x 2 $
+>           "let "++forget n ++":"++ fPrec 10 t
+>                 ++"=" ++ fPrec 10 v ++ " in " ++ fPrec 10 sc
+>       fPrec x (RBind n (B Hole t) sc) = bracket x 2 $
+>           "?"++forget n ++":"++fPrec 10 t++"." ++ fPrec 10 sc
+>       fPrec x (RBind n (B (Guess v) t) sc) = bracket x 2 $
+>           "try "++forget n ++":"++fPrec 10 t
+>                 ++"=" ++ fPrec 10 v ++ " in " ++ fPrec 10 sc
+>       fPrec x (RBind n (B (Pattern v) t) sc) = bracket x 2 $
+>           "patt "++forget n ++":"++fPrec 10 t
+>                 ++"=" ++ fPrec 10 v ++ " in " ++ fPrec 10 sc
+>       fPrec x (RBind n (B MatchAny t) sc) = bracket x 2 $
+>           "patt "++forget n ++":"++fPrec 10 t ++ " in " ++ fPrec 10 sc
+>       fPrec _ (RLabel t c) =
+>           "< "++fPrec 10 t++" : "++fcomp c++" >"
+>       fPrec x (RCall c t) = bracket x 3 $
+>           "call < " ++ fcomp c ++ " > "++ fPrec 0 t
+>       fPrec _ (RReturn t) = "return " ++ fPrec 0 t
+>       fPrec _ (RStage (RQuote t)) = "{'" ++ fPrec 10 t ++ "}"
+>       fPrec _ (RStage (RCode t)) = "{{" ++ fPrec 10 t ++ "}}"
+>       fPrec _ (RStage (REval t)) = "!" ++ fPrec 0 t
+>       fPrec _ (RStage (REscape t)) = "~" ++ fPrec 0 t
+>       fPrec _ (RConst x) = show x
+>       fPrec _ (RStar) = "*"
+>       fPrec _ (RInfer) = "_"
+>       fPrec _ (RMeta n) = "?"++forget n
+>       fPrec _ (RAnnot t) = t
+>       bracket outer inner str | inner>outer = "("++str++")"
+>                               | otherwise = str
+
+>       fcomp (RComp n cs) = forget n ++ showargs cs
+>           where showargs [] = ""
+>                 showargs (x:xs) = " " ++ fPrec 0 x ++ showargs xs
+
+> instance Forget RStage String where
+>     forget (RQuote x) = "{'" ++ forget x ++ "}"
+>     forget (RCode x) = "{{" ++ forget x ++ "}}"
+>     forget (REval x) = "{!" ++ forget x ++ "}"
+>     forget (REscape x) = "{~" ++ forget x ++ "}"
+
+> instance Show n => Forget (Indexed n) Raw where
+>     forget (Ind t) = forget t
+
+> instance Show n => Forget (Levelled n) Raw where
+>     forget (Lev t) = forget t
+
+> instance Show n => Forget (TT n) Raw where
+>     forget t = forgetTT (vapp showV t)
+>      where
+>        showV (ctx,i) | i < length ctx = P (ctx!!i)
+>	               | otherwise = V i
+>        forgetTT (P x) = Var $ UN (show x)
+>        forgetTT (V i) = RAnnot $ "v" ++ (show i)
+>        forgetTT (Con t x i) = Var $ UN (show x)
+>        forgetTT (TyCon x i) = Var $ UN (show x)
+>        forgetTT (Elim x) = Var $ UN (show x)
+>        forgetTT (App f a) = RApp (forgetTT f) (forgetTT a)
+>        forgetTT (Bind n (B Lambda t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B Lambda (forget t)) (forget sc))
+>        forgetTT (Bind n (B Pi t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B Pi (forget t)) (forget sc))
+>        forgetTT (Bind n (B MatchAny t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B MatchAny (forget t)) (forget sc))
+>        forgetTT (Bind n (B (Let v) t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B (Let (forget v)) (forget t))
+>                      (forget sc))
+>        forgetTT (Bind n (B Hole t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B Hole (forget t)) (forget sc))
+>        forgetTT (Bind n (B (Guess v) t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B (Guess (forget v)) (forget t))
+>                      (forget sc))
+>        forgetTT (Bind n (B (Pattern v) t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B (Pattern (forget v)) (forget t))
+>                      (forget sc))
+>        forgetTT (Proj n i t) = RAnnot $ (show t)++"!"++(show i)++":"++show n
+>        forgetTT (Label t (Comp n cs)) = RLabel (forgetTT t)
+>                                          (RComp (UN $ show n)
+>                                             (map forgetTT cs))
+>        forgetTT (Call (Comp n cs) t) = RCall (RComp (UN $ show n)
+>                                               (map forgetTT cs))
+>                                                 (forgetTT t)
+>        forgetTT (Return t) = RReturn (forgetTT t)
+>        forgetTT (Stage t) = RStage (forget t)
+>        forgetTT (Const x) = RConst x
+>        forgetTT Star = RStar
+
+> instance Show n => Forget (Stage n) RStage where
+>     forget (Code x) = RCode (forget x)
+>     forget (Quote x) = RQuote (forget x)
+>     forget (Eval x _) = REval (forget x)
+>     forget (Escape x _) = REscape (forget x)
+
+> testid = (Bind (UN "x") (B Lambda Star) (Sc (V 0)))
+> testterm = (App testid Star)
+
+Some handy gadgets for Raw terms
+
+> mkapp f [] = f
+> mkapp f (x:xs) = mkapp (RApp f x) xs
+
+> getargnames (RBind n _ sc) = n:(getargnames sc)
+> getargnames _ = []
+
+> getappargs (RApp f a) = getappargs f ++ [a]
+> getappargs _ = []
+
+> getappfun (RApp f a) = getappfun f
+> getappfun x = x
+
+> getrettype (RBind n (B Pi _) sc) = getrettype sc
+> getrettype x = x
+
+> nameOccurs x (Var n) | x == n = True
+>                      | otherwise = False
+> nameOccurs x (RApp f a) = nameOccurs x f || nameOccurs x a
+> nameOccurs x (RBind n b sc)
+>     | x == n = False
+>     | otherwise = occBind x b || nameOccurs x sc
+> nameOccurs x (RLabel r comp) = nameOccurs x r || occComp x comp
+> nameOccurs x (RCall comp r)  = nameOccurs x r || occComp x comp
+> nameOccurs x (RReturn r) = nameOccurs x r
+> nameOccurs x (RStage s) = occStage x s
+> nameOccurs x _ = False
+
+> occComp x (RComp _ rs) = or $ map (nameOccurs x) rs
+> occBind x (B (Let v) t) = nameOccurs x v || nameOccurs x t
+> occBind x (B _ t) = nameOccurs x t
+> occStage x (RQuote r) = nameOccurs x r
+> occStage x (RCode r) = nameOccurs x r
+> occStage x (REval r) = nameOccurs x r
+> occStage x (REscape r) = nameOccurs x r
+
+
+> debugTT t = show (forgetTT (vapp showV t))
+>      where
+>        showV (ctx,i) | i < length ctx = P (UN ("{v}"++show i))
+>	               | otherwise = V i
+>        forgetTT (P x) = Var $ UN (show x)
+>        forgetTT (V i) = RAnnot $ "v" ++ (show i)
+>        forgetTT (Con t x i) = Var $ UN (show x)
+>        forgetTT (TyCon x i) = Var $ UN (show x)
+>        forgetTT (Elim x) = Var $ UN (show x)
+>        forgetTT (App f a) = RApp (forgetTT f) (forgetTT a)
+>        forgetTT (Bind n (B Lambda t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B Lambda (forget t)) (forget sc))
+>        forgetTT (Bind n (B Pi t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B Pi (forget t)) (forget sc))
+>        forgetTT (Bind n (B (Let v) t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B (Let (forget v)) (forget t))
+>				(forget sc))
+>        forgetTT (Bind n (B Hole t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B Hole (forget t)) (forget sc))
+>        forgetTT (Bind n (B (Guess v) t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B (Guess (forget v)) (forget t))
+>				(forget sc))
+>        forgetTT (Bind n (B (Pattern v) t) (Sc sc)) =
+>                    (RBind (UN (show n)) (B (Pattern (forget v)) (forget t))
+>				(forget sc))
+>        forgetTT (Proj n i t) = RAnnot $ (show t)++"!"++(show i)++":"++show n
+>        forgetTT (Label t (Comp n cs)) = RLabel (forgetTT t)
+>                                          (RComp (UN $ show n)
+>                                             (map forgetTT cs))
+>        forgetTT (Call (Comp n cs) t) = RCall (RComp (UN $ show n)
+>                                               (map forgetTT cs))
+>                                                 (forgetTT t)
+>        forgetTT (Return t) = RReturn (forgetTT t)
+>        forgetTT (Stage (Quote t)) = RStage (RQuote (forgetTT t))
+>        forgetTT (Stage (Code t)) = RStage (RCode (forgetTT t))
+>        forgetTT (Stage (Eval t _)) = RStage (REval (forgetTT t))
+>        forgetTT (Stage (Escape t _)) = RStage (REscape (forgetTT t))
+>        forgetTT (Const x) = RConst x
+>        forgetTT Star = RStar
diff --git a/Ivor/Tactics.lhs b/Ivor/Tactics.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Tactics.lhs
@@ -0,0 +1,666 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Tactics where
+
+> import Ivor.TTCore
+> import Ivor.Typecheck
+> import Ivor.Nobby
+> import Ivor.Gadgets
+> import Ivor.Unify
+
+> import Data.List
+> import Data.Maybe
+> import Data.Char
+> import Debug.Trace
+
+Tactics for manipulating holes (See Conor McBride's thesis for the
+inspiration for many of these).
+
+Tactics may do several things in addition to manipulating the term. These
+include adding a new goal, solving other holes, and wanting to add a
+new axiom to the context.
+
+> data TacticAction = AddGoal Name
+>                   | NextGoal Name
+>                   | Solved Name (TT Name)
+>                   | AddAxiom Name (TT Name)
+>                   | HideGoal Name
+>    deriving (Show,Eq)
+
+> type Tactic = Monad m => Gamma Name ->
+>                          Env Name ->
+>                          Indexed Name ->
+>                          m (Indexed Name, [TacticAction])
+
+> type HoleFn a = Gamma Name -> Env Name -> Indexed Name -> a
+
+Find a named hole in a term (or the leftmost outermost hole if no name
+is given), and do something if/when you get there.  Could be used for,
+e.g., applying tactics, displaying a proof context, etc.
+
+> findhole :: Gamma Name -> Maybe Name -> Indexed Name ->
+>             HoleFn a -> Maybe a
+> findhole gam n (Ind s) holefn = fh [] s
+>     where fh env b@(Bind x (B Hole ty) _)
+>               | same x n = Just $ holefn gam env (Ind b)
+>           fh env b@(Bind x (B (Guess v) ty) _)
+>               | same x n = Just $ holefn gam env (Ind b)
+>           fh env (Bind x binder@(B b ty) (Sc s)) =
+>               first [fhb env b,
+>                      fh env ty,
+>                      fh ((x,binder):env) s]
+>           fh env (App f s) = first [fh env f, fh env s]
+>           fh env (Stage (Quote t)) = fh env t
+>           fh env (Stage (Code t)) = fh env t
+>           fh env (Stage (Eval t _)) = fh env t
+>           fh env (Stage (Escape t _)) = fh env t
+>           fh _ _ = fail "No such hole binder"
+>
+>           fhb env (Let x) = fh env x
+>           fhb env (Guess x) = fh env x
+>           fhb env _ = Nothing
+>
+>           first = maybeHead.catMaybes
+>           maybeHead (x:xs) = Just x
+>           maybeHead _ = Nothing
+>
+>           same x Nothing = True
+>           same x (Just n) = x == n
+
+Boolean indicates whether to return all (True) or just the ones with
+no guesses attached (False).
+
+> allholes :: Gamma Name -> Bool -> Indexed Name -> [(Name,Indexed Name)]
+> allholes gam guesses (Ind s) = fh [] s
+>     where fh env b@(Bind x binder@(B Hole ty) (Sc sc))
+>               = [(x,Ind ty)] ++ fh env ty ++ fh ((x,binder):env) sc
+>           fh env b@(Bind x binder@(B (Guess v) ty) (Sc sc))
+>              | guesses = [(x,Ind ty)] ++ fh env v ++ fh env ty ++ fh ((x,binder):env) sc
+>           fh env (Bind x binder@(B b ty) (Sc s)) =
+>               fhb env b ++ fh env ty ++ fh ((x,binder):env) s
+>           fh env (App f s) = fh env f ++ fh env s
+>           fh env (Stage (Quote t)) = fh env t
+>           fh env (Stage (Code t)) = fh env t
+>           fh env (Stage (Eval t _)) = fh env t
+>           fh env (Stage (Escape t _)) = fh env t
+>           fh _ _ = []
+>
+>           -- fhb env (Let x) = fh env x
+>           fhb env (Guess x) = fh env x
+>           fhb env _ = []
+
+Typecheck a term in the context of the given hole
+
+> holecheck :: Monad m => Name -> Gamma Name -> Indexed Name ->
+>              Raw -> m (Indexed Name, Indexed Name)
+> holecheck n gam state raw = case (findhole gam (Just n) state docheck) of
+>                                Nothing -> fail "No such hole binder"
+>                                (Just x) -> x
+>    where docheck gam env _ = check gam env raw Nothing
+
+Run a tactic on the given named hole (or the first hole, if no name is
+given). Searches through the given term for a hole with the given
+name, and runs the tactic on the term it finds, with the term in its
+appropriate context.
+
+[I wanted to write this in terms of findhole, but then I lose the rest of
+the term. Oh well.]
+
+FIXME: Why not use a state monad for the unified variables in rt?
+
+> runtactic :: Monad m => Gamma Name -> Name ->
+>              Indexed Name -> Tactic -> m (Indexed Name, [TacticAction])
+> runtactic gam n t tac = runtacticEnv gam [] n t tac
+
+> runtacticEnv :: Monad m => Gamma Name -> Env Name -> Name ->
+>                 Indexed Name -> Tactic -> m (Indexed Name, [TacticAction])
+> runtacticEnv gam env n (Ind s) tactic =
+>     do (tm, actions) <- (rt env s)
+>        return ((Ind (substNames (mapMaybe mkUnify actions) tm)), actions)
+>     where rt env b@(Bind x (B Hole ty) _)
+>               | x == n = do (Ind b', u) <- tactic gam env (Ind b)
+>                             return (b', u)
+>           rt env b@(Bind x (B (Guess v) ty) _)
+>               | x == n = do (Ind b',u) <- tactic gam env (Ind b)
+>                             return (b', u)
+>           rt env b@(Bind x (B (Let v) ty) _)
+>               | x == n = do (Ind b',u) <- tactic gam env (Ind b)
+>                             return (b',u)
+
+                | otherwise = return (b, []) -- fail "No such hole"
+
+>           rt env b@(Bind x (B Lambda ty) _)
+>               | x == n = do (Ind b',u) <- tactic gam env (Ind b)
+>                             return (b',u)
+>           rt env (Bind x binder@(B b ty) (Sc s)) =
+>               do (b',u) <- rtb env b
+>                  (ty',u') <- rt env ty
+>                  (s',u'') <- rt ((x,binder):env) s
+>                  return (Bind x (B b' ty') (Sc s'), nub (u++u'++u''))
+>           rt env (App f s) =
+>               do (f',u) <- rt env f
+>                  (s',u') <- rt env s
+>                  return (App f' s', nub (u++u'))
+>           rt env (Stage (Quote t)) = do (t',u) <- rt env t
+>                                         return (Stage (Quote t'), u)
+>           rt env (Stage (Code t)) = do (t',u) <- rt env t
+>                                        return (Stage (Code t'), u)
+>           rt env (Stage (Eval t ty)) = do (t',u) <- rt env t
+>                                           (ty',u) <- rt env ty
+>                                           return (Stage (Eval t' ty'), u)
+>           rt env (Stage (Escape t ty)) = do (t',u) <- rt env t
+>                                             (ty',u) <- rt env ty
+>                                             return (Stage (Escape t' ty'), u)
+>           rt env x = return (x, [])
+>
+>           -- No holes in let bound values!
+>           --rtb env (Let x) = do (rtx, u) <- rt env x
+>           --                     return (Let rtx, u)
+>           rtb env (Guess x) = do (rtx, u) <- rt env x
+>                                  return (Guess rtx, u)
+>           rtb env b = return (b, [])
+>           mkUnify (Solved x ty) = Just (x, ty)
+>           mkUnify _ = Nothing
+
+Tactics by default don't need to return the other holes they solved.
+
+> tacret :: Monad m => Indexed Name -> m (Indexed Name, [TacticAction])
+> tacret x = return (x,[])
+
+Sequence two tactics
+
+> thenT :: Tactic -> Tactic -> Tactic
+> thenT tac1 tac2 gam env tm = do (tm',u) <- tac1 gam env tm
+>                                 (tm'',u') <- tac2 gam env tm'
+>                                 return (tm',nub (u++u'))
+
+Try to run a tactic, do nothing silently if it fails.
+
+> attempt :: Tactic -> Tactic
+> attempt tac gam env tm =
+>     case tac gam env tm of
+>        Just (tm',act) -> return (tm',act)
+>        Nothing -> tacret tm
+
+Create a new theorem ?x:S. x
+
+> theorem :: Name -> Indexed Name -> Indexed Name
+> theorem x (Ind s) = Ind (Bind x (B Hole s) (Sc (P x)))
+
+Create a new definition with holes ?x:S = holey in x
+
+> makeholey :: Name -> Indexed Name -> Indexed Name -> Indexed Name
+> makeholey x (Ind holey) (Ind ty) =
+>     Ind (Bind x (B (Guess holey) ty) (Sc (P x)))
+
+Add a new claim to the current state
+
+> claim :: Name -> Raw -> Tactic -- ?Name:Type.
+> claim x s gam env (Ind t) =
+>     do (Ind sv, st) <- check gam (ptovenv env) s Nothing
+>        checkConv gam st (Ind Star) "Type of claim must be *"
+>        return $ (Ind (Bind x (B Hole (makePsEnv (map fst env) sv)) (Sc t)),
+>                      [NextGoal x])
+
+Add a new claim with guess to the current state
+[FIXME: Doesn't work yet, should put new goal at the end.]
+
+> claimholey :: Name -> Indexed Name -> Indexed Name -> Tactic
+> claimholey x (Ind holey) (Ind ty) gam env (Ind term) =
+>     tacret $ Ind (Bind x (B (Guess holey) ty) (Sc term))
+
+> claimsolved :: Name -> Indexed Name -> Indexed Name -> Tactic
+> claimsolved x (Ind holey) (Ind ty) gam env (Ind term) =
+>     tacret $ Ind (Bind x (B (Let holey) ty) (Sc term))
+
+Begin solving a goal
+
+> attack :: Name -> Tactic
+> attack h gam env (Ind (Bind x b@(B Hole ty) sc))
+>         = tacret $ Ind (Bind x (B (Guess newtm) ty) sc)
+>   where newtm = Bind h0 (B Hole ty) (Sc (P h0))
+>         h0 = uniqify h (x:(map fst env))
+> attack _ _ _ t = fail $ "Internal error; not an attackable hole: " ++ show t
+
+Try filling the current goal with a term
+
+> fill :: Raw -> Tactic
+> fill guess gam env (Ind (Bind x (B Hole tyin') sc)) =
+>     do let (Ind tyin) = finalise (Ind tyin')
+>        (Ind gvin,Ind gtin, env) <- {-trace ("checking "++show guess++" in context " ++ show (ptovenv env)) $ -}
+>                               checkAndBind gam (ptovenv env) guess (Just (Ind tyin))
+>        let gv = makePsEnv (map fst env) gvin
+>        let gt = makePsEnv (map fst env) gtin
+>        let (Ind ty') = normaliseEnv (ptovenv env) (Gam []) (Ind tyin)
+>        let (Ind ty) = normaliseEnv (ptovenv env) gam (Ind tyin)
+>        let fgt = finalise (Ind gt)
+>        let fty' = finalise (Ind ty')
+>        let fty = finalise (Ind ty)
+>        others <- -- trace ("unifying "++show gt++" and "++show ty') $
+>                  case unifyenv (Gam []) (ptovenv env) fgt fty' of
+>                     Nothing -> unifyenv gam (ptovenv env) fgt fty
+>                     (Just x) -> return x
+>        -- let newgt = substNames others gt
+>        -- let newgv = substNames others gv
+>        let newgv = gv
+>        -- trace ((show others) ++ ", "++ show (Ind newgt)) $ checkConv gam (Ind gt) (Ind ty) $ "Guess is badly typed ("++show gt++", "++show ty++")"
+>        return $ (Ind (Bind x (B (Guess newgv) ty) sc),
+>                      map mkAction (nodups others))
+>    where pToVs i [] gv = gv
+>          pToVs i ((x,_):xs) gv = {- trace ("pToVing "++show x++", " ++ show i++ " in "++show gv) $ -}
+>              let (Sc gv') = pToV2 i x gv in
+>                  pToVs (i+1) xs gv'
+>          mkAction (x,tm) = Solved x tm
+>          nodups [] = []
+>          nodups ((x,y):xs) | x `elem` (map fst xs) = nodups xs
+>                            | otherwise = (x,y):(nodups xs)
+> fill _ _ _ _ = fail "Can't try to fill something which isn't a hole"
+
+Use defaults to fill in arguments which don't appear in the goal (hence aren't
+solvable by unification). (FIXME: Not yet implemented.)
+
+> refine :: Raw -> [Raw] -> Tactic
+> refine rtm defaults gam env tm@(Ind (Bind x (B Hole ty) (Sc sc))) =
+>     do (Ind bv,Ind ntyin) <- check gam (ptovenv env) rtm Nothing
+>        let (Ind nty) = normaliseEnv (ptovenv env) gam (Ind ntyin)
+>        let bvin = makePsEnv (map fst env) bv
+>        -- let (Just (Ind nty)) = lookuptype n gam
+>        let claimTypes = getClaims (makePsEnv (map fst env) nty)
+>        let rawapp = mkapp rtm (map (\_ -> RInfer) claimTypes)
+>        let (Ind tyin') = finalise (normaliseEnv (ptovenv env) gam (Ind ty))
+>        (Ind rtch, rtych, ev) <- checkAndBind gam (ptovenv env) rawapp (Just (Ind tyin'))
+>        let argguesses = getArgs rtch
+>        -- So we'll have an application, some of the arguments with inferred
+>        -- names. Let's record which ones...
+>        let claims = uniqifyClaims x env claimTypes
+>        let claimGuesses = zip claims (map appVar argguesses)
+>        (tm',_) <- {- trace (show claimGuesses) $ -} doClaims x claimGuesses gam env tm
+>        let guess = (mkGuess claimGuesses [] (forget bvin))
+>        (filled, unified) <- runtacticEnv gam env x tm'
+>                  (fill guess)
+>        -- (filled, solved) <- solveUnified [] unified filled
+>        -- filled <- tryDefaults defaults claims filled
+>        -- (tm', _) <- trace (show claims) $ tidy gam env filled
+>        let newgoals = mapMaybe isGoal claimGuesses
+>        return $ (filled, map HideGoal (map fst claims) ++
+>                          map AddGoal (reverse newgoals))
+>        --                  map AddGoal (map fst (reverse claims)))
+>        -- tacret filled --(Ind (Bind x (B Hole ty) (Sc sc')))
+>   where mkGuess [] defs n = n
+>         mkGuess (((x,_),guess):xs) (RInfer:ds) n
+>             = (mkGuess xs ds (RApp n (Var x)))
+>         mkGuess (((x,_),guess):xs) [] n
+>             = (mkGuess xs [] (RApp n (Var x)))
+>         -- FIXME: Fix this so default arguments use the 'guess'
+>         mkGuess (((x,_),_):xs) (d:ds) n
+>             = (mkGuess xs ds (RApp n d))
+
+>         -- if we inferred a guess, use that, otherwise use the claim name
+>         appVar (P (MN ("INFER",_))) = Nothing
+>         appVar guess = Just guess
+>         isGoal ((n,ty),Nothing) = Just n
+>         isGoal ((n,ty),Just _) = Nothing
+
+>         todo uns (x,_) = not (isSolved x uns)
+>         solveUnified tohide [] tm = return (tm, tohide)
+>         solveUnified tohide ((Solved x guess):xs) tm
+>             = do (filled,_) <- runtacticEnv gam env x tm (fill (forget guess))
+>                  solveUnified (x:tohide) xs filled
+>         solveUnified tohide (_:xs) tm = solveUnified tohide xs tm
+>         isSolved x [] = False
+>         isSolved x ((Solved n _):xs) | x==n = True
+>         isSolved x (_:xs) = isSolved x xs
+>         tryDefaults [] _ f = return f
+>         tryDefaults (RInfer:xs) (c:cs) tm
+>             = do tryDefaults xs cs tm
+>         tryDefaults (x:xs) ((c,ty):cs) tm
+>             = do (filled, _) <- runtacticEnv gam env c tm (fill x)
+>                  (filled, _) <- runtacticEnv gam env c filled solve
+>                  (filled, _) <- runtacticEnv gam env c filled cut
+>                  tryDefaults xs cs filled
+>         removeClaims claims tm@(Ind (Bind x b@(B _ ty) (Sc sc)))
+>             | x `elem` (map fst claims)
+>                  = {- trace (show (x,sc, forget sc)) $ -}
+>                    let (cl',Ind sc') = removeClaims claims (Ind sc) in
+>                      if (nameOccurs x (forget sc'))
+>                        then (cl', Ind (Bind x b (Sc sc')))
+>                        else ((x,ty):cl', Ind sc')
+>             | otherwise = ([], tm)
+
+> refine _ _ _ _ _ = fail "Not focused on a hole"
+
+        trace (show claims) $ fail "Unimplemented"
+
+> getClaims :: TT Name -> [(Name, TT Name)]
+> getClaims (Bind n (B Pi ty) (Sc sc)) = (n,ty):(getClaims sc)
+> getClaims _ = []
+
+> uniqifyClaims :: Name -> Env Name -> [(Name, TT Name)] -> [(Name, TT Name)]
+> uniqifyClaims nspace env [] = []
+> uniqifyClaims nspace env ((x,ty):xs) =
+>     let newx = uniqify (mkns nspace x) (map fst env)
+>         xs' = substClaim x (P newx) xs in
+>         (newx, ty):(uniqifyClaims nspace ((newx, B Hole ty):env) xs')
+>   where substClaim x newx [] = []
+>         substClaim x newx ((n,ty):xs)
+>                        = (n,substName x newx (Sc ty)):
+>                           (substClaim x newx xs)
+>         mkns (UN a) (UN b) = UN (a++"_"++b)
+>         mkns (MN (a,i)) (UN b) = MN (a++"_"++b, i)
+>         mkns (MN (a,i)) (MN (b,j)) = MN (a++"_"++b, i)
+
+> doClaims :: Name -> [((Name, TT Name), Maybe (TT Name))] -> Tactic
+> doClaims h [] gam env tm = tacret $ tm
+> doClaims h (((n,ty),Nothing):xs) gam env tm =
+>     do (tm',_) <- runtacticEnv gam env h tm (claim n (forget ty))
+>        doClaims h xs gam env tm'
+> doClaims h (((n,ty),Just v):xs) gam env tm =
+>     do (tm',_) <- runtacticEnv gam env h tm (claimsolved n (Ind v) (Ind ty))
+>        doClaims h xs gam env tm'
+
+Give up the current try
+
+> regret :: Tactic
+> regret _ _ (Ind (Bind x (B (Guess gv) ty) sc)) =
+>     tacret $ Ind (Bind x (B Hole ty) sc)
+> regret _ _ _ = fail "Can't regret something you haven't done"
+
+Attempt to solve the current goal with the guess
+
+> solve :: Tactic
+> solve _ _ (Ind (Bind x (B (Guess gv) ty) sc))
+>       | (pure gv) = tacret (Ind (Bind x (B (Let (finind gv)) ty) sc))
+>       | otherwise = fail "I see a hole in your solution"
+>    where finind t = case (finalise (Ind t)) of
+>                        (Ind x) -> x
+> solve _ _ _ = fail "Not a guess"
+
+Substitute a let bound variable into a term
+
+> cut :: Tactic
+> cut _ env (Ind (Bind x (B (Let v) ty) sc)) =
+>     tacret $ {- trace ("Cutting "++show v++" into "++show sc) $ -}
+>            Ind (substName x (makePsEnv (map fst env) v) sc)
+>   where
+> cut _ _ _ = fail "Not a let bound term"
+
+Normalise the goal
+
+> evalGoal :: Tactic
+> evalGoal gam env (Ind (Bind x (B Hole ty) sc)) =
+>    do let (Ind nty) = normaliseEnv (ptovenv env) gam (finalise (Ind ty))
+>       tacret $ Ind (Bind x (B Hole nty) sc)
+> evalGoal _ _ (Ind (Bind x _ _)) = fail $ "evalGoal: " ++ show x ++ " Not a hole"
+> evalGoal _ _ _ = fail "evalGoal: Can't happen"
+
+Do beta reductions (i.e., normalise the goal without expanding global names)
+
+> betaReduce :: Tactic
+> betaReduce gam env (Ind (Bind x (B Hole ty) sc)) =
+>    do let (Ind nty) = normaliseEnv (ptovenv env) (Gam []) (finalise (Ind ty))
+>       tacret $ Ind (Bind x (B Hole nty) sc)
+> betaReduce _ _ (Ind (Bind x _ _)) = fail $ "betaReduce: " ++ show x ++ " Not a hole"
+> betaReduce _ _ _ = fail "betaReduce: Not a binder, can't happen"
+
+Normalise the goal, only expanding the given global name.
+
+> reduceWith :: Name ->Tactic
+> reduceWith fn gam env (Ind (Bind x (B Hole ty) sc)) =
+>    do case glookup fn gam of
+>           Nothing -> fail $ "Unknown name " ++ show fn
+>           Just (v,t) -> do
+>              let (Ind nty) = normaliseEnv (ptovenv env)
+>                                           (Gam [(fn,G v t defplicit)])
+>                                           (finalise (Ind ty))
+>              tacret $ Ind (Bind x (B Hole nty) sc)
+> reduceWith _ _ _ (Ind (Bind x _ _)) = fail $ "reduceWith: " ++ show x ++ " Not a hole"
+> reduceWith _ _ _ _ = fail "reduceWith: Not a binder, can't happen"
+
+Do case analysis by the given elimination operator
+
+> by :: Raw -> Tactic
+> by rule gam env tm@(Ind (Bind x (B Hole ty) sc)) =
+>     do (Ind bv,Ind bt) <- check gam (ptovenv env) rule Nothing
+>        let bvin = makePsEnv (map fst env) bv
+>        let btin = makePsEnv (map fst env) bt
+>        -- Take eliminator apart, find the motive and method names/types
+>        (motive,methods) <- getBits btin
+>        let motiveargs = getExpected (snd motive)
+>        let eargs = getArgs bvin
+>        let elimargs = drop (length eargs - length motiveargs) eargs
+>        let tyuniq = uniqifyBinders (map fst motiveargs) ty
+>        -- Construct the type of the motive Phi
+>        let (Ind mtype) = finalise $ Ind $ bind Lambda motiveargs $
+>                  Sc $ motiveType (zip (map fst motiveargs) elimargs) tyuniq
+>        let mbinding = (B (Let mtype) (snd motive))
+>        let claims = uniqifyClaims x env methods
+>        (Ind mbody, [])
+>            <- doClaims x (zip claims (repeat Nothing)) gam (((fst motive),mbinding):env) tm
+>        let mbind = Bind (fst motive) mbinding (Sc mbody)
+>        let ruleapp = (forget (mkGuess claims (App bvin (P (fst motive)))))
+>        (filled, _) <- runtacticEnv gam env x (Ind mbind)
+>                         (fill ruleapp)
+>        (tm', _) <- tidy gam env filled
+>        --(tm'', _) <- runtacticEnv gam env (fst motive) tm' cut
+>        return (tm', map HideGoal ((fst motive):(map fst claims)) ++
+>                     map AddGoal (map fst (reverse claims)))
+>   where
+>     getBits (Bind mname (B Pi ty) (Sc sc))
+>        | getReturnType ty == Star = do
+>            meths <- getMeths sc
+>            let names = map fst env
+>            return ((mname,(uniqifyBinders names ty)), meths)
+>     getBits _ = fail "What's my motivation?"
+>     getMeths (Bind meth (B Pi ty) (Sc sc)) = do
+>         rest <- getMeths sc
+>         return ((meth,ty):rest)
+>     getMeths _ = return []
+>     motiveType [] ty = ty
+>     motiveType ((marg,earg):xs) ty
+>         = let sc = (motiveType xs ty) in
+>             --trace (show marg ++ " for " ++ show earg ++ " in " ++ show sc) $
+>             substTerm earg (P marg) (Sc (motiveType xs ty))
+>     mkGuess [] n = n
+>     mkGuess ((x,_):xs) n = (mkGuess xs (App n (P x)))
+> by _ _ _ _ = fail "Not focussed on a hole"
+
+Do case analysis on the given term. Work out which elimination rule is
+needed and the necessary indices, then run the 'by' tactic.
+
+Either run the induction rule (if rec is true) or the case analysis rule
+otherwise.
+
+> casetac :: Bool -> Raw -> Tactic
+> casetac rec scrutinee gam env tm@(Ind (Bind x (B Hole ty) sc)) =
+>     do (Ind bv,bt) <- check gam (ptovenv env) scrutinee Nothing
+>        let (Ind btnorm) = (normaliseEnv (ptovenv env) gam bt)
+>        let bvin = makePsEnv (map fst env) bv
+>        let btin = makePsEnv (map fst env) btnorm
+>        let indices = getArgs btin
+>        let ty = getFun btin
+>        runCaseTac rec ty (indices++[bvin]) gam env tm
+> casetac _ _ _ _ _ = fail "Not focussed on a hole"
+
+> runCaseTac :: Bool -> TT Name -> [TT Name] -> Tactic
+> runCaseTac rec (TyCon n _) args gam env tm =
+>     case (lookupval n gam) of
+>         (Just (TCon _ (Elims erule crule cons))) -> do
+>             by (mkapp (Var (if rec then erule else crule))
+>                                (map forget args)) gam env tm
+>         (Just (TCon _ NoConstructorsYet)) ->
+>              fail $ (show n) ++ " is declared but not defined"
+>         _ -> fail $ (show n) ++ " is not a type constructor"
+
+> runCaseTac _ x indices gam env tm =
+>     fail $ (show x) ++ " is not a type constructor"
+
+elimargs <- Get arguments to elimination operator
+motiveargs <- Get expected arguments to motive
+Remove args from elimargs so there are the right number to motiveargs
+  (i.e. remove the ones which come from parameters)
+motivetype <- goal subst[motiveargs for elimargs]
+let motivename = lam motiveargs . motivetype
+in [claim meths]
+
+
+> uniqifyBinders env (Bind n (B Pi p) sc)
+>      | n `elem` env
+>          = let newname = uniqify n env in
+>                Bind newname (B Pi p)
+>                         (Sc (substName n (P newname) sc))
+>      | otherwise = Bind n (B Pi p) (fmap (uniqifyBinders env) sc)
+> uniqifyBinders env x = x
+
+Rename a binder
+
+> rename :: Name -> Tactic
+> rename n gam env (Ind (Bind x (B Hole rnin) sc))
+>     = do renamed <- doRename n rnin
+>          tacret $ Ind (Bind x (B Hole renamed) sc)
+>   where doRename n (Bind x b sc)
+>             = return (Bind n b (Sc (substName x (P n) sc)))
+>         doRename _ _ = fail "Nothing to rename"
+> rename _ _ _ (Ind (Bind x _ _)) = fail $ "rename: " ++ show x ++ " Not a hole"
+> rename _ _ _ _ = fail "rename: Not a binder, can't happen"
+
+Introduce a lambda or let
+
+> intro :: Tactic
+> intro gam env intm@(Ind (Bind x (B Hole tyin) (Sc p)))
+>     | p == (P x) =
+>         do let (Ind ty) = normaliseEnv (ptovenv env) (Gam []) (finalise (Ind tyin))
+>            let ty' = makePsEnv (map fst env) ty
+>            introsty (uniqify x (map fst env)) ty' (Sc p)
+>     | otherwise =
+>            fail $ "Not an introduceable hole. Attack it first."
+> intro _ _ _ = fail $ "Can't introduce here."
+
+> introsty x (Bind y (B Pi s) (Sc t)) xscope =
+>     tacret $ Ind (Bind y (B Lambda s) (Sc (Bind x (B Hole t) xscope)))
+> introsty x (Bind y (B (Let v) s) (Sc t)) xscope =
+>     tacret $ Ind (Bind y (B (Let v) s) (Sc (Bind x (B Hole t) xscope)))
+> introsty x b xscope = fail $ "Nothing to introduce from " ++ show b
+
+Tidy up a term to remove all holes which are not used.
+
+> tidy :: Tactic
+> tidy _ _ (Ind t) = tacret $ Ind $ tidy' t where
+>    tidy' (Bind n (B Hole ty) (Sc sc))
+>        | not $ n `elem` (getNames (Sc sc)) = tidy' sc
+>    tidy' (Bind n (B (Guess _) ty) (Sc sc))
+>        | not $ n `elem` (getNames (Sc sc)) = tidy' sc
+>    tidy' (Bind n b (Sc sc)) =
+>          Bind n (fmap tidy' b) (Sc (tidy' sc))
+>    tidy' (App f a) = App (tidy' f) (tidy' a)
+>    tidy' (Proj n i t) = Proj n i (tidy' t)
+>    tidy' x = x
+
+Replace a goal with an equivalent (convertible) goal.
+
+> equiv :: Raw -> Tactic
+> equiv goal gam env tm@(Ind (Bind x (B Hole ty) sc)) =
+>     do (Ind goalv,Ind goalt) <- check gam (ptovenv env) goal Nothing
+>        let goalvin = makePsEnv (map fst env) goalv
+>        checkConvEnv env gam (Ind goalv) (finalise (Ind ty))
+>                         "Not equivalent to the Goal"
+>        tacret $ Ind (Bind x (B Hole goalvin) sc)
+> equiv _ _ _ (Ind (Bind x _ _)) = fail $ "equiv: " ++ show x ++ " Not a hole"
+> equiv _ _ _ _ = fail "equiv: Not a binder, can't happen"
+
+> generalise :: Raw -> Tactic
+> generalise expr gam env (Ind (Bind x (B Hole tyin) sc)) =
+>     do (nv, nt) <- check gam (ptovenv env) expr Nothing
+>        let (Ind ntyin) = normaliseEnv (ptovenv env) (Gam []) (finalise (Ind tyin))
+>        let (Ind exprv) = normaliseEnv (ptovenv env) gam nv
+>        let (Ind exprt) = normaliseEnv (ptovenv env) gam nt
+>        let ty = makePsEnv (map fst env) ntyin
+>        let exprvin = makePsEnv (map fst env) exprv
+>        let exprtin = makePsEnv (map fst env) exprt
+>        let newname = uniqify (UN "x") $
+>                        (map fst env) ++ (getBoundNames (Sc ty))
+>        let newtysc = unifySubstTerm gam exprvin (P newname) (Sc ty)
+>        let newty = Bind newname (B Pi exprtin) (Sc newtysc)
+>        let newsc = substName x (App (P x) exprvin) sc
+>        tacret $ Ind (Bind x (B Hole newty) (Sc newsc))
+> generalise _ _ _ (Ind (Bind x b sc)) = fail $ "generalise: " ++ show x ++ " Not a hole"
+> generalise _ _ _ _ = fail "generalise: Can't happen"
+
+Replace a term in the goal according to the given equality rule, and the
+given equality type and replacement/symmetry lemmas.
+
+Algorithm:
+rule has type "eq X a b" (b is what we've got, a is what we want)
+Create P = [n:X](ty[n/b])
+claim p : ty[a/b]
+try (repl _ _ _ rule P p)
+
+Boolean flag (flip) is True if symmetry should be applied first.
+
+> replace :: Raw -> Raw -> Raw -> Raw -> Bool -> Tactic
+> replace eq repl sym rule flip gam env tm@(Ind (Bind x (B Hole ty) sc))
+>         = do let userule = if flip
+>                     then (mkapp sym [RInfer, RInfer, RInfer, rule])
+>                     else rule
+>              (Ind rulev, Ind rulet) <- check gam (ptovenv env) userule Nothing
+>              (Ind eqv, Ind eqt) <- check gam (ptovenv env) eq Nothing
+>              (Ind replv, Ind replt) <- check gam (ptovenv env) repl Nothing
+>              (qty,a,b) <- getTypes rulet
+>              let tP = (Bind nm (B Lambda qty) (Sc (substTerm b (P nm) (Sc ty))))
+>              let p = substTerm b a (Sc ty)
+>              (tm',_) <- doClaims x ([((claimname,p),Nothing)]) gam env tm
+>              let repltm = mkapp repl (RInfer:RInfer:RInfer:userule:(forget tP):(Var claimname):[])
+>              (filled, _) <- runtacticEnv gam env x tm' (fill repltm)
+>              return (filled, [AddGoal claimname])
+>    where psn = makePsEnv (map fst env)
+>          nm = uniqify (UN "q") (map fst env)
+>          claimname = mkns x (UN "q")
+>          getTypes (App (App (App (App eq x) _) a) b) = return (x,a,b)
+>          getTypes (App (App (App eq x) a) b) = return (x,a,b)
+>          getTypes _ = fail "Rule is not of equality type"
+>          mkns (UN a) (UN b) = UN (a++"_"++b)
+> replace _ _ _ _ _ _ _ (Ind (Bind x b sc)) = fail $ "replace: " ++ show x ++ " Not a hole"
+> replace _ _ _ _ _ _ _ _ = fail "replace: Not a binder, can't happen"
+
+Create an axiom for the current goal (quantifying over all bound variables
+in the goal, and [FIXME!] all variables they depend on) and use it to
+solve the goal.
+
+> axiomatise :: Name -> [Name] -> Tactic
+> axiomatise n helpers gam env tm@(Ind (Bind x (B Hole tyin) sc)) =
+>     do let (Ind ty') = normaliseEnv (ptovenv env) (Gam []) (finalise (Ind tyin))
+>        let ty = makePsEnv (map fst env) ty'
+>        let fvs = reverse $ getUsedBoundVars env ((getNames (Sc ty))++helpers)
+>        let axiom = bind Pi fvs (Sc ty)
+>        return (Ind (Bind x
+>                     (B (Guess (appArgs (P n) (map (P . fst) fvs))) ty) sc),
+>                    [AddAxiom n axiom])
+>  where getUsedBoundVars [] ns = []
+>        getUsedBoundVars ((n,b@(B _ ty)):bs) ns
+>            | n `elem` ns = (n,ty):(getUsedBoundVars bs ns)
+>            | otherwise = getUsedBoundVars bs ns
+> axiomatise _ _ _ _ (Ind (Bind x b sc)) = fail $ "axiomatise: " ++ show x ++ " Not a hole"
+> axiomatise _ _ _ _ _ = fail "axiomatise: Not a binder, can't happen"
+
+Prepare to return a quoted value
+
+> quote :: Tactic
+> quote gam env tm@(Ind (Bind h (B Hole tyin) sc)) =
+>     do let (Ind ty') = normaliseEnv (ptovenv env) (Gam []) (finalise (Ind tyin))
+>        ty <- checkQuoted ty'
+>        let qv = uniqify (mkns h (UN "qv")) $
+>                        (map fst env) ++ (getBoundNames (Sc ty))
+>        -- Fill hole with {'?qv:ty . qv}
+>        let tm = (Bind qv (B Hole ty) (Sc (P qv)))
+>        -- (tm',_) <- trace (show ty) $ runtacticEnv gam env h tm (claim qv (forget ty))
+>        let filltm = Stage (Quote tm)
+>        return (Ind (Bind h (B (Guess filltm) tyin) sc), [AddGoal qv])
+>   where checkQuoted (Stage (Code t)) = return t
+>         checkQuoted _ = fail "Not a code type"
+>         mkns (UN a) (UN b) = UN (a++"_"++b)
+> quote _ _ (Ind (Bind x b sc)) = fail $ "quote: " ++ show x ++ " Not a hole"
+> quote _ _ _ = fail "quote: Not a binder, can't happen"
+
+> ptovenv [] = []
+> ptovenv ((x,b):xs) = (x,fmap finind b):(ptovenv xs)
+>    where finind t = case finalise (Ind t) of
+>                      (Ind t') -> t'
diff --git a/Ivor/TermParser.lhs b/Ivor/TermParser.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/TermParser.lhs
@@ -0,0 +1,227 @@
+> -- | 
+> -- Module      : Ivor.TermParser
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> -- 
+> -- Extensible Parsec based parsing library for 'ViewTerm's.
+> --
+> -- Briefly, the syntax is as follows:
+> --
+> --  * @[x:A]y@ -- Lambda binding with scope @y@.
+> --
+> --  * @(x:A) -> B@ -- Forall binding with scope @B@ (@->@ optional).
+> --
+> --  * @A -> B@ -- Forall binding where name bound is not used in @B@..
+> --
+> --  * @let x:A=v in y@ -- Let binding, @x=v@ in scope @y@.
+> -- 
+> --  * @f a@ -- Function application (left associative, by juxtaposition).
+> --   
+> --  * @[identifier]@ -- names are legal Haskell identifiers.
+> --  
+> --  * @\*@ -- Asterisk is type of types.
+> --
+> --  * @_@ -- Underscore is a placeholder.
+> --
+> --  * @?identifier@ -- metavariable, add a name to be defined later
+> --
+> -- Lambda\/forall bindings of multiple variables are also accepted,
+> -- in the form @[x,y:A;z:B]@
+> --
+> -- Staging annotations have the following syntax:
+> --
+> --  * @{'x}@ -- quoted term @x@
+> --
+> --  * @{{A}}@ -- code type @A@ (if @x:A@, @{'x}:{{A}}@
+> --
+> --  * @!x@ -- evaluate a quoted term
+> --
+> --  * @~x@ -- escape a quoted term (i.e. splice into a quoted term)
+> -- 
+> -- Extensions for labelled types (see McBride\/McKinna \"The View
+> -- From The Left\" for details):
+> --
+> --  * @\<[identifier] args : t\>@ -- Labelled type.
+> --
+> --  * @call \<label\> term@ -- Call a computation.
+> --   
+> --  * @return t@ -- Return a value from a computation.
+> --
+
+> module Ivor.TermParser(pTerm, pNoApp, pInductive,
+>                          parseTermString, parseDataString) where
+
+> import Ivor.ViewTerm
+> import Ivor.TTCore(Name(..))
+
+> import Text.ParserCombinators.Parsec
+> import Text.ParserCombinators.Parsec.Expr
+> import Text.ParserCombinators.Parsec.Language
+> import qualified Text.ParserCombinators.Parsec.Token as PTok
+
+> import Debug.Trace
+
+> type TokenParser a = PTok.TokenParser a
+
+> lexer :: TokenParser ()
+> lexer  = PTok.makeTokenParser haskellDef
+
+> whiteSpace= PTok.whiteSpace lexer
+> lexeme    = PTok.lexeme lexer
+> symbol    = PTok.symbol lexer
+> natural   = PTok.natural lexer
+> parens    = PTok.parens lexer
+> semi      = PTok.semi lexer
+> comma     = PTok.comma lexer
+> identifier= PTok.identifier lexer
+> reserved  = PTok.reserved lexer
+> operator  = PTok.operator lexer
+> reservedOp= PTok.reservedOp lexer
+> lchar = lexeme.char
+
+> app :: Parser (ViewTerm -> ViewTerm -> ViewTerm)
+> app = do whiteSpace ; return App
+
+> arrow :: Parser (ViewTerm -> ViewTerm -> ViewTerm)
+> arrow = do symbol "->" ; return $ Forall (name "X")
+
+> -- | Basic parsec combinator for parsing terms.
+> pTerm :: Maybe (Parser ViewTerm) -- ^ Extra parse rules (for example 
+>          -- for any primitive types or operators you might have added).
+>          -> Parser ViewTerm
+> pTerm Nothing = try (do chainl1 (pNoApp Nothing) app)
+>             <|> (pNoApp Nothing)
+>             -- <|> pInfix Nothing
+> pTerm (Just ext) = try (do chainl1 (pNoApp (Just ext)) app)
+>                    -- <|> try (pInfix (Just ext))
+>                    <|> try (pNoApp (Just ext))
+>                    <|> ext
+
+> -- | Parse a term which is not an application; 
+> -- use for parsing lists of terms.
+> pNoApp :: Maybe (Parser ViewTerm) -> Parser ViewTerm
+> pNoApp ext = try (do chainr1 (pExp ext) arrow)
+>              <|> pExp ext
+
+> pNoInfix :: Maybe (Parser ViewTerm) -> Parser ViewTerm
+> pNoInfix ext = 
+>        do lchar '[' ; bs <- bindList ext ; lchar ']'
+>           sc <- pTerm ext ;
+>           return $ bindAll Lambda bs sc
+>        <|> try (do lchar '(' ; bs <- bindList ext ; lchar ')'
+>                    option "" (symbol "->")
+>                    sc <- pTerm ext ;
+>                    return $ bindAll Forall bs sc)
+>        <|> do reserved "let" ; var <- identifier;
+>               lchar ':' ; ty <- pTerm ext ; lchar '=' ; val <- pTerm ext ;
+>               reserved "in" ; sc <- pTerm ext ;
+>               return $ Let (UN var) ty val sc
+>        <|> do lchar '(' ; t <- pTerm ext ; lchar ')' ; return t
+>        <|> do lchar '<'
+>               (nm,args) <- computation ext ; lchar ':' ; lty <- pTerm ext
+>               lchar '>';
+>               return $ Label nm args lty
+>        <|> do reserved "call" ; lchar '<' 
+>               (nm,args) <- computation ext ;
+>               lchar '>' ; tm <- pNoApp ext;
+>               return $ Call nm args tm
+>        <|> do reserved "return"; tm <- pTerm ext;
+>               return $ Return tm
+>        <|> do nm <- identifier ; return (Name Unknown (UN nm))
+>        <|> do lchar '*' ; return Star
+>        <|> do lchar '_' ; return Placeholder
+>        <|> do lchar '?' ; var <- identifier ;
+>               return $ Metavar (UN var)
+>        <|> try (do symbol "{'" ; tm <- pTerm ext; lchar '}'
+>                    return $ Quote tm)
+>        <|> try (do symbol "{{" ; tm <- pTerm ext; symbol "}}"
+>                    return $ Code tm)
+>        <|> try (do symbol "!" ; tm <- pNoApp ext;
+>                    return $ Eval tm)
+>        <|> try (do symbol "~" ; tm <- pNoApp ext;
+>                    return $ Escape tm)
+>        <|> do case ext of
+>                  Nothing -> fail "Parse error"
+>                  Just ext -> ext
+
+> -- | Parse an expression with infix expressions (doesn't work!)
+> pExp :: Maybe (Parser ViewTerm) -> Parser ViewTerm
+> pExp ext = pNoInfix ext -- buildExpressionParser opTable (pNoInfix ext)
+
+-- > pInfix ext = do 
+-- >                 lexp <- trace ("Trying = ") $ pNoApp ext
+-- >                 lchar '='
+-- >                 rexp <- trace (show lexp) $ pTerm ext
+-- >                 return $ apply (Name Unknown (name "Eq"))
+-- >                            [Placeholder,Placeholder,lexp,rexp]
+
+> opTable = [[op "$" (\ l r -> apply (Name Unknown (name "Eq"))
+>                                    [Placeholder,Placeholder,l,r])
+>                    AssocLeft]]
+>     where op s f assoc = Infix (do string s
+>                                    return f)
+>                                assoc
+
+
+> -- | Basic parsec combinator for parsing inductive data types
+> pInductive :: Maybe (Parser ViewTerm) -- ^ Extra parse rules (for example 
+>          -- for any primitive types or operators you might have added).
+>          -> Parser Inductive
+> pInductive ext = do nm <- identifier
+>                     parmsM <- many (do lchar '('
+>                                        xs <- bindList ext
+>                                        lchar ')' ; return xs)
+>                     lchar ':'
+>                     indicesM <- many (do lchar '('
+>                                          xs <- bindList ext
+>                                          lchar ')' ; return xs)
+>                     ty <- pTerm ext ; whereIntro
+>                     cons <- sepBy (constructor ext) (lchar '|')
+>                     return $ Inductive (UN nm) 
+>                                        (concat parmsM) 
+>                                        (concat indicesM)
+>                                        ty cons
+>   where whereIntro = do lchar '=' 
+>                         return ()
+>                      <|> do reserved "where"
+>                             return ()
+
+> constructor ext = do nm <- identifier ; lchar ':'
+>                      ty <- pTerm ext
+>                      return $ (UN nm,ty)
+
+> bindList :: Maybe (Parser ViewTerm) -> Parser [(Name, ViewTerm)]
+> bindList ext 
+>     = do namelist <- sepBy1 identifier comma
+>          lchar ':'
+>          ty <- pTerm ext
+>          rest <- option [] (do semi ; bindList ext)
+>          return $ (map (\x -> (UN x,ty)) namelist) ++ rest
+
+> bindAll binder [] sc = sc
+> bindAll binder ((n,ty):xs) sc = binder n ty (bindAll binder xs sc)
+
+> computation :: Maybe (Parser ViewTerm) -> Parser (Name, [ViewTerm])
+> computation ext = do nm <- identifier ; args <- many (pNoApp ext)
+>                      return (UN nm, args)
+
+> -- | Parse a string into a ViewTerm, without mucking about with parsec
+> -- or any extra parse rules.
+> parseTermString :: Monad m => String -> m ViewTerm
+> parseTermString str 
+>     = case parse (do t <- pTerm Nothing ; eof ; return t) "(input)" str of
+>           Left err -> fail (show err)
+>           Right tm -> return tm
+
+> -- | Parse a string into an Inductive, without mucking about with parsec
+> -- or any extra parse rules.
+> parseDataString :: Monad m => String -> m Inductive
+> parseDataString str 
+>     = case parse (do t <- pInductive Nothing ; eof ; return t) 
+>                   "(input)" str of
+>           Left err -> fail (show err)
+>           Right d -> return d
diff --git a/Ivor/Typecheck.lhs b/Ivor/Typecheck.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Typecheck.lhs
@@ -0,0 +1,599 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Typecheck(typecheck, tcClaim,
+>                       check, checkAndBind, checkAndBindPair,
+>                       convert,
+>                       checkConv, checkConvEnv, pToV, pToV2,
+>                       verify, Gamma) where
+
+> import Ivor.TTCore
+> import Ivor.Gadgets
+> import Ivor.Nobby
+> import Ivor.Unify
+> import Ivor.Constant
+
+> import Control.Monad.State
+> import Debug.Trace
+
+Conversion in the presence of staging is a bit more than simply syntactic
+equality on values, since it is possible values contain quoted code which
+code be run later. So we say {'x} =~ {'y] iff x =~ y. Otherwise it's 
+syntactic.
+
+> convert :: Gamma Name -> Indexed Name -> Indexed Name -> Bool
+> convert g x y = convertEnv [] g x y
+
+> convertEnv env g x y 
+>     = (convNormaliseEnv env g x) == (convNormaliseEnv env g y)
+>   -- conv (Stage (Quote x)) (Stage (Quote y)) = convertEnv env g x y
+>   -- need to actually reduce inside quotes to do conversion check
+
+ convert g x y = trace ((show (normalise g x)) ++ " & " ++ (show (normalise g y))) $ (normalise g x)==(normalise g y)
+
+> checkConv :: Monad m => Gamma Name -> Indexed Name -> Indexed Name -> 
+>              String -> m ()
+> checkConv g x y err = if convert g x y then return ()
+>	                 else fail err
+
+> checkConvEnv :: Monad m => Env Name -> Gamma Name -> 
+>                 Indexed Name -> Indexed Name -> 
+>              String -> m ()
+> checkConvEnv env g x y err = if convertEnv env g x y then return ()
+>                              else fail err
+
+
+*****
+SORT OUT TOP LEVEL TYPECHECKING FUNCTIONS
+DEFINE THE INTERFACE CLEARLY
+
+These are: check, checkAndBind, checkAndBindPair.
+
+All should work by generating constraints and solving them, differing only
+in when the constraints get solved.
+so....
+1. Generate constraints
+2. Unify, checking for conversion and creating a substitution
+3. Substitute into term and type
+*****
+
+Top level typechecking function - takes a context and a raw term,
+returning a pair of a term and its type
+
+> typecheck :: Monad m => Gamma Name -> Raw -> m (Indexed Name,Indexed Name)
+> typecheck gamma term = do t <- check gamma [] term Nothing
+>			    return t
+
+> typecheckAndBind :: Monad m => Gamma Name -> Raw -> 
+>                     m (Indexed Name,Indexed Name, Env Name)
+> typecheckAndBind gamma term = checkAndBind gamma [] term Nothing
+
+Check a term, and return well typed terms with explicit names (i.e. no
+de Bruijn indices)
+
+> tcClaim :: Monad m => Gamma Name -> Raw -> m (Indexed Name,Indexed Name)
+> tcClaim gamma term = do (Ind t, Ind v) <- check gamma [] term Nothing
+>			    {-trace (show t) $-}
+>                         return (Ind (makePs t), Ind (makePs v))
+
+Check takes a global context, a local context, the term to check and
+its expected type, if known, and returns a pair of a term and its
+type.
+
+> type CheckState = 
+>     (Level, -- Level number
+>      Bool, -- Inferring types of names (if true)
+>      Env Name, -- Extra bindings, if above is true
+>      -- conversion constraints; remember the environment at the time we tried
+>      [(Env Name, Indexed Name, Indexed Name)])
+
+> type Level = Int
+
+Finishes up type checking by making a substitution from all the conversion
+constraints and applying it to the term and type.
+
+> doConversion :: Monad m =>
+>                 Raw -> Gamma Name ->
+>                 [(Env Name, Indexed Name, Indexed Name)] ->
+>                 Indexed Name -> Indexed Name -> 
+>                m (Indexed Name, Indexed Name)
+> doConversion raw gam constraints (Ind tm) (Ind ty) =
+>     -- trace ("Finishing checking " ++ show tm) $ -- ++ " with " ++ show constraints) $ 
+>           -- Unify twice; first time collect the substitutions, second
+>           -- time do them. Because we don't know what order we can solve
+>           -- constraints in and they might depend on each other...
+>       do (subst, nms) <- mkSubst $ (map (\x -> (False,x)) constraints) ++
+>                                    (map (\x -> (True,x)) ((reverse constraints)++constraints))
+>          let tm' = papp subst tm
+>          let ty' = papp subst ty
+>          return {- $ trace (show nms ++ "\n" ++ show (tm',ty')) -} (Ind tm',Ind ty')
+
+>    where mkSubst [] = return (P, [])
+>          mkSubst ((ok, (env,Ind x,Ind y)):xs) 
+>             = do (s',nms) <- mkSubst xs
+>                  let x' = papp s' x
+>                  let (Ind y') = normalise gam (Ind (papp s' y))
+>                  uns <- case unifyenvErr ok gam env (Ind x') (Ind y') of
+>                         Success x' -> return x'
+>                         Failure err -> fail err
+
+{- trace ("XXX: " ++ err ++ show (x',y')) $ return [] -} fail $ err {- ++"\n" ++ show nms ++"\n" ++ show constraints -- $ -} ++ " Can't convert "++show x'++" and "++show y' ++ "\n" ++ show constraints ++ "\n" ++ show nms
+
+>                  extend s' nms uns
+
+>          extend phi nms [] = return (phi, nms)
+>          extend phi nms ((n,tm):uns) 
+>             = extend ((scomp $! (delta n tm)) $! phi) ((n,tm):nms) uns
+
+>          scomp :: Subst -> Subst -> Subst
+>          scomp s2 s1 tn = papp s2 (s1 tn)
+
+>          delta n ty n' | n == n' = ty
+>                        | otherwise = P n'
+
+> check :: Monad m => Gamma Name -> Env Name -> Raw -> Maybe (Indexed Name) -> 
+>          m (Indexed Name, Indexed Name)
+> check gam env tm mty = do
+>   ((tm', ty'), (_,_,_,convs)) <- lvlcheck 0 False 0 gam env tm mty
+>   tm'' <- doConversion tm gam convs tm' ty'
+>   return tm''
+
+> checkAndBind :: Monad m => Gamma Name -> Env Name -> Raw -> 
+>                 Maybe (Indexed Name) -> 
+>                 m (Indexed Name, Indexed Name, Env Name)
+> checkAndBind gam env tm mty = do
+>    ((v,t), (_,_,e,convs)) <- lvlcheck 0 True 0 gam env tm mty
+>    (v',ty') <- doConversion tm gam convs v t
+>    return (v',ty',e)
+
+
+Check two things together, with the same environment and variable inference,
+and with the same expected type.
+We need this for checking pattern clauses...
+
+> checkAndBindPair :: Monad m => Gamma Name -> Raw -> Raw -> 
+>                     m (Indexed Name, Indexed Name, 
+>                        Indexed Name, Indexed Name, Env Name)
+> checkAndBindPair gam tm1 tm2 = do
+>    ((v1,t1), (next, inf, e, bs)) <- lvlcheck 0 True 0 gam [] tm1 Nothing
+>    -- rename all the 'inferred' things to another generated name,
+>    -- so that they actually get properly checked on the rhs
+>    let realNames = mkNames next
+>    e' <- fixupB gam realNames e
+>    (v1', t1') <- fixupGam gam realNames (v1, t1)
+>    (v1'',t1'') <- doConversion tm1 gam bs v1 (normalise gam t1) 
+>    ((v2,t2), (_, _, e'', bs')) <- {- trace ("Checking " ++ show tm2 ++ " has type " ++ show t1') $ -} lvlcheck 0 inf next gam e' tm2 (Just t1')
+>    (v2',t2') <- doConversion tm2 gam bs' v2 (normalise gam t2) 
+>    return (v1',t1',v2',t2',e'')
+>  where mkNames 0 = []
+>        mkNames n
+>           = ([],Ind (P (MN ("INFER",n-1))), 
+>                 Ind (P (MN ("T",n-1)))):(mkNames (n-1))
+
+> lvlcheck :: Monad m => Level -> Bool -> Int -> 
+>             Gamma Name -> Env Name -> Raw -> 
+>             Maybe (Indexed Name) -> 
+>             m ((Indexed Name, Indexed Name), CheckState)
+> lvlcheck lvl infer next gamma env tm exp 
+>     = do runStateT (tcfixupTop env lvl tm exp) (next, infer, [], []) 
+>  where
+
+Do the typechecking, then unify all the inferred terms.
+
+>  tcfixupTop env lvl t exp = do
+>     tm@(_,tmty) <- tc env lvl t exp
+>     (next, infer, bindings, errs) <- get
+>     -- First, insert inferred values into the term
+>     tm'@(_,tmty) <- fixup errs tm
+>     -- Then check the resulting type matches the expected type.
+>     if infer then (case exp of
+>              Nothing -> return ()
+>              Just expty -> checkConvSt env gamma expty tmty 
+>                               $ "Expected type and inferred type do not match: " 
+>                               ++ show expty ++ " and " ++ show tmty)
+>       else return ()
+>     -- Then fill in any remained inferred values we got by knowing the
+>     -- expected type
+>     (next, infer, bindings, errs) <- get
+>     tm <- fixup errs tm
+>     bindings <- fixupB gamma errs bindings
+>     put (next, infer, bindings, errs)
+>     return tm'
+
+>  tcfixup env lvl t exp = do
+>     tm@(_,tmty) <- tc env lvl t exp
+>     -- case exp of
+>     --   Nothing -> return ()
+>     --   Just expt -> checkConvSt env gamma expt tmty "Type error"
+>     (next, infer, bindings, errs) <- get
+>     tm' <- fixup errs tm
+>     bindings <- fixupB gamma errs bindings
+>     put (next, infer, bindings, errs)
+>     return tm'
+
+tc has state threaded through -- state is a tuple of the next name to
+generate, the stage we're at, and a list of conversion errors (which
+will later be unified).  Needs an explicit type to help out ghc's
+typechecker...
+
+>  tc :: Monad m => Env Name -> Level -> Raw -> Maybe (Indexed Name) ->
+>                   StateT CheckState m (Indexed Name, Indexed Name)
+>  tc env lvl (Var n) exp = do
+>        (rv, rt) <- mkTT (lookupi n env 0) (glookup n gamma)
+>        case exp of
+>           Nothing -> return (rv,rt)
+>           Just expt -> do checkConvSt env gamma rt expt $ "Type error"
+>                           return (rv,rt)
+
+>    where mkTT (Just (i, B _ t)) _ = return (Ind (P n), Ind t)
+>          mkTT Nothing (Just ((Fun _ _),t)) = return (Ind (P n), t)
+>          mkTT Nothing (Just ((Partial _ _),t)) = return (Ind (P n), t)
+>          mkTT Nothing (Just ((PatternDef _),t)) = return (Ind (P n), t)
+>          mkTT Nothing (Just (Unreducible,t)) = return (Ind (P n), t)
+>          mkTT Nothing (Just (Undefined,t)) = return (Ind (P n), t)
+>          mkTT Nothing (Just ((ElimRule _),t)) = return (Ind (Elim n), t)
+>          mkTT Nothing (Just ((PrimOp _ _),t)) = return (Ind (P n), t)
+>          mkTT Nothing (Just ((DCon tag i),t)) = return (Ind (Con tag n i), t)
+>          mkTT Nothing (Just ((TCon i _),t)) = return (Ind (TyCon n i), t)
+>          mkTT Nothing Nothing = defaultResult
+
+>          lookupi x [] _ = Nothing
+>          lookupi x ((n,t):xs) i | x == n = Just (i,t)
+>          lookupi x (_:xs) i = lookupi x xs (i+1)
+
+>          defaultResult = do
+>              (next, infer, bindings, errs) <- get
+>              if infer
+>                 then case exp of
+>                        Nothing -> fail $ "No such name as " ++ show n
+>                        Just (Ind t) -> do put (next, infer, (n, B Pi t):bindings, errs)
+>                                           return (Ind (P n), Ind t)
+>                 else fail $ "No such name as " ++ show n
+
+>  tc env lvl (RApp f a) exp = do
+>     (Ind fv, Ind ft) <- tcfixup env lvl f Nothing
+>     let fnfng = normaliseEnv env (Gam []) (Ind ft)
+>     let fnf = normaliseEnv env gamma (Ind ft)
+>     (rv, rt) <-
+>       case (fnfng,fnf) of
+>        ((Ind (Bind _ (B Pi s) (Sc t))),_) -> do
+>          (Ind av,Ind at) <- tcfixup env lvl a (Just (Ind s))
+>          checkConvSt env gamma (Ind at) (Ind s) $ "Type error: " ++ show a ++ " : " ++ show at ++ ", expected type "++show s -- ++" "++show env
+>          let tt = (Bind (MN ("x",0)) (B (Let av) at) (Sc t))
+>          let tmty = (normaliseEnv env (Gam []) (Ind tt))
+>          return (Ind (App fv av), tmty)
+>        (_, (Ind (Bind _ (B Pi s) (Sc t)))) -> do
+>          (Ind av,Ind at) <- tcfixup env lvl a (Just (Ind s))
+>          checkConvSt env gamma (Ind at) (Ind s) $ "Type error: " ++ show a ++ " : " ++ show at ++ ", expected type "++show s -- ++" "++show env
+>          let tt = (Bind (MN ("x",0)) (B (Let av) at) (Sc t))
+>          let tt' = (normaliseEnv env gamma (Ind tt))
+>          return (Ind (App fv av), (normaliseEnv env gamma (Ind tt)))
+>        _ -> fail $ "Cannot apply a non function type " ++ show ft ++ " to " ++ show a
+>     return (rv,rt)
+>     case exp of
+>        Nothing -> return (rv,rt)
+>        Just expt -> do checkConvSt env gamma rt expt $ "Type error"
+>                        return (rv,rt)
+>  tc env lvl (RConst x) _ = tcConst x
+>  tc env lvl RStar _ = return (Ind Star, Ind Star)
+
+Pattern bindings are a special case since they may bind several names,
+and we don't convert names to de Bruijn indices
+
+>  tc env lvl (RBind n (B (Pattern p) ty) sc) exp = do
+>     (gb, env) <- checkpatt gamma env lvl n p ty
+>     let scexp = case exp of
+>          Nothing -> Nothing
+>          (Just (Ind (Bind sn sb (Sc st)))) -> Just $
+>             normaliseEnv ((sn,sb):env) gamma (Ind st)
+>     (Ind scv, Ind sct) <- tcfixup ((n,gb):env) lvl sc scexp
+>     discharge gamma n gb (Sc scv) (Sc sct)
+
+>  tc env lvl (RBind n b sc) exp = do
+>     gb <- checkbinder gamma env lvl n b
+>     let scexp = case exp of
+>          Nothing -> Nothing
+>          (Just (Ind (Bind sn sb (Sc st)))) -> Just $
+>             normaliseEnv ((sn,sb):env) gamma (Ind st)
+>          _ -> fail (show exp)
+>     (Ind scv, Ind sct) <- tcfixup ((n,gb):env) lvl sc scexp
+>     --discharge gamma n gb (Sc scv) (Sc sct)
+>     discharge gamma n gb (pToV n scv) (pToV n sct)
+>  tc env lvl l@(RLabel t comp) _ = do
+>     (Ind tv, Ind tt) <- tcfixup env lvl t Nothing
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>       (Ind Star) -> do compv <- checkComp env lvl comp
+>                        return (Ind (Label tv compv), Ind Star)
+>       _ -> fail $ "Type of label " ++ show l ++ " must be *"
+>  tc env lvl (RCall comp t) _ = do
+>     compv <- checkComp env lvl comp
+>     (Ind tv, Ind tt) <- tcfixup env lvl t Nothing
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>       (Ind (Label t comp)) -> return (Ind (Call compv tv), Ind t)
+>       _ -> fail $ "Type of call must be a label"
+>  tc env lvl (RReturn t) (Just exp) = do
+>     let expnf = normaliseEnv env gamma exp
+>     case expnf of
+>       (Ind (Label lt comp)) -> do
+>          (Ind tv, Ind tt) <- tcfixup env lvl t (Just (Ind lt))
+>          checkConvSt env gamma (Ind lt) (Ind tt) $ 
+>             "Type error: " ++ show tt ++", expected type " ++ show lt
+>          return (Ind (Return tv), Ind (Label tt comp))
+>       _ -> fail $ "return " ++ show t++ " should give a label, got " ++ show expnf
+>  tc env lvl (RReturn t) Nothing = fail $ "Need to know the type to return for "++show t
+>  tc env lvl (RStage s) exp = do
+>          (Ind sv, Ind st) <- tcStage env lvl s exp
+>          return (Ind sv, Ind st)
+>  tc env lvl RInfer (Just exp) = do 
+>                       (next, infer, bindings, errs) <- get
+>                       put (next+1, infer, bindings, errs)
+>                       return (Ind (P (MN ("INFER",next))), exp)
+>  tc env lvl RInfer Nothing = fail "Can't infer a term for placeholder"
+
+If we have a metavariable, we need to record the type of the expression which
+will solve it. It needs to take the environment as arguments, and return
+the expected type.
+
+>  tc env lvl (RMeta n) (Just exp) = do (next, infer, bindings, errs) <- get
+>                                       fail $ show (n, exp, bindings, env) ++ " -- Not implemented"
+>  tc env lvl (RMeta n) Nothing = fail $ "Don't know the expected type of " ++ show n
+
+>  tcStage env lvl (RQuote t) _ = do
+>     (Ind tv, Ind tt) <- tc env (lvl+1) t Nothing
+>     return (Ind (Stage (Quote tv)), Ind (Stage (Code tt)))
+>  tcStage env lvl (RCode t) _ = do
+>     (Ind tv, Ind tt) <- tc env lvl t Nothing
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>       (Ind Star) -> return (Ind (Stage (Code tv)), Ind Star)
+>       _ -> fail $ "Type of code " ++ show t ++ " must be *"
+>  tcStage env lvl (REval t) _ = do
+>     -- when (lvl/=0) $ fail $ "Can't eval at level " ++ show lvl
+>     (Ind tv, Ind tt) <- tc env lvl t Nothing
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>        (Ind (Stage (Code tcode))) -> 
+>            return (Ind (Stage (Eval tv tt)), Ind tcode)
+>        _ -> fail $ "Can't eval a non-quoted term (type " ++ show ttnf ++ ")"
+>  tcStage env lvl (REscape t) _ = do
+>     -- when (lvl==0) $ fail $ "Can't escape at level " ++ show lvl
+>     (Ind tv, Ind tt) <- tc env lvl t Nothing
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>        (Ind (Stage (Code tcode))) -> 
+>            return (Ind (Stage (Escape tv tt)), Ind tcode)
+>        _ -> fail "Can't escape a non-quoted term"
+
+>  checkComp env lvl (RComp n ts) = do
+>     tsc <- mapM (\ t -> tcfixup env lvl t Nothing) ts
+>     return (Comp n (map ( \ (Ind v, Ind t) -> v) tsc))
+
+Insert inferred values into the term
+
+>  fixup e tm = fixupGam gamma e tm
+
+>  tcConst :: (Monad m, Constant c) => c -> m (Indexed Name, Indexed Name)
+>  tcConst c = return (Ind (Const c), Ind (constType c))
+
+ tcConst Star = return (Ind (Const Star), Ind (Const Star)) --- *:* is a bit dodgy...
+
+  checkbinder :: Monad m => Gamma Name -> Env Name -> Level ->
+	          Name -> Binder Raw -> m (Binder (TT Name))
+
+-- FIXME: Should convert here rather than assert it must be *
+
+>  checkbinder gamma env lvl n (B Lambda t) = do
+>     (Ind tv,Ind tt) <- tcfixup env lvl t (Just (Ind Star))
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>       (Ind Star) -> return (B Lambda tv)
+>       (Ind (P (MN ("INFER",_)))) -> return (B Lambda tv)
+>       _ -> fail $ "The type of the binder " ++ show n ++ " must be *"
+>  checkbinder gamma env lvl n (B Pi t) = do
+>     (Ind tv,Ind tt) <- tcfixup env lvl t (Just (Ind Star))
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>       (Ind Star) -> return (B Pi tv)
+>       (Ind (P (MN ("INFER",_)))) -> return (B Pi tv)
+>       _ -> fail $ "The type of the binder " ++ show n ++ " must be *"
+
+>  checkbinder gamma env lvl n (B (Let v) RInfer) = do
+>     (Ind vv,Ind vt) <- tcfixup env lvl v Nothing
+>     return (B (Let vv) vt)
+
+>  checkbinder gamma env lvl n (B (Let v) t) = do
+>     (Ind tv,Ind tt) <- tcfixup env lvl t (Just (Ind Star))
+>     (Ind vv,Ind vt) <- tcfixup env lvl v (Just (Ind tv))
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     checkConvEnv env gamma (Ind vt) (Ind tv) $ 
+>        show vt ++ " and " ++ show tv ++ " are not convertible\n" ++ 
+>             dbg (normaliseEnv env gamma (Ind vt)) ++ "\n" ++
+>             dbg (normaliseEnv env gamma (Ind tv)) ++ "\n"
+>     case ttnf of
+>       (Ind Star) -> return (B (Let vv) tv)
+>       _ -> fail $ "The type of the binder " ++ show n ++ " must be *"
+>    where dbg (Ind t) = debugTT t
+
+>  checkbinder gamma env lvl n (B Hole t) = do
+>     (Ind tv,Ind tt) <- tcfixup env lvl t Nothing
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     case ttnf of
+>       (Ind Star) -> return (B Hole tv)
+>       _ -> fail $ "The type of the binder " ++ show n ++ " must be *"
+>  checkbinder gamma env lvl n (B (Guess v) t) = do
+>     (Ind tv,Ind tt) <- tcfixup env lvl t Nothing
+>     (Ind vv,Ind vt) <- tcfixup env lvl v Nothing
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     checkConvEnv env gamma (Ind vt) (Ind tv) $ 
+>        show vt ++ " and " ++ show tv ++ " are not convertible"
+>     case ttnf of
+>       (Ind Star) -> return (B (Guess vv) tv)
+>       _ -> fail $ "The type of the binder " ++ show n ++ " must be *"
+
+>  checkpatt gamma env lvl n RInfer t = do
+>     (Ind tv,Ind tt) <- tcfixup env lvl t Nothing
+>     return ((B MatchAny tv), env)
+>  checkpatt gamma env lvl n pat t = do
+>     (Ind tv,Ind tt) <- tcfixup env lvl t Nothing
+>     (next, infer, bindings, err) <- get
+>     put (next, True, bindings, err)
+>     (Ind patv,Ind patt) <- tcfixup (bindings++env) lvl pat Nothing
+>     (next, _ ,bindings, err) <- get
+>     put (next, infer, bindings, err)
+>     let ttnf = normaliseEnv env gamma (Ind tt)
+>     --checkConvEnv env gamma (Ind patt) (Ind tv) $ 
+>     --   show patt ++ " and " ++ show tv ++ " are not convertible"
+>     case ttnf of
+>       (Ind Star) -> return ((B (Pattern patv) tv), bindings++env)
+>       _ -> fail $ "The type of the binder " ++ show n ++ " must be *"
+
+Check a raw term representing a pattern. Return the pattern, and the 
+extended environment.
+
+-- > checkPatt :: Monad m => Gamma Name -> Env Name -> Maybe (Pattern Name) ->
+-- >              Raw -> Raw -> 
+-- >              m (Pattern Name, Env Name)
+-- > checkPatt gam env acc (Var n) ty = trace (show n ++ ": "++ show env) $ do
+-- >      (Ind tyc, _) <- check gam env ty (Just (Ind Star))
+-- >      (pat, t) <- mkVarPatt (lookupi n env 0) (glookup n gam) (Ind tyc)
+-- >      --checkConvEnv env gam (Ind tyc) (Ind t) $
+-- >      --   show ty ++ " and " ++ show t ++ " are not convertible"
+-- >      return (combinepats acc pat, (n, (B Pi tyc)):env)
+-- >   where
+-- >        mkVarPatt (Just (i, B _ t)) _ _ = return (PVar n, t)
+-- >        mkVarPatt Nothing (Just ((DCon tag i), (Ind t))) _
+-- >            = do tyname <- getTyName gam n
+-- >                 return (PCon tag n tyname [], t)
+-- >        mkVarPatt Nothing Nothing (Ind defty) = return (PVar n, defty)
+-- >        lookupi x [] _ = Nothing
+-- >        lookupi x ((n,t):xs) i | x == n = Just (i,t)
+-- >        lookupi x (_:xs) i = lookupi x xs (i+1)
+
+-- > checkPatt gam env acc (RApp f a) ty = do
+-- >      (Ind tyc, _) <- trace (show ty) $ check gam env ty (Just (Ind Star))
+-- >      let (RBind _ _ fscope) = ty
+-- >      let (Bind nm (B _ nmt) _) = tyc
+-- >      (fpat, fbindingsin) <- checkPatt gam env Nothing f ty
+-- >      let fbindings = ((nm,(B Pi nmt)):fbindingsin)
+-- >      (apat, abindings) <- checkPatt gam (fbindings++env) 
+-- >                                       (Just fpat) a fscope
+-- >      return (combinepats (Just fpat) apat, fbindings++abindings)
+
+--    where
+--         mkEnv = map (\ (n,Ind t) -> (n, B Pi t))
+
+-- > checkPatt gam env acc RInfer ty = return (combinepats acc PTerm, env)
+-- > checkPatt gam env _ _ _ = fail "Invalid pattern"
+
+> checkConvSt env g x y err = do (next, infer, bindings, err) <- get
+>                                put (next, infer, bindings, (env,x,y):err)
+>                                return ()
+
+> fixupGam gamma [] tm = return tm
+> fixupGam gamma ((env,x,y):xs) (Ind tm, Ind ty) = do 
+>      uns <- case unifyenv gamma env y x of
+>                 Success x' -> return x'
+>                 Failure err -> return [] -- fail err -- $ "Can't convert "++show x++" and "++show y ++ " ("++show err++")"
+>      let tm' = fixupNames gamma uns tm
+>      let ty' = fixupNames gamma uns ty
+>      fixupGam gamma xs (Ind tm', Ind ty')
+
+> fixupNames gam [] tm = tm
+> fixupNames gam ((x,ty):xs) tm = fixupNames gam xs $ substName x ty (Sc tm)
+
+> fixupB gam xs [] = return []
+> fixupB gam xs ((n, (B b t)):bs) = do
+>    bs' <- fixupB gam xs bs
+>    (Ind t', _) <- fixupGam gam xs (Ind t, Ind Star)
+>    return ((n,(B b t')):bs')
+
+> combinepats Nothing x = x
+> combinepats (Just (PVar n)) x = error "can't apply things to a variable"
+> combinepats (Just (PCon tag n ty args)) x = PCon tag n ty (args++[x])
+
+ discharge :: Monad m =>
+              Gamma Name -> Name -> Binder (TT Name) -> 
+	       (Scope (TT Name)) -> (Scope (TT Name)) ->
+	       m (Indexed Name, Indexed Name)
+
+> discharge gamma n (B Lambda t) scv sct = do
+>    let lt = Bind n (B Pi t) sct
+>    let lv = Bind n (B Lambda t) scv
+>    return (Ind lv,Ind lt)
+> discharge gamma n (B Pi t) scv (Sc sct) = do
+>    checkConvSt [] gamma (Ind Star) (Ind sct) $ 
+>       "The scope of a Pi binding must be a type"
+>    let lt = Star
+>    let lv = Bind n (B Pi t) scv
+>    return (Ind lv,Ind lt)
+> discharge gamma n (B (Let v) t) scv sct = do
+>    let lt = Bind n (B (Let v) t) sct
+>    let lv = Bind n (B (Let v) t) scv
+>    return (Ind lv,Ind lt)
+> discharge gamma n (B Hole t) scv (Sc sct) = do
+>    let lt = sct -- already checked sct and t are convertible
+>    let lv = Bind n (B Hole t) scv
+>    -- A hole can't appear in the type of its scope, however.
+>    checkNotHoley 0 sct
+>    return (Ind lv,Ind lt)
+> discharge gamma n (B (Guess v) t) scv (Sc sct) = do
+>    let lt = sct -- already checked sct and t are convertible
+>    let lv = Bind n (B (Guess v) t) scv
+>    -- A hole can't appear in the type of its scope, however.
+>    checkNotHoley 0 sct
+>    return (Ind lv,Ind lt)
+> discharge gamma n (B (Pattern v) t) scv (Sc sct) = do
+>    let lt = sct -- already checked sct and t are convertible
+>    let lv = Bind n (B (Pattern v) t) scv
+>    -- A hole can't appear in the type of its scope, however.
+>    checkNotHoley 0 sct
+>    return (Ind lv,Ind lt)
+> discharge gamma n (B MatchAny t) scv (Sc sct) = do
+>    let lt = sct
+>    let lv = Bind n (B MatchAny t) scv
+>    return (Ind lv,Ind lt)
+
+> checkNotHoley :: Monad m => Int -> TT n -> m ()
+> checkNotHoley i (V v) | v == i = fail "You can't put a hole where a hole don't belong."
+> checkNotHoley i (App f a) = do checkNotHoley i f
+>                                checkNotHoley i a
+> checkNotHoley i (Bind _ _ (Sc s)) = checkNotHoley (i+1) s
+> checkNotHoley i (Proj _ _ t) = checkNotHoley i t
+> checkNotHoley _ _ = return ()
+
+> pToV :: Eq n => n -> (TT n) -> (Scope (TT n))
+> pToV = pToV2 0
+
+> pToV2 v p (P n) | p==n = Sc (V v)
+>                 | otherwise = Sc (P n)
+> pToV2 v p (V w) = Sc (V w)
+> pToV2 v p (Con t n i) = Sc (Con t n i)
+> pToV2 v p (TyCon n i) = Sc (TyCon n i)
+> pToV2 v p (Elim n) = Sc (Elim n)
+> pToV2 v p (Bind n b (Sc sc)) = Sc (Bind n (fmap (getSc.(pToV2 v p)) b)
+>                                    (pToV2 (v+1) p sc))
+>				where getSc (Sc a) = a
+> pToV2 v p (App f a) = Sc $ App (getSc (pToV2 v p f))
+>                               (getSc (pToV2 v p a))
+>				where getSc (Sc a) = a
+> pToV2 v p (Label t (Comp n ts)) = Sc $ Label (getSc (pToV2 v p t))
+>                                         (Comp n (map (getSc.(pToV2 v p)) ts))
+> pToV2 v p (Call (Comp n ts) t) = Sc $ Call 
+>                                        (Comp n (map (getSc.(pToV2 v p)) ts))
+>                                        (getSc (pToV2 v p t))
+> pToV2 v p (Return t) = Sc $ Return (getSc (pToV2 v p t))
+> pToV2 v p (Proj n i t) = Sc $ Proj n i (getSc (pToV2 v p t))
+>				where getSc (Sc a) = a
+> pToV2 v p (Stage t) = Sc $ Stage (sLift (getSc.(pToV2 v p)) t)
+> pToV2 v p (Const x) = Sc (Const x)
+> pToV2 v p Star = Sc Star
+
+> checkR g t = (typecheck g t):: (Result (Indexed Name, Indexed Name)) 
+
+If we're paranoid - recheck a supposedly well-typed term. Might want to
+do this after finishing a proof.
+
+> verify :: Monad m => Gamma Name -> Indexed Name -> m ()
+> verify gam tm = do (_,_) <- typecheck gam (forget tm)
+>                    return ()
diff --git a/Ivor/Unify.lhs b/Ivor/Unify.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/Unify.lhs
@@ -0,0 +1,196 @@
+> {-# OPTIONS_GHC -fglasgow-exts #-}
+
+> module Ivor.Unify where
+
+> import Ivor.Nobby
+> import Ivor.TTCore
+
+> import Data.List
+
+> import Debug.Trace
+
+> type Unified = [(Name, TT Name)]
+
+> type Subst = Name -> TT Name
+
+Unify on named terms, but normalise using de Bruijn indices.
+(I hope this doesn't get too confusing...)
+
+> unify :: Monad m =>
+>          Gamma Name -> Indexed Name -> Indexed Name -> m Unified
+> unify gam x y = unifyenv gam [] (finalise x) (finalise y)
+
+> unifyenv :: Monad m =>
+>             Gamma Name -> Env Name ->
+>             Indexed Name -> Indexed Name -> m Unified
+> unifyenv = unifyenvErr False
+
+> unifyenvCollect :: Monad m =>
+>                    Gamma Name -> Env Name ->
+>                    Indexed Name -> Indexed Name -> m Unified
+> unifyenvCollect = unifyenvErr True
+
+> unifyenvErr :: Monad m =>
+>                Bool -> -- Ignore errors
+>                Gamma Name -> Env Name ->
+>                Indexed Name -> Indexed Name -> m Unified
+> -- For the sake of readability of the results, first attempt to unify
+> -- without reducing global names, and reduce if that doesn't work.
+> -- (Actually, I'm not sure this helps. Probably just slows things down.)
+> unifyenvErr i gam env x y = {- trace (show (x,y) ++ "\n" ++
+>                                    show (p (normalise (gam' gam) x)) ++ "\n" ++
+>                                    show (p (normalise (gam' gam) x))) $-}
+>     {-case unifynferr i env (p (normalise emptyGam x))
+>                      (p (normalise emptyGam y)) of
+>           (Just x) -> return x
+>           Nothing -> -} unifynferr i env (p (normalise (gam' gam) x))
+>                                       (p (normalise (gam' gam) y))
+>    where p (Ind t) = Ind (makePs t)
+>          gam' g = concatGam g (envToGamHACK env)
+
+Make the local environment something that Nobby knows about. Very hacky...
+
+> envToGamHACK [] = emptyGam
+> envToGamHACK ((n,B (Let v) ty):xs)
+>     = insertGam n (G (Fun [] (Ind v)) (Ind ty) defplicit) (envToGamHACK xs)
+> envToGamHACK (_:xs) = envToGamHACK xs
+
+> unifynf :: Monad m =>
+>            Env Name -> Indexed Name -> Indexed Name -> m Unified
+> unifynf = unifynferr True
+
+Collect names which do unify, and ignore errors
+
+> unifyCollect :: Monad m =>
+>            Env Name -> Indexed Name -> Indexed Name -> m Unified
+> unifyCollect = unifynferr False
+
+> sentinel = [(MN ("HACK!!",0), P (MN ("HACK!!",0)))]
+
+> unifynferr :: Monad m =>
+>               Bool -> -- Ignore errors
+>               Env Name -> Indexed Name -> Indexed Name -> m Unified
+> unifynferr ignore env (Ind x) (Ind y)
+>                = do acc <- un env env x y []
+>                     if ignore then return () else checkAcc acc
+>                     return (acc \\ sentinel)
+>    where un envl envr (P x) (P y) acc
+>              | x == y = return acc
+>              | loc x envl == loc y envr && loc x envl >=0
+>                  = return acc
+>              -- | ignore = trace (show (x,y)) $ return sentinel -- broken, forget acc, but move on
+>          un envl envr (P x) t acc | hole envl x = return ((x,t):acc)
+>          un envl envr t (P x) acc | hole envl x = return ((x,t):acc)
+>          un envl envr (Bind x b@(B Hole ty) (Sc sc)) t acc
+>             = un ((x,b):envl) envr sc t acc
+>          un envl envr (Bind x b (Sc sc)) (Bind x' b' (Sc sc')) acc =
+>              do acc' <- unb envl envr b b' acc
+>                 un ((x,b):envl) ((x',b'):envr) sc sc' acc'
+>                 -- combine bu scu
+>          -- if unifying the functions fails because the names are different,
+>          -- unifying the arguments is going to be a waste of time bec
+>          un envl envr x@(App f s) y@(App f' s') acc
+>              | funify (getFun f) (getFun f') = -- trace ("OK " ++ show (f,f',getFun f, getFun f')) $
+>                   do acc' <- un envl envr f f' acc
+>                      un envl envr s s' acc'
+>              | otherwise = if ignore then return acc
+>                               else fail $ "Can't unify "++show x++" and "++show y -- ++ " 5"
+>             where funify (P x) (P y)
+>                       | x==y = True
+>                       | otherwise = hole envl x || hole envl y
+>                   funify (Con _ _ _) (P x) = hole envr x
+>                   funify (P x) (Con _ _ _) = hole envl x
+>                   funify (TyCon _ _) (P x) = hole envr x
+>                   funify (P x) (TyCon _ _) = hole envl x
+>                   funify _ _ = True -- unify normally
+>          un envl envr (Proj _ i t) (Proj _ i' t') acc
+>             | i == i' = un envl envr t t' acc
+>          un envl envr (Label t c) (Label t' c') acc = un envl envr t t' acc
+>          un envl envr (Call c t) (Call c' t') acc = un envl envr t t' acc
+>          un envl envr (Return t) (Return t') acc = un envl envr t t' acc
+>          un envl envr (Stage x) (Stage y) acc = unst envl envr x y acc
+>          un envl envr x y acc
+>                     | x == y || ignore = return acc
+>                     | otherwise = fail $ "Can't unify " ++ show x ++
+>                                          " and " ++ show y -- ++ " 1"
+>          unb envl envr (B b ty) (B b' ty') acc =
+>              do acc' <- unbb envl envr b b' acc
+>                 un envl envr ty ty' acc'
+>          unbb envl envr Lambda Lambda acc = return acc
+>          unbb envl envr Pi Pi acc = return acc
+>          unbb envl envr Hole Hole acc = return acc
+>          unbb envl envr (Let v) (Let v') acc = un envl envr v v' acc
+>          unbb envl envr (Guess v) (Guess v') acc = un envl envr v v' acc
+>          unbb envl envr x y acc
+>                   = if ignore then return acc
+>                        else fail $ "Can't unify "++show x++" and "++show y -- ++ " 2"
+
+>          unst envl envr (Quote x) (Quote y) acc = un envl envr x y acc
+>          unst envl envr (Code x) (Code y) acc = un envl envr x y acc
+>          unst envl envr (Eval x _) (Eval y _) acc = un envl envr x y acc
+>          unst envl envr (Escape x _) (Escape y _) acc = un envl envr x y acc
+>          unst envl envr x y acc =
+>                   if ignore then return acc
+>                       else fail $ "Can't unify " ++ show (Stage x) ++
+>                                " and " ++ show (Stage y) -- ++ " 3"
+
+>          hole env x | (Just (B Hole ty)) <- lookup x env = True
+>                     | otherwise = isInferred x
+>          isInferred (MN ("INFER",_)) = True -- OK, a bit of a nasty hack.
+>          isInferred _ = False
+
+>          checkAcc [] = return ()
+>          checkAcc ((n,tm):xs)
+>              | (Just tm') <- lookup n xs
+>                  = if (ueq tm tm')  -- Take account of names! == no good.
+>                       then checkAcc xs
+>                       else fail $ "Can't unify " ++ show tm ++
+>                                   " and " ++ show tm' -- ++ " 4"
+>              | otherwise = checkAcc xs
+
+>          loc x xs = loc' 0 x xs
+>          loc' i x ((n,_):xs) | x == n = i
+>                              | otherwise = loc' (i+1) x xs
+>          loc' i x [] = -1
+
+An equality test which takes account of names which should be equal.
+TMP HACK! ;)
+
+>          ueq :: TT Name -> TT Name -> Bool
+>          ueq x y = case unifyenv (Gam []) [] (Ind x) (Ind y) of
+>                   Just _ -> True
+>                   _ -> False
+
+Grr!
+
+> ueq :: Gamma Name -> TT Name -> TT Name -> Bool
+> ueq gam x y = case unifyenv gam [] (Ind x) (Ind y) of
+>                   Just _ -> True
+>                   _ -> False
+
+
+> substNames :: [(Name,TT Name)] -> TT Name -> TT Name
+> substNames [] tm = tm
+> substNames ((n,t):xs) tm = substNames xs (substName n t (Sc tm))
+
+Look for a specific term (unifying with a subterm)
+and replace it.
+
+> unifySubstTerm :: Gamma Name -> TT Name -> TT Name ->
+>                   Scope (TT Name) -> TT Name
+> unifySubstTerm gam p tm (Sc x) = p' x where
+>     p' x | ueq gam x p = tm
+>     p' (App f' a) = (App (p' f') (p' a))
+>     p' (Bind n b (Sc sc)) = (Bind n (fmap p' b) (Sc (p' sc)))
+>      --   | n == p = (Bind n (fmap p' b) (Sc sc))
+>      --   | otherwise
+>     p' (Proj n i x) = Proj n i (p' x)
+>     p' (Label t (Comp n cs)) = Label (p' t) (Comp n (map p' cs))
+>     p' (Call (Comp n cs) t) = Call (Comp n (map p' cs)) (p' t)
+>     p' (Return t) = Return (p' t)
+>     p' (Stage (Quote t)) = Stage (Quote (p' t))
+>     p' (Stage (Code t)) = Stage (Code (p' t))
+>     p' (Stage (Eval t ty)) = Stage (Eval (p' t) (p' ty))
+>     p' (Stage (Escape t ty)) = Stage (Escape (p' t) (p' ty))
+>     p' x = x
+
diff --git a/Ivor/ViewTerm.lhs b/Ivor/ViewTerm.lhs
new file mode 100644
--- /dev/null
+++ b/Ivor/ViewTerm.lhs
@@ -0,0 +1,259 @@
+> {-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances #-}
+
+> -- | 
+> -- Module      : Ivor.ViewTerm
+> -- Copyright   : Edwin Brady
+> -- Licence     : BSD-style (see LICENSE in the distribution)
+> --
+> -- Maintainer  : eb@dcs.st-and.ac.uk
+> -- Stability   : experimental
+> -- Portability : non-portable
+> -- 
+> -- Exported view of terms and inductive data structures; imported 
+> -- implicitly by "Ivor.TT".
+
+> module Ivor.ViewTerm(-- * Variable names
+>                        Name,name,displayName,NameType(..),mkVar,
+>                        -- * Terms
+>                        Term(..), ViewTerm(..), apply,
+>                        view, viewType, ViewConst, typeof, 
+>                        freeIn, namesIn, occursIn, getApp,
+>                        -- * Inductive types
+>                        Inductive(..)) 
+>    where
+
+> import Ivor.TTCore as TTCore
+> import Ivor.Gadgets
+> import Ivor.State
+> import Ivor.Typecheck
+
+> import Data.Typeable
+> import Data.List
+
+> name :: String -> Name
+> name = UN
+
+> displayName :: Name -> String
+> displayName (UN x) = x
+> displayName (MN (x,i)) = "_" ++ x ++ "_" ++ show i
+
+> -- | Abstract type representing a TT term and its type.
+> newtype Term = Term (Indexed Name, Indexed Name)
+
+> instance Show Term where
+>     show (Term (Ind tm,Ind ty)) 
+>         = show (makePs tm) ++ " : " ++ show (makePs ty) ++ "\n"
+
+> -- | Categories for names; typechecked terms will know what each variable
+> -- is for. 
+> data NameType = Bound | Free | DataCon | TypeCon | ElimOp 
+>               | Unknown -- ^ Use for sending to typechecker.
+
+> -- | Construct a term representing a variable
+> mkVar :: String -- ^ Variable name
+>          -> ViewTerm
+> mkVar nm = Name Unknown (name nm)
+
+> data ViewTerm 
+>     = Name { nametype :: NameType, var :: Name }
+>     | App { fun :: ViewTerm, arg :: ViewTerm }
+>     | Lambda { var :: Name, vartype :: ViewTerm, scope :: ViewTerm }
+>     | Forall { var :: Name, vartype :: ViewTerm, scope :: ViewTerm }
+>     | Let { var :: Name, vartype :: ViewTerm,
+>             varval :: ViewTerm, scope :: ViewTerm }
+>     | Label { fname :: Name, fargs :: [ViewTerm], labeltype :: ViewTerm }
+>     | Call { fname :: Name, fargs :: [ViewTerm], callterm :: ViewTerm }
+>     | Return { returnterm :: ViewTerm }
+>     | forall c. Constant c => Constant c
+>     | Star
+>     | Quote { quotedterm :: ViewTerm } -- ^ Staging annotation
+>     | Code { codetype :: ViewTerm } -- ^ Staging annotation
+>     | Eval { evalterm :: ViewTerm } -- ^ Staging annotation
+>     | Escape { escapedterm :: ViewTerm } -- ^ Staging annotation
+>     | Placeholder
+>     | Metavar { var :: Name }
+
+> instance Eq ViewTerm where
+>     (==) (Name _ x) (Name _ y) = x == y
+>     (==) (Ivor.ViewTerm.App f a) (Ivor.ViewTerm.App f' a') = f == f' && a == a'
+>     (==) (Ivor.ViewTerm.Lambda n ty sc) (Ivor.ViewTerm.Lambda n' ty' sc') = n==n' && ty==ty' && sc==sc'
+>     (==) (Forall n ty sc) (Forall n' ty' sc') = n==n' && ty==ty' && sc==sc'
+>     (==) (Ivor.ViewTerm.Let n v ty sc) (Ivor.ViewTerm.Let n' v' ty' sc') = n==n' && v==v' 
+>                                                 && ty==ty' && sc==sc'
+>     (==) (Ivor.ViewTerm.Label _ _ ty) (Ivor.ViewTerm.Label _ _ ty') = ty == ty'
+>     (==) (Ivor.ViewTerm.Call _ _ t) (Ivor.ViewTerm.Call _ _ t') = t == t'
+>     (==) (Ivor.ViewTerm.Return t) (Ivor.ViewTerm.Return t') = t==t'
+>     (==) Ivor.ViewTerm.Star Ivor.ViewTerm.Star = True
+>     (==) Placeholder Placeholder = True
+>     (==) (Metavar x) (Metavar y) = x == y
+>     (==) (Constant x) (Constant y) = case cast x of
+>                                        Just x' -> x' == y
+>                                        Nothing -> False
+>     (==) (Ivor.ViewTerm.Quote t) (Ivor.ViewTerm.Quote t') = t==t'
+>     (==) (Ivor.ViewTerm.Code t) (Ivor.ViewTerm.Code t') = t==t'
+>     (==) (Ivor.ViewTerm.Eval t) (Ivor.ViewTerm.Eval t') = t==t'
+>     (==) (Ivor.ViewTerm.Escape t) (Ivor.ViewTerm.Escape t') = t==t'
+>     (==) _ _ = False
+
+> -- | Haskell types which can be used as constants
+> class (Typeable c, Show c, Eq c) => ViewConst c where
+>     typeof :: c -> Name
+
+> instance ViewConst c => Constant c where
+>     constType x = TyCon (typeof x) 0
+
+> -- | Make an application of a function to several arguments
+> apply :: ViewTerm -> [ViewTerm] -> ViewTerm
+> apply f [] = f
+> apply f (x:xs) = Ivor.ViewTerm.apply (Ivor.ViewTerm.App f x) xs
+
+> data Inductive
+>     = Inductive { typecon :: Name, 
+>                   parameters :: [(Name,ViewTerm)],
+>                   indices :: [(Name,ViewTerm)],
+>                   contype :: ViewTerm,
+>                   constructors :: [(Name,ViewTerm)] }
+
+> instance Forget ViewTerm Raw where
+>     forget (Ivor.ViewTerm.App f a) = RApp (forget f) (forget a)
+>     forget (Ivor.ViewTerm.Lambda v ty sc) = RBind v 
+>                                            (B TTCore.Lambda (forget ty)) 
+>                                            (forget sc)
+>     forget (Forall v ty sc) = RBind v (B Pi (forget ty)) (forget sc)
+>     forget (Ivor.ViewTerm.Let v ty val sc) = RBind v (B (TTCore.Let (forget val))
+>                                                  (forget ty)) (forget sc)
+>     forget (Ivor.ViewTerm.Label n args ty) 
+>         = RLabel (forget ty) (RComp n (map forget args))
+>     forget (Ivor.ViewTerm.Call n args ty) 
+>         = RCall (RComp n (map forget args)) (forget ty)
+>     forget (Ivor.ViewTerm.Return ty) = RReturn (forget ty)
+>     forget (Constant c) = RConst c
+>     forget (Ivor.ViewTerm.Star) = TTCore.RStar
+>     forget Placeholder = RInfer
+>     forget (Metavar x) = RMeta x
+>     forget (Ivor.ViewTerm.Quote t) = RStage (RQuote (forget t))
+>     forget (Ivor.ViewTerm.Code t) = RStage (RCode (forget t))
+>     forget (Ivor.ViewTerm.Eval t) = RStage (REval (forget t))
+>     forget (Ivor.ViewTerm.Escape t) = RStage (REscape (forget t))
+>     forget x = Var (var x)
+
+> instance Show ViewTerm where
+>     show = show.forget
+
+> instance Forget Inductive String where
+>     forget (Inductive n ps inds cty cons) =
+>         show n++" "++showbind ps++" : "++showbind inds++show (forget cty)
+>                  ++ " = "++
+>                showcons cons
+>       where showbind [] = ""
+>             showbind ((x,ty):xs) = "("++show x++":"++show (forget ty)++")"
+>                                    ++ showbind xs
+>             showcons [] = ""
+>             showcons [x] = showcon x
+>             showcons (x:xs) = showcon x ++ " | " ++ showcons xs
+>             showcon (x,ty) = show x ++ " : " ++ show (forget ty)
+
+> instance Show Inductive where
+>     show = forget
+
+> -- |Get a pattern matchable representation of a term.
+> view :: Term -> ViewTerm
+> view (Term (Ind tm,_)) = vt (Ind (makePs tm))
+
+> -- |Get a pattern matchable representation of a term's type.
+> viewType :: Term -> ViewTerm
+> viewType (Term (_,Ind ty)) = vt (Ind (makePs ty))
+
+> vt :: Indexed Name -> ViewTerm
+> vt (Ind tm) = vtaux [] tm where
+>     vtaux ctxt (P n) = Name Free n
+>     vtaux ctxt (V i) = Name Bound (traceIndex ctxt i "ViewTerm vt")
+>     vtaux ctxt (Con _ n _) = Name DataCon n
+>     vtaux ctxt (TyCon n _) = Name TypeCon n
+>     vtaux ctxt (Elim n) = Name ElimOp n
+>     vtaux ctxt (TTCore.App f a) = Ivor.ViewTerm.App (vtaux ctxt f) (vtaux ctxt a)
+>     vtaux ctxt (Bind n (B TTCore.Lambda ty) (Sc sc)) =
+>         Ivor.ViewTerm.Lambda n (vtaux ctxt ty) (vtaux (n:ctxt) sc)
+>     vtaux ctxt (Bind n (B Pi ty) (Sc sc)) =
+>         Forall n (vtaux ctxt ty) (vtaux (n:ctxt) sc)
+>     vtaux ctxt (Bind n (B (TTCore.Let val) ty) (Sc sc)) =
+>         Ivor.ViewTerm.Let n (vtaux ctxt ty) (vtaux ctxt val) (vtaux (n:ctxt) sc)
+>     vtaux ctxt (Const c) = Constant c
+>     vtaux ctxt TTCore.Star = Ivor.ViewTerm.Star
+>     vtaux ctxt (TTCore.Label ty (Comp n ts)) =
+>         Ivor.ViewTerm.Label n (fmap (vtaux ctxt) ts) (vtaux ctxt ty)
+>     vtaux ctxt (TTCore.Call (Comp n ts) ty) =
+>         Ivor.ViewTerm.Call n (fmap (vtaux ctxt) ts) (vtaux ctxt ty)
+>     vtaux ctxt (TTCore.Return ty) = Ivor.ViewTerm.Return (vtaux ctxt ty)
+>     vtaux ctxt (Stage (TTCore.Quote tm)) 
+>         = Ivor.ViewTerm.Quote (vtaux ctxt tm)
+>     vtaux ctxt (Stage (TTCore.Code tm)) 
+>         = Ivor.ViewTerm.Code (vtaux ctxt tm)
+>     vtaux ctxt (Stage (TTCore.Eval tm _)) 
+>         = Ivor.ViewTerm.Eval (vtaux ctxt tm)
+>     vtaux ctxt (Stage (TTCore.Escape tm _)) 
+>         = Ivor.ViewTerm.Escape (vtaux ctxt tm)
+>     vtaux _ _ = error "Can't happen vtaux"
+
+> -- | Return whether the name occurs free in the term.
+> freeIn :: Name -> ViewTerm -> Bool
+> freeIn n t = fi n t where
+>    fi n (Ivor.ViewTerm.Name _ x) | x == n = True
+>                    | otherwise = False
+>    fi n (Ivor.ViewTerm.App f a) = fi n f || fi n a
+>    fi n (Ivor.ViewTerm.Lambda x ty sc) 
+>        | x == n = False
+>        | otherwise = fi n ty || fi n sc
+>    fi n (Forall x ty sc) | x == n = False
+>                          | otherwise = fi n ty || fi n sc
+>    fi n (Ivor.ViewTerm.Let x v ty sc) 
+>        | x == n = False
+>        | otherwise = fi n v || fi n ty || fi n sc
+>    fi n (Ivor.ViewTerm.Label _ _ t) = fi n t
+>    fi n (Ivor.ViewTerm.Call _ _ t) = fi n t
+>    fi n (Ivor.ViewTerm.Return t) = fi n t
+>    fi n (Ivor.ViewTerm.Quote t) = fi n t
+>    fi n (Ivor.ViewTerm.Code t) = fi n t
+>    fi n (Ivor.ViewTerm.Eval t) = fi n t
+>    fi n (Ivor.ViewTerm.Escape t) = fi n t
+>    fi n _ = False
+
+> -- | Return the names occurring free in a term
+> namesIn :: ViewTerm -> [Name]
+> namesIn t = nub $ fi [] t where
+>    fi ns (Ivor.ViewTerm.Name _ x) | x `elem` ns = []
+>                                   | otherwise = [x]
+>    fi ns (Ivor.ViewTerm.App f a) = fi ns f ++ fi ns a
+>    fi ns (Ivor.ViewTerm.Lambda x ty sc) = fi (x:ns) sc
+>    fi ns (Forall x ty sc) = fi (x:ns) sc
+>    fi ns (Ivor.ViewTerm.Let x v ty sc) = fi (x:ns) sc
+>    fi ns (Ivor.ViewTerm.Label _ _ t) = fi ns t
+>    fi ns (Ivor.ViewTerm.Call _ _ t) = fi ns t
+>    fi ns (Ivor.ViewTerm.Return t) = fi ns t
+>    fi ns (Ivor.ViewTerm.Quote t) = fi ns t
+>    fi ns (Ivor.ViewTerm.Code t) = fi ns t
+>    fi ns (Ivor.ViewTerm.Eval t) = fi ns t
+>    fi ns (Ivor.ViewTerm.Escape t) = fi ns t
+>    fi ns _ = []
+
+> -- | Return whether a subterm occurs in a (first order) term.
+> occursIn :: ViewTerm -> ViewTerm -> Bool
+> occursIn n t = fi n t where
+>    fi n (Ivor.ViewTerm.App f a) = fi n f || fi n a
+>    fi n (Ivor.ViewTerm.Lambda x ty sc) = False -- higher order
+>    fi n (Forall x ty sc) = False
+>    fi n (Ivor.ViewTerm.Let x v ty sc)  = False
+>    fi n (Ivor.ViewTerm.Label _ _ t) = fi n t
+>    fi n (Ivor.ViewTerm.Call _ _ t) = fi n t
+>    fi n (Ivor.ViewTerm.Return t) = fi n t
+>    fi n (Ivor.ViewTerm.Code t) = fi n t
+>    fi n (Ivor.ViewTerm.Eval t) = fi n t
+>    fi n (Ivor.ViewTerm.Escape t) = fi n t
+>    fi n x = n == x
+
+> -- | Get the function from an application. If no application, returns the
+> -- entire term.
+> getApp :: ViewTerm -> ViewTerm
+> getApp (Ivor.ViewTerm.App f a) = getApp f
+> getApp x = x
+
diff --git a/Jones/Main.lhs b/Jones/Main.lhs
new file mode 100644
--- /dev/null
+++ b/Jones/Main.lhs
@@ -0,0 +1,13 @@
+> module Main where
+
+Jones the Steam.
+Simple program for starting up an interactive shell with Ivor library.
+
+> import Ivor.TT
+> import Ivor.Shell
+
+> main :: IO ()
+> main = do let shell = addModulePath (newShell emptyContext) 
+>                          (prefix ++ "/lib/ivor")
+>           ctxt <- runShell "> " shell
+>           putStrLn "Finished"
diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,32 @@
+Copyright (c) 2006 Edwin Brady
+    School of Computer Science, University of St Andrews
+All rights reserved.
+
+This code is derived from software written by Edwin Brady
+(eb@dcs.st-and.ac.uk).
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. None of the names of the copyright holders may be used to endorse
+   or promote products derived from this software without specific
+   prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*** End of disclaimer. ***
diff --git a/Setup.lhs b/Setup.lhs
new file mode 100644
--- /dev/null
+++ b/Setup.lhs
@@ -0,0 +1,4 @@
+> import Distribution.Simple
+
+> main = defaultMain
+
diff --git a/TODO b/TODO
new file mode 100644
--- /dev/null
+++ b/TODO
@@ -0,0 +1,48 @@
+Short term things to do:
+
+* Allow holes in pattern matching definitions
+* Need an easier way of updating a context with an input file
+   (currently have to create a shell, then load, then create a new
+   shell if you want to modify the context further)
+* Improve error messages!
+* Recursive functions shouldn't reduce at type level.
+* Either better than Monad m? Define an Error type.
+* Fix naming bug --- terms of form t1 -> t2 automatically give t1 the
+  name X, which can clash. Particularly a problem in data type declarations.
+* Current naive proof state representation is far too slow. Come up
+  with something better.
+* Keep track of level in proof state.
+* Keep track of binding level in context, and check at point of use.
+* Allow dump of global context to disk, for fast reloading.
+* Syntax for equality.
+* Elimination with a motive.
+* Unit tests - at least check nat.tt, vect.tt, JM equality,
+  primitives, simple staging, compiler.
+* More readable high level language for function definition. Really
+  just has to use tactic engine to translate simple case expressions into
+  D-case calls.
+* Separate API into several files for clarity.
+* Allow call <fn args> _ in raw terms; i.e. allow the typechecker to
+  spot recursive calls, rather than needing a tactic to do so.
+* Finish compiler by:
+  - Finding a method of exporting primitive types
+  - Implement compilation of D-Case
+
+Things which could be done to the library, in no particular order
+(other than the order I thought of them in...):
+
+* A higher level dependently typed language might be useful (e.g. like
+  Coq's language). If not useful, at least fun :).
+* Namespace management.
+* Some useful error messages from the Parsec parsers would be nice.
+* Proper type universes, of some form.
+* Generate DRec and DNoConfusion as well as DElim/DCase.
+* Build in Sigma types? (At least a nicer syntax?)
+* Infix operators, especially = would be nice.
+
+Tactics:
+
+* Injectivity.
+* Discriminate.
+* Inversion.
+
diff --git a/docs/HCAR.tex b/docs/HCAR.tex
new file mode 100644
--- /dev/null
+++ b/docs/HCAR.tex
@@ -0,0 +1,56 @@
+\documentclass{article}
+
+\usepackage{hcar}
+\usepackage{url}
+
+\begin{document}
+
+\begin{hcarentry}{Ivor}
+\report{Edwin Brady}
+\status{Active Development}
+\makeheader
+
+Ivor is a tactic-based theorem proving engine with a Haskell API. Unlike
+other systems such as Coq and Agda, the tactic engine is primarily
+intended to be used by programs, rather than a human operator. To this
+end, the API provides a collection of primitive tactics and
+combinators for building new tactics. This allows easy construction of
+domain specific tactics, while keeping the core type theory small and
+independently checkable.
+
+The primary aim of the library is to support research into generative
+programming and resource bounded computation in Hume
+(\url{http://www.hume-lang.org/}). In this setting, we have developed a
+dependently typed framework for representing program execution cost,
+and used the Ivor library to implement domain specific tactics for
+constructing programs within this framework. However the library is
+more widely applicable, some potential uses being:
+
+\begin{itemize}
+\item A core language for a richly typed functional language.
+\item The underlying implementation for a theorem prover (see first order
+  logic theorem prover example at 
+  \url{http://www.dcs.st-and.ac.uk/~eb/Ivor}).
+\item An implementation framework for a domain specific language requiring
+  strong correctness properties.
+\end{itemize}
+
+Ivor features a dependent type theory similar to Luo's ECC with
+definitions, with additional (experimental) multi-stage programming
+support. Optionally, it can be extended with heterogenous equality,
+primitive types and operations, new parser rules and user defined
+tactics. By default, all programs in the type theory terminate, but in
+the spirit of flexibilty, the library can be configured to allow
+general recursion.
+
+The library is in active development, although at an early
+stage. Future plans include development of more basic tactics (for
+basic properties such as injectivity and disjointness of constructors,
+and elimination with a motive), a compiler (with optimisations) and a
+larger collection of standard definitions.
+
+\FurtherReading
+  \url{http://www.dcs.st-and.ac.uk/~eb/Ivor}
+\end{hcarentry}
+
+\end{document}
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,22 @@
+all: humett.pdf
+
+SOURCES = humett.tex dtp.bib macros.ltx library.ltx local.ltx \
+          intro.tex tt.tex interface.tex shell.tex tactics.tex \
+          combinators.tex conclusion.tex
+
+humett.pdf: $(SOURCES)
+	pdflatex humett
+	-bibtex humett
+	-pdflatex humett
+
+humett.ps: humett.dvi
+	dvips -o humett.ps humett
+
+humett.dvi: $(SOURCES)
+	-latex humett
+	-bibtex humett
+	-latex humett
+	-latex humett
+
+clean:
+	rm -f *.dvi *.pdf *.aux *.bbl *.blg *.log
diff --git a/docs/combinators.tex b/docs/combinators.tex
new file mode 100644
--- /dev/null
+++ b/docs/combinators.tex
@@ -0,0 +1,1 @@
+\section{Building New Tactics}
diff --git a/docs/conclusion.tex b/docs/conclusion.tex
new file mode 100644
--- /dev/null
+++ b/docs/conclusion.tex
@@ -0,0 +1,1 @@
+\section{Conclusion}
diff --git a/docs/dtp.bib b/docs/dtp.bib
new file mode 100644
--- /dev/null
+++ b/docs/dtp.bib
@@ -0,0 +1,114 @@
+@phdthesis{ brady-thesis,
+    author = {Edwin Brady},
+    title = {Practical Implementation of a Dependently Typed Functional Programming Language},
+    year = 2005,
+    school = {University of Durham}
+}
+
+@article{view-left,
+   journal = {Journal of Functional Programming},
+   number = {1},
+   volume = {14},
+   title = {The View From The Left},
+   year = {2004},
+   author = {Conor McBride and James McKinna},
+   pages = {69--111}
+}
+
+@misc{epigram-afp,
+    author = {Conor McBride},
+    title = {Epigram: Practical Programming with Dependent Types},
+    year = {2004},
+    howpublished = {Lecture Notes, International Summer School on Advanced Functional Programming}
+}
+
+@misc{coq-manual,
+   howpublished = {\verb+http://coq.inria.fr/+},
+   title = {The {Coq} Proof Assistant --- Reference Manual},
+   year = {2004},
+   author = {{Coq Development Team}}
+}
+
+@inproceedings{extraction-coq,
+   title = {A New Extraction for {Coq}},
+   year = {2002},
+   booktitle = {Types for proofs and programs},
+   editor = {Herman Geuvers and Freek Wiedijk},
+   publisher = {Springer},
+   author = {Pierre Letouzey},
+   series = {LNCS}
+}
+
+@techreport{lego-manual,
+   title = {\textsc{Lego} Proof Development System: User's Manual},
+   year = {1992},
+   institution = {Department of Computer Science, University of Edinburgh},
+   author = {Zhaohui Luo and Robert Pollack}
+}
+
+@inproceedings{cayenne,
+    author = "Lennart Augustsson",
+    title = "Cayenne - a Language with Dependent Types",
+    booktitle = "International Conference on Functional Programming",
+    pages = "239--250",
+    year = "1998",
+    url = "citeseer.nj.nec.com/augustsson98cayenne.html" 
+}
+
+@book{luo94,
+   title = {Computation and Reasoning -- A Type Theory for Computer Science},
+   year = {1994},
+   publisher = {OUP},
+   author = {Zhaohui Luo},
+   series = {International Series of Monographs on Computer Science}
+}
+
+@phdthesis{goguen-thesis,
+   school = {University of Edinburgh},
+   title = {A Typed Operational Semantics for Type Theory},
+   year = {1994},
+   author = {Healfdene Goguen}
+}
+
+@phdthesis{mcbride-thesis,
+   month = {May},
+   school = {University of Edinburgh},
+   title = {Dependently Typed Functional Programs and their         proofs},
+   year = {2000},
+   author = {Conor McBride}
+}
+
+@misc{mckinnabrady-phase,
+   title = {Phase Distinctions in the Compilation of {Epigram}},
+   year = 2005,
+   author = {James McKinna and Edwin Brady},
+   note = {Draft}
+}
+
+@article{pugh-omega,
+   title =  "The {Omega} {Test}: a fast and practical integer programming algorithm for dependence analysis", 
+   author = "William Pugh", 
+   journal = "Communication of the ACM", 
+   year = 1992, 
+   pages = {102--114}
+}
+
+
+@Article{RegionTypes,
+  refkey =       "C1753",
+  title =        "Region-Based Memory Management",
+  author =       "M. Tofte and J.-P. Talpin",
+  pages =        "109--176",
+  journal =      "Information and Computation",
+  month =        "1~" # feb,
+  year =         "1997",
+  volume =       "132",
+  number =       "2"
+}
+
+@phdthesis{ pedro-thesis,
+    author = {Pedro Vasconcelos},
+    title = {Space Cost Modelling for Concurrent Resource Sensitive Systems},
+    year = 2006,
+    school = {University of St Andrews}
+}
diff --git a/docs/hcar.sty b/docs/hcar.sty
new file mode 100644
--- /dev/null
+++ b/docs/hcar.sty
@@ -0,0 +1,182 @@
+\ProvidesPackage{hcar}
+
+\newif\ifhcarfinal
+\hcarfinalfalse
+\DeclareOption{final}{\hcarfinaltrue}
+\ProcessOptions
+
+\RequirePackage{keyval}
+\RequirePackage{color}
+\RequirePackage{array}
+
+\ifhcarfinal
+  \RequirePackage[T1]{fontenc}
+  \RequirePackage{lmodern}
+  \RequirePackage{tabularx}
+  \RequirePackage{booktabs}
+  \RequirePackage{framed}
+  \RequirePackage[obeyspaces,T1]{url}
+  \RequirePackage
+    [bookmarks=true,colorlinks=true,
+     urlcolor=urlcolor,
+     linkcolor=linkcolor,
+     breaklinks=true,
+     pdftitle={Haskell Communities and Activities Report}]%
+    {hyperref}
+\else
+  \RequirePackage[obeyspaces]{url}
+\fi
+\urlstyle{sf}
+
+\definecolor{urlcolor}{rgb}{0.1,0.3,0}
+\definecolor{linkcolor}{rgb}{0.3,0,0}
+\definecolor{shadecolor}{rgb}{0.9,0.95,1}%{0.98,1.0,0.95}
+\definecolor{framecolor}{gray}{0.9}
+\definecolor{oldgray}{gray}{0.7}
+
+\newcommand{\FurtherReading}{\subsubsection*{Further reading}}
+\newcommand{\FuturePlans}{\subsubsection*{Future plans}}
+\newcommand{\Separate}{\smallskip\noindent}
+\newcommand{\FinalNote}{\smallskip\noindent}
+
+\newcommand{\urlpart}{\begingroup\urlstyle{sf}\Url}
+\newcommand{\email}[1]{\href{mailto:\EMailRepl{#1}{ at }}{$\langle$\urlpart{#1}$\rangle$}}
+\newcommand{\cref}[1]{($\rightarrow\,$\ref{#1})}
+
+\ifhcarfinal
+  \let\hcarshaded=\shaded
+  \let\endhcarshaded=\endshaded
+\else
+  \newsavebox{\shadedbox}
+  \newlength{\shadedboxwidth}
+  \def\hcarshaded
+    {\begingroup
+     \setlength{\shadedboxwidth}{\linewidth}%
+     \addtolength{\shadedboxwidth}{-2\fboxsep}%
+     \begin{lrbox}{\shadedbox}%
+     \begin{minipage}{\shadedboxwidth}\ignorespaces}
+  \def\endhcarshaded
+    {\end{minipage}%
+     \end{lrbox}%
+     \noindent
+     \colorbox{shadecolor}{\usebox{\shadedbox}}%
+     \endgroup}
+\fi
+
+\ifhcarfinal
+  \newenvironment{hcartabularx}
+    {\tabularx{\linewidth}{l>{\raggedleft}X}}
+    {\endtabularx}
+\else
+  \newenvironment{hcartabularx}
+    {\begin{tabular}{@{}m{.3\linewidth}@{}>{\raggedleft}p{.7\linewidth}@{}}}
+    {\end{tabular}}
+\fi
+
+\ifhcarfinal
+  \let\hcartoprule=\toprule
+  \let\hcarbottomrule=\bottomrule
+\else
+  \let\hcartoprule=\hline
+  \let\hcarbottomrule=\hline
+\fi
+
+\define@key{hcarentry}{chapter}[]{\let\level\chapter}
+\define@key{hcarentry}{section}[]{\let\level\section}
+\define@key{hcarentry}{subsection}[]{\let\level\subsection}
+\define@key{hcarentry}{subsubsection}[]{\let\level\subsubsection}
+\define@key{hcarentry}{level}{\let\level=#1}
+%\define@key{hcarentry}{label}{\def\entrylabel{\label{#1}}}
+\define@key{hcarentry}{new}[]%
+  {\let\startnew=\hcarshaded\let\stopnew=\endhcarshaded
+   \def\startupdated{\let\orig@addv\addvspace\let\addvspace\@gobble}%
+   \def\stopupdated{\let\addvspace\orig@addv}}
+\define@key{hcarentry}{old}[]{\def\normalcolor{\color{oldgray}}\color{oldgray}}%
+\define@key{hcarentry}{updated}[]%
+  {\def\startupdated
+    {\leavevmode\let\orig@addv\addvspace\let\addvspace\@gobble\hcarshaded}%
+   \def\stopupdated{\endhcarshaded\let\addvspace\orig@addv}}
+
+\def\@makeheadererror{\PackageError{hcar}{hcarentry without header}{}}
+
+\newenvironment{hcarentry}[2][]%
+{\let\level\subsection
+ \let\startupdated=\empty\let\stopupdated=\empty
+ \let\startnew=\empty\let\stopnew=\empty
+%\let\entrylabel=\empty
+ \global\let\@makeheaderwarning\@makeheadererror
+ \setkeys{hcarentry}{#1}%
+ \startnew\startupdated
+ \level{#2}%
+ % test:
+ \global\let\@currentlabel\@currentlabel
+%\stopupdated
+ \let\report@\empty
+ \let\groupleaders@\empty
+ \let\members@\empty
+ \let\contributors@\empty
+ \let\participants@\empty
+ \let\developers@\empty
+ \let\maintainer@\empty
+ \let\status@\empty
+ \let\release@\empty
+ \let\portability@\empty
+ \let\entry@\empty}%
+{\stopnew\@makeheaderwarning}%
+
+\renewcommand{\labelitemi}{$\circ$}
+\settowidth{\leftmargini}{\labelitemi}
+\addtolength{\leftmargini}{\labelsep}
+
+\newcommand*\MakeKey[2]%
+  {\expandafter\def\csname #1\endcsname##1%
+     {\expandafter\def\csname #1@\endcsname{\Key@{#2}{##1}}\ignorespaces}}
+\MakeKey{report}{Report by:}
+\MakeKey{status}{Status:}
+\MakeKey{groupleaders}{Group leaders:}
+\MakeKey{members}{Members:}
+\MakeKey{contributors}{Contributors:}
+\MakeKey{participants}{Participants:}
+\MakeKey{developers}{Developers:}
+\MakeKey{maintainer}{Maintainer:}
+\MakeKey{release}{Current release:}
+\MakeKey{portability}{Portability:}
+\MakeKey{entry}{Entry:}
+
+\newcommand\Key@[2]{#1 & #2\tabularnewline}
+
+\newcommand\makeheader
+{\smallskip
+ \begingroup
+ \sffamily
+ \small
+ \noindent
+ \let\ohrule\hrule
+ \def\hrule{\color{framecolor}\ohrule}%
+ \begin{hcartabularx}
+ \hline
+ \report@
+ \groupleaders@
+ \members@
+ \participants@
+ \developers@
+ \contributors@
+ \maintainer@
+ \status@
+ \release@
+ \portability@
+ \hcarbottomrule
+ \end{hcartabularx}
+ \endgroup
+ \stopupdated
+ \global\let\@makeheaderwarning\empty
+ \@afterindentfalse
+ \@xsect\smallskipamount}
+
+% columns/linebreaks, interchanged
+\newcommand\NCi{&\let\NX\NCii}%
+\newcommand\NCii{&\let\NX\NL}%
+\newcommand\NL{\\\let\NX\NCi}%
+\let\NX\NCi
+\newcommand\hcareditor[1]{&#1 (ed.)&\\}
+\newcommand\hcarauthor[1]{#1\NX}%
diff --git a/docs/humett.tex b/docs/humett.tex
new file mode 100644
--- /dev/null
+++ b/docs/humett.tex
@@ -0,0 +1,39 @@
+\documentclass{article}
+
+\input{macros.ltx}
+\input{library.ltx}
+\input{local.ltx}
+
+\NatPackage
+
+\begin{document}
+
+\title{\prover{} --- A Type Theory Based Theorem Proving Library}
+\author{Edwin Brady}
+
+\maketitle
+
+% Introduction
+\input{intro.tex}
+
+% The type theory
+\input{tt.tex}
+
+% The interface
+\input{interface.tex}
+
+% The shell
+\input{shell.tex}
+
+% Primitive tactics
+\input{tactics.tex}
+
+% Making new tactics; combinators
+\input{combinators.tex}
+
+\input{conclusion}
+
+\bibliographystyle{alpha}
+\bibliography{dtp}
+
+\end{document}
diff --git a/docs/interface.tex b/docs/interface.tex
new file mode 100644
--- /dev/null
+++ b/docs/interface.tex
@@ -0,0 +1,1 @@
+\section{The API}
diff --git a/docs/intro.tex b/docs/intro.tex
new file mode 100644
--- /dev/null
+++ b/docs/intro.tex
@@ -0,0 +1,1 @@
+\section{Introduction}
diff --git a/docs/library.ltx b/docs/library.ltx
new file mode 100644
--- /dev/null
+++ b/docs/library.ltx
@@ -0,0 +1,325 @@
+%%%%%%%%%%%%%%% library file for datatypes etc.
+
+%%% Identifiers
+
+\newcommand{\va}{\VV{a}}
+\newcommand{\vb}{\VV{b}}
+\newcommand{\vc}{\VV{c}}
+\newcommand{\vd}{\VV{d}}
+\newcommand{\ve}{\VV{e}}
+\newcommand{\vf}{\VV{f}}
+\newcommand{\vg}{\VV{g}}
+\newcommand{\vh}{\VV{h}}
+\newcommand{\vi}{\VV{i}}
+\newcommand{\vj}{\VV{j}}
+\newcommand{\vk}{\VV{k}}
+\newcommand{\vl}{\VV{l}}
+\newcommand{\vm}{\VV{m}}
+\newcommand{\vn}{\VV{n}}
+\newcommand{\vo}{\VV{o}}
+\newcommand{\vp}{\VV{p}}
+\newcommand{\vq}{\VV{q}}
+\newcommand{\vr}{\VV{r}}
+\newcommand{\vs}{\VV{s}}
+\newcommand{\vt}{\VV{t}}
+\newcommand{\vu}{\VV{u}}
+\newcommand{\vv}{\VV{v}}
+\newcommand{\vw}{\VV{w}}
+\newcommand{\vx}{\VV{x}}
+\newcommand{\vy}{\VV{y}}
+\newcommand{\vz}{\VV{z}}
+\newcommand{\vA}{\VV{A}}
+\newcommand{\vB}{\VV{B}}
+\newcommand{\vC}{\VV{C}}
+\newcommand{\vD}{\VV{D}}
+\newcommand{\vE}{\VV{E}}
+\newcommand{\vF}{\VV{F}}
+\newcommand{\vG}{\VV{G}}
+\newcommand{\vH}{\VV{H}}
+\newcommand{\vI}{\VV{I}}
+\newcommand{\vJ}{\VV{J}}
+\newcommand{\vK}{\VV{K}}
+\newcommand{\vL}{\VV{L}}
+\newcommand{\vM}{\VV{M}}
+\newcommand{\vN}{\VV{N}}
+\newcommand{\vO}{\VV{O}}
+\newcommand{\vP}{\VV{P}}
+\newcommand{\vQ}{\VV{Q}}
+\newcommand{\vR}{\VV{R}}
+\newcommand{\vS}{\VV{S}}
+\newcommand{\vT}{\VV{T}}
+\newcommand{\vU}{\VV{U}}
+\newcommand{\vV}{\VV{V}}
+\newcommand{\vW}{\VV{W}}
+\newcommand{\vX}{\VV{X}}
+\newcommand{\vY}{\VV{Y}}
+\newcommand{\vZ}{\VV{Z}}
+\newcommand{\vas}{\VV{as}}
+\newcommand{\vbs}{\VV{bs}}
+\newcommand{\vcs}{\VV{cs}}
+\newcommand{\vds}{\VV{ds}}
+\newcommand{\ves}{\VV{es}}
+\newcommand{\vfs}{\VV{fs}}
+\newcommand{\vgs}{\VV{gs}}
+\newcommand{\vhs}{\VV{hs}}
+\newcommand{\vis}{\VV{is}}
+\newcommand{\vjs}{\VV{js}}
+\newcommand{\vks}{\VV{ks}}
+\newcommand{\vls}{\VV{ls}}
+\newcommand{\vms}{\VV{ms}}
+\newcommand{\vns}{\VV{ns}}
+\newcommand{\vos}{\VV{os}}
+\newcommand{\vps}{\VV{ps}}
+\newcommand{\vqs}{\VV{qs}}
+\newcommand{\vrs}{\VV{rs}}
+%\newcommand{\vss}{\VV{ss}}
+\newcommand{\vts}{\VV{ts}}
+\newcommand{\vus}{\VV{us}}
+\newcommand{\vvs}{\VV{vs}}
+\newcommand{\vws}{\VV{ws}}
+\newcommand{\vxs}{\VV{xs}}
+\newcommand{\vys}{\VV{ys}}
+\newcommand{\vzs}{\VV{zs}}
+
+%%% Telescope Identifiers
+
+\newcommand{\ta}{\vec{\VV{a}}}
+\newcommand{\tb}{\vec{\VV{b}}}
+\newcommand{\tc}{\vec{\VV{c}}}
+\newcommand{\td}{\vec{\VV{d}}}
+\newcommand{\te}{\vec{\VV{e}}}
+\newcommand{\tf}{\vec{\VV{f}}}
+\newcommand{\tg}{\vec{\VV{g}}}
+%\newcommand{\th}{\vec{\VV{h}}}
+\newcommand{\ti}{\vec{\VV{i}}}
+\newcommand{\tj}{\vec{\VV{j}}}
+\newcommand{\tk}{\vec{\VV{k}}}
+\newcommand{\tl}{\vec{\VV{l}}}
+\newcommand{\tm}{\vec{\VV{m}}}
+\newcommand{\tn}{\vec{\VV{n}}}
+%\newcommand{\to}{\vec{\VV{o}}}
+\newcommand{\tp}{\vec{\VV{p}}}
+\newcommand{\tq}{\vec{\VV{q}}}
+\newcommand{\tr}{\vec{\VV{r}}}
+\newcommand{\tts}{\vec{\VV{s}}}
+\newcommand{\ttt}{\vec{\VV{t}}}
+\newcommand{\tu}{\vec{\VV{u}}}
+%\newcommand{\tv}{\vec{\VV{v}}}
+\newcommand{\tw}{\vec{\VV{w}}}
+\newcommand{\tx}{\vec{\VV{x}}}
+\newcommand{\ty}{\vec{\VV{y}}}
+\newcommand{\tz}{\vec{\VV{z}}}
+\newcommand{\tA}{\vec{\VV{A}}}
+\newcommand{\tB}{\vec{\VV{B}}}
+\newcommand{\tC}{\vec{\VV{C}}}
+\newcommand{\tD}{\vec{\VV{D}}}
+\newcommand{\tE}{\vec{\VV{E}}}
+\newcommand{\tF}{\vec{\VV{F}}}
+\newcommand{\tG}{\vec{\VV{G}}}
+\newcommand{\tH}{\vec{\VV{H}}}
+\newcommand{\tI}{\vec{\VV{I}}}
+\newcommand{\tJ}{\vec{\VV{J}}}
+\newcommand{\tK}{\vec{\VV{K}}}
+\newcommand{\tL}{\vec{\VV{L}}}
+\newcommand{\tM}{\vec{\VV{M}}}
+\newcommand{\tN}{\vec{\VV{N}}}
+\newcommand{\tO}{\vec{\VV{O}}}
+\newcommand{\tP}{\vec{\VV{P}}}
+\newcommand{\tQ}{\vec{\VV{Q}}}
+\newcommand{\tR}{\vec{\VV{R}}}
+\newcommand{\tS}{\vec{\VV{S}}}
+\newcommand{\tT}{\vec{\VV{T}}}
+\newcommand{\tU}{\vec{\VV{U}}}
+\newcommand{\tV}{\vec{\VV{V}}}
+\newcommand{\tW}{\vec{\VV{W}}}
+\newcommand{\tX}{\vec{\VV{X}}}
+\newcommand{\tY}{\vec{\VV{Y}}}
+\newcommand{\tZ}{\vec{\VV{Z}}}
+
+
+
+%%% Nat
+
+\newcommand{\NatPackage}{
+  \newcommand{\Nat}{\TC{\mathbb{N}}}
+  \newcommand{\Z}{\DC{0}}
+  \newcommand{\suc}{\DC{s}}
+  \newcommand{\NatDecl}{
+    \Data \hg
+    \Axiom{\Nat\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\Z\Hab\Nat} \hg
+    \Rule{\vn\Hab\Nat}
+         {\suc\:\vn\Hab\Nat}
+}}
+
+%%% Bool
+
+\newcommand{\BoolPackage}{
+  \newcommand{\Bool}{\TC{Bool}}
+  \newcommand{\true}{\DC{true}}
+  \newcommand{\false}{\DC{false}}
+  \newcommand{\BoolDecl}{
+    \Data \hg
+    \Axiom{\Bool\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\true\Hab\Bool} \hg
+    \Axiom{\false\Hab\Bool}
+}}
+
+%%% So
+
+\newcommand{\SoPackage}{
+  \newcommand{\So}{\TC{So}}
+  \newcommand{\oh}{\DC{oh}}
+  \newcommand{\SoDecl}{
+    \Data \hg
+    \Rule{\vb\Hab\Bool}
+         {\So\:\vb\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\oh\Hab\So\:\true}
+}}
+
+%%% Unit
+
+\newcommand{\UnitPackage}{
+  \newcommand{\Unit}{\TC{Unit}}
+  \newcommand{\void}{\DC{void}}
+  \newcommand{\UnitDecl}{
+    \Data \hg
+    \Axiom{\Unit\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\void\Hab\Unit}
+}}
+
+%%% Maybe
+
+\newcommand{\MaybePackage}{
+  \newcommand{\Maybe}{\TC{Maybe}}
+  \newcommand{\yes}{\DC{yes}}
+  \newcommand{\no}{\DC{no}}
+  \newcommand{\MaybeDecl}{
+    \Data \hg
+    \Rule{\vA\Hab\Type}
+         {\Maybe\:\vA\Hab\Type} \hg
+    \Where \hg
+    \Rule{\va \Hab \vA}
+         {\yes\:\va\Hab\Maybe\:\vA} \hg
+    \Axiom{\no\Hab\Maybe\:\vA}
+}}
+
+%%% Cross
+
+\newcommand{\pr}[2]{(#1\DC{,}#2)}  %grrrr
+\newcommand{\CrossPackage}{
+  \newcommand{\Cross}{\times}
+  \newcommand{\CrossDecl}{
+    \Data \hg
+    \Rule{\vA,\vB\Hab\Type}
+         {\vA\Cross\vB\Hab\Type} \hg
+    \Where \hg
+    \Rule{\va \Hab \vA \hg \vb\Hab\vB}
+         {\pr{\va}{\vb}\Hab\vA\Cross\vB}
+}}
+
+%%% Fin
+
+\newcommand{\FinPackage}{
+  \newcommand{\Fin}{\TC{Fin}}
+  \newcommand{\fz}{\DC{f0}}
+  \newcommand{\fs}{\DC{fs}}
+  \newcommand{\FinDecl}{
+    \AR{
+    \Data \hg
+    \Rule{\vn\Hab\Nat}
+         {\Fin\:\vn\Hab\Type} \hg \\
+    \Where \hg
+    \begin{array}[t]{c}
+    \Axiom{\fz\Hab\Fin\:(\suc\:\vn)} \hg
+    \Rule{\vi\Hab\Fin\:\vn}
+         {\fs\:\vi\Hab\Fin\:(\suc\:\vn)}
+    \end{array}
+    }
+}}
+
+%%% Vect
+
+\newcommand{\VectPackage}{
+  \newcommand{\Vect}{\TC{Vect}}
+  \newcommand{\vnil}{\varepsilon}
+  \newcommand{\vcons}{\,\dcolon\,}
+  \newcommand{\vsnoc}{\,\dcolon\,}
+  \newcommand{\VectConsDecl}{
+    \Data \hg
+    \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
+         {\Vect\:\vA\:\vn\Hab\Type} \hg
+    \Where \hg \begin{array}[t]{c}
+    \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
+    \Rule{\vx\Hab\vA \hg \vxs\Hab \Vect\:\vA\:\vn }
+         {\vx\vcons\vxs\Hab\Vect\:\vA\:(\suc\vn)}
+    \end{array}
+}
+  \newcommand{\VectSnocDecl}{
+    \Data \hg
+    \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
+         {\Vect\:\vA\:\vn\Hab\Type} \hg
+    \Where \hg \begin{array}[t]{c}
+    \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
+    \Rule{\vxs\Hab \Vect\:\vA\:\vn \hg \vx\Hab\vA}
+         {\vxs\vsnoc\vx\Hab\Vect\:\vA\:(\suc\vn)}
+    \end{array}
+}
+}
+
+%%% Compare
+
+%Data Compare : (x:nat)(y:nat)Type
+%  = lt : (x:nat)(y:nat)(Compare x (plus (S y) x))
+%  | eq : (x:nat)(Compare x x)
+%  | gt : (x:nat)(y:nat)(Compare (plus (S x) y) y);
+
+
+\newcommand{\ComparePackage}{
+  \newcommand{\Compare}{\TC{Compare}}
+  \newcommand{\ltComp}{\DC{lt}}
+  \newcommand{\eqComp}{\DC{eq}}
+  \newcommand{\gtComp}{\DC{gt}}
+  \newcommand{\CompareDecl}{
+    \Data \hg
+    \Rule{\vm\Hab\Nat\hg\vn\Hab\Nat}
+         {\Compare\:\vm\:\vn\Hab\Type} \\
+    \Where \hg\begin{array}[t]{c}
+    \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
+         {\ltComp_{\vx}\:\vy\Hab\Compare\:\vx\:(\FN{plus}\:\vx\:(\suc\:\vy))} \\
+    \Rule{\vx\Hab\Nat}
+         {\eqComp_{\vx}\Hab\Compare\:\vx\:\vx}\\
+    \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
+         {\gtComp_{\vy}\:\vx\Hab\Compare\:(\FN{plus}\:\vy\:(\suc\:\vx))\:\vy} \\
+    \end{array}	 
+  }
+
+%Data CompareM : Type
+%  = ltM : (ydiff:nat)CompareM
+%  | eqM : CompareM
+%  | gtM : (xdiff:nat)CompareM;
+
+  \newcommand{\CompareM}{\TC{Compare^-}}
+  \newcommand{\ltCompM}{\DC{lt^-}}
+  \newcommand{\eqCompM}{\DC{eq^-}}
+  \newcommand{\gtCompM}{\DC{gt^-}}
+  \newcommand{\CompareMDecl}{
+
+     \Data \hg
+     \Axiom{\CompareM\Hab\Type} \\
+     \Where \hg\begin{array}[t]{c}
+     \Rule{\vy\Hab\Nat}
+          {\ltCompM\:\vy\Hab\CompareM} \\
+     \Axiom{\eqCompM\Hab\CompareM}\\
+     \Rule{\vx\Hab\Nat}
+          {\gtCompM\:\vx\Hab\CompareM} \\
+     \end{array}	
+  }
+  \newcommand{\CompareRec}{\FN{CompareRec}}
+  \newcommand{\CompareRecM}{\FN{CompareRec^-}}
+
+}
diff --git a/docs/local.ltx b/docs/local.ltx
new file mode 100644
--- /dev/null
+++ b/docs/local.ltx
@@ -0,0 +1,1 @@
+\newcommand{\prover}{\textsc{HumeTT}}
diff --git a/docs/macros.ltx b/docs/macros.ltx
new file mode 100644
--- /dev/null
+++ b/docs/macros.ltx
@@ -0,0 +1,950 @@
+%\usepackage{amstex}
+\usepackage{amssymb}
+\usepackage{latexsym}
+\usepackage{eepic}
+
+
+%%%%%%%%% INFERENCE RULES
+
+\newlength{\rulevgap}
+\setlength{\rulevgap}{0.05in}
+\newlength{\ruleheight}
+\newlength{\ruledepth}
+\newsavebox{\rulebox}
+\newlength{\GapLength}
+\newcommand{\gap}[1]{\settowidth{\GapLength}{#1} \hspace*{\GapLength}}
+\newcommand{\dotstep}[2]{\begin{tabular}[b]{@{}c@{}}
+                         #1\\$\vdots$\\#2
+                         \end{tabular}}
+\newlength{\fracwid}
+\newcommand{\dotfrac}[2]{\settowidth{\fracwid}{$\frac{#1}{#2}$}
+                         \addtolength{\fracwid}{0.1in}
+                         \begin{tabular}[b]{@{}c@{}}
+                         $#1$\\
+                         \parbox[c][0.02in][t]{\fracwid}{\dotfill} \\
+                         $#2$\\
+                         \end{tabular}}
+\newcommand{\Rule}[2]{\savebox{\rulebox}[\width][b]                         %
+                              {\( \frac{\raisebox{0in} {\( #1 \)}}       %
+                                       {\raisebox{-0.03in}{\( #2 \)}} \)}   %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\Case}[2]{\savebox{\rulebox}[\width][b]                         %
+                              {\( \dotfrac{\raisebox{0in} {\( #1 \)}}       %
+                                       {\raisebox{-0.03in}{\( #2 \)}} \)}   %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\Axiom}[1]{\savebox{\rulebox}[\width][b]                        %
+                               {$\frac{}{\raisebox{-0.03in}{$#1$}}$}        %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\RuleSide}[3]{\gap{$#2$} \hspace*{0.1in}               %
+                            \Rule{#1}{#3}                          %
+                          \hspace*{0.1in}$#2$}
+\newcommand{\AxiomSide}[2]{\gap{$#1$} \hspace*{0.1in}              %
+                             \Axiom{#2}                            %
+                           \hspace*{0.1in}$#1$}
+\newcommand{\RULE}[1]{\textbf{#1}}
+\newcommand{\hg}{\hspace{0.2in}}
+
+\newcommand{\ProofState}
+                      [2]{\parbox{10cm}{\AR{\hg\AR{#1}\\\Axiom{\hg#2\hg}}}}
+
+%%%%%%%%%%%% TRISTUFF
+
+\newcommand{\btr}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+\blacken\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\end{picture}
+}
+
+\newcommand{\btl}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+\blacken\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\end{picture}
+}
+
+\newcommand{\wtr}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+%\blacken\path(57,192)(57,12)(12,102)
+%	(57,192)(57,192)
+\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\end{picture}
+}
+
+\newcommand{\wtl}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+%\blacken\path(12,192)(12,12)(57,102)
+%	(12,192)(12,192)
+\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\end{picture}
+}
+
+
+
+%%%%%%%%%%%% FONTS
+
+\newcommand{\TC}[1]{\mathsf{#1}}
+\newcommand{\DC}[1]{\mathsf{#1}}
+\newcommand{\VV}[1]{\mathit{#1}}
+\newcommand{\FN}[1]{\mathbf{#1}}
+\newcommand{\HFN}[1]{\mathtt{#1}}
+\newcommand{\RW}[1]{\underline{\textrm{#1}}}
+\newcommand{\MO}[1]{\mbox{\textsc{#1}}}
+
+\newcommand{\HF}[1]{\mathtt{#1}}
+
+\newcommand{\MV}[1]{\nhole\mathit{#1}}
+\newcommand{\Lang}[1]{\mathsf{#1}}
+\newcommand{\Name}[1]{\mathit{#1}}
+
+\newcommand{\demph}[1]{\textbf{#1}}
+\newcommand{\remph}[1]{\emph{#1}}
+
+%%%% Keywords for meta operations
+\newcommand{\IF}{\;\RW{if}\;\;}
+\newcommand{\THEN}{\RW{then}}
+\newcommand{\ELSE}{\RW{else}}
+\newcommand{\AND}{\RW{and}}
+\newcommand{\Otherwise}{\RW{otherwise}}
+\newcommand{\Do}{\RW{do}}
+\newcommand{\Return}{\RW{return}}
+
+\newcommand{\CASE}{\RW{case}}
+\newcommand{\LET}{\RW{let}}
+\newcommand{\IN}{\RW{in}}
+\newcommand{\of}{\RW{of}}
+
+\newcommand{\CLASS}{\mathtt{class}}
+\newcommand{\INSTANCE}{\mathtt{instance}}
+
+%%%%%%%%%%%% GROUPING
+
+\newcommand{\G}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-10)
+\end{picture}
+}
+
+\newcommand{\E}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-2)(4,-2)
+\end{picture}
+}
+
+%\newcommand{\C}{
+%\setlength{\unitlength}{1pt}
+%\begin{picture}(4,10)(0,0)
+%\path(4,8)(2,8)(2,-2)(4,-2)
+%\end{picture}
+%}
+
+\newcommand{\M}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-2)(6,-2)
+\end{picture}
+}
+
+\newcommand{\F}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(4,8)(2,8)(2,-6)
+\end{picture}
+}
+
+\newcommand{\K}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(0,8)(4,8)
+\end{picture}
+}
+
+\newcommand{\J}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(0,-2)(4,-2)
+\end{picture}
+}
+
+\newcommand{\W}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\end{picture}
+}
+
+
+
+%%%%%%%%%%%% GUBBINS
+
+\newcommand{\mathskip}{\medskip}
+
+\newcommand{\fbx}[1]{\fbox{$#1$}}
+\newcommand{\stk}[1]{\begin{array}{c}#1\end{array}}
+%\newcommand{\DM}[1]{\hg\mbox{$#1$}}
+\newcommand{\DM}[1]{\mathskip\par\(#1\)\mathskip}
+\newcommand{\mbx}[1]{\mathskip\par\noindent\(#1\)\mathskip}
+\newcommand{\AR}[1]{\begin{array}[t]{@{}l}#1\end{array}}
+\newcommand{\ARt}[1]{\begin{array}[t]{@{}l@{}cl}#1\end{array}}
+\newcommand{\ARc}[1]{\begin{array}{@{}l}#1\end{array}}
+\newcommand{\EA}[1]{\begin{array}[t]{r@{}c@{}l}#1\end{array}}
+\newcommand{\A}{@{\:}c}
+%\newcommand{\R}{@{\:}r}
+\newcommand{\CA}{c}
+\newcommand{\LA}{l}
+\newcommand{\PAc}[2]{\begin{array}{l#1@{}r@{}l}#2\end{array}}
+\newcommand{\PA}[2]{\begin{array}[t]{l@{\:}l#1@{}r@{\:}l}#2\end{array}}
+\newcommand{\DTREE}[3]{\begin{array}[t]{l#1@{}r@{\:}l#2}#3\end{array}}
+\newcommand{\IDTREE}[2]{%
+  \begin{array}[t]{l@{\:}c@{\:}l@{\:}r@{\:}l#1}#2\end{array}}
+\newcommand{\IA}[2]
+   {\begin{array}[t]{l@{\:}r@{\:}c@{\:}l@{\:}#1@{\:}r@{\:}l}#2\end{array}}
+\newcommand{\IAc}[2]
+   {\begin{array}[c]{r@{\:}c@{\:}l@{\:}#1@{}r@{}l}#2\end{array}}
+\newcommand{\CS}[1]{\left\lfloor\begin{array}{@{}l}#1\end{array}\right.}
+\newcommand{\BY}[3]{\multicolumn{2}{l}{\;\RW{by}\; #1} \\ %
+    \multicolumn{#2}{l}{\CS{#3}} }
+\newcommand{\WITH}[3]{\multicolumn{2}{l}{\;\RW{with}\; #1} \\ %
+    \multicolumn{#2}{l}{\CS{#3}} }
+\newcommand{\WithBy}{\RW{with-by}}
+\newcommand{\Wb}[1]{\WithBy& #1}
+\newcommand{\By}[1]{\multicolumn{2}{l}{\Leftarrow #1}}
+\newcommand{\andby}{\Leftarrow}
+\newcommand{\MyWith}[1]{\multicolumn{2}{l}{|\;#1}}
+\newcommand{\Byr}[1]{\;\RW{by}\; #1}
+
+\newcommand{\Bar}{|}
+\newcommand{\Bart}{\settowidth{\GapLength}{$\Bar$}%
+                   \raisebox{6pt}[0pt][0pt]{$\Bar$}%
+                   \hspace*{-1\GapLength}%
+                   \Bar}
+\newcommand{\With}[1]{\Bar & #1}
+\newcommand{\Witt}[1]{\Bart & #1}
+
+\newcommand{\B}{@{\:}r@{\:}c}
+\newcommand{\Ret}[1]{\multicolumn{2}{l}{\cq #1}}
+\newcommand{\MRet}[2]{\multicolumn{#1}{l}{\cq #2}}
+\newcommand{\HRet}[1]{\multicolumn{2}{l}{\hq #1}}
+\newcommand{\MHRet}[2]{\multicolumn{#1}{l}{\hq #2}}
+\newcommand{\IRet}[1]{\multicolumn{2}{l}{\iq #1}}
+\newcommand{\IMRet}[2]{\multicolumn{#1}{l}{\iq #2}}
+\newcommand{\MoRet}[1]{\multicolumn{2}{l}{\mq #1}}
+\newcommand{\MMoRet}[2]{\multicolumn{#1}{l}{\mq #2}}
+\newcommand{\Data}{\RW{data}}
+\newcommand{\Where}{\RW{where}}
+\newcommand{\Let}{\RW{let}}
+\newcommand{\Fact}{\RW{fact}}
+\newcommand{\Rec}[1]{#1\textbf{-Rec}}
+\newcommand{\Memo}[1]{#1\textbf{-Memo}}
+\newcommand{\Elim}[1]{#1\textbf{-Elim}}
+\newcommand{\Cases}[1]{#1\textbf{-Case}}
+\newcommand{\View}[1]{#1\textbf{-View}}
+\newcommand{\As}[2]{#1 \:\RW{as}\: #2}
+\newcommand{\nhole}{\Box}
+\newcommand{\turq}{\:\vdash_?\:}
+\newcommand{\split}{\;\lhd\;}
+\newcommand{\CType}[2]{\{#1 \split\; #2\}}
+\newcommand{\CC}[2]{(#1)\:#2}
+\newcommand{\UP}[2]{#1 | \{#2\}}
+\newcommand{\Ured}{\:\Downarrow\:}
+\newcommand{\gdd}{\prec}
+\newcommand{\HC}[1]{\left<#1\right>}
+\newcommand{\HT}[2]{\left<#1 \hab #2\right>}
+
+\newcommand{\view}{\RW{view}}
+\newcommand{\ecase}{\RW{case}}
+\newcommand{\rec}{\RW{rec}}
+
+\newcommand{\If}{\mathsf{if}}
+\newcommand{\Then}{\mathsf{then}}
+\newcommand{\Else}{\mathsf{else}}
+\newcommand{\elim}{\RW{elim}}
+
+\newcommand{\Payload}{\mathsf{type}}
+\newcommand{\Any}{\mathsf{Some}}
+
+\newcommand{\lbl}[2]{\langle #1 \Hab #2 \rangle}
+\newcommand{\call}[2]{\RW{call}\:\langle#1\rangle\:#2}
+\newcommand{\return}[1]{\RW{return}\:#1}
+
+\newcommand{\Remark}[1]{\noindent\textbf{Remark:} #1}
+
+\newcommand{\DBOX}[2]{\fbox{\parbox{#1}{\textbf{Definition:}#2}}}
+
+\newcommand{\FIG}[3]{\begin{figure}[h]\DM{#1}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\FFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\FFIGTC}[3]{\begin{figure*}[t]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure*}}
+\newcommand{\VFIG}[3]{\begin{figure}[h]\begin{boxedverbatim}#1\end{boxedverbatim}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\PFIG}[3]{\begin{figure}[p]\begin{center}\fbox{\DM{#1}}\end{center}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\CFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
+
+\newcommand{\TFIG}[4]{\begin{figure}[h]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure}}
+\newcommand{\TFIGTC}[4]{\begin{figure*}[t]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure*}}
+
+\newcommand{\RESFIG}[3]{
+\TFIG{|l|c|c|c|c|c|c|c|c|}{
+\hline
+    & \multicolumn{4}{c|}{\Naive{} compilation} &
+          \multicolumn{4}{|c|}{Optimised compilation} \\
+\cline{2-9}
+\raisebox{1.5ex}[0pt]{Program} & Instrs & Thunks & Cells &
+Accesses & Instructions & Thunks & Cells & Accesses \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+\hline
+}{#2}{#3}}
+
+\newcommand{\NEWRESFIG}[3]{
+\TFIG{|l|l|c|c|c|c|}{
+\hline
+%    & \multicolumn{4}{c|}{\Naive{} compilation} &
+%          \multicolumn{4}{|c|}{Optimised compilation} \\
+%\cline{2-9}
+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+}{#2}{#3}}
+
+\newcommand{\NEWRESFIGTC}[3]{
+\TFIGTC{|l|l|c|c|c|c|}{
+\hline
+%    & \multicolumn{4}{c|}{\Naive{} compilation} &
+%          \multicolumn{4}{|c|}{Optimised compilation} \\
+%\cline{2-9}
+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+}{#2}{#3}}
+
+\newcommand{\RESLINE}[9]{
+& \Naive{} & #2 & #3 & #5 & #4 \\
+#1
+& Optimised & #6 & #7 & #9 & #8 \\
+}
+\newcommand{\RESCHANGE}[4]{
+& Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
+\hline
+}
+\newcommand{\RESCHANGEa}[5]{
+#5 & Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
+\hline
+}
+
+%%%%%%%%%%%% PUNCTUATION
+
+\newcommand{\pad}[2]{#1#2#1}
+
+\newcommand{\hab}{\pad{\,}{:}}
+\newcommand{\Hab}{\pad{\;}{:}}
+\newcommand{\HHab}{\pad{\;}{::}}
+
+%%%%%%%%%%%% TYPE
+
+\newcommand{\Type}{\star}
+
+
+%%%%%%%%%%%%% ARROWS
+
+\newcommand{\To}{\pad{\:}{\rightarrow}}
+%\newcommand{\car}{\vartriangleright}
+
+%%%%%%%%%%%%% QUANTIFIERS
+
+\newcommand{\lam}[2]{\lambda#1\pad{\!}{:}#2}
+\newcommand{\all}[2]{\forall#1\pad{\!}{:}#2}
+\newcommand{\remlam}[2]{\lambda\{#1\pad{\!}{:}#2\}}
+\newcommand{\remall}[2]{\forall\{#1\pad{\!}{:}#2\}}
+\newcommand{\allpi}[2]{\Pi#1\pad{\!}{:}#2}
+\newcommand{\ali}[2]{\forall#1|#2}
+\newcommand{\exi}[2]{\exists#1\pad{\!}{:}#2}
+\newcommand{\wit}[2]{\ang{#1,#2}}
+\newcommand{\X}{\times}
+\newcommand{\sig}[2]{\Sigma#1\pad{\!}{:}#2}
+
+\newcommand{\SC}{.\:}
+
+\newcommand{\letbind}[3]{\mathsf{let}\:#1{:}#2\:=\:#3\:\mathsf{in}}
+\newcommand{\ifthen}[3]{\mathsf{if}\:#1\:\mathsf{then}\:#2\:\mathsf{else}\:#3}
+
+%%%%%%%%%%%%% EQUALITIES
+
+\newcommand{\cq}{\pad{\:}{\mapsto}}
+\newcommand{\xq}{\pad{}{\doteq}}
+\newcommand{\pq}{\pad{\:}{=}}
+\newcommand{\dq}{\pad{\:}{:=}}
+\newcommand{\iq}{\pad{\:}{\leadsto}}
+\newcommand{\mq}{\Longrightarrow}
+\newcommand{\retq}{\Rightarrow}
+\newcommand{\hq}{\pad{\:}{=}}
+\newcommand{\defq}{\mapsto}
+
+\newcommand{\refl}{\TC{refl}}
+
+
+
+
+%%%%%%%%%%%%% CATSTUFF
+
+\newlength{\Lwibrs}
+\newlength{\Lwobrs}
+\newsavebox{\Bwibrs}
+\newsavebox{\Bwobrs}
+\newcommand{\Db}[5]{%
+  \savebox{\Bwobrs}[\width][b]{$#5$}%
+  \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right#3$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left#1\pad{\hspace*{-0.25\Lwibrs}}{\usebox{\Bwibrs}}\right#4}
+\newcommand{\LDb}[3]{%
+  \savebox{\Bwobrs}[\width][b]{$#3$}%
+  \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right.$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left#1\hspace*{-0.4\Lwibrs}\usebox{\Bwibrs}\right.}
+\newcommand{\RDb}[3]{%
+  \savebox{\Bwobrs}[\width][b]{$#3$}%
+  \savebox{\Bwibrs}[\width][b]{$\left.\usebox{\Bwobrs}\right#1$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left.\usebox{\Bwibrs}\hspace*{-0.4\Lwibrs}\right#2}
+\newcommand{\Sc}{\Db{[}{[}{]}{]}}
+\newcommand{\Mo}{\Db{|}{>}{<}{|}}
+\newcommand{\MoL}{\LDb{|}{>}}
+\newcommand{\MoR}{\RDb{<}{|}}
+
+\newcommand{\car}{\mbox{$-\!\triangleright$}}
+\newcommand{\io}[1]{\iota_{#1}}
+\newcommand{\cc}{\diamond}
+
+
+%%%%%%%%%%%%% FNS
+
+\newcommand{\Wk}{\Uparrow}
+
+%%%%%%%%%%%%% Transformation
+
+\newcommand{\Transform}[3]{\textsc{Trans}\:_{\Name{#1}}
+   \interp{#2}\:\mq\:#3}
+%\:[\:#2\:\Longrightarrow\:#3\:]}
+\newcommand{\Morphism}[2]{\textsc{Morphism}\:#1\:\Longrightarrow\:#2}
+\newcommand{\MI}[1]{\begin{array}{ll} #1 \end{array}\\}
+\newcommand{\MorphItem}[2]{& #1 \:\Longrightarrow\: #2}
+
+%%%%%%%%%%%%% Stuff
+
+% Motive and methods
+
+\newcommand{\motive}{\vP}
+\newcommand{\meth}[1]{\vm_{#1}}
+
+% Tuples
+\newcommand{\tuple}[1]{\langle#1\rangle}
+\newcommand{\Tuple}[1]{\mathsf{Tuple}}
+\newcommand{\proj}{\mathsf{proj}}
+\newcommand{\app}{\mathrm{+\!+}}
+
+% Commenting out
+\newcommand{\ig}[1]{[#1]}
+\newcommand{\rem}[1]{\{\!#1\!\}}
+\newcommand{\igc}[1]{[#1]}
+\newcommand{\remc}[1]{\{\!#1\!\}}
+
+
+\newcommand{\ind}{\hspace*{0.1cm}}
+
+% Content free type
+\newcommand{\CF}{\TC{CF}}
+\newcommand{\cf}{\DC{cf}}
+
+% Error token
+\newcommand{\error}{\DC{error}}
+\newcommand{\fail}{\perp}
+
+% Constructor stripping
+\newcommand{\conarg}[2]{#1!#2}
+
+\newcommand{\Vect}{\TC{Vect}}
+\newcommand{\VectM}{\TC{Vect^-}}
+\newcommand{\Vnil}{\DC{\epsilon}}
+\newcommand{\Vcons}{\DC{::}}
+
+\newcommand{\Vsnoc}{\DC{::}}
+
+\newcommand{\VnilM}{\DC{\epsilon^-}}
+\newcommand{\VconsM}{\DC{::^-}}
+
+\newcommand{\Vnilcase}{\VV{vNilCase}}
+\newcommand{\Vconscase}{\VV{vConsCase}}
+
+\newcommand{\DSigma}{\TC{Sigma}}
+\newcommand{\Exists}{\DC{Exists}}
+
+\newcommand{\ListPair}[2]{\sig{#1}{\List\:\vA}.#2 = \FN{length}\:#1}
+\newcommand{\lpNilDef}{\lpNil{\FN{refl}\:\Z}}
+\newcommand{\lpNil}[1]{(\nil\:\vA,#1)}
+\newcommand{\lpConsDef}[3]{\lpCons{#1}{(\FN{fst\:#2})}{\FN{resp}\:(\FN{snd}\:#2)}}
+\newcommand{\lpCons}[3]{(\cons\:#1\:#2,#3)}
+\newcommand{\lp}[2]{(#1, #2)}
+
+\newcommand{\VnilTop}{\DC{vNil}^\ast}
+\newcommand{\VconsTop}{\DC{vCons}^\ast}
+
+\newcommand{\VnilBot}{\DC{\epsilon}^-}
+\newcommand{\VconsBot}{\DC{::}^-}
+
+\newcommand{\VectTop}{\TC{Vect}^\ast}
+\newcommand{\VectBot}{\TC{Vect}^-}
+
+\newcommand{\VectDrop}{\FN{vectDropIdx}}
+\newcommand{\VectRebuild}{\FN{vectRebuild}}
+
+\newcommand{\Prop}{\TC{Prop}}
+\newcommand{\Set}{\TC{Set}}
+\newcommand{\CoqType}{\TC{Type}}
+
+\newcommand{\List}{\TC{List}}
+\newcommand{\nil}{\DC{nil}}
+\newcommand{\cons}{\DC{cons}}
+
+\newcommand{\Zip}{\TC{Tsil}}
+\newcommand{\zip}{\FN{tsil}}
+\newcommand{\zipcons}{\FN{tsilcons}}
+\newcommand{\snoc}{\DC{Snoc}}
+\newcommand{\lin}{\DC{Empty}}
+
+\newcommand{\BigInt}{\TC{BigInt}}
+\newcommand{\False}{\TC{False}}
+\newcommand{\Unit}{\TC{True}}
+\newcommand{\UnitI}{\DC{()}}
+
+\newcommand{\genType}{\TC{X}}
+\newcommand{\genIndicesDec}{\tb\Hab\tB}
+\newcommand{\genIndices}{\tb}
+\newcommand{\genConArgsDec}[1]{\vec{\VV{a_#1}}\Hab\vec{\VV{A_#1}}}
+\newcommand{\genConArgs}[1]{\vec{\VV{a_#1}}}
+\newcommand{\genConIndicesDec}[1]{\vec{\VV{b_#1}}\Hab\vec{\VV{B_#1}}}
+\newcommand{\genConIndices}[1]{\vec{\VV{b_#1}}}
+\newcommand{\genCon}[1]{\DC{x}_#1}
+
+\newcommand{\genTypeTop}{\TC{X^\ast}}
+\newcommand{\genTypeBot}{\TC{X^-}}
+
+\newcommand{\genTypeDrop}{\FN{XDropIdx}}
+\newcommand{\genTypeRebuild}{\FN{XRebuild}}
+
+\newcommand{\HTerm}{\texttt{Term}}
+\newcommand{\Term}{\TC{Term}}
+\newcommand{\Var}{\DC{var}}
+\newcommand{\Lam}{\DC{lam}}
+\newcommand{\App}{\DC{app}}
+\newcommand{\TermM}{\TC{Term^-}}
+\newcommand{\VarM}{\DC{var^-}}
+\newcommand{\LamM}{\DC{lam^-}}
+\newcommand{\AppM}{\DC{app^-}}
+\newcommand{\Env}{\TC{Env}}
+\newcommand{\SType}{\TC{STy}}
+\newcommand{\farrow}{\Rightarrow}
+\newcommand{\lookup}{\FN{lookup}}
+
+\newcommand{\source}{\Lang{TT}}
+\newcommand{\target}{\Lang{ExTT}}
+\newcommand{\runtime}{\Lang{RunTT}}
+
+\newcommand{\lt}{\TC{<}}
+\newcommand{\ltO}{\DC{ltO}}
+\newcommand{\ltS}{\DC{ltS}}
+
+\newcommand{\interp}[1]{\llbracket #1 \rrbracket}
+\newcommand{\inferrable}[2]{\FN{inferrable}(#1,#2)}
+\newcommand{\mkPat}{\FN{mkPat}}
+
+\newcommand{\FinM}{\TC{Fin^-}}
+\newcommand{\fzM}{\DC{f0^-}}
+\newcommand{\fsM}{\DC{fs^-}}
+
+\newcommand{\concat}{\mathrm{++}}
+
+%\newcommand{\bottom}{\perp}
+
+% Reductions
+
+\newcommand{\reduces}{\rhd}
+\newcommand{\translation}{\Rightarrow}
+%\newcommand{\reducesn}[1]{\reduces\hspace*{-0.15cm}_{#1}}
+%\newcommand{\reducesto}{\reduces\hspace*{-0.15cm}^{*}}
+\newcommand{\reducesn}[1]{\reduces_{#1}}
+\newcommand{\reducesto}{\reduces^{*}}
+
+% Equality
+
+\newcommand{\Refl}{\DC{refl}}
+\newcommand{\leZ}{\DC{O_{\le}}}
+\newcommand{\leS}{\DC{S_{\le}}}
+
+% Random elimination things
+
+\newcommand{\lte}{\TC{\leq}}
+\newcommand{\lten}{\DC{leN}}
+\newcommand{\lteO}{\DC{leO}}
+\newcommand{\lteS}{\DC{leS}}
+
+\newcommand{\ltelim}{\Elim{\lt}}
+\newcommand{\leelim}{\Elim{\lte}}
+
+\newcommand{\dD}{\TC{D}}
+\newcommand{\delim}{\Elim{\TC{D}}}
+\newcommand{\drec}{\Rec{\TC{D}}}
+\newcommand{\dcase}{\Cases{\TC{D}}}
+\newcommand{\dview}{\View{\TC{D}}}
+\newcommand{\dmemo}{\Memo{\TC{D}}}
+\newcommand{\natrec}{\Rec{\Nat}}
+\newcommand{\natmemo}{\Memo{\Nat}}
+\newcommand{\natmemogen}{\Nat\textbf{-MemoGen}}
+\newcommand{\natelim}{\Elim{\Nat}}
+\newcommand{\boolcase}{\Cases{\Bool}}
+\newcommand{\vectrec}{\Rec{\Vect}}
+\newcommand{\vectelim}{\Elim{\Vect}}
+\newcommand{\listrec}{\Rec{\List}}
+\newcommand{\listelim}{\Elim{\List}}
+\newcommand{\finrec}{\Rec{\Fin}}
+\newcommand{\finelim}{\Elim{\Fin}}
+\newcommand{\natcase}{\Cases{\Nat}}
+\newcommand{\vectcase}{\Cases{\Vect}}
+\newcommand{\natdoublerec}{\Nat\textbf{-double-elim}}
+\newcommand{\eqelim}{=\textbf{-elim}}
+\newcommand{\falsecase}{\Cases{\False}}
+
+% Code
+\newcommand{\Haskell}[1]{\begin{quotation}\begin{verbatim}#1\end{verbatim}\end{quotation}}
+
+% Quicksort
+
+\newcommand{\QSView}{\TC{QuickSort}}
+\newcommand{\qsempty}{\DC{empty}}
+\newcommand{\partition}{\DC{partition}}
+\newcommand{\qsview}{\FN{mkQuickSort}}
+
+% More gubbins
+
+\newcommand{\converts}{\simeq}
+\newcommand{\cumul}{\preceq}
+\newcommand{\whnf}{\Downarrow}
+\newcommand{\elem}{\in}
+\newcommand{\proves}{\vdash}
+\newcommand{\biimplies}{\Longleftrightarrow}
+
+\newcommand{\lc}{\lambda_{\mathsf{AC}}}
+\newcommand{\zed}{\mathbb{Z}}
+
+% Haskell keywords
+
+\newcommand{\hdata}{\mathtt{data}}
+\newcommand{\newtype}{\mathtt{newtype}}
+%\newcommand{\htype}{\mathtt{type}}
+
+\newcommand{\HTC}[1]{\mathtt{#1}}
+\newcommand{\HDC}[1]{\mathtt{#1}}
+
+% Nobby
+
+\newcommand{\Value}{\HTC{Value}}
+\newcommand{\VGamma}{\HTC{Env}}
+\newcommand{\Ctxt}{\HTC{Ctxt}}
+\newcommand{\Defs}{\HTC{Defs}}
+\newcommand{\ECtxt}{\HTC{ECtxt}}
+\newcommand{\TCtxt}{\HTC{TCtxt}}
+\newcommand{\VG}{\HDC{Env}}
+\newcommand{\Model}{\HTC{Model}}
+\newcommand{\Const}{\HTC{Const}}
+\newcommand{\Normal}{\HTC{Normal}}
+\newcommand{\Scope}{\HTC{Scope}}
+\newcommand{\Kripke}{\HTC{Kripke}}
+\newcommand{\Weakening}{\HTC{Weakening}}
+\newcommand{\Ready}{\HTC{Ready}}
+\newcommand{\Blocked}{\HTC{Blocked}}
+\newcommand{\Spine}{\HTC{Spine}}
+
+\newcommand{\BV}{\HDC{BV}}
+\newcommand{\BCon}{\HDC{BCon}}
+\newcommand{\BTyCon}{\HDC{BTyCon}}
+\newcommand{\RCon}{\HDC{RCon}}
+\newcommand{\RTyCon}{\HDC{RTyCon}}
+\newcommand{\BElim}{\HDC{BElim}}
+\newcommand{\DV}{\HDC{V}}
+\newcommand{\DP}{\HDC{P}}
+
+\newcommand{\MR}{\HDC{R}}
+\newcommand{\MB}{\HDC{B}}
+\newcommand{\DSc}{\HDC{Sc}}
+\newcommand{\DKr}{\HDC{Kr}}
+\newcommand{\DWk}{\HDC{Wk}}
+\newcommand{\DSnoc}{\HDC{;}}
+\newcommand{\DType}{\HDC{Type}}
+\newcommand{\DName}{\HDC{Name}}
+\newcommand{\DInt}{\HDC{Int}}
+\newcommand{\DString}{\HDC{String}}
+\newcommand{\DElim}{\HDC{Elim}}
+\newcommand{\Empty}{\HDC{\emptyset}}
+
+\newcommand{\ConCode}{\HTC{ConCode}}
+\newcommand{\ElimRule}{\HTC{ElimRule}}
+
+\newcommand{\DConst}{\HDC{Const}}
+\newcommand{\DCon}{\HDC{Con}}
+\newcommand{\DTyCon}{\HDC{TyCon}}
+\newcommand{\RConst}{\HDC{RConst}}
+\newcommand{\RLam}{\HDC{RLam}}
+\newcommand{\RPi}{\HDC{RPi}}
+\newcommand{\DLam}{\HDC{Lam}}
+\newcommand{\DLet}{\HDC{Let}}
+\newcommand{\DPi}{\HDC{Pi}}
+\newcommand{\DApp}{\HDC{App}}
+
+\newcommand{\TMaybe}{\HTC{Maybe}}
+\newcommand{\DNothing}{\HDC{Nothing}}
+\newcommand{\DJust}{\HDC{Just}}
+
+
+% G-machine and heap
+
+\newcommand{\PUSH}{\mathsf{PUSH}}
+\newcommand{\PUSHNAME}{\mathsf{PUSHNAME}}
+\newcommand{\POP}{\mathsf{DISCARD}}
+\newcommand{\PUSHFUN}{\mathsf{PUSHFUN}}
+\newcommand{\APPLY}{\mathsf{MKAP}}
+\newcommand{\EVAL}{\mathsf{EVAL}}
+\newcommand{\GCON}{\mathsf{MKCON}}
+\newcommand{\GTUP}{\mathsf{MKTUP}}
+\newcommand{\GTYPE}{\mathsf{MKTYPE}}
+\newcommand{\UPDATE}{\mathsf{UPDATE}}
+\newcommand{\RET}{\mathsf{RET}}
+\newcommand{\UNWIND}{\mathsf{UNWIND}}
+\newcommand{\CASEJUMP}{\mathsf{CASEJUMP}}
+\newcommand{\LABEL}{\mathsf{LABEL}}
+\newcommand{\MOVE}{\mathsf{MOVE}}
+\newcommand{\JUMP}{\mathsf{JUMP}}
+\newcommand{\SPLIT}{\mathsf{SPLIT}}
+\newcommand{\SQUEEZE}{\mathsf{SQUEEZE}}
+\newcommand{\JFUN}{\mathsf{JFUN}}
+\newcommand{\PROJ}{\mathsf{PROJ}}
+\newcommand{\ERROR}{\mathsf{ERROR}}
+\newcommand{\SLIDE}{\mathsf{SLIDE}}
+\newcommand{\ALLOC}{\mathsf{ALLOC}}
+
+\newcommand{\PUSHBIG}{\mathsf{PUSHBIG}}
+\newcommand{\PUSHBASIC}{\mathsf{PUSHBASIC}}
+\newcommand{\PUSHINT}{\mathsf{PUSHINT}}
+\newcommand{\PUSHBOOL}{\mathsf{PUSHBOOL}}
+\newcommand{\GET}{\mathsf{GET}}
+\newcommand{\MKINT}{\mathsf{MKINT}}
+\newcommand{\MKBOOL}{\mathsf{MKBOOL}}
+\newcommand{\ADD}{\mathsf{ADD}}
+\newcommand{\SUB}{\mathsf{SUB}}
+\newcommand{\MULT}{\mathsf{MULT}}
+\newcommand{\LT}{\mathsf{LT}}
+\newcommand{\EQ}{\mathsf{EQ}}
+\newcommand{\GT}{\mathsf{GT}}
+\newcommand{\JTRUE}{\mathsf{JTRUE}}
+
+\newcommand{\APP}{\mathsf{APP}}
+\newcommand{\FUN}{\mathsf{FUN}}
+\newcommand{\CON}{\mathsf{CON}}
+\newcommand{\TYCON}{\mathsf{TYCON}}
+\newcommand{\TUP}{\mathsf{TUP}}
+\newcommand{\TYPE}{\mathsf{TYPE}}
+\newcommand{\INT}{\mathsf{INT}}
+\newcommand{\BIGINT}{\mathsf{BIGINT}}
+\newcommand{\BOOL}{\mathsf{BOOL}}
+\newcommand{\HOLE}{\mathsf{HOLE}}
+
+% G machine translation scheme
+
+\newcommand{\sinterp}[1]{\mathcal{S}\interp{#1}}
+\newcommand{\sinterpm}[1]{\mathcal{S}\AR{\interp{#1}}}
+\newcommand{\einterp}[3]{\mathcal{E}\interp{#1}\:#2\:#3}
+\newcommand{\cinterp}[3]{\mathcal{C}\interp{#1}\:#2\:#3}
+\newcommand{\binterp}[3]{\mathcal{B}\interp{#1}\:#2\:#3}
+\newcommand{\rinterp}[3]{\mathcal{R}\interp{#1}\:#2\:#3}
+\newcommand{\iinterp}[3]{\mathcal{I}\interp{#1}\:#2\:#3}
+\newcommand{\len}[1]{\MO{length}(#1)}
+
+\newcommand{\casecomp}[2]{\mathcal{I}(#1,\left\{\ARc{#2}\right\})}
+\newcommand{\casecompA}[3]{\mathcal{I}(#1,\left\{\ARc{#2}\right\}[#3])}
+\newcommand{\ischeme}{\mathcal{I}}
+
+% tail call markup
+
+\newcommand{\tailcall}{\mathsf{tail}}
+
+% Trees
+
+\newcommand{\Tree}{\TC{Tree}}
+\newcommand{\Leaf}{\DC{Leaf}}
+\newcommand{\Node}{\DC{Node}}
+\newcommand{\treecase}{\Cases{\Tree}}
+
+% Languages
+
+\newcommand{\Coq}{\textsc{Coq}}
+\newcommand{\Lego}{\textsc{Lego}}
+\newcommand{\Oleg}{\textsc{Oleg}}
+\newcommand{\Alf}{\textsc{Alf}}
+\newcommand{\Epigram}{\textsc{Epigram}}
+\newcommand{\SystemF}{System $\mathcal{F}$}
+\newcommand{\Iswim}{\textsc{Iswim}}
+\newcommand{\Cynthia}{\textit{C$^Y$\hspace*{-0.1cm}NTHIA}}
+
+% Accessibility
+
+\newcommand{\Acc}{\TC{Acc}}
+\newcommand{\acc}{\DC{acc}}
+\newcommand{\qsAcc}{\TC{qsAcc}}
+\newcommand{\qsNil}{\DC{qsNil}}
+\newcommand{\qsCons}{\DC{qsCons}}
+\newcommand{\allQsAcc}{\FN{allQsAcc}}
+
+% Lazy shortcuts
+
+\newcommand{\naive}{na\"{\i}ve}
+\newcommand{\Naive}{Na\"{\i}ve}
+
+% Conor's bits
+
+\newcommand{\remem}[1]{\left|#1\right|}
+\newcommand{\idsb}{\MO{id}}
+\newcommand{\ang}[1]{\langle#1\rangle}
+
+\newcommand{\vePm}[1]{\vP #1 \vm_{\Vnil} #1 \vm_{\Vcons}}%
+\newcommand{\vcrhs}{\vm_{\Vcons}\:\vk\:\va\:\vv\:%
+                     (\vectelim\:\vA\:\vk\:\vv\:\vePm{\:})}%
+
+\newcommand{\igV}[2]{#1^{\ig{#2}}}
+\newcommand{\remV}[2]{#1^{\rem{#2}}}
+
+\newcommand{\FIXME}[1]{[\textbf{FIXME}: #1]}
+%\newcommand{\FIXME}[1]{\wibble}
+
+% More gubbins
+
+\newcommand{\Between}{\TC{between}}
+\newcommand{\bZ}{\DC{bO}}
+\newcommand{\bZZS}{\DC{bOOs}}
+\newcommand{\bZSS}{\DC{b0ss}}
+\newcommand{\bSSS}{\DC{bsss}}
+\newcommand{\betelim}{\Elim{\Between}}
+\newcommand{\betrhs}[1]{\motive#1\meth{\bZ}#1\meth{\bZZS}#1\meth{\bZSS}#1\meth{\bSSS}}
+
+
+\newcommand{\valenv}{\TC{ValEnv}}
+\newcommand{\vempty}{\DC{empty}}
+\newcommand{\vextend}{\DC{extend}}
+
+\newcommand{\EpiVal}{\TC{Epigram}}
+\newcommand{\unsafeCoerce}{\HF{unsafeCoerce\mbox{\texttt{\#}}}}
+
+\newcommand{\qq}{\mbox{\texttt{"}}}
+\newcommand{\impossible}{\RW{Impossible}}
+
+\newcommand{\Real}{\mathbb{R}}
+
+\newcommand{\DoubleRec}{\TC{DoubleElim}}
+\newcommand{\DoubleOn}{\DC{Double_{\Z\vn}}}
+\newcommand{\DoubleSO}{\DC{Double_{\suc\Z}}}
+\newcommand{\DoubleSS}{\DC{Double_{\suc\suc}}}
+
+\newcommand{\doublerec}{\textbf{double-elim}}
+
+\newcommand{\set}{\TC{DList}}
+\newcommand{\setuser}{\TC{DListTop}}
+\newcommand{\setempty}{\emptyset}
+\newcommand{\setinsert}{\DC{insert}}
+
+
+%%%% Type systems
+
+\newcommand{\stlc}{\lambda\hspace*{-0.15cm}\to}
+\newcommand{\plc}{\lambda2}
+\newcommand{\dlc}{\lambda{}P}
+
+\newcommand{\EC}{\mathcal{E}}
+
+%%%% reductions
+
+\newcommand{\betared}{\iq\hspace*{-0.15cm}_{\beta}}
+\newcommand{\deltared}{\iq\hspace*{-0.15cm}_{\delta}}
+\newcommand{\gammared}{\iq\hspace*{-0.15cm}_{\gamma}}
+\newcommand{\etared}{\iq\hspace*{-0.15cm}_{\eta}}
+\newcommand{\iotared}{\iq\hspace*{-0.15cm}_{\iota}}
+\newcommand{\rhored}{\iq\hspace*{-0.15cm}_{\rho}}
+
+%%%% ExTT rules
+
+\newcommand{\exconverts}{\stackrel{\mathsf{Ex}}{\converts}}
+\newcommand{\excumul}{\stackrel{\mathsf{Ex}}{\cumul}}
+\newcommand{\exequiv}{\stackrel{\mathsf{Ex}}{\equiv}}
+\newcommand{\exreduces}{\stackrel{\mathsf{Ex}}\reduces}
+\newcommand{\exreducesto}{\stackrel{\mathsf{Ex}}{\reducesto}}
+\newcommand{\exreducesn}[1]{\exreduces_{#1}}
+
+\newcommand{\ttequiv}{\stackrel{\mathsf{TT}}{\equiv}}
+\newcommand{\ttreduces}{\stackrel{\mathsf{TT}}\reduces}
+\newcommand{\ttreducesn}[1]{\ttreduces_{#1}}
+
+%%% Type synthesis
+
+\newcommand{\hastype}{\Longrightarrow}
+\newcommand{\whnfs}{\twoheadrightarrow}
+\newcommand{\conv}{\converts}
+
+\newcommand{\exhastype}{\stackrel{\mathsf{Ex}}{\hastype}}
+\newcommand{\exwhnfs}{\stackrel{\mathsf{Ex}}{\whnfs}}
+\newcommand{\exconv}{\stackrel{\mathsf{Ex}}{\conv}}
+\newcommand{\exproves}{\stackrel{\mathsf{Ex}}{\proves}}
+
+\newcommand{\tthastype}{\stackrel{\mathsf{TT}}{\hastype}}
+\newcommand{\ttwhnfs}{\stackrel{\mathsf{TT}}{\whnfs}}
+\newcommand{\ttconv}{\stackrel{\mathsf{TT}}{\conv}}
+\newcommand{\ttproves}{\stackrel{\mathsf{TT}}{\proves}}
+
+%%% Lightning
+
+\newcommand{\light}[1]{\lightning^{#1}}
+\newcommand{\LHab}[1]{\pad{\;}{:^{#1}}}
+\newcommand{\llam}[3]{\lambda#1\pad{\!}{:}^{#2}#3}
+\newcommand{\lall}[3]{\forall#1\pad{\!}{:}^{#2}#3}
+\newcommand{\lapp}[3]{#1(#2)^{#3}}
+\newcommand{\larg}[2]{(#1)^{#2}}
+
+\newcommand{\RName}[1]{\hspace*{0.1in}\mathsf{#1}}
diff --git a/docs/shell.tex b/docs/shell.tex
new file mode 100644
--- /dev/null
+++ b/docs/shell.tex
@@ -0,0 +1,1 @@
+\section{The Shell}
diff --git a/docs/tactics.tex b/docs/tactics.tex
new file mode 100644
--- /dev/null
+++ b/docs/tactics.tex
@@ -0,0 +1,1 @@
+\section{Primitive Tactics}
diff --git a/docs/tt.tex b/docs/tt.tex
new file mode 100644
--- /dev/null
+++ b/docs/tt.tex
@@ -0,0 +1,1 @@
+\section{$\source$ --- The Core Type Theory}
diff --git a/emacs/ivor-mode.el b/emacs/ivor-mode.el
new file mode 100644
--- /dev/null
+++ b/emacs/ivor-mode.el
@@ -0,0 +1,214 @@
+(eval-when-compile
+  (require 'comint))
+
+(defvar ivor-mode-map
+   (let ((map (make-sparse-keymap)))
+     (define-key map "\C-j" 'newline-and-indent)
+     (define-key map "\C-n" 'ivor-send-to-shell)
+     (define-key map "\C-c\C-n" 'ivor-send-all-to-shell)
+     (define-key map "\C-c\C-s" 'ivor-start)
+     (define-key map "\C-c\C-d" 'ivor-stop)
+     (define-key map "\C-c\C-r" 'ivor-restart)
+     (define-key map "\C-c\C-u" 'ivor-undo)
+     map)
+   "Keymap for `ivor-mode'.")
+
+(add-to-list 'auto-mode-alist '("\\.tt\\'" . ivor-mode))
+
+(defvar ivor-mode-syntax-table
+   (let ((st (make-syntax-table)))
+     (modify-syntax-entry ?{ ". 1" st)
+     (modify-syntax-entry ?} ". 4" st)
+     (modify-syntax-entry ?- ". 1b2b3" st)
+     (modify-syntax-entry ?\n "> b" st)
+     st)
+   "Syntax table for `ivor-mode'.")
+
+;;;(regexp-opt '("Data" "Rec" "Qed" "Freeze" "Thaw" "Eval" "Check" "Load"
+;;;           "Suspend" "Resume" "Compile" "Repl" "Equality" "Drop"
+;;;           "Primitives" "Forget" "Let" "Axiom" "Focus" "Declare" "Where"
+;;;           "Plugin"))
+
+;;;(regexp-opt '("attack" "claim" "local" "refine" "solve" "fill" "return"
+;;;           "quote" "call" "abandon" "rename" "intro" "intros" "arg"
+;;;           "equiv" "generalise" "dependent" "replace" "axiomatise"
+;;;           "compute" "unfold" "trivial" "by" "induction" "case"
+;;;           "auto" "left" "right" "split" "exists" "decide"))
+
+(defconst ivor-font-lock-keywords
+  (list '("\\<\\(Axiom\\|C\\(?:heck\\|ompile\\)\\|D\\(?:ata\\|eclare\\|rop\\)\\|E\\(?:quality\\|val\\)\\|F\\(?:o\\(?:cus\\|rget\\)\\|reeze\\)\\|L\\(?:et\\|oad\\)\\|Primitives\\|Qed\\|Re\\(?:c\\|pl\\|sume\\)\\|Suspend\\|Thaw\\|Plugin\\|Where\\)\\>"
+ . font-lock-keyword-face)
+        '("a\\(?:bandon\\|rg\\|ttack\\|uto\\|xiomatise\\)\\|by\\|c\\(?:a\\(?:ll\\|se\\)\\|laim\\|ompute\\)\\|de\\(?:cide\\|pendent\\)\\|e\\(?:quiv\\|xists\\)\\|fill\\|generalise\\|in\\(?:duction\\|tros?\\)\\|l\\(?:eft\\|ocal\\)\\|quote\\|r\\(?:e\\(?:fine\\|name\\|place\\|turn\\)\\|ight\\)\\|s\\(?:olve\\|plit\\)\\|trivial\\|unfold" . font-lock-builtin-face)
+        '("<\\([^:]*\\):[^>]*>" . (1 font-lock-string-face keep t))
+        '("<\\([^>:]*\\)>" . (1 font-lock-string-face keep t))
+        '("^\\([a-zA-Z0-9\\'\\_]+\\)\\s-*:" . (1 font-lock-function-name-face keep t))
+        '("^\\([a-zA-Z0-9\\'\\_]+\\)\\s-*=" . (1 font-lock-function-name-face keep t))
+        '("Rec\\s-+\\([a-zA-Z0-9\\'\\_]+\\)\\s-*:" . (1 font-lock-function-name-face t t))
+        '("\\b\\([a-zA-Z0-9\\'\\_]+\\)\\s-*:" . (1 font-lock-variable-name-face keep t))
+        '("\\b\\([a-zA-Z0-9\\'\\_]+\\)\\s-*," . (1 font-lock-variable-name-face keep t))
+  )
+  "Highlighting for Ivor mode")
+
+;;;(defvar tt-font-lock-keywords
+;;;   '(("Data" (1 font-lock-keyword-face)))
+;;;   "Keyword highlighting specification for `ivor-mode'.")
+
+
+;;(defvar tt-imenu-generic-expression
+;;   ...)
+
+;;(defvar tt-outline-regexp
+;;   ...)
+
+ ;;;###autoload
+(define-derived-mode ivor-mode fundamental-mode "Ivor"
+   "A major mode for editing Ivor files."
+   (set (make-local-variable 'comment-start) "-- ")
+   (set (make-local-variable 'comment-start-skip) "#+\\s-*")
+   (set (make-local-variable 'font-lock-defaults)
+        '(ivor-font-lock-keywords))
+   (set (make-local-variable 'indent-line-function) 'ivor-indent-line)
+;;   (set (make-local-variable 'imenu-generic-expression)
+;;      ivor-imenu-generic-expression)
+;;   (set (make-local-variable 'outline-regexp) ivor-outline-regexp)
+   )
+
+;;; Indentation
+;; 1. Qed line is indented to 0
+;; 2. After 'Data' indent each line 4 until a semicolon, or 2 if the line
+;;    begins with '|' or '='
+
+
+(defun ivor-indent-line ()
+   "Indent current line of Ivor code."
+   (interactive)
+   (let ((savep (> (current-column) (current-indentation)))
+         (indent (condition-case nil (max (ivor-calculate-indentation) 0)
+                   (error 0))))
+     (if savep
+         (save-excursion (indent-line-to indent))
+       (indent-line-to indent))))
+
+(defun ivor-calculate-indentation ()
+   "Return the column to which the current line should be indented."
+   ;; Default is the indentation of the previous line
+  (cond
+   ((ivor-isQed) 0)
+   ((ivor-first-is "[ \\t]*|") (ivor-under-eq))
+   ((ivor-eq-no-semi) 4)
+   ((ivor-first-is "[ \\t]*=") 2)
+   (t (ivor-get-previous-indentation))
+  )
+)
+
+(defun ivor-isQed ()
+  (save-excursion
+    (beginning-of-line)
+    (looking-at "Qed")))
+
+(defun ivor-eq-no-semi ()
+  (save-excursion
+    (forward-line -1)
+    (beginning-of-line)
+    (looking-at ".*=[^;]*$")))
+
+(defun ivor-under-eq ()
+  "Indent to under the = sign on the previous line, or 4 spaces if none"
+  (save-excursion
+    (forward-line -1)
+    (beginning-of-line)
+    (let ((this-line (thing-at-point 'line)))
+      (let ((eq-point (string-match "=" this-line)))
+        (progn (if (eq eq-point nil)
+                   2
+                 eq-point))))))
+
+(defun ivor-first-is (str)
+  (save-excursion
+    (beginning-of-line)
+    (looking-at str)))
+
+(defun ivor-get-previous-indentation ()
+  "Return the indentation of the previous line"
+  (save-excursion
+    (forward-line -1)
+    (current-indentation)))
+
+(defun ivor-send-to-shell ()
+  "Read the current line and send it to the shell process, if any"
+  (interactive)
+  (progn (save-excursion
+           (beginning-of-line)
+           (let* ((this-line (thing-at-point 'line))
+                  (chomped (substring this-line 0 (- (length this-line) 1))))
+             (progn (set-buffer (get-buffer "*Ivor*"))
+                    (insert chomped)
+                    (comint-send-input))))
+         (forward-line 1)
+         (beginning-of-line)
+         )
+)
+
+(defun ivor-send-all-to-shell ()
+  "Send the buffer up to the current point to the shell process"
+  (interactive)
+  (let ((contents (buffer-substring 1 (point))))
+        (progn (set-buffer (get-buffer "*Ivor*"))
+               (insert contents)
+               (comint-send-input))))
+
+(defvar ivor-shell-exec "jones")
+(defvar ivor-shell-sep ";")
+
+(defun set-ivor-shell (executable)
+  "Set the Ivor shell executable"
+  (interactive "sShell executable: ")
+  (setq ivor-shell-exec executable))
+
+(defun set-ivor-sep (sep)
+  "Set the Ivor shell command separator"
+  (interactive "sShell separator: ")
+  (setq ivor-shell-sep sep))
+
+(defun ivor-start ()
+  "Start a shell with Ivor in it"
+  (interactive)
+  (when (not (bufferp (get-buffer "*Ivor*")))
+    (progn (shell "*Ivor*")
+           (set-buffer (get-buffer "*Ivor*"))
+           (insert ivor-shell-exec)
+           (comint-send-input))))
+
+(defun ivor-stop ()
+  "Stop the Ivor process"
+  (interactive)
+  (let ((dir (file-name-directory buffer-file-name)))
+    (save-current-buffer
+      (progn (set-buffer (get-buffer "*Ivor*"))
+             (insert (concat "Drop" ivor-shell-sep))
+             (comint-send-input))))
+  (goto-char (point-min)))
+
+(defun ivor-restart ()
+  "Restart the Ivor process"
+  (interactive)
+  (let ((dir (file-name-directory buffer-file-name)))
+    (save-current-buffer
+      (progn (set-buffer (get-buffer "*Ivor*"))
+             (insert (concat "Drop" ivor-shell-sep))
+             (comint-send-input)
+             (insert (concat "cd " dir "; " ivor-shell-exec))
+             (comint-send-input))))
+  (goto-char (point-min)))
+
+(defun ivor-undo-proof ()
+  "Send undo command in a proof state."
+  (interactive)
+  (let ((dir (file-name-directory buffer-file-name)))
+    (save-current-buffer
+      (progn (set-buffer (get-buffer "*Ivor*"))
+             (insert "Undo;")
+             (comint-send-input))))
+  (goto-char (point-min)))
+
+(provide 'ivor)
diff --git a/examplett/Nat.hs b/examplett/Nat.hs
new file mode 100644
--- /dev/null
+++ b/examplett/Nat.hs
@@ -0,0 +1,156 @@
+{-# OPTIONS_GHC -fglasgow-exts #-} 
+
+module Nat where
+
+import GHC.Base
+
+coerce :: a -> b
+coerce = unsafeCoerce#
+
+data Type = Type
+data Val = Val
+
+class Project x where
+    project :: forall val. Int -> x -> val
+
+data TT_Nat = TT_O | forall arg. TT_S arg 
+
+instance Project TT_Nat where
+    project 0 (TT_S  a0) = ((coerce a0)::val)
+
+
+
+fn_NatElim :: val -> val -> val -> val -> val
+fn_NatElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (case ((coerce v0)::TT_Nat) of { TT_O  -> v2 ; TT_S _  -> (((coerce v3)::val->val->val) ((coerce (project 0((coerce v0)::TT_Nat)))::val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val) ((coerce (project 0((coerce v0)::TT_Nat)))::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce v3)::val) ))::val) ) ; })))))
+
+data TT_True = TT_II 
+fn_TrueElim :: val -> val -> val -> val
+fn_TrueElim = (\v0 -> (\v1 -> (\v2 -> (case ((coerce v0)::TT_True) of { TT_II  -> v2 ; }))))
+
+data TT_False = TT_False
+fn_FalseElim :: val -> val -> val
+fn_FalseElim = (\v0 -> (\v1 -> error "Impossible"))
+
+data TT_Ex = forall arg. TT_ex_intro arg arg arg arg 
+
+instance Project TT_Ex where
+    project 3 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a3)::val)
+    project 2 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a2)::val)
+    project 1 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a1)::val)
+    project 0 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a0)::val)
+
+
+
+fn_ExElim :: val -> val -> val -> val -> val -> val
+fn_ExElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (case ((coerce v2)::TT_Ex) of { TT_ex_intro _ _ _ _  -> (((coerce v4)::val->val->val) ((coerce (project 2((coerce v2)::TT_Ex)))::val) ((coerce (project 3((coerce v2)::TT_Ex)))::val) ) ; }))))))
+
+data TT_Or = forall arg. TT_or_intro_l arg arg arg | forall arg. TT_or_intro_r arg arg arg 
+
+instance Project TT_Or where
+    project 2 (TT_or_intro_l  a0 a1 a2) = ((coerce a2)::val)
+    project 1 (TT_or_intro_l  a0 a1 a2) = ((coerce a1)::val)
+    project 0 (TT_or_intro_l  a0 a1 a2) = ((coerce a0)::val)
+
+
+    project 2 (TT_or_intro_r  a0 a1 a2) = ((coerce a2)::val)
+    project 1 (TT_or_intro_r  a0 a1 a2) = ((coerce a1)::val)
+    project 0 (TT_or_intro_r  a0 a1 a2) = ((coerce a0)::val)
+
+
+
+fn_OrElim :: val -> val -> val -> val -> val -> val -> val
+fn_OrElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (case ((coerce v2)::TT_Or) of { TT_or_intro_l _ _ _  -> (((coerce v4)::val->val) ((coerce (project 2((coerce v2)::TT_Or)))::val) ) ; TT_or_intro_r _ _ _  -> (((coerce v5)::val->val) ((coerce (project 2((coerce v2)::TT_Or)))::val) ) ; })))))))
+
+data TT_And = forall arg. TT_and_intro arg arg arg arg 
+
+instance Project TT_And where
+    project 3 (TT_and_intro  a0 a1 a2 a3) = ((coerce a3)::val)
+    project 2 (TT_and_intro  a0 a1 a2 a3) = ((coerce a2)::val)
+    project 1 (TT_and_intro  a0 a1 a2 a3) = ((coerce a1)::val)
+    project 0 (TT_and_intro  a0 a1 a2 a3) = ((coerce a0)::val)
+
+
+
+fn_AndElim :: val -> val -> val -> val -> val -> val
+fn_AndElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (case ((coerce v2)::TT_And) of { TT_and_intro _ _ _ _  -> (((coerce v4)::val->val->val) ((coerce (project 2((coerce v2)::TT_And)))::val) ((coerce (project 3((coerce v2)::TT_And)))::val) ) ; }))))))
+
+data TT_Eq = forall arg. TT_refl arg arg 
+
+instance Project TT_Eq where
+    project 1 (TT_refl  a0 a1) = ((coerce a1)::val)
+    project 0 (TT_refl  a0 a1) = ((coerce a0)::val)
+
+
+
+fn_EqElim :: val -> val -> val -> val -> val -> val -> val
+fn_EqElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (case ((coerce v3)::TT_Eq) of { TT_refl _ _  -> v5 ; })))))))
+
+fn_plus_eq_fst_sym :: val -> val -> val -> val -> val
+fn_plus_eq_fst_sym = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v0)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v0)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v0)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v0)::val) ))::val) ((coerce (((coerce fn_plus_comm)::val->val->val) ((coerce v0)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus_comm)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (((coerce fn_plus_eq_fst)::val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ))))
+
+fn_plus_eq_fst :: val -> val -> val -> val -> val
+fn_plus_eq_fst = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v2)::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (\v3 -> v3))::val) ((coerce (\v3 -> (\v4 -> (\v5 -> (((coerce v4)::val->val) ((coerce (((coerce fn_s_injective)::val->val->val->val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v3)::val) ((coerce (\v6 -> ((coerce Type)::val)))::val) ((coerce (\v6 -> v6))::val) ((coerce (\v6 -> (\v7 -> (\v8 -> (coerce (TT_S ((coerce (((coerce v7)::val->val) ((coerce v8)::val) ))::val) )::val)))))::val) ((coerce v0)::val) ))::val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v3)::val) ((coerce (\v6 -> ((coerce Type)::val)))::val) ((coerce (\v6 -> v6))::val) ((coerce (\v6 -> (\v7 -> (\v8 -> (coerce (TT_S ((coerce (((coerce v7)::val->val) ((coerce v8)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) ((coerce v5)::val) ))::val) )))))::val) ))))
+
+fn_plus_assoc :: val -> val -> val -> val
+fn_plus_assoc = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v3 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) ((coerce v2)::val) ))::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v1)::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (\v3 -> v3))::val) ((coerce (\v3 -> (\v4 -> (\v5 -> (coerce (TT_S ((coerce (((coerce v4)::val->val) ((coerce v5)::val) ))::val) )::val)))))::val) ((coerce v2)::val) ))::val) )::val))::val) ((coerce (\v3 -> (\v4 -> (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) ((coerce v2)::val) ))::val) ((coerce v4)::val) ))::val) ((coerce (\v5 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce v5)::val) )::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (coerce (TT_S ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) )::val))::val) ((coerce v2)::val) ))::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v3)::val) ((coerce (\v5 -> ((coerce Type)::val)))::val) ((coerce (\v5 -> v5))::val) ((coerce (\v5 -> (\v6 -> (\v7 -> (coerce (TT_S ((coerce (((coerce v6)::val->val) ((coerce v7)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) ((coerce (\v5 -> ((coerce Type)::val)))::val) ((coerce (\v5 -> v5))::val) ((coerce (\v5 -> (\v6 -> (\v7 -> (coerce (TT_S ((coerce (((coerce v6)::val->val) ((coerce v7)::val) ))::val) )::val)))))::val) ((coerce v2)::val) ))::val) )::val))::val) )::val))::val) ))))::val) ))))
+
+fn_plus_comm :: val -> val -> val
+fn_plus_comm = (\v0 -> (\v1 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v2 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) )))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (coerce (TT_O )::val))::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plusnO)::val->val) ((coerce v1)::val) ))::val) ))::val) ((coerce (\v2 -> (\v3 -> (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce v3)::val) ))::val) ((coerce (\v4 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce v4)::val) )::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v2)::val) )::val))::val) ))::val) )))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v2)::val) )::val))::val) ))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) )::val))::val) ((coerce (((coerce fn_plusnSm)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ))))::val) )))
+
+fn_plusnSm :: val -> val -> val
+fn_plusnSm = (\v0 -> (\v1 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v2 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) )::val))::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) )::val))::val) ((coerce (\v2 -> (\v3 -> (((coerce fn_eq_resp_S)::val->val->val->val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v2)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce (\v4 -> v4))::val) ((coerce (\v4 -> (\v5 -> (\v6 -> (coerce (TT_S ((coerce (((coerce v5)::val->val) ((coerce v6)::val) ))::val) )::val)))))::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v2)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce (\v4 -> v4))::val) ((coerce (\v4 -> (\v5 -> (\v6 -> (coerce (TT_S ((coerce (((coerce v5)::val->val) ((coerce v6)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) )::val))::val) ((coerce v3)::val) ))))::val) )))
+
+fn_plusnO :: val -> val
+fn_plusnO = (\v0 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v1 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce v1)::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_O )::val))::val) )::val))::val) ((coerce (\v1 -> (\v2 -> (((coerce fn_eq_resp_S)::val->val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce v1)::val) ((coerce v2)::val) ))))::val) ))
+
+fn_discriminate_Nat :: val -> val -> val -> val
+fn_discriminate_Nat = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_FalseElim)::val->val->val) ((coerce (((coerce fn_notO_S)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (\v3 -> v0))::val) ))))
+
+fn_notn_S :: val -> val -> val
+fn_notn_S = (\v0 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v1 -> (((coerce fn_not)::val->val) ((coerce (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ))::val) )))::val) ((coerce (((coerce fn_notO_S)::val->val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce (\v1 -> (\v2 -> (\v3 -> (((coerce v2)::val->val) ((coerce (((coerce fn_s_injective)::val->val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ((coerce v3)::val) ))::val) )))))::val) ))
+
+fn_notO_S :: val -> val -> val
+fn_notO_S = (\v0 -> (\v1 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_O )::val))::val) ((coerce (coerce (TT_S ((coerce v0)::val) )::val))::val) ((coerce v1)::val) ((coerce (\v2 -> (\v3 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v2)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce ((coerce Type)::val))::val) ((coerce (\v4 -> (\v5 -> ((coerce Type)::val))))::val) ))))::val) ((coerce (coerce (TT_II )::val))::val) )))
+
+fn_s_injective :: val -> val -> val -> val
+fn_s_injective = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_eq_resp_f)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce ((coerce Type)::val))::val) ((coerce (\v3 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v3)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce v0)::val) ((coerce (\v4 -> (\v5 -> v4)))::val) )))::val) ((coerce (coerce (TT_S ((coerce v0)::val) )::val))::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ((coerce v2)::val) ))))
+
+fn_eq_resp_S :: val -> val -> val -> val
+fn_eq_resp_S = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_eq_resp_f)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce ((coerce Type)::val))::val) ((coerce (\v3 -> (coerce (TT_S ((coerce v3)::val) )::val)))::val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ))))
+
+fn_simplifyS :: val -> val -> val
+fn_simplifyS = (\v0 -> (\v1 -> (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v0)::val) ((coerce (\v2 -> ((coerce Type)::val)))::val) ((coerce (\v2 -> v2))::val) ((coerce (\v2 -> (\v3 -> (\v4 -> (coerce (TT_S ((coerce (((coerce v3)::val->val) ((coerce v4)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) )::val))::val) )::val)))
+
+fn_simplifyO :: val -> val
+fn_simplifyO = (\v0 -> (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce v0)::val) )::val))
+
+fn_plus :: val -> val -> val
+fn_plus = (\v0 -> (\v1 -> (((coerce fn_plus_AP_)::val->val->val) ((coerce v0)::val) ((coerce v1)::val) )))
+
+fn_plus_AP_ :: val -> val -> val
+fn_plus_AP_ = (\v0 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v1 -> ((coerce Type)::val)))::val) ((coerce (\v1 -> v1))::val) ((coerce (\v1 -> (\v2 -> (\v3 -> (coerce (TT_S ((coerce (((coerce v2)::val->val) ((coerce v3)::val) ))::val) )::val)))))::val) ))
+
+fn_or_commutes :: val -> val -> val -> val
+fn_or_commutes = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_OrElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce (\v3 -> (((coerce ((coerce Type)::val))::val->val->val) ((coerce v1)::val) ((coerce v0)::val) )))::val) ((coerce (\v3 -> (coerce (TT_or_intro_r ((coerce v1)::val) ((coerce v0)::val) ((coerce v3)::val) )::val)))::val) ((coerce (\v3 -> (coerce (TT_or_intro_l ((coerce v1)::val) ((coerce v0)::val) ((coerce v3)::val) )::val)))::val) ))))
+
+fn_and_commutes :: val -> val -> val -> val
+fn_and_commutes = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_AndElim)::val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce (\v3 -> (((coerce ((coerce Type)::val))::val->val->val) ((coerce v1)::val) ((coerce v0)::val) )))::val) ((coerce (\v3 -> (\v4 -> (coerce (TT_and_intro ((coerce v1)::val) ((coerce v0)::val) ((coerce v4)::val) ((coerce v3)::val) )::val))))::val) ))))
+
+fn_notElim :: val -> val -> val -> val
+fn_notElim = (\v0 -> (\v1 -> (\v2 -> (((coerce v1)::val->val) ((coerce v2)::val) ))))
+
+fn_not :: val -> val
+fn_not = (\v0 -> ((coerce Type)::val))
+
+fn_eq_resp_f :: val -> val -> val -> val -> val -> val -> val
+fn_eq_resp_f = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v3)::val) ((coerce v4)::val) ((coerce v5)::val) ((coerce (\v6 -> (\v7 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce v1)::val) ((coerce (((coerce v2)::val->val) ((coerce v3)::val) ))::val) ((coerce (((coerce v2)::val->val) ((coerce v6)::val) ))::val) ))))::val) ((coerce (coerce (TT_refl ((coerce v1)::val) ((coerce (((coerce v2)::val->val) ((coerce v3)::val) ))::val) )::val))::val) )))))))
+
+fn_sym :: val -> val -> val -> val -> val
+fn_sym = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce v3)::val) ((coerce (\v4 -> (\v5 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce v0)::val) ((coerce v4)::val) ((coerce v1)::val) ))))::val) ((coerce (coerce (TT_refl ((coerce v0)::val) ((coerce v1)::val) )::val))::val) )))))
+
+fn_trans :: val -> val -> val -> val -> val -> val -> val
+fn_trans = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v2)::val) ((coerce v3)::val) ((coerce v5)::val) ((coerce (\v6 -> (\v7 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v6)::val) ))))::val) ((coerce v4)::val) )))))))
+
+fn_repl :: val -> val -> val -> val -> val -> val -> val
+fn_repl = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce v3)::val) ((coerce (\v6 -> (\v7 -> (((coerce v4)::val->val) ((coerce v6)::val) ))))::val) ((coerce v5)::val) )))))))
+
diff --git a/examplett/Test.hs b/examplett/Test.hs
new file mode 100644
--- /dev/null
+++ b/examplett/Test.hs
@@ -0,0 +1,166 @@
+{-# OPTIONS_GHC -fglasgow-exts #-} 
+
+module Test where
+
+import GHC.Base
+
+coerce :: a -> b
+coerce = unsafeCoerce#
+
+data Type = Type
+data Val = Val
+
+class Project x where
+    project :: forall val. Int -> x -> val
+
+data TT_Nat = TT_O | forall arg. TT_S arg 
+
+instance Project TT_Nat where
+
+
+    project 0 (TT_S  a0) = ((coerce a0)::val)
+
+
+
+fn_NatElim :: val -> val -> val -> val -> val
+fn_NatElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (case ((coerce v0)::TT_Nat) of { TT_O  -> v2 ; TT_S _  -> (((coerce v3)::val->val->val) ((coerce (project 0((coerce v0)::TT_Nat)))::val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val) ((coerce (project 0((coerce v0)::TT_Nat)))::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce v3)::val) ))::val) ) ; })))))
+
+data TT_True = TT_II 
+
+instance Project TT_True where
+
+
+
+fn_TrueElim :: val -> val -> val -> val
+fn_TrueElim = (\v0 -> (\v1 -> (\v2 -> (case ((coerce v0)::TT_True) of { TT_II  -> v2 ; }))))
+
+data TT_False = TT_False
+
+instance Project TT_False where
+
+fn_FalseElim :: val -> val -> val
+fn_FalseElim = (\v0 -> (\v1 -> error "Impossible"))
+
+data TT_Ex = forall arg. TT_ex_intro arg arg arg arg 
+
+instance Project TT_Ex where
+    project 3 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a3)::val)
+    project 2 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a2)::val)
+    project 1 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a1)::val)
+    project 0 (TT_ex_intro  a0 a1 a2 a3) = ((coerce a0)::val)
+
+
+
+fn_ExElim :: val -> val -> val -> val -> val -> val
+fn_ExElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (case ((coerce v2)::TT_Ex) of { TT_ex_intro _ _ _ _  -> (((coerce v4)::val->val->val) ((coerce (project 2((coerce v2)::TT_Ex)))::val) ((coerce (project 3((coerce v2)::TT_Ex)))::val) ) ; }))))))
+
+data TT_Or = forall arg. TT_or_intro_l arg arg arg | forall arg. TT_or_intro_r arg arg arg 
+
+instance Project TT_Or where
+    project 2 (TT_or_intro_l  a0 a1 a2) = ((coerce a2)::val)
+    project 1 (TT_or_intro_l  a0 a1 a2) = ((coerce a1)::val)
+    project 0 (TT_or_intro_l  a0 a1 a2) = ((coerce a0)::val)
+
+
+    project 2 (TT_or_intro_r  a0 a1 a2) = ((coerce a2)::val)
+    project 1 (TT_or_intro_r  a0 a1 a2) = ((coerce a1)::val)
+    project 0 (TT_or_intro_r  a0 a1 a2) = ((coerce a0)::val)
+
+
+
+fn_OrElim :: val -> val -> val -> val -> val -> val -> val
+fn_OrElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (case ((coerce v2)::TT_Or) of { TT_or_intro_l _ _ _  -> (((coerce v4)::val->val) ((coerce (project 2((coerce v2)::TT_Or)))::val) ) ; TT_or_intro_r _ _ _  -> (((coerce v5)::val->val) ((coerce (project 2((coerce v2)::TT_Or)))::val) ) ; })))))))
+
+data TT_And = forall arg. TT_and_intro arg arg arg arg 
+
+instance Project TT_And where
+    project 3 (TT_and_intro  a0 a1 a2 a3) = ((coerce a3)::val)
+    project 2 (TT_and_intro  a0 a1 a2 a3) = ((coerce a2)::val)
+    project 1 (TT_and_intro  a0 a1 a2 a3) = ((coerce a1)::val)
+    project 0 (TT_and_intro  a0 a1 a2 a3) = ((coerce a0)::val)
+
+
+
+fn_AndElim :: val -> val -> val -> val -> val -> val
+fn_AndElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (case ((coerce v2)::TT_And) of { TT_and_intro _ _ _ _  -> (((coerce v4)::val->val->val) ((coerce (project 2((coerce v2)::TT_And)))::val) ((coerce (project 3((coerce v2)::TT_And)))::val) ) ; }))))))
+
+data TT_Eq = forall arg. TT_refl arg arg 
+
+instance Project TT_Eq where
+    project 1 (TT_refl  a0 a1) = ((coerce a1)::val)
+    project 0 (TT_refl  a0 a1) = ((coerce a0)::val)
+
+
+
+fn_EqElim :: val -> val -> val -> val -> val -> val -> val
+fn_EqElim = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (case ((coerce v3)::TT_Eq) of { TT_refl _ _  -> v5 ; })))))))
+
+fn_plus_eq_fst_sym :: val -> val -> val -> val -> val
+fn_plus_eq_fst_sym = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v0)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v0)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v0)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v0)::val) ))::val) ((coerce (((coerce fn_plus_comm)::val->val->val) ((coerce v0)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus_comm)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (((coerce fn_plus_eq_fst)::val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ))))
+
+fn_plus_eq_fst :: val -> val -> val -> val -> val
+fn_plus_eq_fst = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v2)::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (\v3 -> v3))::val) ((coerce (\v3 -> (\v4 -> (\v5 -> (((coerce v4)::val->val) ((coerce (((coerce fn_s_injective)::val->val->val->val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v3)::val) ((coerce (\v6 -> ((coerce Type)::val)))::val) ((coerce (\v6 -> v6))::val) ((coerce (\v6 -> (\v7 -> (\v8 -> (coerce (TT_S ((coerce (((coerce v7)::val->val) ((coerce v8)::val) ))::val) )::val)))))::val) ((coerce v0)::val) ))::val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v3)::val) ((coerce (\v6 -> ((coerce Type)::val)))::val) ((coerce (\v6 -> v6))::val) ((coerce (\v6 -> (\v7 -> (\v8 -> (coerce (TT_S ((coerce (((coerce v7)::val->val) ((coerce v8)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) ((coerce v5)::val) ))::val) )))))::val) ))))
+
+fn_plus_assoc :: val -> val -> val -> val
+fn_plus_assoc = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v3 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) ((coerce v2)::val) ))::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v1)::val) ((coerce (\v3 -> ((coerce Type)::val)))::val) ((coerce (\v3 -> v3))::val) ((coerce (\v3 -> (\v4 -> (\v5 -> (coerce (TT_S ((coerce (((coerce v4)::val->val) ((coerce v5)::val) ))::val) )::val)))))::val) ((coerce v2)::val) ))::val) )::val))::val) ((coerce (\v3 -> (\v4 -> (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) ((coerce v2)::val) ))::val) ((coerce v4)::val) ))::val) ((coerce (\v5 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce v5)::val) )::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (coerce (TT_S ((coerce (((coerce fn_plus)::val->val->val) ((coerce v3)::val) ((coerce v1)::val) ))::val) )::val))::val) ((coerce v2)::val) ))::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v3)::val) ((coerce (\v5 -> ((coerce Type)::val)))::val) ((coerce (\v5 -> v5))::val) ((coerce (\v5 -> (\v6 -> (\v7 -> (coerce (TT_S ((coerce (((coerce v6)::val->val) ((coerce v7)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) ((coerce (\v5 -> ((coerce Type)::val)))::val) ((coerce (\v5 -> v5))::val) ((coerce (\v5 -> (\v6 -> (\v7 -> (coerce (TT_S ((coerce (((coerce v6)::val->val) ((coerce v7)::val) ))::val) )::val)))))::val) ((coerce v2)::val) ))::val) )::val))::val) )::val))::val) ))))::val) ))))
+
+fn_plus_comm :: val -> val -> val
+fn_plus_comm = (\v0 -> (\v1 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v2 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) )))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce (coerce (TT_O )::val))::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plusnO)::val->val) ((coerce v1)::val) ))::val) ))::val) ((coerce (\v2 -> (\v3 -> (((coerce fn_repl)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce v3)::val) ))::val) ((coerce (\v4 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce v4)::val) )::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v2)::val) )::val))::val) ))::val) )))::val) ((coerce (((coerce fn_sym)::val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v2)::val) )::val))::val) ))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) )::val))::val) ((coerce (((coerce fn_plusnSm)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ))::val) ))))::val) )))
+
+fn_plusnSm :: val -> val -> val
+fn_plusnSm = (\v0 -> (\v1 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v2 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_plus)::val->val->val) ((coerce v2)::val) ((coerce v1)::val) ))::val) )::val))::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) )::val))::val) ((coerce (\v2 -> (\v3 -> (((coerce fn_eq_resp_S)::val->val->val->val) ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v2)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce (\v4 -> v4))::val) ((coerce (\v4 -> (\v5 -> (\v6 -> (coerce (TT_S ((coerce (((coerce v5)::val->val) ((coerce v6)::val) ))::val) )::val)))))::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v2)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce (\v4 -> v4))::val) ((coerce (\v4 -> (\v5 -> (\v6 -> (coerce (TT_S ((coerce (((coerce v5)::val->val) ((coerce v6)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) )::val))::val) ((coerce v3)::val) ))))::val) )))
+
+fn_plusnO :: val -> val
+fn_plusnO = (\v0 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v1 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce v1)::val) )))::val) ((coerce (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_O )::val))::val) )::val))::val) ((coerce (\v1 -> (\v2 -> (((coerce fn_eq_resp_S)::val->val->val->val) ((coerce (((coerce fn_plus)::val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce v1)::val) ((coerce v2)::val) ))))::val) ))
+
+fn_discriminate_Nat :: val -> val -> val -> val
+fn_discriminate_Nat = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_FalseElim)::val->val->val) ((coerce (((coerce fn_notO_S)::val->val->val) ((coerce v1)::val) ((coerce v2)::val) ))::val) ((coerce (\v3 -> v0))::val) ))))
+
+fn_notn_S :: val -> val -> val
+fn_notn_S = (\v0 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v1 -> (((coerce fn_not)::val->val) ((coerce (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ))::val) )))::val) ((coerce (((coerce fn_notO_S)::val->val) ((coerce (coerce (TT_O )::val))::val) ))::val) ((coerce (\v1 -> (\v2 -> (\v3 -> (((coerce v2)::val->val) ((coerce (((coerce fn_s_injective)::val->val->val->val) ((coerce v1)::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ((coerce v3)::val) ))::val) )))))::val) ))
+
+fn_notO_S :: val -> val -> val
+fn_notO_S = (\v0 -> (\v1 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_O )::val))::val) ((coerce (coerce (TT_S ((coerce v0)::val) )::val))::val) ((coerce v1)::val) ((coerce (\v2 -> (\v3 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v2)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce ((coerce Type)::val))::val) ((coerce (\v4 -> (\v5 -> ((coerce Type)::val))))::val) ))))::val) ((coerce (coerce (TT_II )::val))::val) )))
+
+fn_s_injective :: val -> val -> val -> val
+fn_s_injective = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_eq_resp_f)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce ((coerce Type)::val))::val) ((coerce (\v3 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v3)::val) ((coerce (\v4 -> ((coerce Type)::val)))::val) ((coerce v0)::val) ((coerce (\v4 -> (\v5 -> v4)))::val) )))::val) ((coerce (coerce (TT_S ((coerce v0)::val) )::val))::val) ((coerce (coerce (TT_S ((coerce v1)::val) )::val))::val) ((coerce v2)::val) ))))
+
+fn_eq_resp_S :: val -> val -> val -> val
+fn_eq_resp_S = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_eq_resp_f)::val->val->val->val->val->val->val) ((coerce ((coerce Type)::val))::val) ((coerce ((coerce Type)::val))::val) ((coerce (\v3 -> (coerce (TT_S ((coerce v3)::val) )::val)))::val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ))))
+
+fn_simplifyS :: val -> val -> val
+fn_simplifyS = (\v0 -> (\v1 -> (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce (coerce (TT_S ((coerce (((coerce fn_NatElim)::val->val->val->val->val->val) ((coerce v0)::val) ((coerce (\v2 -> ((coerce Type)::val)))::val) ((coerce (\v2 -> v2))::val) ((coerce (\v2 -> (\v3 -> (\v4 -> (coerce (TT_S ((coerce (((coerce v3)::val->val) ((coerce v4)::val) ))::val) )::val)))))::val) ((coerce v1)::val) ))::val) )::val))::val) )::val)))
+
+fn_simplifyO :: val -> val
+fn_simplifyO = (\v0 -> (coerce (TT_refl ((coerce ((coerce Type)::val))::val) ((coerce v0)::val) )::val))
+
+fn_plus :: val -> val -> val
+fn_plus = (\v0 -> (\v1 -> (((coerce fn_plus_AP_)::val->val->val) ((coerce v0)::val) ((coerce v1)::val) )))
+
+fn_plus_AP_ :: val -> val -> val
+fn_plus_AP_ = (\v0 -> (((coerce fn_NatElim)::val->val->val->val->val) ((coerce v0)::val) ((coerce (\v1 -> ((coerce Type)::val)))::val) ((coerce (\v1 -> v1))::val) ((coerce (\v1 -> (\v2 -> (\v3 -> (coerce (TT_S ((coerce (((coerce v2)::val->val) ((coerce v3)::val) ))::val) )::val)))))::val) ))
+
+fn_or_commutes :: val -> val -> val -> val
+fn_or_commutes = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_OrElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce (\v3 -> (((coerce ((coerce Type)::val))::val->val->val) ((coerce v1)::val) ((coerce v0)::val) )))::val) ((coerce (\v3 -> (coerce (TT_or_intro_r ((coerce v1)::val) ((coerce v0)::val) ((coerce v3)::val) )::val)))::val) ((coerce (\v3 -> (coerce (TT_or_intro_l ((coerce v1)::val) ((coerce v0)::val) ((coerce v3)::val) )::val)))::val) ))))
+
+fn_and_commutes :: val -> val -> val -> val
+fn_and_commutes = (\v0 -> (\v1 -> (\v2 -> (((coerce fn_AndElim)::val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce (\v3 -> (((coerce ((coerce Type)::val))::val->val->val) ((coerce v1)::val) ((coerce v0)::val) )))::val) ((coerce (\v3 -> (\v4 -> (coerce (TT_and_intro ((coerce v1)::val) ((coerce v0)::val) ((coerce v4)::val) ((coerce v3)::val) )::val))))::val) ))))
+
+fn_notElim :: val -> val -> val -> val
+fn_notElim = (\v0 -> (\v1 -> (\v2 -> (((coerce v1)::val->val) ((coerce v2)::val) ))))
+
+fn_not :: val -> val
+fn_not = (\v0 -> ((coerce Type)::val))
+
+fn_eq_resp_f :: val -> val -> val -> val -> val -> val -> val
+fn_eq_resp_f = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v3)::val) ((coerce v4)::val) ((coerce v5)::val) ((coerce (\v6 -> (\v7 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce v1)::val) ((coerce (((coerce v2)::val->val) ((coerce v3)::val) ))::val) ((coerce (((coerce v2)::val->val) ((coerce v6)::val) ))::val) ))))::val) ((coerce (coerce (TT_refl ((coerce v1)::val) ((coerce (((coerce v2)::val->val) ((coerce v3)::val) ))::val) )::val))::val) )))))))
+
+fn_sym :: val -> val -> val -> val -> val
+fn_sym = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce v3)::val) ((coerce (\v4 -> (\v5 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce v0)::val) ((coerce v4)::val) ((coerce v1)::val) ))))::val) ((coerce (coerce (TT_refl ((coerce v0)::val) ((coerce v1)::val) )::val))::val) )))))
+
+fn_trans :: val -> val -> val -> val -> val -> val -> val
+fn_trans = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v2)::val) ((coerce v3)::val) ((coerce v5)::val) ((coerce (\v6 -> (\v7 -> (((coerce ((coerce Type)::val))::val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v6)::val) ))))::val) ((coerce v4)::val) )))))))
+
+fn_repl :: val -> val -> val -> val -> val -> val -> val
+fn_repl = (\v0 -> (\v1 -> (\v2 -> (\v3 -> (\v4 -> (\v5 -> (((coerce fn_EqElim)::val->val->val->val->val->val->val) ((coerce v0)::val) ((coerce v1)::val) ((coerce v2)::val) ((coerce v3)::val) ((coerce (\v6 -> (\v7 -> (((coerce v4)::val->val) ((coerce v6)::val) ))))::val) ((coerce v5)::val) )))))))
+
diff --git a/examplett/ack.tt b/examplett/ack.tt
new file mode 100644
--- /dev/null
+++ b/examplett/ack.tt
@@ -0,0 +1,35 @@
+Load "nat.tt";
+
+Primitives;
+
+natToInt : (x:Nat)Int;
+intros;
+induction x;
+fill 0;
+intros;
+fill addInt 1 k_IH;
+Qed;
+
+ack:(x,y:Nat)<ack x y: Nat>;
+intro x;
+induction x;
+intros;
+return;
+fill (S y);
+intros;
+induction y0;
+return;
+call ack k (S O);
+intros;
+refine k_IH;
+fill call <ack (S k) k0> k_IH0;
+Qed;
+
+runack = [x,y:Int](natToInt (call <ack (intToNat x) (intToNat y)>
+            (ack (intToNat x) (intToNat y))));
+
+Eval runack 2 6; {- 15 -}
+Eval runack 3 4; {- 125 -}
+Eval runack 3 5; {- 253 -}
+
+Eval runack 4 4; {- no chance -}
diff --git a/examplett/eq.tt b/examplett/eq.tt
new file mode 100644
--- /dev/null
+++ b/examplett/eq.tt
@@ -0,0 +1,31 @@
+Data Eq (A:*)(a:A) : (b:A)* where refl : Eq A a a;
+
+repl : (A:*)(a:A)(b:A)(q:Eq _ a b)(P:(a:A)*)(p:P a)(P b);
+intros;
+induction q;
+fill p;
+Qed;
+Freeze repl;
+
+trans : (A:*)(a:A)(b:A)(c:A)(p:Eq _ a b)(q:Eq _ b c)(Eq _ a c);
+intros;
+induction q;
+fill p;
+Qed;
+Freeze trans;
+
+sym : (A:*)(a:A)(b:A)(p:Eq _ a b)(Eq _ b a);
+intros;
+induction p;
+refine refl;
+Qed;
+Freeze sym;
+
+Repl Eq repl sym;
+
+eq_resp_f:(A,B:*)(f:(a:A)B)(x:A)(y:A)(q:Eq _ x y)(Eq _ (f x) (f y));
+intros;
+induction q;
+refine refl;
+Qed;
+Freeze eq_resp_f;
diff --git a/examplett/fin.tt b/examplett/fin.tt
new file mode 100644
--- /dev/null
+++ b/examplett/fin.tt
@@ -0,0 +1,16 @@
+Load "lt.tt";
+
+Data Fin : (n:Nat)* where
+      fz : (k:Nat)(Fin (S k))
+    | fs : (k:Nat)(i:Fin k)(Fin (S k));
+
+mkFin : (m,n:Nat)(p:Lt m n)(Fin n);
+intros;
+induction p;
+intros;
+refine fz;
+intros;
+refine fs;
+fill p_IH;
+Qed;
+
diff --git a/examplett/general.tt b/examplett/general.tt
new file mode 100644
--- /dev/null
+++ b/examplett/general.tt
@@ -0,0 +1,32 @@
+Data Nat:* = O:Nat | S:(k:Nat)Nat;
+
+General Y;
+
+genplus:(m:Nat)(n:Nat)Nat;
+by Y;
+intro PLUS m n;
+induction m;
+fill n;
+intros;
+fill S (PLUS k n);
+Qed;
+
+undefined:(A:*)A;
+by Y;
+intro UNDEF A;
+refine UNDEF;
+Qed;
+Freeze undefined;
+
+Data List (A:*) : * = nil:List A | cons:(x:A)(xs:List A)List A;
+
+head:(A:*)(xs:List A)A;
+intros;
+induction xs;
+refine undefined;
+intros;
+refine x;
+Qed;
+
+Eval head _ (cons _ O (nil Nat));
+Eval head _ (nil Nat);
diff --git a/examplett/interp.tt b/examplett/interp.tt
new file mode 100644
--- /dev/null
+++ b/examplett/interp.tt
@@ -0,0 +1,2 @@
+Load "nat.tt";
+
diff --git a/examplett/jmeq.tt b/examplett/jmeq.tt
new file mode 100644
--- /dev/null
+++ b/examplett/jmeq.tt
@@ -0,0 +1,173 @@
+Equality Eq refl;
+
+repl : (A:*)(x:A)(y:A)(q:Eq _ _ x y)(P:(m:A)*)(p:P x)(P y);
+intros;
+by EqElim _ _ _ q;
+fill p;
+Qed;
+Freeze repl;
+
+trans : (A:*)(a:A)(b:A)(c:A)(p:Eq _ _ a b)(q:Eq _ _ b c)(Eq _ _ a c);
+intros;
+by EqElim _ _ _ q;
+fill p;
+Qed;
+Freeze trans;
+
+sym : (A:*)(a:A)(b:A)(p:Eq _ _ a b)(Eq _ _ b a);
+intros;
+by EqElim _ _ _ p;
+refine refl;
+Qed;
+Freeze sym;
+
+Repl Eq repl sym;
+
+eq_resp_f:(A,B:*)(f:(a:A)B)(x:A)(y:A)(q:Eq _ _ x y)(Eq _ _ (f x) (f y));
+intros;
+by EqElim _ _ _ q;
+refine refl;
+Qed;
+Freeze eq_resp_f;
+
+Data Nat:* = O:Nat | S:(k:Nat)Nat;
+
+plus' : (m:Nat)(n:Nat)<plus' m n : Nat>;
+intro m;
+induction m;
+intros;
+fill return n;
+intros;
+fill return (S (call <plus' k n0> (k_IH n0)));
+Qed;
+
+plus = [m:Nat][n:Nat](call <plus' m n> (plus' m n));
+
+simplifyO:(n:Nat)(Eq _ _ (plus O n) n);
+intros;
+refine refl;
+Qed;
+
+simplifyS:(m,n:Nat)(Eq _ _ (plus (S m) n) (S (plus m n)));
+intros;
+refine refl;
+Qed;
+
+eq_resp_S:(n:Nat)(m:Nat)(q:Eq _ _ n m)(Eq _ _ (S n) (S m));
+intros;
+fill (eq_resp_f _ _ S n m q);
+Qed;
+Freeze eq_resp_S;
+
+s_injective:(n:Nat)(m:Nat)(q:Eq _ _ (S n) (S m))(Eq _ _ n m);
+intros;
+local unS:(m:Nat)Nat;
+intros;
+induction m0;
+fill n;
+intros;
+fill k;
+fill eq_resp_f _ _ unS _ _ q;
+Qed;
+Freeze s_injective;
+
+notO_S:(k:Nat)(not (Eq _ _ O (S k)));
+intros;
+equiv (q:Eq _ _ O (S k))False;
+intros;
+local dmotive : (x:Nat)(q:Eq _ _ O x)*;
+intros;
+induction x;
+fill True;
+intros;
+fill False;
+fill EqElim _ _ _ q dmotive II;
+Qed;
+Freeze notO_S;
+
+notn_S:(n:Nat)(not (Eq _ n (S n)));
+intro;
+induction n;
+fill notO_S O;
+intros;
+equiv (q:Eq _ (S k) (S (S k)))False;
+intros;
+claim q:Eq _ k (S k);
+fill k_IH q0;
+refine s_injective;
+fill q;
+Qed;
+Freeze notn_S;
+
+discriminate_Nat:(A:*)(k:Nat)(q:Eq _ O (S k))A;
+intros;
+local false:False;
+fill notO_S k q;
+induction false;
+Qed;
+Freeze discriminate_Nat;
+
+plusnO:(n:Nat)(Eq _ _ (plus n O) n);
+intro;
+induction n;
+refine refl;
+intros;
+equiv Eq _ _ (S (plus k O)) (S k);
+refine eq_resp_S;
+fill k_IH;
+Qed;
+Freeze plusnO;
+
+plusnSm:(n:Nat)(m:Nat)(Eq _ _ (plus n (S m)) (S (plus n m)));
+intros;
+induction n;
+refine refl;
+intros;
+refine eq_resp_S;
+fill k_IH;
+Qed;
+Freeze plusnSm;
+
+plus_comm:(n:Nat)(m:Nat)(Eq _ _ (plus n m) (plus m n));
+intros;
+induction n;
+refine sym;
+refine plusnO;
+intros;
+equiv Eq _ _ (S (plus k m)) (plus m (S k));
+replace k_IH;
+refine sym;
+refine plusnSm;
+Qed;
+Freeze plus_comm;
+
+plus_assoc:(m,n,p:Nat)(Eq _ _ (plus m (plus n p)) (plus (plus m n) p));
+intros;
+induction m;
+refine refl;
+intros;
+equiv Eq _ _ (S (plus k (plus n p))) (plus (S (plus k n)) p);
+replace k_IH;
+refine refl;
+Qed;
+Freeze plus_assoc;
+
+plus_eq_fst : (m,n,p:Nat)(q:Eq _ _ (plus p m) (plus p n))(Eq _ _ m n);
+intro m n p;
+induction p;
+intros;
+fill q;
+intros;
+refine k_IH;
+refine s_injective;
+refine q0;
+Qed;
+Freeze plus_eq_fst;
+
+plus_eq_fst_sym : (m,n,p:Nat)(q:Eq _ _ (plus m p) (plus n p))(Eq _ _ m n);
+intro m n p;
+replace plus_comm m p;
+replace plus_comm n p;
+fill plus_eq_fst m n p;
+Qed;
+Freeze plus_eq_fst_sym;
diff --git a/examplett/logic.tt b/examplett/logic.tt
new file mode 100644
--- /dev/null
+++ b/examplett/logic.tt
@@ -0,0 +1,54 @@
+Data And (A:*)(B:*) : * where and_intro : (a:A)(b:B)(And A B);
+
+Data Or (A:*)(B:*) : * where
+       or_intro_l : (a:A)(Or A B)
+     | or_intro_r : (b:B)(Or A B);
+
+Data Ex (A:*)(P:(a:A)*) : * where ex_intro : (x:A)(p:P x)(Ex A P);
+
+Data False : * where ;
+
+Data True : * where II : True ;
+
+not = [A:*](a:A)False;
+
+notElim = [A:*][p:not A][pp:A](p pp);
+
+Axiom classical:(P:*)(Or P (not P));
+
+and_commutes : (A:*)(B:*)(p:And A B)(And B A);
+intros;
+induction p;
+intros;
+split;
+trivial;
+trivial;
+Qed;
+Freeze and_commutes;
+
+or_commutes : (A:*)(B:*)(p:Or A B)(Or B A);
+intros;
+induction p;
+intros;
+right;
+trivial;
+intros;
+left;
+trivial;
+Qed;
+Freeze or_commutes;
+
+implies : ((a:*)(Or a (not a)))->
+          (A:*)(B:*)(A -> B) -> (Or (not A) B);
+intros;
+case (X A);
+intros;
+right;
+refine X0;
+trivial;
+intros;
+left;
+trivial;
+Qed;
+
+
diff --git a/examplett/lt.tt b/examplett/lt.tt
new file mode 100644
--- /dev/null
+++ b/examplett/lt.tt
@@ -0,0 +1,26 @@
+Load "nat.tt";
+
+Data Lt : (m,n:Nat)* where
+    ltO : (m:Nat)Lt O (S m)
+  | ltS : (m,n:Nat)(p:Lt m n)Lt (S m) (S n);
+
+LtmSn : (m,n:Nat)(p:Lt m n)(Lt m (S n));
+intros;
+induction p;
+intros;
+refine ltO;
+intros;
+refine ltS;
+fill p_IH;
+Qed;
+
+Ltmplus : (m,n,i:Nat)(p:Lt m n)(Lt m (plus n i));
+intros;
+induction p;
+intros;
+refine ltO;
+intro m2 n1;
+intros;
+refine ltS;
+fill p_IH;
+Qed;
diff --git a/examplett/nat.tt b/examplett/nat.tt
new file mode 100644
--- /dev/null
+++ b/examplett/nat.tt
@@ -0,0 +1,229 @@
+Load "eq.tt";
+Load "logic.tt";
+
+Data Nat:* where 
+   O:Nat 
+ | S:(k:Nat)Nat;
+
+plus : Nat -> Nat -> Nat;
+intro m;
+induction m;
+intros;
+fill X0;
+intros;
+fill S (k_IH X1);
+Qed;
+
+mult : (m:Nat) -> (n:Nat) -> Nat;
+intro m;
+induction m;
+intros;
+fill O;
+intros;
+fill (plus n0 (k_IH n0));
+Qed;
+
+simplifyO:(n:Nat)(Eq _ (plus O n) n);
+intros;
+refine refl;
+Qed;
+
+simplifyS:(m,n:Nat)(Eq _ (plus (S m) n) (S (plus m n)));
+intros;
+refine refl;
+Qed;
+
+eq_resp_S:(n:Nat)(m:Nat)(q:Eq _ n m)(Eq _ (S n) (S m));
+intros;
+fill (eq_resp_f _ _ S n m q);
+Qed;
+Freeze eq_resp_S;
+
+s_injective:(n:Nat)(m:Nat)(q:Eq _ (S n) (S m))(Eq _ n m);
+intros;
+local unS:(m:Nat)Nat;
+intros;
+induction m0;
+fill n;
+intros;
+fill k;
+fill eq_resp_f _ _ unS _ _ q;
+Qed;
+Freeze s_injective;
+
+notO_S:(k:Nat)(not (Eq _ O (S k)));
+intros;
+compute;
+intro q;
+local dmotive : (x:Nat)(q:Eq _ O x)*;
+intros;
+induction x;
+fill True;
+intros;
+fill False;
+fill EqElim _ _ _ q dmotive II;
+Qed;
+Freeze notO_S;
+
+notn_S:(n:Nat)(not (Eq _ n (S n)));
+intro;
+induction n;
+fill notO_S O;
+intros;
+unfold not;
+intros;
+claim q:Eq _ k (S k);
+fill k_IH q;
+refine s_injective;
+fill a;
+Qed;
+Freeze notn_S;
+
+discriminate_Nat:(A:*)(k:Nat)(q:Eq _ O (S k))A;
+intros;
+local false:False;
+fill notO_S k q;
+induction false;
+Qed;
+Freeze discriminate_Nat;
+
+plusnO:(n:Nat)(Eq _ (plus n O) n);
+intro;
+induction n;
+refine refl;
+intros;
+equiv Eq _ (S (plus k O)) (S k);
+refine eq_resp_S;
+fill k_IH;
+Qed;
+Freeze plusnO;
+
+plusnSm:(n:Nat)(m:Nat)(Eq _ (plus n (S m)) (S (plus n m)));
+intros;
+induction n;
+refine refl;
+intros;
+refine eq_resp_S;
+fill k_IH;
+Qed;
+Freeze plusnSm;
+
+plus_comm:(n:Nat)(m:Nat)(Eq _ (plus n m) (plus m n));
+intros;
+induction n;
+refine sym;
+refine plusnO;
+intros;
+equiv Eq _ (S (plus k m)) (plus m (S k));
+replace k_IH;
+refine sym;
+refine plusnSm;
+Qed;
+Freeze plus_comm;
+
+plus_assoc:(m,n,p:Nat)(Eq _ (plus m (plus n p)) (plus (plus m n) p));
+intros;
+induction m;
+refine refl;
+intros;
+equiv Eq _ (S (plus k (plus n p))) (plus (S (plus k n)) p);
+replace k_IH;
+refine refl;
+Qed;
+Freeze plus_assoc;
+
+plus_eq_fst : (m,n,p:Nat)(q:Eq _ (plus p m) (plus p n))(Eq _ m n);
+intro m n p;
+induction p;
+intros;
+fill q;
+intros;
+refine k_IH;
+refine s_injective;
+refine q0;
+Qed;
+Freeze plus_eq_fst;
+
+plus_eq_fst_sym : (m,n,p:Nat)(q:Eq _ (plus m p) (plus n p))(Eq _ m n);
+intro m n p;
+replace plus_comm m p;
+replace plus_comm n p;
+fill plus_eq_fst m n p;
+Qed;
+Freeze plus_eq_fst_sym;
+
+multnO:(n:Nat)(Eq _ (mult n O) O);
+intro;
+induction n;
+refine refl;
+intros;
+equiv Eq _ (plus O (mult k O)) O;
+replace k_IH;
+refine refl;
+Qed;
+Freeze multnO;
+
+multnSm:(n:Nat)(m:Nat)(Eq _ (mult n (S m)) (plus n (mult n m)));
+intro;
+induction n;
+intros;
+refine refl;
+intros;
+equiv Eq _ (S (plus m0 (mult k (S m0))))
+             (S (plus k (plus m0 (mult k m0))));
+refine eq_resp_S;
+replace (k_IH m0);
+generalise mult k m0;
+intros;
+replace (plus_comm m0 x);
+replace (plus_assoc k x m0);
+replace (plus_comm m0 (plus k x));
+refine refl;
+Qed;
+Freeze multnSm;
+
+mult_comm : (m,n:Nat) -> (Eq _ (mult m n) (mult n m));
+intro m;
+induction m;
+intros;
+replace (multnO n);
+refine refl;
+intros;
+replace (multnSm n0 k);
+replace sym (k_IH n0);
+refine refl;
+Qed;
+Freeze mult_comm;
+
+mult_distrib:(m,n,p:Nat)(Eq _ (plus (mult m p) (mult n p))
+                              (mult (plus m n) p));
+intros;
+induction m;
+refine refl;
+intros;
+equiv Eq _ (plus (plus p (mult k p)) (mult n p))
+           (plus p (mult (plus k n) p));
+replace sym k_IH;
+generalise mult k p;
+generalise mult n p;
+intro x y;
+replace plus_assoc p y x;
+refine refl;
+Qed;
+
+mult_assoc:(m,n,p:Nat)(Eq _ (mult m (mult n p)) (mult (mult m n) p));
+intro m;
+induction m;
+intros;
+compute;
+refine refl;
+intros;
+equiv Eq _ (plus (mult n0 p0) (mult k (mult n0 p0)))
+           (mult (plus n0 (mult k n0)) p0);
+replace k_IH n0 p0;
+generalise mult k n0;
+intros;
+replace mult_distrib n0 x p0;
+refine refl;
+Qed;
+
diff --git a/examplett/natsimpl.tt b/examplett/natsimpl.tt
new file mode 100644
--- /dev/null
+++ b/examplett/natsimpl.tt
@@ -0,0 +1,65 @@
+Data Nat:* = O:Nat | S:(k:Nat)Nat;
+
+plus : (m:Nat)(n:Nat)Nat;
+intro m;
+induction m;
+intros;
+fill n;
+intros;
+refine S;
+fill k_IH n0; 
+Qed;
+
+adderType : (m:Nat)(n:Nat)*;
+intros;
+induction m;
+fill Nat;
+intros;
+fill (n:Nat)k_IH;
+Qed;
+
+adder: (m:Nat)(n:Nat)(adderType m n);
+intro m;
+induction m;
+intros;
+fill n;
+intros;
+compute;
+intros;
+fill k_IH (plus n0 n1);
+Qed;
+
+mult:(m:Nat)(n:Nat)Nat;
+intros;
+induction m;
+fill O;
+intros;
+fill (plus n k_IH);
+Qed;
+
+fact:(m:Nat)Nat;
+intros;
+induction m;
+fill (S O);
+intros;
+fill (mult (S k) k_IH);
+Qed;
+
+
+testval = fact (S (S (S (S (S (S (S (S (S O)))))))));
+
+Data Vect (A:*):(n:Nat)* 
+    = vnil:Vect A O
+    | vcons:(k:Nat)(x:A)(xs:Vect A k)Vect A (S k);
+
+vectsum : (k:Nat)(v:Vect Nat k)Nat;
+intros;
+induction v;
+fill O;
+intros;
+fill (plus x xs_IH);
+Qed;
+
+testvect2 = vcons _ _ (S O) (vcons _ _ (S (S (S O))) (vnil Nat));
+testval2 = vectsum _ testvect2;
+
diff --git a/examplett/partial.tt b/examplett/partial.tt
new file mode 100644
--- /dev/null
+++ b/examplett/partial.tt
@@ -0,0 +1,53 @@
+{- Uustalu, Altenkirch and Capretta's Partiality monad -}
+
+Data Partial (A:*) : * = {- codata -}
+    Now : (a:A)Partial A
+  | Later : (p:Partial A)Partial A;
+
+Declare never:(A:*)Partial A;
+never = [A:*](Later _ (never A));
+
+returnD = [A:*][a:A]Now _ a;
+
+{- corecursive -}
+Rec bindD : (A,B:*)(d:Partial A)(k:(a:A)(Partial B))Partial B;
+intros;
+case d;
+intros;
+fill k a;
+intros;
+fill Later _ (bindD _ _ p k);
+Qed;
+
+{- corecursive -}
+Rec lfpAux : (A,B:*)(k:(a0:A)(Partial B))
+   (f:(fk:(a1:A)Partial B)(fa:A)Partial B)(a:A)Partial B;
+intros;
+case f k a;
+intros;
+fill Now _ a0;
+intros;
+fill Later _ (lfpAux _ _ (f k) f a);
+Qed;
+
+lfp = [A,B:*][f:(k:(a:A)Partial B)((a:A)Partial B)][a:A]
+        (lfpAux _ _ ([x:A]never B) f a);
+
+Load "nat.tt";
+
+fact : (x:Nat)Partial Nat;
+intros;
+refine lfp Nat;
+intro factfn arg;
+case arg;
+refine returnD;
+fill (S O);
+intros;
+case (factfn k);
+intros;
+refine returnD;
+fill (mult a (S k));
+intros;
+fill p;
+fill x;
+Qed;
diff --git a/examplett/plus.tt b/examplett/plus.tt
new file mode 100644
--- /dev/null
+++ b/examplett/plus.tt
@@ -0,0 +1,37 @@
+Datatype Nat {
+   TyCon Nat : *,
+   Con O : Nat,
+   Con S : (n:Nat)Nat,
+   Elim natElim : (n:Nat)(P:(n:Nat)*)
+                  (mz:(P O))
+		  (ms:(k:Nat)(ih:(P n))(P (S k)))
+		  (P n),
+   Scheme O,P,mz,ms -> mz
+   Scheme (S k),P,mz,ms -> ms k (natElim k P mz ms)
+};
+
+plus : (m:Nat)(n:Nat)Nat;
+intro;
+intro;
+claim A:*;
+claim mzero:A;
+claim msuc:(k:Nat)(ih:A)A;
+try natElim m ([n:Nat]A) mzero msuc;
+mzero.try n;
+solve;
+msuc.focus;
+attack M;
+intro;
+intro;
+try (S ih);
+solve;
+M.cut;
+msuc.solve;
+msuc.cut;
+H.solve;
+H.cut;
+mzero.cut;
+plus.tidy;
+solve;
+Lift;
+
diff --git a/examplett/staged.tt b/examplett/staged.tt
new file mode 100644
--- /dev/null
+++ b/examplett/staged.tt
@@ -0,0 +1,41 @@
+Load "nat.tt";
+
+code = {'(plus (S (S O)) (S (S O)))};
+
+plusQ = [a:Nat][b:Nat]{'plus a b};
+
+Check code;
+Eval code;
+
+Eval  !code;
+
+test = [a:Nat]{'[b:Nat]~(plusQ a b)};
+
+test2 = {'[A:*][x:{{A}}]~(!{'x})};
+
+
+
+Eval test (S (S (S O)));
+Eval !(test (S (S (S O)))) (S (S (S O)));
+
+code2 = {'plus ~code ~code};
+code3 = {'{'plus ~code ~code}};
+code4 = [x:{{Nat}}]{'plus ~x ~x};
+
+Eval code4 {'(plus (S O) (S O))};
+Eval !(code4 {'(plus (S O) (S O))});
+
+plusST : (m,n:{{Nat}}){{Nat}};
+intros;
+induction !m;
+fill n;
+intros;
+fill {'S ~k_IH};
+Qed;
+
+val = code4 {'(plus (S O) (S O))};
+
+Eval plusST val val;
+Eval !(plusST val val);
+
+Eval plusST;
diff --git a/examplett/stageplus.tt b/examplett/stageplus.tt
new file mode 100644
--- /dev/null
+++ b/examplett/stageplus.tt
@@ -0,0 +1,39 @@
+Load "nat.tt";
+
+-- plusST = lam m,n:{{Nat}}.
+--    case !m of
+--       O -> n
+--       S k -> {'S ~(plusST ~k n)}
+
+plusST:(m,n:{{Nat}}){{Nat}};
+intros;
+induction !m;
+fill n;
+intros;
+fill {'S ~k_IH};
+Qed;
+
+quote4 = {'plus (S (S O)) (S (S O))};
+
+quote8 = plusST quote4 quote4;
+
+Eval quote8;
+Eval !quote8;
+
+quotefoo = [m:Nat][n:Nat]{'plus (S (S O)) (([p:Nat](plus m p)) n)};
+
+mult:(m,n:Nat)Nat;
+intros;
+induction m;
+refine O;
+intros;
+refine (plus n k_IH);
+Qed;
+
+power:(m,x:Nat)Nat;
+induction m;
+fill (S O);
+intros;
+fill (mult x k_IH);
+Qed;
+
diff --git a/examplett/test.c b/examplett/test.c
new file mode 100644
--- /dev/null
+++ b/examplett/test.c
@@ -0,0 +1,2576 @@
+#include "closure.h"
+#include <stdio.h>
+
+#define FTAG_EVM_testval2 104
+VAL _EVM_testval2();
+#define FTAG_EVM_testvect2 103
+VAL _EVM_testvect2();
+#define FTAG_EVM_vectsum 100
+VAL _EVM_vectsum(VAL v0,VAL v1);
+#define FTAG_EVMSC_1_vectsum 101
+VAL _EVMSC_1_vectsum(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_0_vectsum 102
+VAL _EVMSC_0_vectsum(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_testvect 99
+VAL _EVM_testvect();
+#define FTAG_EVM_vtail 98
+VAL _EVM_vtail(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVM_vtailAux 93
+VAL _EVM_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_2_vtailAux 94
+VAL _EVMSC_2_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8);
+#define FTAG_EVMSC_3_vtailAux 95
+VAL _EVMSC_3_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8,VAL v9);
+#define FTAG_EVMSC_1_vtailAux 96
+VAL _EVMSC_1_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_0_vtailAux 97
+VAL _EVMSC_0_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVM_FinElim 92
+VAL _EVM_FinElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVM_VectElim 91
+VAL _EVM_VectElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVM_plus_eq_fst_sym 88
+VAL _EVM_plus_eq_fst_sym(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_1_plus_eq_fst_sym 89
+VAL _EVMSC_1_plus_eq_fst_sym(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_0_plus_eq_fst_sym 90
+VAL _EVMSC_0_plus_eq_fst_sym(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_plus_eq_fst 78
+VAL _EVM_plus_eq_fst(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_2_plus_eq_fst 79
+VAL _EVMSC_2_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_8_plus_eq_fst 80
+VAL _EVMSC_8_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8);
+#define FTAG_EVMSC_7_plus_eq_fst 81
+VAL _EVMSC_7_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6);
+#define FTAG_EVMSC_6_plus_eq_fst 82
+VAL _EVMSC_6_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6);
+#define FTAG_EVMSC_5_plus_eq_fst 83
+VAL _EVMSC_5_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8);
+#define FTAG_EVMSC_4_plus_eq_fst 84
+VAL _EVMSC_4_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6);
+#define FTAG_EVMSC_3_plus_eq_fst 85
+VAL _EVMSC_3_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6);
+#define FTAG_EVMSC_1_plus_eq_fst 86
+VAL _EVMSC_1_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_0_plus_eq_fst 87
+VAL _EVMSC_0_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_plus_assoc 65
+VAL _EVM_plus_assoc(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_4_plus_assoc 66
+VAL _EVMSC_4_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_11_plus_assoc 67
+VAL _EVMSC_11_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7);
+#define FTAG_EVMSC_10_plus_assoc 68
+VAL _EVMSC_10_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_9_plus_assoc 69
+VAL _EVMSC_9_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_8_plus_assoc 70
+VAL _EVMSC_8_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7);
+#define FTAG_EVMSC_7_plus_assoc 71
+VAL _EVMSC_7_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_6_plus_assoc 72
+VAL _EVMSC_6_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_5_plus_assoc 73
+VAL _EVMSC_5_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_3_plus_assoc 74
+VAL _EVMSC_3_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_2_plus_assoc 75
+VAL _EVMSC_2_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_1_plus_assoc 76
+VAL _EVMSC_1_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_0_plus_assoc 77
+VAL _EVMSC_0_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_plus_comm 61
+VAL _EVM_plus_comm(VAL v0,VAL v1);
+#define FTAG_EVMSC_1_plus_comm 62
+VAL _EVMSC_1_plus_comm(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_2_plus_comm 63
+VAL _EVMSC_2_plus_comm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_0_plus_comm 64
+VAL _EVMSC_0_plus_comm(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVM_plusnSm 52
+VAL _EVM_plusnSm(VAL v0,VAL v1);
+#define FTAG_EVMSC_1_plusnSm 53
+VAL _EVMSC_1_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_7_plusnSm 54
+VAL _EVMSC_7_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6);
+#define FTAG_EVMSC_6_plusnSm 55
+VAL _EVMSC_6_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_5_plusnSm 56
+VAL _EVMSC_5_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_4_plusnSm 57
+VAL _EVMSC_4_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6);
+#define FTAG_EVMSC_3_plusnSm 58
+VAL _EVMSC_3_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_2_plusnSm 59
+VAL _EVMSC_2_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_0_plusnSm 60
+VAL _EVMSC_0_plusnSm(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVM_plusnO 49
+VAL _EVM_plusnO(VAL v0);
+#define FTAG_EVMSC_1_plusnO 50
+VAL _EVMSC_1_plusnO(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_0_plusnO 51
+VAL _EVMSC_0_plusnO(VAL v0,VAL v1);
+#define FTAG_EVM_discriminate_Nat 47
+VAL _EVM_discriminate_Nat(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_0_discriminate_Nat 48
+VAL _EVMSC_0_discriminate_Nat(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_notn_S 44
+VAL _EVM_notn_S(VAL v0);
+#define FTAG_EVMSC_1_notn_S 45
+VAL _EVMSC_1_notn_S(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_0_notn_S 46
+VAL _EVMSC_0_notn_S(VAL v0,VAL v1);
+#define FTAG_EVM_notO_S 40
+VAL _EVM_notO_S(VAL v0,VAL v1);
+#define FTAG_EVMSC_0_notO_S 41
+VAL _EVMSC_0_notO_S(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_2_notO_S 42
+VAL _EVMSC_2_notO_S(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_1_notO_S 43
+VAL _EVMSC_1_notO_S(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVM_s_injective 36
+VAL _EVM_s_injective(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_0_s_injective 37
+VAL _EVMSC_0_s_injective(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_2_s_injective 38
+VAL _EVMSC_2_s_injective(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_1_s_injective 39
+VAL _EVMSC_1_s_injective(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVM_eq_resp_S 34
+VAL _EVM_eq_resp_S(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_0_eq_resp_S 35
+VAL _EVMSC_0_eq_resp_S(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_simplifyS 30
+VAL _EVM_simplifyS(VAL v0,VAL v1);
+#define FTAG_EVMSC_2_simplifyS 31
+VAL _EVMSC_2_simplifyS(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_1_simplifyS 32
+VAL _EVMSC_1_simplifyS(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_0_simplifyS 33
+VAL _EVMSC_0_simplifyS(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVM_simplifyO 29
+VAL _EVM_simplifyO(VAL v0);
+#define FTAG_EVM_plus 28
+VAL _EVM_plus(VAL v0,VAL v1);
+#define FTAG_EVM_plus' 24
+VAL _EVM_plus'(VAL v0);
+#define FTAG_EVMSC_2_plus' 25
+VAL _EVMSC_2_plus'(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_1_plus' 26
+VAL _EVMSC_1_plus'(VAL v0,VAL v1);
+#define FTAG_EVMSC_0_plus' 27
+VAL _EVMSC_0_plus'(VAL v0,VAL v1);
+#define FTAG_EVM_NatElim 23
+VAL _EVM_NatElim(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_or_commutes 19
+VAL _EVM_or_commutes(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_2_or_commutes 20
+VAL _EVMSC_2_or_commutes(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_1_or_commutes 21
+VAL _EVMSC_1_or_commutes(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_0_or_commutes 22
+VAL _EVMSC_0_or_commutes(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_and_commutes 16
+VAL _EVM_and_commutes(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVMSC_1_and_commutes 17
+VAL _EVMSC_1_and_commutes(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVMSC_0_and_commutes 18
+VAL _EVMSC_0_and_commutes(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVM_notElim 15
+VAL _EVM_notElim(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVM_not 14
+VAL _EVM_not(VAL v0);
+#define FTAG_EVM_TrueElim 13
+VAL _EVM_TrueElim(VAL v0,VAL v1,VAL v2);
+#define FTAG_EVM_FalseElim 12
+VAL _EVM_FalseElim(VAL v0,VAL v1);
+#define FTAG_EVM_ExElim 11
+VAL _EVM_ExElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVM_OrElim 10
+VAL _EVM_OrElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVM_AndElim 9
+VAL _EVM_AndElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4);
+#define FTAG_EVM_eq_resp_f 7
+VAL _EVM_eq_resp_f(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_0_eq_resp_f 8
+VAL _EVMSC_0_eq_resp_f(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7);
+#define FTAG_EVM_sym 5
+VAL _EVM_sym(VAL v0,VAL v1,VAL v2,VAL v3);
+#define FTAG_EVMSC_0_sym 6
+VAL _EVMSC_0_sym(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVM_trans 3
+VAL _EVM_trans(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_0_trans 4
+VAL _EVMSC_0_trans(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7);
+#define FTAG_EVM_repl 1
+VAL _EVM_repl(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+#define FTAG_EVMSC_0_repl 2
+VAL _EVMSC_0_repl(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7);
+#define FTAG_EVM_EqElim 0
+VAL _EVM_EqElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5);
+VAL eval(VAL x) {
+    if (x->ty != FUN) return x;
+    else {
+        function* f = (function*)(x -> info);
+        switch(f->ftag) {
+            EVALCASE(FTAG_EVM_testval2,0,_EVM_testval2());
+            EVALCASE(FTAG_EVM_testvect2,0,_EVM_testvect2());
+            EVALCASE(FTAG_EVM_vectsum,2,_EVM_vectsum(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVMSC_1_vectsum,6,_EVMSC_1_vectsum(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_0_vectsum,4,_EVMSC_0_vectsum(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_testvect,0,_EVM_testvect());
+            EVALCASE(FTAG_EVM_vtail,3,_EVM_vtail(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVM_vtailAux,4,_EVM_vtailAux(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_2_vtailAux,9,_EVMSC_2_vtailAux(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7),FARG(8)));
+            EVALCASE(FTAG_EVMSC_3_vtailAux,10,_EVMSC_3_vtailAux(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7),FARG(8),FARG(9)));
+            EVALCASE(FTAG_EVMSC_1_vtailAux,5,_EVMSC_1_vtailAux(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_0_vtailAux,6,_EVMSC_0_vtailAux(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVM_FinElim,5,_EVM_FinElim(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVM_VectElim,6,_EVM_VectElim(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVM_plus_eq_fst_sym,3,_EVM_plus_eq_fst_sym(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_1_plus_eq_fst_sym,4,_EVMSC_1_plus_eq_fst_sym(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_0_plus_eq_fst_sym,4,_EVMSC_0_plus_eq_fst_sym(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_plus_eq_fst,3,_EVM_plus_eq_fst(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_2_plus_eq_fst,6,_EVMSC_2_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_8_plus_eq_fst,9,_EVMSC_8_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7),FARG(8)));
+            EVALCASE(FTAG_EVMSC_7_plus_eq_fst,7,_EVMSC_7_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6)));
+            EVALCASE(FTAG_EVMSC_6_plus_eq_fst,7,_EVMSC_6_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6)));
+            EVALCASE(FTAG_EVMSC_5_plus_eq_fst,9,_EVMSC_5_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7),FARG(8)));
+            EVALCASE(FTAG_EVMSC_4_plus_eq_fst,7,_EVMSC_4_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6)));
+            EVALCASE(FTAG_EVMSC_3_plus_eq_fst,7,_EVMSC_3_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6)));
+            EVALCASE(FTAG_EVMSC_1_plus_eq_fst,4,_EVMSC_1_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_0_plus_eq_fst,4,_EVMSC_0_plus_eq_fst(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_plus_assoc,3,_EVM_plus_assoc(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_4_plus_assoc,5,_EVMSC_4_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_11_plus_assoc,8,_EVMSC_11_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7)));
+            EVALCASE(FTAG_EVMSC_10_plus_assoc,6,_EVMSC_10_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_9_plus_assoc,6,_EVMSC_9_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_8_plus_assoc,8,_EVMSC_8_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7)));
+            EVALCASE(FTAG_EVMSC_7_plus_assoc,6,_EVMSC_7_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_6_plus_assoc,6,_EVMSC_6_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_5_plus_assoc,6,_EVMSC_5_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_3_plus_assoc,6,_EVMSC_3_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_2_plus_assoc,4,_EVMSC_2_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_1_plus_assoc,4,_EVMSC_1_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_0_plus_assoc,4,_EVMSC_0_plus_assoc(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_plus_comm,2,_EVM_plus_comm(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVMSC_1_plus_comm,4,_EVMSC_1_plus_comm(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_2_plus_comm,5,_EVMSC_2_plus_comm(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_0_plus_comm,3,_EVMSC_0_plus_comm(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVM_plusnSm,2,_EVM_plusnSm(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVMSC_1_plusnSm,4,_EVMSC_1_plusnSm(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_7_plusnSm,7,_EVMSC_7_plusnSm(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6)));
+            EVALCASE(FTAG_EVMSC_6_plusnSm,5,_EVMSC_6_plusnSm(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_5_plusnSm,5,_EVMSC_5_plusnSm(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_4_plusnSm,7,_EVMSC_4_plusnSm(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6)));
+            EVALCASE(FTAG_EVMSC_3_plusnSm,5,_EVMSC_3_plusnSm(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_2_plusnSm,5,_EVMSC_2_plusnSm(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_0_plusnSm,3,_EVMSC_0_plusnSm(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVM_plusnO,1,_EVM_plusnO(FARG(0)));
+            EVALCASE(FTAG_EVMSC_1_plusnO,3,_EVMSC_1_plusnO(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_0_plusnO,2,_EVMSC_0_plusnO(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVM_discriminate_Nat,3,_EVM_discriminate_Nat(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_0_discriminate_Nat,4,_EVMSC_0_discriminate_Nat(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_notn_S,1,_EVM_notn_S(FARG(0)));
+            EVALCASE(FTAG_EVMSC_1_notn_S,4,_EVMSC_1_notn_S(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_0_notn_S,2,_EVMSC_0_notn_S(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVM_notO_S,2,_EVM_notO_S(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVMSC_0_notO_S,4,_EVMSC_0_notO_S(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_2_notO_S,6,_EVMSC_2_notO_S(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_1_notO_S,5,_EVMSC_1_notO_S(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVM_s_injective,3,_EVM_s_injective(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_0_s_injective,4,_EVMSC_0_s_injective(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_2_s_injective,6,_EVMSC_2_s_injective(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_1_s_injective,5,_EVMSC_1_s_injective(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVM_eq_resp_S,3,_EVM_eq_resp_S(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_0_eq_resp_S,4,_EVMSC_0_eq_resp_S(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_simplifyS,2,_EVM_simplifyS(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVMSC_2_simplifyS,5,_EVMSC_2_simplifyS(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_1_simplifyS,3,_EVMSC_1_simplifyS(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_0_simplifyS,3,_EVMSC_0_simplifyS(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVM_simplifyO,1,_EVM_simplifyO(FARG(0)));
+            EVALCASE(FTAG_EVM_plus,2,_EVM_plus(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVM_plus',1,_EVM_plus'(FARG(0)));
+            EVALCASE(FTAG_EVMSC_2_plus',4,_EVMSC_2_plus'(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_1_plus',2,_EVMSC_1_plus'(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVMSC_0_plus',2,_EVMSC_0_plus'(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVM_NatElim,4,_EVM_NatElim(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_or_commutes,3,_EVM_or_commutes(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_2_or_commutes,4,_EVMSC_2_or_commutes(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_1_or_commutes,4,_EVMSC_1_or_commutes(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_0_or_commutes,4,_EVMSC_0_or_commutes(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_and_commutes,3,_EVM_and_commutes(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVMSC_1_and_commutes,5,_EVMSC_1_and_commutes(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVMSC_0_and_commutes,4,_EVMSC_0_and_commutes(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVM_notElim,3,_EVM_notElim(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVM_not,1,_EVM_not(FARG(0)));
+            EVALCASE(FTAG_EVM_TrueElim,3,_EVM_TrueElim(FARG(0),FARG(1),FARG(2)));
+            EVALCASE(FTAG_EVM_FalseElim,2,_EVM_FalseElim(FARG(0),FARG(1)));
+            EVALCASE(FTAG_EVM_ExElim,5,_EVM_ExElim(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVM_OrElim,6,_EVM_OrElim(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVM_AndElim,5,_EVM_AndElim(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4)));
+            EVALCASE(FTAG_EVM_eq_resp_f,6,_EVM_eq_resp_f(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_0_eq_resp_f,8,_EVMSC_0_eq_resp_f(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7)));
+            EVALCASE(FTAG_EVM_sym,4,_EVM_sym(FARG(0),FARG(1),FARG(2),FARG(3)));
+            EVALCASE(FTAG_EVMSC_0_sym,6,_EVMSC_0_sym(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVM_trans,6,_EVM_trans(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_0_trans,8,_EVMSC_0_trans(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7)));
+            EVALCASE(FTAG_EVM_repl,6,_EVM_repl(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+            EVALCASE(FTAG_EVMSC_0_repl,8,_EVMSC_0_repl(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5),FARG(6),FARG(7)));
+            EVALCASE(FTAG_EVM_EqElim,6,_EVM_EqElim(FARG(0),FARG(1),FARG(2),FARG(3),FARG(4),FARG(5)));
+        }
+    }
+    return x;
+}
+VAL _EVM_testval2() {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp3 = MKCON0(0);
+    tmp2 = MKCON1(1,tmp3);
+    tmp1 = MKCON1(1,tmp2);
+    tmp2 = _EVM_testvect2();
+    return _EVM_vectsum(tmp1,tmp2);
+}
+
+VAL _EVM_testvect2() {
+
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp3 = MKCON0(0);
+    tmp2 = MKCON1(1,tmp3);
+    tmp4 = MKCON0(0);
+    tmp3 = MKCON1(1,tmp4);
+    tmp5 = MKTYPE;
+    tmp6 = MKCON0(0);
+    tmp10 = MKCON0(0);
+    tmp9 = MKCON1(1,tmp10);
+    tmp8 = MKCON1(1,tmp9);
+    tmp7 = MKCON1(1,tmp8);
+    tmp9 = MKTYPE;
+    tmp8 = MKCON1(0,tmp9);
+    args = MKARGS(4);
+    args[0] = tmp5;
+    args[1] = tmp6;
+    args[2] = tmp7;
+    args[3] = tmp8;
+    tmp4 = MKCONN(1,args,4);
+    args = MKARGS(4);
+    args[0] = tmp1;
+    args[1] = tmp2;
+    args[2] = tmp3;
+    args[3] = tmp4;
+    tmp0 = MKCONN(1,args,4);
+    return tmp0;
+}
+
+VAL _EVM_vectsum(VAL v0,VAL v1) {
+
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v0;
+    tmp3 = v1;
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp4 = CLOSURE2(FTAG_EVMSC_0_vectsum,2,tmp5,tmp6);
+    tmp5 = MKCON0(0);
+    tmp7 = v0;
+    tmp8 = v1;
+    tmp6 = CLOSURE2(FTAG_EVMSC_1_vectsum,2,tmp7,tmp8);
+    return _EVM_VectElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_1_vectsum(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v3;
+    tmp2 = v5;
+    return _EVM_plus(tmp1,tmp2);
+}
+
+VAL _EVMSC_0_vectsum(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_testvect() {
+
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKCON0(0);
+    tmp4 = MKCON0(0);
+    tmp3 = MKCON1(1,tmp4);
+    tmp5 = MKTYPE;
+    tmp4 = MKCON1(0,tmp5);
+    args = MKARGS(4);
+    args[0] = tmp1;
+    args[1] = tmp2;
+    args[2] = tmp3;
+    args[3] = tmp4;
+    tmp0 = MKCONN(1,args,4);
+    return tmp0;
+}
+
+VAL _EVM_vtail(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v1;
+    tmp4 = v1;
+    tmp3 = MKCON1(1,tmp4);
+    tmp4 = v2;
+    tmp6 = MKTYPE;
+    tmp8 = v1;
+    tmp7 = MKCON1(1,tmp8);
+    args = MKARGS(2);
+    args[0] = tmp6;
+    args[1] = tmp7;
+    tmp5 = MKCONN(0,args,2);
+    tmp0 = CLOSURE5(FTAG_EVM_vtailAux,5,tmp1,tmp2,tmp3,tmp4,tmp5);
+    return tmp0;
+}
+
+VAL _EVM_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v2;
+    tmp3 = v3;
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp8 = v3;
+    tmp4 = CLOSURE4(FTAG_EVMSC_0_vtailAux,4,tmp5,tmp6,tmp7,tmp8);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp5 = CLOSURE4(FTAG_EVMSC_1_vtailAux,4,tmp6,tmp7,tmp8,tmp9);
+    tmp7 = v0;
+    tmp8 = v1;
+    tmp9 = v2;
+    tmp10 = v3;
+    tmp6 = CLOSURE4(FTAG_EVMSC_2_vtailAux,4,tmp7,tmp8,tmp9,tmp10);
+    return _EVM_VectElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_2_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8) {
+
+    VAL tmp14;
+    VAL tmp13;
+    VAL tmp12;
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v4;
+    tmp3 = v1;
+    tmp5 = MKTYPE;
+    tmp6 = v1;
+    tmp7 = v4;
+    tmp9 = v1;
+    tmp10 = v4;
+    tmp11 = v8;
+    tmp8 = _EVM_s_injective(tmp9,tmp10,tmp11);
+    tmp4 = _EVM_sym(tmp5,tmp6,tmp7,tmp8);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp10 = v4;
+    tmp11 = v5;
+    tmp12 = v6;
+    tmp13 = v7;
+    tmp14 = v8;
+    args = MKARGS(9);
+    args[0] = tmp6;
+    args[1] = tmp7;
+    args[2] = tmp8;
+    args[3] = tmp9;
+    args[4] = tmp10;
+    args[5] = tmp11;
+    args[6] = tmp12;
+    args[7] = tmp13;
+    args[8] = tmp14;
+    tmp5 = CLOSUREN(FTAG_EVMSC_3_vtailAux,9,args,9);
+    tmp6 = v6;
+    return _EVM_repl(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_3_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8,VAL v9) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v0;
+    tmp3 = v9;
+    tmp0 = CLOSUREADD2(tmp1,tmp2,tmp3);
+    return tmp0;
+}
+
+VAL _EVMSC_1_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = MKTYPE;
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp1 = CLOSUREADD2(tmp2,tmp3,tmp4);
+    tmp2 = v1;
+    tmp4 = MKTYPE;
+    tmp6 = v1;
+    tmp5 = MKCON1(1,tmp6);
+    tmp6 = MKCON0(0);
+    tmp7 = v4;
+    tmp3 = _EVM_sym(tmp4,tmp5,tmp6,tmp7);
+    return _EVM_discriminate_Nat(tmp1,tmp2,tmp3);
+}
+
+VAL _EVMSC_0_vtailAux(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_FinElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    eval(v1);
+    switch(TAG(v1)) {
+    case 0:
+    tmp1 = v3;
+    tmp3 = v1;
+    tmp2 = GETCONARG(tmp3,0);
+    tmp0 = CLOSUREADD1(tmp1,tmp2);
+    return tmp0;
+
+    case 1:
+    tmp1 = v4;
+    tmp3 = v1;
+    tmp2 = GETCONARG(tmp3,0);
+    tmp4 = v1;
+    tmp3 = GETCONARG(tmp4,1);
+    tmp6 = v1;
+    tmp5 = GETCONARG(tmp6,0);
+    tmp7 = v1;
+    tmp6 = GETCONARG(tmp7,1);
+    tmp7 = v2;
+    tmp8 = v3;
+    tmp9 = v4;
+    tmp4 = _EVM_FinElim(tmp5,tmp6,tmp7,tmp8,tmp9);
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
+VAL _EVM_VectElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    eval(v2);
+    switch(TAG(v2)) {
+    case 0:
+    tmp0 = v4;
+    return tmp0;
+
+    case 1:
+    tmp1 = v5;
+    tmp3 = v2;
+    tmp2 = GETCONARG(tmp3,1);
+    tmp4 = v2;
+    tmp3 = GETCONARG(tmp4,2);
+    tmp5 = v2;
+    tmp4 = GETCONARG(tmp5,3);
+    tmp7 = v2;
+    tmp6 = GETCONARG(tmp7,0);
+    tmp8 = v2;
+    tmp7 = GETCONARG(tmp8,1);
+    tmp9 = v2;
+    tmp8 = GETCONARG(tmp9,3);
+    tmp9 = v3;
+    tmp10 = v4;
+    tmp11 = v5;
+    tmp5 = _EVM_VectElim(tmp6,tmp7,tmp8,tmp9,tmp10,tmp11);
+    tmp0 = CLOSUREADD4(tmp1,tmp2,tmp3,tmp4,tmp5);
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
+VAL _EVM_plus_eq_fst_sym(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp16;
+    VAL tmp15;
+    VAL tmp14;
+    VAL tmp13;
+    VAL tmp12;
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp3 = v2;
+    tmp4 = v0;
+    tmp2 = _EVM_plus(tmp3,tmp4);
+    tmp4 = v0;
+    tmp5 = v2;
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp5 = MKTYPE;
+    tmp7 = v0;
+    tmp8 = v2;
+    tmp6 = _EVM_plus(tmp7,tmp8);
+    tmp8 = v2;
+    tmp9 = v0;
+    tmp7 = _EVM_plus(tmp8,tmp9);
+    tmp9 = v0;
+    tmp10 = v2;
+    tmp8 = _EVM_plus_comm(tmp9,tmp10);
+    tmp4 = _EVM_sym(tmp5,tmp6,tmp7,tmp8);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp5 = CLOSURE3(FTAG_EVMSC_0_plus_eq_fst_sym,3,tmp6,tmp7,tmp8);
+    tmp7 = MKTYPE;
+    tmp9 = v2;
+    tmp10 = v1;
+    tmp8 = _EVM_plus(tmp9,tmp10);
+    tmp10 = v1;
+    tmp11 = v2;
+    tmp9 = _EVM_plus(tmp10,tmp11);
+    tmp11 = MKTYPE;
+    tmp13 = v1;
+    tmp14 = v2;
+    tmp12 = _EVM_plus(tmp13,tmp14);
+    tmp14 = v2;
+    tmp15 = v1;
+    tmp13 = _EVM_plus(tmp14,tmp15);
+    tmp15 = v1;
+    tmp16 = v2;
+    tmp14 = _EVM_plus_comm(tmp15,tmp16);
+    tmp10 = _EVM_sym(tmp11,tmp12,tmp13,tmp14);
+    tmp12 = v0;
+    tmp13 = v1;
+    tmp14 = v2;
+    tmp11 = CLOSURE3(FTAG_EVMSC_1_plus_eq_fst_sym,3,tmp12,tmp13,tmp14);
+    tmp13 = v0;
+    tmp14 = v1;
+    tmp15 = v2;
+    tmp12 = _EVM_plus_eq_fst(tmp13,tmp14,tmp15);
+    tmp6 = _EVM_repl(tmp7,tmp8,tmp9,tmp10,tmp11,tmp12);
+    return _EVM_repl(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_1_plus_eq_fst_sym(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_0_plus_eq_fst_sym(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_plus_eq_fst(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v2;
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp5 = v2;
+    tmp2 = CLOSURE3(FTAG_EVMSC_0_plus_eq_fst,3,tmp3,tmp4,tmp5);
+    tmp4 = v0;
+    tmp5 = v1;
+    tmp6 = v2;
+    tmp3 = CLOSURE3(FTAG_EVMSC_1_plus_eq_fst,3,tmp4,tmp5,tmp6);
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp4 = CLOSURE3(FTAG_EVMSC_2_plus_eq_fst,3,tmp5,tmp6,tmp7);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_2_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp14;
+    VAL tmp13;
+    VAL tmp12;
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v4;
+    tmp4 = v3;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp10 = v4;
+    tmp11 = v5;
+    args = MKARGS(6);
+    args[0] = tmp6;
+    args[1] = tmp7;
+    args[2] = tmp8;
+    args[3] = tmp9;
+    args[4] = tmp10;
+    args[5] = tmp11;
+    tmp5 = CLOSUREN(FTAG_EVMSC_3_plus_eq_fst,6,args,6);
+    tmp7 = v0;
+    tmp8 = v1;
+    tmp9 = v2;
+    tmp10 = v3;
+    tmp11 = v4;
+    tmp12 = v5;
+    args = MKARGS(6);
+    args[0] = tmp7;
+    args[1] = tmp8;
+    args[2] = tmp9;
+    args[3] = tmp10;
+    args[4] = tmp11;
+    args[5] = tmp12;
+    tmp6 = CLOSUREN(FTAG_EVMSC_4_plus_eq_fst,6,args,6);
+    tmp8 = v0;
+    tmp9 = v1;
+    tmp10 = v2;
+    tmp11 = v3;
+    tmp12 = v4;
+    tmp13 = v5;
+    args = MKARGS(6);
+    args[0] = tmp8;
+    args[1] = tmp9;
+    args[2] = tmp10;
+    args[3] = tmp11;
+    args[4] = tmp12;
+    args[5] = tmp13;
+    tmp7 = CLOSUREN(FTAG_EVMSC_5_plus_eq_fst,6,args,6);
+    tmp8 = v0;
+    tmp3 = CLOSURE5(FTAG_EVM_NatElim,5,tmp4,tmp5,tmp6,tmp7,tmp8);
+    tmp5 = v3;
+    tmp7 = v0;
+    tmp8 = v1;
+    tmp9 = v2;
+    tmp10 = v3;
+    tmp11 = v4;
+    tmp12 = v5;
+    args = MKARGS(6);
+    args[0] = tmp7;
+    args[1] = tmp8;
+    args[2] = tmp9;
+    args[3] = tmp10;
+    args[4] = tmp11;
+    args[5] = tmp12;
+    tmp6 = CLOSUREN(FTAG_EVMSC_6_plus_eq_fst,6,args,6);
+    tmp8 = v0;
+    tmp9 = v1;
+    tmp10 = v2;
+    tmp11 = v3;
+    tmp12 = v4;
+    tmp13 = v5;
+    args = MKARGS(6);
+    args[0] = tmp8;
+    args[1] = tmp9;
+    args[2] = tmp10;
+    args[3] = tmp11;
+    args[4] = tmp12;
+    args[5] = tmp13;
+    tmp7 = CLOSUREN(FTAG_EVMSC_7_plus_eq_fst,6,args,6);
+    tmp9 = v0;
+    tmp10 = v1;
+    tmp11 = v2;
+    tmp12 = v3;
+    tmp13 = v4;
+    tmp14 = v5;
+    args = MKARGS(6);
+    args[0] = tmp9;
+    args[1] = tmp10;
+    args[2] = tmp11;
+    args[3] = tmp12;
+    args[4] = tmp13;
+    args[5] = tmp14;
+    tmp8 = CLOSUREN(FTAG_EVMSC_8_plus_eq_fst,6,args,6);
+    tmp9 = v1;
+    tmp4 = CLOSURE5(FTAG_EVM_NatElim,5,tmp5,tmp6,tmp7,tmp8,tmp9);
+    tmp5 = v5;
+    tmp2 = _EVM_s_injective(tmp3,tmp4,tmp5);
+    tmp0 = CLOSUREADD1(tmp1,tmp2);
+    return tmp0;
+}
+
+VAL _EVMSC_8_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v7;
+    tmp3 = v8;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_7_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v6;
+    return tmp0;
+}
+
+VAL _EVMSC_6_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_5_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7,VAL v8) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v7;
+    tmp3 = v8;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_4_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v6;
+    return tmp0;
+}
+
+VAL _EVMSC_3_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_1_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v3;
+    return tmp0;
+}
+
+VAL _EVMSC_0_plus_eq_fst(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_plus_assoc(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp12;
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp5 = v2;
+    tmp2 = CLOSURE3(FTAG_EVMSC_0_plus_assoc,3,tmp3,tmp4,tmp5);
+    tmp4 = MKTYPE;
+    tmp6 = v1;
+    tmp8 = v0;
+    tmp9 = v1;
+    tmp10 = v2;
+    tmp7 = CLOSURE3(FTAG_EVMSC_1_plus_assoc,3,tmp8,tmp9,tmp10);
+    tmp9 = v0;
+    tmp10 = v1;
+    tmp11 = v2;
+    tmp8 = CLOSURE3(FTAG_EVMSC_2_plus_assoc,3,tmp9,tmp10,tmp11);
+    tmp10 = v0;
+    tmp11 = v1;
+    tmp12 = v2;
+    tmp9 = CLOSURE3(FTAG_EVMSC_3_plus_assoc,3,tmp10,tmp11,tmp12);
+    tmp10 = v2;
+    tmp5 = CLOSURE5(FTAG_EVM_NatElim,5,tmp6,tmp7,tmp8,tmp9,tmp10);
+    args = MKARGS(2);
+    args[0] = tmp4;
+    args[1] = tmp5;
+    tmp3 = MKCONN(0,args,2);
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp4 = CLOSURE3(FTAG_EVMSC_4_plus_assoc,3,tmp5,tmp6,tmp7);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_4_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp19;
+    VAL tmp18;
+    VAL tmp17;
+    VAL tmp16;
+    VAL tmp15;
+    VAL tmp14;
+    VAL tmp13;
+    VAL tmp12;
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp4 = v3;
+    tmp5 = v1;
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp4 = v2;
+    tmp2 = _EVM_plus(tmp3,tmp4);
+    tmp4 = v3;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp5 = _EVM_plus(tmp6,tmp7);
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp5 = MKTYPE;
+    tmp7 = v3;
+    tmp9 = v1;
+    tmp10 = v2;
+    tmp8 = _EVM_plus(tmp9,tmp10);
+    tmp6 = _EVM_plus(tmp7,tmp8);
+    tmp9 = v3;
+    tmp10 = v1;
+    tmp8 = _EVM_plus(tmp9,tmp10);
+    tmp9 = v2;
+    tmp7 = _EVM_plus(tmp8,tmp9);
+    tmp8 = v4;
+    tmp4 = _EVM_sym(tmp5,tmp6,tmp7,tmp8);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp10 = v4;
+    tmp5 = CLOSURE5(FTAG_EVMSC_5_plus_assoc,5,tmp6,tmp7,tmp8,tmp9,tmp10);
+    tmp7 = MKTYPE;
+    tmp11 = v3;
+    tmp13 = v0;
+    tmp14 = v1;
+    tmp15 = v2;
+    tmp16 = v3;
+    tmp17 = v4;
+    tmp12 = CLOSURE5(FTAG_EVMSC_6_plus_assoc,5,tmp13,tmp14,tmp15,tmp16,tmp17);
+    tmp14 = v0;
+    tmp15 = v1;
+    tmp16 = v2;
+    tmp17 = v3;
+    tmp18 = v4;
+    tmp13 = CLOSURE5(FTAG_EVMSC_7_plus_assoc,5,tmp14,tmp15,tmp16,tmp17,tmp18);
+    tmp15 = v0;
+    tmp16 = v1;
+    tmp17 = v2;
+    tmp18 = v3;
+    tmp19 = v4;
+    tmp14 = CLOSURE5(FTAG_EVMSC_8_plus_assoc,5,tmp15,tmp16,tmp17,tmp18,tmp19);
+    tmp15 = v1;
+    tmp10 = CLOSURE5(FTAG_EVM_NatElim,5,tmp11,tmp12,tmp13,tmp14,tmp15);
+    tmp12 = v0;
+    tmp13 = v1;
+    tmp14 = v2;
+    tmp15 = v3;
+    tmp16 = v4;
+    tmp11 = CLOSURE5(FTAG_EVMSC_9_plus_assoc,5,tmp12,tmp13,tmp14,tmp15,tmp16);
+    tmp13 = v0;
+    tmp14 = v1;
+    tmp15 = v2;
+    tmp16 = v3;
+    tmp17 = v4;
+    tmp12 = CLOSURE5(FTAG_EVMSC_10_plus_assoc,5,tmp13,tmp14,tmp15,tmp16,tmp17);
+    tmp14 = v0;
+    tmp15 = v1;
+    tmp16 = v2;
+    tmp17 = v3;
+    tmp18 = v4;
+    tmp13 = CLOSURE5(FTAG_EVMSC_11_plus_assoc,5,tmp14,tmp15,tmp16,tmp17,tmp18);
+    tmp14 = v2;
+    tmp9 = CLOSURE5(FTAG_EVM_NatElim,5,tmp10,tmp11,tmp12,tmp13,tmp14);
+    tmp8 = MKCON1(1,tmp9);
+    args = MKARGS(2);
+    args[0] = tmp7;
+    args[1] = tmp8;
+    tmp6 = MKCONN(0,args,2);
+    return _EVM_repl(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_11_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v6;
+    tmp3 = v7;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_10_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v5;
+    return tmp0;
+}
+
+VAL _EVMSC_9_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_8_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v6;
+    tmp3 = v7;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_7_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v5;
+    return tmp0;
+}
+
+VAL _EVMSC_6_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_5_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v5;
+    tmp3 = MKCON1(1,tmp4);
+    tmp7 = v3;
+    tmp8 = v1;
+    tmp6 = _EVM_plus(tmp7,tmp8);
+    tmp5 = MKCON1(1,tmp6);
+    tmp6 = v2;
+    tmp4 = _EVM_plus(tmp5,tmp6);
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVMSC_3_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v4;
+    tmp3 = v5;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_2_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v3;
+    return tmp0;
+}
+
+VAL _EVMSC_1_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_0_plus_assoc(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v3;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp5 = _EVM_plus(tmp6,tmp7);
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp6 = v3;
+    tmp7 = v1;
+    tmp5 = _EVM_plus(tmp6,tmp7);
+    tmp6 = v2;
+    tmp4 = _EVM_plus(tmp5,tmp6);
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVM_plus_comm(VAL v0,VAL v1) {
+
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp2 = CLOSURE2(FTAG_EVMSC_0_plus_comm,2,tmp3,tmp4);
+    tmp4 = MKTYPE;
+    tmp6 = v1;
+    tmp7 = MKCON0(0);
+    tmp5 = _EVM_plus(tmp6,tmp7);
+    tmp7 = MKCON0(0);
+    tmp8 = v1;
+    tmp6 = _EVM_plus(tmp7,tmp8);
+    tmp8 = v1;
+    tmp7 = _EVM_plusnO(tmp8);
+    tmp3 = _EVM_sym(tmp4,tmp5,tmp6,tmp7);
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp4 = CLOSURE2(FTAG_EVMSC_1_plus_comm,2,tmp5,tmp6);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_1_plus_comm(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp12;
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp3 = v1;
+    tmp4 = v2;
+    tmp2 = _EVM_plus(tmp3,tmp4);
+    tmp4 = v2;
+    tmp5 = v1;
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp5 = MKTYPE;
+    tmp7 = v2;
+    tmp8 = v1;
+    tmp6 = _EVM_plus(tmp7,tmp8);
+    tmp8 = v1;
+    tmp9 = v2;
+    tmp7 = _EVM_plus(tmp8,tmp9);
+    tmp8 = v3;
+    tmp4 = _EVM_sym(tmp5,tmp6,tmp7,tmp8);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp5 = CLOSURE4(FTAG_EVMSC_2_plus_comm,4,tmp6,tmp7,tmp8,tmp9);
+    tmp7 = MKTYPE;
+    tmp9 = v1;
+    tmp11 = v2;
+    tmp10 = MKCON1(1,tmp11);
+    tmp8 = _EVM_plus(tmp9,tmp10);
+    tmp11 = v1;
+    tmp12 = v2;
+    tmp10 = _EVM_plus(tmp11,tmp12);
+    tmp9 = MKCON1(1,tmp10);
+    tmp11 = v1;
+    tmp12 = v2;
+    tmp10 = _EVM_plusnSm(tmp11,tmp12);
+    tmp6 = _EVM_sym(tmp7,tmp8,tmp9,tmp10);
+    return _EVM_repl(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_2_plus_comm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v4;
+    tmp3 = MKCON1(1,tmp4);
+    tmp5 = v1;
+    tmp7 = v2;
+    tmp6 = MKCON1(1,tmp7);
+    tmp4 = _EVM_plus(tmp5,tmp6);
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVMSC_0_plus_comm(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v2;
+    tmp5 = v1;
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp5 = v1;
+    tmp6 = v2;
+    tmp4 = _EVM_plus(tmp5,tmp6);
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVM_plusnSm(VAL v0,VAL v1) {
+
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp2 = CLOSURE2(FTAG_EVMSC_0_plusnSm,2,tmp3,tmp4);
+    tmp4 = MKTYPE;
+    tmp6 = v1;
+    tmp5 = MKCON1(1,tmp6);
+    args = MKARGS(2);
+    args[0] = tmp4;
+    args[1] = tmp5;
+    tmp3 = MKCONN(0,args,2);
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp4 = CLOSURE2(FTAG_EVMSC_1_plusnSm,2,tmp5,tmp6);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_1_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v2;
+    tmp4 = v0;
+    tmp5 = v1;
+    tmp6 = v2;
+    tmp7 = v3;
+    tmp3 = CLOSURE4(FTAG_EVMSC_2_plusnSm,4,tmp4,tmp5,tmp6,tmp7);
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp8 = v3;
+    tmp4 = CLOSURE4(FTAG_EVMSC_3_plusnSm,4,tmp5,tmp6,tmp7,tmp8);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp5 = CLOSURE4(FTAG_EVMSC_4_plusnSm,4,tmp6,tmp7,tmp8,tmp9);
+    tmp7 = v1;
+    tmp6 = MKCON1(1,tmp7);
+    tmp1 = CLOSURE5(FTAG_EVM_NatElim,5,tmp2,tmp3,tmp4,tmp5,tmp6);
+    tmp4 = v2;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp5 = CLOSURE4(FTAG_EVMSC_5_plusnSm,4,tmp6,tmp7,tmp8,tmp9);
+    tmp7 = v0;
+    tmp8 = v1;
+    tmp9 = v2;
+    tmp10 = v3;
+    tmp6 = CLOSURE4(FTAG_EVMSC_6_plusnSm,4,tmp7,tmp8,tmp9,tmp10);
+    tmp8 = v0;
+    tmp9 = v1;
+    tmp10 = v2;
+    tmp11 = v3;
+    tmp7 = CLOSURE4(FTAG_EVMSC_7_plusnSm,4,tmp8,tmp9,tmp10,tmp11);
+    tmp8 = v1;
+    tmp3 = CLOSURE5(FTAG_EVM_NatElim,5,tmp4,tmp5,tmp6,tmp7,tmp8);
+    tmp2 = MKCON1(1,tmp3);
+    tmp3 = v3;
+    return _EVM_eq_resp_S(tmp1,tmp2,tmp3);
+}
+
+VAL _EVMSC_7_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v5;
+    tmp3 = v6;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_6_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v4;
+    return tmp0;
+}
+
+VAL _EVMSC_5_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_4_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v5;
+    tmp3 = v6;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_3_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v4;
+    return tmp0;
+}
+
+VAL _EVMSC_2_plusnSm(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_0_plusnSm(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v2;
+    tmp6 = v1;
+    tmp5 = MKCON1(1,tmp6);
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp6 = v2;
+    tmp7 = v1;
+    tmp5 = _EVM_plus(tmp6,tmp7);
+    tmp4 = MKCON1(1,tmp5);
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVM_plusnO(VAL v0) {
+
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp3 = v0;
+    tmp2 = CLOSURE1(FTAG_EVMSC_0_plusnO,1,tmp3);
+    tmp4 = MKTYPE;
+    tmp5 = MKCON0(0);
+    args = MKARGS(2);
+    args[0] = tmp4;
+    args[1] = tmp5;
+    tmp3 = MKCONN(0,args,2);
+    tmp5 = v0;
+    tmp4 = CLOSURE1(FTAG_EVMSC_1_plusnO,1,tmp5);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_1_plusnO(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v1;
+    tmp3 = MKCON0(0);
+    tmp1 = _EVM_plus(tmp2,tmp3);
+    tmp2 = v1;
+    tmp3 = v2;
+    return _EVM_eq_resp_S(tmp1,tmp2,tmp3);
+}
+
+VAL _EVMSC_0_plusnO(VAL v0,VAL v1) {
+
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v1;
+    tmp5 = MKCON0(0);
+    tmp3 = _EVM_plus(tmp4,tmp5);
+    tmp4 = v1;
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVM_discriminate_Nat(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v1;
+    tmp3 = v2;
+    tmp1 = _EVM_notO_S(tmp2,tmp3);
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp5 = v2;
+    tmp2 = CLOSURE3(FTAG_EVMSC_0_discriminate_Nat,3,tmp3,tmp4,tmp5);
+    return _EVM_FalseElim(tmp1,tmp2);
+}
+
+VAL _EVMSC_0_discriminate_Nat(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v0;
+    return tmp0;
+}
+
+VAL _EVM_notn_S(VAL v0) {
+
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp3 = v0;
+    tmp2 = CLOSURE1(FTAG_EVMSC_0_notn_S,1,tmp3);
+    tmp4 = MKCON0(0);
+    tmp3 = CLOSURE1(FTAG_EVM_notO_S,1,tmp4);
+    tmp5 = v0;
+    tmp4 = CLOSURE1(FTAG_EVMSC_1_notn_S,1,tmp5);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_1_notn_S(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v2;
+    tmp3 = v1;
+    tmp5 = v1;
+    tmp4 = MKCON1(1,tmp5);
+    tmp5 = v3;
+    tmp2 = _EVM_s_injective(tmp3,tmp4,tmp5);
+    tmp0 = CLOSUREADD1(tmp1,tmp2);
+    return tmp0;
+}
+
+VAL _EVMSC_0_notn_S(VAL v0,VAL v1) {
+
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = MKTYPE;
+    tmp3 = MKTYPE;
+    tmp4 = v1;
+    tmp6 = v1;
+    tmp5 = MKCON1(1,tmp6);
+    tmp1 = CLOSUREADD3(tmp2,tmp3,tmp4,tmp5);
+    return _EVM_not(tmp1);
+}
+
+VAL _EVM_notO_S(VAL v0,VAL v1) {
+
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKCON0(0);
+    tmp4 = v0;
+    tmp3 = MKCON1(1,tmp4);
+    tmp4 = v1;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp5 = CLOSURE2(FTAG_EVMSC_0_notO_S,2,tmp6,tmp7);
+    tmp6 = MKCON0(0);
+    return _EVM_EqElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_0_notO_S(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v2;
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp5 = v2;
+    tmp6 = v3;
+    tmp2 = CLOSURE4(FTAG_EVMSC_1_notO_S,4,tmp3,tmp4,tmp5,tmp6);
+    tmp3 = MKTYPE;
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp8 = v3;
+    tmp4 = CLOSURE4(FTAG_EVMSC_2_notO_S,4,tmp5,tmp6,tmp7,tmp8);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_2_notO_S(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVMSC_1_notO_S(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_s_injective(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v0;
+    tmp5 = v1;
+    tmp6 = v2;
+    tmp3 = CLOSURE3(FTAG_EVMSC_0_s_injective,3,tmp4,tmp5,tmp6);
+    tmp5 = v0;
+    tmp4 = MKCON1(1,tmp5);
+    tmp6 = v1;
+    tmp5 = MKCON1(1,tmp6);
+    tmp6 = v2;
+    return _EVM_eq_resp_f(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_0_s_injective(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v3;
+    tmp3 = v0;
+    tmp4 = v1;
+    tmp5 = v2;
+    tmp6 = v3;
+    tmp2 = CLOSURE4(FTAG_EVMSC_1_s_injective,4,tmp3,tmp4,tmp5,tmp6);
+    tmp3 = v0;
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp8 = v3;
+    tmp4 = CLOSURE4(FTAG_EVMSC_2_s_injective,4,tmp5,tmp6,tmp7,tmp8);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_2_s_injective(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v4;
+    return tmp0;
+}
+
+VAL _EVMSC_1_s_injective(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_eq_resp_S(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = MKTYPE;
+    tmp4 = v0;
+    tmp5 = v1;
+    tmp6 = v2;
+    tmp3 = CLOSURE3(FTAG_EVMSC_0_eq_resp_S,3,tmp4,tmp5,tmp6);
+    tmp4 = v0;
+    tmp5 = v1;
+    tmp6 = v2;
+    return _EVM_eq_resp_f(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_0_eq_resp_S(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v3;
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVM_simplifyS(VAL v0,VAL v1) {
+
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp4 = v0;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp5 = CLOSURE2(FTAG_EVMSC_0_simplifyS,2,tmp6,tmp7);
+    tmp7 = v0;
+    tmp8 = v1;
+    tmp6 = CLOSURE2(FTAG_EVMSC_1_simplifyS,2,tmp7,tmp8);
+    tmp8 = v0;
+    tmp9 = v1;
+    tmp7 = CLOSURE2(FTAG_EVMSC_2_simplifyS,2,tmp8,tmp9);
+    tmp8 = v1;
+    tmp3 = CLOSURE5(FTAG_EVM_NatElim,5,tmp4,tmp5,tmp6,tmp7,tmp8);
+    tmp2 = MKCON1(1,tmp3);
+    args = MKARGS(2);
+    args[0] = tmp1;
+    args[1] = tmp2;
+    tmp0 = MKCONN(0,args,2);
+    return tmp0;
+}
+
+VAL _EVMSC_2_simplifyS(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v3;
+    tmp3 = v4;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_1_simplifyS(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v2;
+    return tmp0;
+}
+
+VAL _EVMSC_0_simplifyS(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_simplifyO(VAL v0) {
+
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v0;
+    args = MKARGS(2);
+    args[0] = tmp1;
+    args[1] = tmp2;
+    tmp0 = MKCONN(0,args,2);
+    return tmp0;
+}
+
+VAL _EVM_plus(VAL v0,VAL v1) {
+
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v1;
+    tmp0 = CLOSURE2(FTAG_EVM_plus',2,tmp1,tmp2);
+    return tmp0;
+}
+
+VAL _EVM_plus'(VAL v0) {
+
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp3 = v0;
+    tmp2 = CLOSURE1(FTAG_EVMSC_0_plus',1,tmp3);
+    tmp4 = v0;
+    tmp3 = CLOSURE1(FTAG_EVMSC_1_plus',1,tmp4);
+    tmp5 = v0;
+    tmp4 = CLOSURE1(FTAG_EVMSC_2_plus',1,tmp5);
+    return _EVM_NatElim(tmp1,tmp2,tmp3,tmp4);
+}
+
+VAL _EVMSC_2_plus'(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp2 = v2;
+    tmp3 = v3;
+    tmp1 = CLOSUREADD1(tmp2,tmp3);
+    tmp0 = MKCON1(1,tmp1);
+    return tmp0;
+}
+
+VAL _EVMSC_1_plus'(VAL v0,VAL v1) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = v1;
+    return tmp0;
+}
+
+VAL _EVMSC_0_plus'(VAL v0,VAL v1) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_NatElim(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    eval(v0);
+    switch(TAG(v0)) {
+    case 0:
+    tmp0 = v2;
+    return tmp0;
+
+    case 1:
+    tmp1 = v3;
+    tmp3 = v0;
+    tmp2 = GETCONARG(tmp3,0);
+    tmp5 = v0;
+    tmp4 = GETCONARG(tmp5,0);
+    tmp5 = v1;
+    tmp6 = v2;
+    tmp7 = v3;
+    tmp3 = _EVM_NatElim(tmp4,tmp5,tmp6,tmp7);
+    tmp0 = CLOSUREADD2(tmp1,tmp2,tmp3);
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
+VAL _EVM_or_commutes(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v1;
+    tmp3 = v2;
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp4 = CLOSURE3(FTAG_EVMSC_0_or_commutes,3,tmp5,tmp6,tmp7);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp5 = CLOSURE3(FTAG_EVMSC_1_or_commutes,3,tmp6,tmp7,tmp8);
+    tmp7 = v0;
+    tmp8 = v1;
+    tmp9 = v2;
+    tmp6 = CLOSURE3(FTAG_EVMSC_2_or_commutes,3,tmp7,tmp8,tmp9);
+    return _EVM_OrElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_2_or_commutes(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v1;
+    tmp2 = v0;
+    tmp3 = v3;
+    args = MKARGS(3);
+    args[0] = tmp1;
+    args[1] = tmp2;
+    args[2] = tmp3;
+    tmp0 = MKCONN(0,args,3);
+    return tmp0;
+}
+
+VAL _EVMSC_1_or_commutes(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v1;
+    tmp2 = v0;
+    tmp3 = v3;
+    args = MKARGS(3);
+    args[0] = tmp1;
+    args[1] = tmp2;
+    args[2] = tmp3;
+    tmp0 = MKCONN(1,args,3);
+    return tmp0;
+}
+
+VAL _EVMSC_0_or_commutes(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v1;
+    tmp3 = v0;
+    tmp0 = CLOSUREADD2(tmp1,tmp2,tmp3);
+    return tmp0;
+}
+
+VAL _EVM_and_commutes(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v1;
+    tmp3 = v2;
+    tmp5 = v0;
+    tmp6 = v1;
+    tmp7 = v2;
+    tmp4 = CLOSURE3(FTAG_EVMSC_0_and_commutes,3,tmp5,tmp6,tmp7);
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp5 = CLOSURE3(FTAG_EVMSC_1_and_commutes,3,tmp6,tmp7,tmp8);
+    return _EVM_AndElim(tmp1,tmp2,tmp3,tmp4,tmp5);
+}
+
+VAL _EVMSC_1_and_commutes(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v1;
+    tmp2 = v0;
+    tmp3 = v4;
+    tmp4 = v3;
+    args = MKARGS(4);
+    args[0] = tmp1;
+    args[1] = tmp2;
+    args[2] = tmp3;
+    args[3] = tmp4;
+    tmp0 = MKCONN(0,args,4);
+    return tmp0;
+}
+
+VAL _EVMSC_0_and_commutes(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v1;
+    tmp3 = v0;
+    tmp0 = CLOSUREADD2(tmp1,tmp2,tmp3);
+    return tmp0;
+}
+
+VAL _EVM_notElim(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v1;
+    tmp2 = v2;
+    tmp0 = CLOSUREADD1(tmp1,tmp2);
+    return tmp0;
+}
+
+VAL _EVM_not(VAL v0) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_TrueElim(VAL v0,VAL v1,VAL v2) {
+
+    VAL tmp0;
+    VAL* args;
+    eval(v0);
+    switch(TAG(v0)) {
+    case 0:
+    tmp0 = v2;
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
+VAL _EVM_FalseElim(VAL v0,VAL v1) {
+
+    VAL tmp0;
+    VAL* args;
+    tmp0 = MKTYPE;
+    return tmp0;
+}
+
+VAL _EVM_ExElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    eval(v2);
+    switch(TAG(v2)) {
+    case 0:
+    tmp1 = v4;
+    tmp3 = v2;
+    tmp2 = GETCONARG(tmp3,2);
+    tmp4 = v2;
+    tmp3 = GETCONARG(tmp4,3);
+    tmp0 = CLOSUREADD2(tmp1,tmp2,tmp3);
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
+VAL _EVM_OrElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    eval(v2);
+    switch(TAG(v2)) {
+    case 0:
+    tmp1 = v4;
+    tmp3 = v2;
+    tmp2 = GETCONARG(tmp3,2);
+    tmp0 = CLOSUREADD1(tmp1,tmp2);
+    return tmp0;
+
+    case 1:
+    tmp1 = v5;
+    tmp3 = v2;
+    tmp2 = GETCONARG(tmp3,2);
+    tmp0 = CLOSUREADD1(tmp1,tmp2);
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
+VAL _EVM_AndElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4) {
+
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    eval(v2);
+    switch(TAG(v2)) {
+    case 0:
+    tmp1 = v4;
+    tmp3 = v2;
+    tmp2 = GETCONARG(tmp3,2);
+    tmp4 = v2;
+    tmp3 = GETCONARG(tmp4,3);
+    tmp0 = CLOSUREADD2(tmp1,tmp2,tmp3);
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
+VAL _EVM_eq_resp_f(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v3;
+    tmp3 = v4;
+    tmp4 = v5;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp10 = v4;
+    tmp11 = v5;
+    args = MKARGS(6);
+    args[0] = tmp6;
+    args[1] = tmp7;
+    args[2] = tmp8;
+    args[3] = tmp9;
+    args[4] = tmp10;
+    args[5] = tmp11;
+    tmp5 = CLOSUREN(FTAG_EVMSC_0_eq_resp_f,6,args,6);
+    tmp7 = v1;
+    tmp9 = v2;
+    tmp10 = v3;
+    tmp8 = CLOSUREADD1(tmp9,tmp10);
+    args = MKARGS(2);
+    args[0] = tmp7;
+    args[1] = tmp8;
+    tmp6 = MKCONN(0,args,2);
+    return _EVM_EqElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_0_eq_resp_f(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7) {
+
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v1;
+    tmp4 = v2;
+    tmp5 = v3;
+    tmp3 = CLOSUREADD1(tmp4,tmp5);
+    tmp5 = v2;
+    tmp6 = v6;
+    tmp4 = CLOSUREADD1(tmp5,tmp6);
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVM_sym(VAL v0,VAL v1,VAL v2,VAL v3) {
+
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v1;
+    tmp3 = v2;
+    tmp4 = v3;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp5 = CLOSURE4(FTAG_EVMSC_0_sym,4,tmp6,tmp7,tmp8,tmp9);
+    tmp7 = v0;
+    tmp8 = v1;
+    args = MKARGS(2);
+    args[0] = tmp7;
+    args[1] = tmp8;
+    tmp6 = MKCONN(0,args,2);
+    return _EVM_EqElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_0_sym(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v0;
+    tmp3 = v4;
+    tmp4 = v1;
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVM_trans(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v2;
+    tmp3 = v3;
+    tmp4 = v5;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp10 = v4;
+    tmp11 = v5;
+    args = MKARGS(6);
+    args[0] = tmp6;
+    args[1] = tmp7;
+    args[2] = tmp8;
+    args[3] = tmp9;
+    args[4] = tmp10;
+    args[5] = tmp11;
+    tmp5 = CLOSUREN(FTAG_EVMSC_0_trans,6,args,6);
+    tmp6 = v4;
+    return _EVM_EqElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_0_trans(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7) {
+
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = MKTYPE;
+    tmp2 = v0;
+    tmp3 = v1;
+    tmp4 = v6;
+    tmp0 = CLOSUREADD3(tmp1,tmp2,tmp3,tmp4);
+    return tmp0;
+}
+
+VAL _EVM_repl(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp11;
+    VAL tmp10;
+    VAL tmp9;
+    VAL tmp8;
+    VAL tmp7;
+    VAL tmp6;
+    VAL tmp5;
+    VAL tmp4;
+    VAL tmp3;
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v0;
+    tmp2 = v1;
+    tmp3 = v2;
+    tmp4 = v3;
+    tmp6 = v0;
+    tmp7 = v1;
+    tmp8 = v2;
+    tmp9 = v3;
+    tmp10 = v4;
+    tmp11 = v5;
+    args = MKARGS(6);
+    args[0] = tmp6;
+    args[1] = tmp7;
+    args[2] = tmp8;
+    args[3] = tmp9;
+    args[4] = tmp10;
+    args[5] = tmp11;
+    tmp5 = CLOSUREN(FTAG_EVMSC_0_repl,6,args,6);
+    tmp6 = v5;
+    return _EVM_EqElim(tmp1,tmp2,tmp3,tmp4,tmp5,tmp6);
+}
+
+VAL _EVMSC_0_repl(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5,VAL v6,VAL v7) {
+
+    VAL tmp2;
+    VAL tmp1;
+    VAL tmp0;
+    VAL* args;
+    tmp1 = v4;
+    tmp2 = v6;
+    tmp0 = CLOSUREADD1(tmp1,tmp2);
+    return tmp0;
+}
+
+VAL _EVM_EqElim(VAL v0,VAL v1,VAL v2,VAL v3,VAL v4,VAL v5) {
+
+    VAL tmp0;
+    VAL* args;
+    eval(v3);
+    switch(TAG(v3)) {
+    case 0:
+    tmp0 = v5;
+    return tmp0;
+
+    default:
+    return NULL;
+    }
+}
+
diff --git a/examplett/test.tt b/examplett/test.tt
new file mode 100644
--- /dev/null
+++ b/examplett/test.tt
@@ -0,0 +1,83 @@
+Datatype Nat {
+   TyCon Nat : *,
+   Con O : Nat,
+   Con S : (n:Nat)Nat,
+   Elim natElim : (n:Nat)(P:(n:Nat)*)
+                  (mz:(P O))
+		  (ms:(k:Nat)(ih:(P n))(P (S k)))
+		  (P n),
+   Scheme O,P,mz,ms -> mz
+   Scheme (S k),P,mz,ms -> ms k (natElim k P mz ms)
+};
+
+holey_plus = [m:Nat][n:Nat](?H:Nat. 
+	   (natElim n ([n:Nat]Nat) H ([k:Nat][ih:Nat](S ih))));
+H. try m;
+H. solve;
+H. cut;
+Prf;
+holey_plus.solve;
+Lift;
+
+plus = [m:Nat][n:Nat](natElim n ([n:Nat]Nat) m ([k:Nat][ih:Nat](S ih)));
+mult = [m:Nat][n:Nat](natElim n ([n:Nat]Nat) O ([k:Nat][ih:Nat](plus m ih)));
+fact = [n:Nat](natElim n ([n:Nat]Nat) (S O) ([k:Nat][ih:Nat](mult ih (S k))));
+
+double : (n:Nat)Nat;
+double. attack H;
+H. intro;
+H. x:Nat;
+H. y:Nat;
+H. try plus x y;
+H. solve;
+y. try n;
+y. solve;
+x. try n; 
+x. solve;
+double. solve;
+Lift;
+
+id : (A:*)(a:A)A;
+id. attack H;
+H. intro;
+H. intro;
+H. try a;
+H. solve;
+H. cut;
+id. solve;
+Lift;
+
+Eval plus (S (S O)) (S (S O));
+
+Datatype Vect {
+   TyCon Vect : (A:*)(n:Nat)*,
+   Con Vnil : (A:*)(Vect A O),
+   Con Vcons : (A:*)(k:Nat)(a:A)(v:Vect A k)(Vect A (S k)),
+   Elim VectElim : (A:*)
+                   (n:Nat)
+                   (v:Vect A n)
+                   (P:(n:Nat)(v:Vect A n)*)
+                   (mnil:(P O (Vnil A)))
+                   (mcons:(k:Nat)(a:A)(v:Vect A k)(ih:P k v)
+                          (P (S k) (Vcons A k a v)))
+                   (P n v),
+    Scheme A,O,(Vnil A),P,mnil,mcons -> mnil
+    Scheme A,(S k),(Vcons A k a v),P,mnil,mcons 
+          -> mcons k a v (VectElim A k v P mnil mcons)
+};
+
+vectFold = [A:*][B:*][n:Nat][v:Vect A n][empty:B][tail:(a:A)(b:B)B]
+	 (VectElim A n v ([n:Nat][v:Vect A n]B) empty
+	     ([k:Nat][a:A][v:Vect A k][ih:B](tail a ih)));
+
+Eval VectElim Nat O (Vnil Nat) ([n:Nat][v:Vect Nat n]Nat) 
+    (S O) ([k:Nat][a:Nat][v:Vect Nat k][ih:Nat](S ih));
+
+Eval VectElim Nat (S (S O)) (Vcons Nat (S O) (S O) (Vcons Nat O (S O) (Vnil Nat)))
+    ([n:Nat][v:Vect Nat n]Nat) (S O) ([k:Nat][a:Nat][v:Vect Nat k][ih:Nat](S (S ih)));
+
+Output "rts/test";
+
+Eval fact (S (S (S (S (S (S (S O)))))));
+
+Quit;
diff --git a/examplett/vec.tt b/examplett/vec.tt
new file mode 100644
--- /dev/null
+++ b/examplett/vec.tt
@@ -0,0 +1,13 @@
+Load "nat.tt";
+
+Data Vect (A:*) : (n:Nat)* =
+   Vnil : (Vect A O)
+ | Vcons : (k:Nat)(a:A)(v:Vect A k)(Vect A (S k));
+
+vec_append : (A:*)(m,n:Nat)(xs:Vect A m)(ys:Vect A n)(Vect A (plus m n));
+intros;
+induction xs;
+fill ys;
+intros;
+fill (Vcons _ _ a v_IH);
+Qed;
diff --git a/examplett/vect.tt b/examplett/vect.tt
new file mode 100644
--- /dev/null
+++ b/examplett/vect.tt
@@ -0,0 +1,76 @@
+Load "fin.tt";
+
+Data Vect (A:*):(n:Nat)* where
+      vnil:Vect A O
+    | vcons:(k:Nat)(x:A)(xs:Vect A k)Vect A (S k);
+
+vappend : (A:*)->(n,m:Nat)->(xs:Vect A n)->(ys:Vect A m)->
+           (Vect A (plus n m));
+intros;
+induction xs;
+fill ys;
+intros;
+fill (vcons _ _ x xs_IH);
+Qed;
+
+vtail : (A:*)(k:Nat)(xs:Vect A (S k))Vect A k;
+local vtailAux : (A:*)(k:Nat)(k':Nat)(xs:Vect A k')(p:Eq _ (S k) k')Vect A k;
+Focus H;
+intros;
+refine (vtailAux _ k _ xs);
+refine refl;
+intro A k k' xs;
+induction xs;
+intros;
+fill discriminate_Nat _ _ (sym _ _ _ p);
+intros;
+replace s_injective _ _ p0;
+fill xs0;
+Qed;
+
+testvect = vcons _ _ (S O) (vnil Nat);
+
+vectsum : (k:Nat)(v:Vect Nat k)Nat;
+intros;
+induction v;
+fill O;
+intros;
+fill (plus x xs_IH);
+Qed;
+
+testvect2 = vcons _ _ (S O) (vcons _ _ (S (S (S O))) (vnil Nat));
+testval2 = vectsum _ testvect2;
+
+lookup:(A:*)(n:Nat)(i:Fin n)(xs:Vect A n)A;
+local lookupAux:(A:*)(n:Nat)(i:Fin n)(n':Nat)(xs:Vect A n')(p:Eq _ n n')A;
+intro A n i;
+induction i;
+intro k n' xs;
+induction xs;
+intros;
+fill (discriminate_Nat _ _ (sym _ _ _ p));
+intros;
+fill x; {- fz (x::xs) -}
+intro k i i_IH n' xs;
+induction xs;
+intros;
+fill (discriminate_Nat _ _ (sym _ _ _ p0));
+intros;
+refine (i_IH k0);
+fill xs0;
+refine s_injective;
+trivial;
+intros;
+refine (lookupAux _ _ i _ xs);
+refine refl;
+Qed;
+
+lookupLt:(A:*)(n:Nat)(i:Nat)(p:Lt i n)(xs:Vect A n)A;
+intros;
+refine lookup;
+fill n;
+refine mkFin;
+fill i;
+fill p;
+fill xs;
+Qed;
diff --git a/ivor.cabal b/ivor.cabal
new file mode 100644
--- /dev/null
+++ b/ivor.cabal
@@ -0,0 +1,78 @@
+Name:           ivor
+Version:        0.1.5
+License:        BSD3
+License-file:   LICENSE
+Author:         Edwin Brady
+Maintainer:     Edwin Brady <eb@dcs.st-and.ac.uk>
+Homepage:       http://www.dcs.st-and.ac.uk/~eb/Ivor/
+
+Stability:      experimental
+Category:       Theorem provers
+Synopsis:       Theorem proving library based on dependent type theory
+Description:    Ivor is a type theory based theorem prover, with a
+                Haskell API, designed for easy extending and embedding
+                of theorem proving technology in Haskell
+                applications. It provides an implementation of the
+                type theory and tactics for building terms, more or
+                less along the lines of systems such as Coq or Agda,
+                and taking much of its inspiration from Conor
+                McBride's presentation of OLEG.
+                .
+                The API provides a collection of primitive tactics and
+                combinators for building new tactics. It is therefore
+                possible to build new tactics to suit specific
+                applications. Ivor features a dependent type theory
+                similar to Luo's ECC with definitions (and similar to
+                that implemented in Epigram), with dependent pattern
+                matching, and experimental multi-stage programming
+                support. Optionally, it can be extended with
+                heterogeneous equality, primitive types and operations,
+                new parser rules, user defined tactics and (if you
+                want your proofs to be untrustworthy) a fixpoint
+                combinator.
+
+Data-files:     BUGS, INSTALL, TODO, docs/macros.ltx, docs/local.ltx, docs/tt.tex, docs/conclusion.tex,
+                docs/intro.tex, docs/hcar.sty, docs/tactics.tex, docs/library.ltx,
+                docs/shell.tex, docs/dtp.bib, docs/HCAR.tex, docs/Makefile,
+                docs/combinators.tex, docs/humett.tex, docs/interface.tex,
+                papers/tutorial/tutorial.tex, papers/tutorial/macros.ltx, papers/tutorial/theoremproving.tex,
+                papers/tutorial/introduction.tex, papers/tutorial/hslibrary.tex, papers/tutorial/library.ltx,
+                papers/tutorial/programming.tex, papers/tutorial/Makefile, papers/bib/literature.bib,
+                papers/ivor/examples.tex, papers/ivor/code.tex, papers/ivor/macros.ltx,
+                papers/ivor/ivor.tex, papers/ivor/corett.tex, papers/ivor/conclusions.tex,
+                papers/ivor/intro.tex, papers/ivor/llncs.cls, papers/ivor/tactics.tex,
+                papers/ivor/library.ltx, papers/ivor/dtp.bib, papers/ivor/alink.bib,
+                papers/ivor/Makefile, papers/ivor/embounded.bib
+
+Extra-source-files: emacs/ivor-mode.el, examplett/staged.tt, examplett/test.c, examplett/partial.tt, examplett/nat.tt,
+                    examplett/vec.tt, examplett/lt.tt, examplett/Test.hs, examplett/plus.tt,
+                    examplett/jmeq.tt, examplett/eq.tt, examplett/logic.tt, examplett/interp.tt,
+                    examplett/stageplus.tt, examplett/Nat.hs, examplett/general.tt, examplett/natsimpl.tt,
+                    examplett/test.tt, examplett/vect.tt, examplett/fin.tt, examplett/ack.tt,
+                    IOvor/IOPrims.lhs, IOvor/Main.lhs, IOvor/iobasics.tt, Jones/Main.lhs,
+                    lib/nat.tt, lib/lt.tt, lib/list.tt, lib/eq.tt,
+                    lib/basics.tt, lib/logic.tt, lib/vect.tt, lib/fin.tt
+
+
+
+Build-depends:  base, parsec, mtl, plugins, directory
+Build-type:     Simple
+
+Extensions:     MultiParamTypeClasses, FunctionalDependencies,
+                ExistentialQuantification, OverlappingInstances
+-- Needs some -Wall cleanup
+-- GHC-options:    -Wall
+
+Exposed-modules:
+                Ivor.TT, Ivor.Shell, Ivor.Primitives,
+                Ivor.TermParser, Ivor.ViewTerm, Ivor.Equality,
+                Ivor.Plugin, Ivor.Construction
+Other-modules:  Ivor.Nobby, Ivor.TTCore, Ivor.State,
+                Ivor.Tactics, Ivor.Typecheck, Ivor.Evaluator
+                Ivor.Gadgets, Ivor.SC, Ivor.Bytecode,
+                Ivor.CodegenC, Ivor.Datatype, Ivor.Display,
+                Ivor.ICompile, Ivor.MakeData, Ivor.Unify,
+                Ivor.Grouper, Ivor.ShellParser, Ivor.Constant,
+                Ivor.RunTT, Ivor.Compiler, Ivor.Prefix,
+                Ivor.PatternDefs,  Ivor.ShellState
+
diff --git a/lib/basics.tt b/lib/basics.tt
new file mode 100644
--- /dev/null
+++ b/lib/basics.tt
@@ -0,0 +1,15 @@
+-- Some generally useful definitions
+-- Heterogeneous equality, nats, maybe, bools, lists.
+
+Load "eq.tt";
+Load "nat.tt";
+
+Data Maybe (A:*) : * 
+  = nothing : Maybe A
+  | just : (a:A)(Maybe A);
+
+Data Bool : * = true : Bool | false : Bool;
+
+Data List (A:*) : * 
+  = nil : List A
+  | cons : (x:A)->(xs:List A)->(List A);
diff --git a/lib/eq.tt b/lib/eq.tt
new file mode 100644
--- /dev/null
+++ b/lib/eq.tt
@@ -0,0 +1,31 @@
+Equality Eq refl;
+
+repl : (A:*)(x:A)(y:A)(q:Eq _ _ x y)(P:(m:A)*)(p:P x)(P y);
+intros;
+by EqElim _ _ _ q;
+fill p;
+Qed;
+Freeze repl;
+
+trans : (A:*)(a:A)(b:A)(c:A)(p:Eq _ _ a b)(q:Eq _ _ b c)(Eq _ _ a c);
+intros;
+by EqElim _ _ _ q;
+fill p;
+Qed;
+Freeze trans;
+
+sym : (A:*)(a:A)(b:A)(p:Eq _ _ a b)(Eq _ _ b a);
+intros;
+by EqElim _ _ _ p;
+refine refl;
+Qed;
+Freeze sym;
+
+Repl Eq repl sym;
+
+eq_resp_f:(A,B:*)(f:(a:A)B)(x:A)(y:A)(q:Eq _ _ x y)(Eq _ _ (f x) (f y));
+intros;
+by EqElim _ _ _ q;
+refine refl;
+Qed;
+Freeze eq_resp_f;
diff --git a/lib/fin.tt b/lib/fin.tt
new file mode 100644
--- /dev/null
+++ b/lib/fin.tt
@@ -0,0 +1,15 @@
+Load "basics.tt";
+Load "lt.tt";
+
+Data Fin : (n:Nat)*
+    = fz : (k:_)(Fin (S k))
+    | fs : (k:_)(i:Fin k)(Fin (S k));
+
+Match weaken : (n:_)(i:Fin n)->(Fin (S n)) =
+    weaken _ (fz _) = fz _
+  | weaken _ (fs _ i) = fs _ (weaken _ i);
+
+Match fin2Nat : (n:_)(i:Fin n)->Nat =
+    fin2Nat _ (fz _) = O
+  | fin2Nat _ (fs _ i) = S (fin2Nat _ i);
+
diff --git a/lib/list.tt b/lib/list.tt
new file mode 100644
--- /dev/null
+++ b/lib/list.tt
@@ -0,0 +1,5 @@
+Load "nat.tt";
+
+Data List (A:*) : *
+  = nil : List A
+  | cons : (x:A)->(xs:List A)->(List A);
diff --git a/lib/logic.tt b/lib/logic.tt
new file mode 100644
--- /dev/null
+++ b/lib/logic.tt
@@ -0,0 +1,39 @@
+Data And (A:*)(B:*) : * = and_intro : (a:A)(b:B)(And A B);
+
+Data Or (A:*)(B:*) : * 
+     = or_intro_l : (a:A)(Or A B)
+     | or_intro_r : (b:B)(Or A B);
+
+Data Ex (A:*)(P:(a:A)*) : * = ex_intro : (x:A)(p:P x)(Ex A P);
+
+Data False : * = ;
+
+Data True : * = II : True ;
+
+not = [A:*](a:A)False;
+
+notElim = [A:*][p:not A][pp:A](p pp);
+
+Axiom classical:(P:*)(Or P (not P));
+
+and_commutes : (A:*)(B:*)(p:And A B)(And B A);
+intros;
+induction p;
+intros;
+refine and_intro;
+fill b;
+fill a;
+Qed;
+Freeze and_commutes;
+
+or_commutes : (A:*)(B:*)(p:Or A B)(Or B A);
+intros;
+induction p;
+intros;
+refine or_intro_r;
+fill a;
+intros;
+refine or_intro_l;
+fill b;
+Qed;
+Freeze or_commutes;
diff --git a/lib/lt.tt b/lib/lt.tt
new file mode 100644
--- /dev/null
+++ b/lib/lt.tt
@@ -0,0 +1,55 @@
+Load "basics.tt";
+
+Data le : (m,n:Nat)* =
+    leO : (n:_)(le O n)
+  | leS : (m,n:_)(p:le m n)(le (S m) (S n));
+
+Match leSuc : (m,n:Nat)(p:le m n)(le m (S n)) =
+    leSuc _ _ (leO _) = leO _
+  | leSuc _ _ (leS _ _ p) = leS _ _ (leSuc _ _ p);
+
+Match leSym : (m:Nat)(le m m) =
+    leSym O = leO _
+  | leSym (S k) = leS _ _ (leSym k);
+
+Match lePlus : (m,n:Nat)(le m (plus m n)) =
+    lePlus O n = leO _
+  | lePlus (S k) n = leS _ _ (lePlus k n);
+
+Data Compare : (m,n:Nat)* =
+    cmpLT : (k,m:Nat)(Compare m (plus m (S k)))
+  | cmpEQ : (n:Nat)(Compare n n)
+  | cmpGT : (k,n:Nat)(Compare (plus n (S k)) n);
+
+Match Partial compareAux : (m,n:Nat)(Compare m n)->(Compare (S m) (S n)) =
+    compareAux _ _ (cmpLT k _) = cmpLT k _
+  | compareAux _ _ (cmpEQ n) = cmpEQ _
+  | compareAux _ _ (cmpGT k _) = cmpGT k _;
+
+Match compare : (m,n:Nat)(Compare m n) =
+    compare O (S k) = cmpLT _ O
+  | compare O O = cmpEQ _
+  | compare (S k) O = cmpGT _ O
+  | compare (S x) (S y) = compareAux _ _ (compare x y);
+
+Match mkLTaux : (m,n:Nat)(Compare m n)->(Maybe (le m n)) =
+    mkLTaux _ _ (cmpLT k m) = just _ (lePlus m (S k))
+  | mkLTaux _ _ (cmpEQ m) = just _ (leSym m)
+  | mkLTaux _ _ (cmpGT k m) = nothing _;
+
+mkLT = [m,n:Nat](mkLTaux _ _ (compare m n));
+
+isBounded : (n,min,max:Nat)(Maybe (And (le min n) (le n max)));
+intros;
+induction mkLT min n;
+refine nothing;
+intros;
+induction mkLT n max;
+refine nothing;
+intros;
+refine just;
+refine and_intro;
+refine a;
+refine a0;
+Qed;
+
diff --git a/lib/nat.tt b/lib/nat.tt
new file mode 100644
--- /dev/null
+++ b/lib/nat.tt
@@ -0,0 +1,173 @@
+Load "eq.tt";
+Load "logic.tt";
+
+Data Nat:* = O:Nat | S:(k:Nat)Nat;
+
+Match plus : Nat->Nat->Nat =
+   plus O y = y
+ | plus (S k) y = S (plus k y);
+
+Match mult : Nat->Nat->Nat =
+   mult O y = O
+ | mult (S k) y = plus y (mult k y);
+
+simplifyO:(n:_)(Eq _ _ (plus O n) n);
+intros;
+refine refl;
+Qed;
+
+simplifyS:(m,n:_)(Eq _ _ (plus (S m) n) (S (plus m n)));
+intros;
+refine refl;
+Qed;
+
+eq_resp_S:(n,m:_)(q:Eq _ _ n m)(Eq _ _ (S n) (S m));
+intros;
+fill (eq_resp_f _ _ S n m q);
+Qed;
+Freeze eq_resp_S;
+
+s_injective:(n,m:_)(q:Eq _ _ (S n) (S m))(Eq _ _ n m);
+intros;
+local unS:(m:Nat)Nat;
+intros;
+induction m0;
+fill n;
+intros;
+fill k;
+fill eq_resp_f _ _ unS _ _ q;
+Qed;
+Freeze s_injective;
+
+notO_S:(k:_)(not (Eq _ _ O (S k)));
+intros;
+compute;
+intro q;
+local dmotive : (x:Nat)(q:Eq _ _ O x)*;
+intros;
+induction x;
+fill True;
+intros;
+fill False;
+fill EqElim _ _ _ q dmotive II;
+Qed;
+Freeze notO_S;
+
+notn_S:(n:_)(not (Eq _ _ n (S n)));
+intro;
+induction n;
+fill notO_S O;
+intros;
+unfold not;
+intros;
+claim q:Eq _ _ k (S k);
+fill k_IH q;
+refine s_injective;
+fill a;
+Qed;
+Freeze notn_S;
+
+discriminate_Nat:(A,k:_)(q:Eq _ _ O (S k))A;
+intros;
+local false:False;
+fill notO_S k q;
+induction false;
+Qed;
+Freeze discriminate_Nat;
+
+plusnO:(n:_)(Eq _ _ (plus n O) n);
+intro;
+induction n;
+refine refl;
+intros;
+equiv Eq _ _ (S (plus k O)) (S k);
+refine eq_resp_S;
+fill k_IH;
+Qed;
+Freeze plusnO;
+
+plusnSm:(n,m:_)(Eq _ _ (plus n (S m)) (S (plus n m)));
+intros;
+induction n;
+refine refl;
+intros;
+refine eq_resp_S;
+fill k_IH;
+Qed;
+Freeze plusnSm;
+
+plus_comm:(n,m:_)(Eq _ _ (plus n m) (plus m n));
+intros;
+induction n;
+refine sym;
+refine plusnO;
+intros;
+equiv Eq _ _ (S (plus k m)) (plus m (S k));
+replace k_IH;
+refine sym;
+refine plusnSm;
+Qed;
+Freeze plus_comm;
+
+plus_assoc:(m,n,p:_)(Eq _ _ (plus m (plus n p)) (plus (plus m n) p));
+intros;
+induction m;
+refine refl;
+intros;
+equiv Eq _ _ (S (plus k (plus n p))) (plus (S (plus k n)) p);
+replace k_IH;
+refine refl;
+Qed;
+Freeze plus_assoc;
+
+plus_eq_fst : (m,n,p:_)(q:Eq _ _ (plus p m) (plus p n))(Eq _ _ m n);
+intro m n p;
+induction p;
+intros;
+fill q;
+intros;
+refine k_IH;
+refine s_injective;
+refine q0;
+Qed;
+Freeze plus_eq_fst;
+
+plus_eq_fst_sym : (m,n,p:_)(q:Eq _ _ (plus m p) (plus n p))(Eq _ _ m n);
+intro m n p;
+replace plus_comm m p;
+replace plus_comm n p;
+intros;
+fill plus_eq_fst m n p q;
+Qed;
+Freeze plus_eq_fst_sym;
+
+multnO:(n:_)(Eq _ _ (mult n O) O);
+intro;
+induction n;
+refine refl;
+intros;
+equiv Eq _ _ (plus O (mult k O)) O;
+replace k_IH;
+refine refl;
+Qed;
+Freeze multnO;
+
+multnSm:(n,m:_)(Eq _ _ (mult n (S m)) (plus n (mult n m)));
+intro;
+induction n;
+intros;
+refine refl;
+intros;
+equiv Eq _ _ (S (plus m0 (mult k (S m0))))
+             (S (plus k (plus m0 (mult k m0))));
+refine eq_resp_S;
+replace (k_IH m0);
+generalise mult k m0;
+intros;
+replace (plus_comm m0 x);
+replace (plus_assoc k x m0);
+replace (plus_comm m0 (plus k x));
+refine refl;
+Qed;
+Freeze multnSm;
+
diff --git a/lib/vect.tt b/lib/vect.tt
new file mode 100644
--- /dev/null
+++ b/lib/vect.tt
@@ -0,0 +1,13 @@
+Load "basics.tt";
+Load "fin.tt";
+
+Data Vect (A:*):(n:Nat)* 
+    = vnil:Vect A O
+    | vcons:(k:Nat)(x:A)(xs:Vect A k)Vect A (S k);
+
+Match lookup : (A:*)(n:Nat)(i:Fin n)(xs:Vect A n)A =
+    lookup _ _ (fz _) (vcons _ _ x xs) = x
+  | lookup _ _ (fs _ i) (vcons _ _ x xs) = lookup _ _ i xs;
+
+testvect = vcons _ _ O (vcons _ _ (S O) (vcons _ _ (S (S O)) (vnil Nat)));
+testfin = fs _ (fz (S O));
diff --git a/papers/bib/literature.bib b/papers/bib/literature.bib
new file mode 100644
--- /dev/null
+++ b/papers/bib/literature.bib
@@ -0,0 +1,3019 @@
+
+@inproceedings{sheard-langfuture,
+  author = {Tim Sheard},
+  title = "Languages of the future",
+  booktitle = "ACM Conference on Object Orientated Programming Systems, Languages and Applicatioons (OOPSLA'04)",
+  year = "2004"
+}
+
+@inproceedings{ivor,
+  author = {Edwin Brady},
+  title = {{Ivor}, a proof engine},
+  year = {2007},
+  publisher = {Springer},
+  series = {LNCS},
+  booktitle = {Implementation and Application of Functional Languages 2006},
+  note = {To appear}
+}
+
+@misc{coq-in-coq,
+  author = {Bruno Barras and Benjamin Werner},
+  year = 1997,
+  title = {{Coq} in {Coq}}
+}
+
+@article{hudak-edsl,
+  author = {Paul Hudak},
+  title = {Building Domain-Specific Embedded Languages},
+  year = {1996},
+  month = {December},
+  journal = {ACM Computing Surveys},
+  volume = {28A},
+  number = {4}
+}
+
+@inproceedings{concon,
+  author = {Conor McBride and Healfdene Goguen and James McKinna},
+  title = {Some Constructions On Constructors},
+  year = 2005,
+  booktitle = {TYPES 2004},
+  publisher = {Springer},
+  series = {LNCS},
+  volume = {3839}
+}
+
+@InProceedings{Hume-GPCE,
+author = {K. Hammond and G.J. Michaelson},
+title = {{Hume: a Domain-Specific Language for Real-Time Embedded Systems}},
+booktitle = {{Proc. Conf. Generative Programming and Component Engineering (GPCE~'03)}},
+publisher = {Springer-Verlag},
+series = {Lecture Notes in Computer Science},
+year = {2003},
+}
+
+@inproceedings{lcf-milner,
+  author = {Robin Milner},
+  title = {{LCF}: A Way of Doing Proofs with a Machine},
+  booktitle = {Mathematical Foundations of Computer Science 1978},
+  pages = {146-159},
+  year = 1979,
+  series = {LNCS},
+  volume = {64}
+}
+
+
+@inproceedings{epireloaded,
+  title = {Epigram Reloaded: A Standalone Typechecker for {ETT}},
+  author = {James Chapman and Thorsten Altenkirch and Conor McBride},
+  year = 2006,
+  booktitle = {Trends in Functional Programming 2005},
+  note = {To appear}
+}
+
+@TECHREPORT{why-tool,
+  AUTHOR = {J.-C. Filli\^atre},
+  TITLE = {{Why: a multi-language multi-prover verification tool}},
+  INSTITUTION = {{LRI, Universit\'e Paris Sud}},
+  TYPE = {{Research Report}},
+  NUMBER = {1366},
+  MONTH = {March},
+  YEAR = 2003,
+  URL = {http://www.lri.fr/~filliatr/ftp/publis/why-tool.ps.gz}
+}
+
+@misc{ large-extraction,
+  author = "Lu\'iz Cruz-Filipe and Bas Spitters",
+  title = "Program Extraction from Large Proof Developments",
+  year = 2003,
+  url = "citeseer.ist.psu.edu/cruz-filipe03program.html" }
+
+@inproceedings{ fta,
+    author = "Herman Geuvers and Freek Wiedijk and Jan Zwanenburg",
+    title = "A Constructive Proof of the Fundamental Theorem of Algebra without Using the Rationals",
+    booktitle = "{TYPES 2000}",
+    pages = "96--111",
+    year = "2000",
+    url = "citeseer.ist.psu.edu/geuvers01constructive.html" }
+
+@article{mckinna-expr,
+   title = {A type-correct, stack-safe, provably correct, expression compiler in {Epigram}},
+   author = {James McKinna and Joel Wright},
+   year = 2007,
+   journal = 	 {Journal of Functional Programming},
+   note = {To appear}
+}
+
+@article{pugh-omega,
+   title =  "The {Omega} {Test}: a fast and practical integer programming algorithm for dependence analysis",
+   author = "William Pugh",
+   journal = "Communication of the ACM",
+   year = 1992,
+   pages = {102--114}
+}
+
+@misc{four-colour,
+  author = "Georges Gonthier",
+  title = "A computer-checked proof of the {Four Colour Theorem}",
+  year = 2005,
+  howpublished = {\url{http://research.microsoft.com/~gonthier/4colproof.pdf}}}
+
+@inproceedings{sparkle,
+  author = "Maarten {de Mol} and Marko {van Eekelen} and Rinus Plasmeijer",
+  title = "Theorem Proving for Functional Programmers",
+  url = "citeseer.ist.psu.edu/654423.html",
+  BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2002)},
+  publisher = {Springer},
+  series = {LNCS},
+  volume = {2312},
+  year = 2002
+ }
+
+@misc{agda,
+   title = {Agda},
+   author = {Catarina Coquand},
+   howpublished= {\url{http://agda.sourceforge.net/}},
+   year = 2005
+}
+
+@misc{cover,
+   title = {Cover Translator},
+   howpublished = {\url{http://coverproject.org/CoverTranslator/}}
+}
+
+@misc{parsec,
+  title = {Parsec, a fast combinator parser},
+  author = {Daan Leijen},
+  year = {2001},
+  howpublished = {\url{http://www.cs.uu.nl/~daan/parsec.html}}
+}
+
+@inproceedings{dtpmsp-gpce,
+    author = {Edwin Brady and Kevin Hammond},
+    title = {A Verified Staged Interpreter is a Verified Compiler},
+    booktitle = {{Proc. Conf. Generative Programming and Component Engineering (GPCE~'06)}},
+    year = 2006
+}
+
+@misc{haddock,
+  title = {Haddock: A {Haskell} Documentation Tool},
+  howpublished = {\url{http://www.haskell.org/haddock/}}
+}
+
+@inproceedings{offshoring,
+  title = {Implicitly Heterogeneous Multi-Stage Programming},
+  author = {Jason Eckhardt and Roumen Kaibachev and Emir Pa\v{s}al\'{i}c and Kedar Swadi and Walid Taha},
+  booktitle = {Proc. 2005 Conf. on Generative Programming and Component Engineering (GPCE 2005)},
+  publisher = {Springer},
+  series = {LNCS},
+  volume = {3676},
+  year = 2005
+}
+
+@misc{alti-partial,
+  title = {Stop thinking about bottoms when writing programs},
+  author = {Thorsten Altenkirch},
+  year = 2006,
+  note = {Talk at BCTCS 2006}
+}
+
+@misc{tarmo-partial,
+  title = {Partiality is an Effect},
+  author = {Tarmo Uustalu},
+  year = 2004,
+  note = {Talk at Dagstuhl workshop on Dependently Typed Progamming}
+}
+
+@inproceedings{McKinnaPOPL06,
+ author = {James McKinna},
+ title = {Why dependent types matter},
+ booktitle = {Proc. ACM Symp. on Principles of Programming Languages (POPL 2006)},
+ year = {2006},
+ issn = {0362-1340},
+ pages = {1--1},
+ doi = {http://doi.acm.org/10.1145/1111320.1111038},
+}
+
+
+@inproceedings{leroy-compiler,
+  title = {Formal Certification of a Compiler Back-end},
+  author = {Xavier Leroy},
+  year = 2006,
+  booktitle = {Principles of Programming Languages 2006},
+  pages = {42--54},
+  publisher = {ACM Press}
+}
+
+@inproceedings{hutton-exceptions,
+   title = {Compiling Exceptions Correctly},
+   year = 2004,
+   author = {Graham Hutton and Joel Wright},
+   booktitle = {Mathematics of Program Construction},
+   publisher = {Springer},
+   series = {LNCS},
+   volume = {3125}
+}
+
+@inproceedings{tagless-staged,
+  title = {Tagless Staged Interpreters for Typed Languages},
+  year = {2002},
+  booktitle = {Proc. 2002 International Conf. on Functional Programming (ICFP 2002)},
+  author = {Emir Pa\v{s}al\'{i}c and Walid Taha and Tim Sheard},
+  publisher = {ACM}
+}
+
+@inproceedings{env-classifiers,
+   title = {Environment Classifiers},
+   year = 2003,
+   author = {Walid Taha},
+   booktitle = {Proc. ACM Symp. on Principles of Programming Languages (POPL 2003)},
+   pages = {26--37},
+}
+
+@inproceedings{dsl-msp,
+   title = {{DSL} Implementation in {MetaOCaml}, {Template Haskell}, {and C++}},
+   booktitle = {Domain Specific Program Genearation 2004},
+   author = {Krzysztof Czarnecki and John O'Donnell and J\"{o}rg Striegnitz and Walid Taha},
+   publisher = {Springer},
+   series = {LNCS},
+   volume = {3016},
+   year = 2004
+}
+
+@misc{ gadt-extk,
+    author = {Tim Sheard and James Hook and Nathan Linger},
+    title = {{GADTs} + Extensible Kinds = Dependent Programming},
+    year = 2005,
+    misc = {Submitted to ICFP '05}
+}
+
+@INPROCEEDINGS{dt-framework,
+  TITLE = {A Dependently Typed Framework for Static Analysis of Program Execution Costs},
+  YEAR = {2006},
+  BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2005)},
+  AUTHOR = {Edwin Brady and Kevin Hammond},
+  VOLUME = {4015},
+  SERIES = {LNCS},
+  PAGES = {74--90},
+  PUBLISHER = {Springer}
+}
+
+@INPROCEEDINGS{step-counting,
+  TITLE = {Accurate Step Counting},
+  YEAR = {2006},
+  BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2005)},
+  AUTHOR = {Catherine Hope and Graham Hutton},
+  PUBLISHER = {Springer}
+}
+
+@misc{multi-taha,
+    author = {Walid Taha},
+    title = {A Gentle Introduction to Multi-stage Programming},
+    year = {2003},
+    note = {Available from \url{http://www.cs.rice.edu/~taha/publications/journal/dspg04a.pdf}}
+}
+
+@misc{mckinnabrady-phase,
+   title = {Phase Distinctions in the Compilation of {Epigram}},
+   year = 2005,
+   author = {James McKinna and Edwin Brady},
+   note = {Draft}
+}
+
+@phdthesis{ brady-thesis,
+    author = {Edwin Brady},
+    title = {Practical Implementation of a Dependently Typed Functional Programming Language},
+    year = 2005,
+    school = {University of Durham}
+}
+
+@phdthesis{ taha-thesis,
+    author = {Walid Taha},
+    title = {Multi-stage Programming:  Its Theory and Applications},
+    year = 1999,
+    school = {Oregon Graduate Inst. of Science and Technology}
+}
+
+@phdthesis{ pasalic-thesis,
+    author = {Emir Pa\v{s}al\'{i}c},
+    title = {The Role of Type-Equality in Meta-programming},
+    year = 2004,
+    school = {OGI School of Science and Engineering}
+}
+
+@misc{ydtm,
+    author = {Thorsten Altenkirch and Conor McBride and James McKinna},
+    title = {Why Dependent Types Matter},
+    note = {Draft},
+    year = 2005}
+
+
+@inproceedings { wadler-listless,
+    author = {Philip Wadler},
+    title = {Listlessness is better than laziness: {Lazy} evaluation and garbage collection at compile-time},
+    booktitle = {Proceedings of the 1984 ACM Symposium on LISP and functional programming},
+    year = 1984,
+    pages = {45--52}
+}
+
+@techreport { gofer-impl,
+    author = {Mark P. Jones},
+    title = {The implementation of the Gofer functional programming system},
+    month = {May},
+    year = {1994},
+    number = {YALEU/DCS/RR-1030},
+    institution = {Yale University}
+}
+
+@techreport { pm-opt1,
+    author = {Kevin Scott and Norman Ramsey},
+    title = {When do match-compilation heuristics matter?},
+    month = {May},
+    year = {2000},
+    number = {CS-2000-13},
+    institution = {Department of Computer Science, University of Virginia}
+}
+
+@inproceedings{ pm-opt2,
+    author = "Fabrice Le Fessant and Luc Maranget",
+    title = "Optimizing Pattern Matching",
+    booktitle = "International Conference on Functional Programming",
+    pages = "26-37",
+    year = "2001",
+    url = "citeseer.ist.psu.edu/lefessant01optimizing.html" }
+
+@incollection{con-engine,
+  author = {G\'{e}rard Huet},
+  title = {The constructive engine},
+  booktitle = {A Perspective in Theoreticak Computer Science},
+  publisher = {World Scientific Publishing},
+  year = {1989},
+  editor = {R. Narasimhan},
+  note = {Commemorative Volume for Gift Siromoney},
+  pages = {38--69}
+}
+
+@inproceedings{gadts,
+  title = {Simple unification-based type inference for {GADTs}},
+  author = {Simon {Peyton Jones} and Dimitrios Vytiniotis and Stephanie Weirich and Geoffrey Washburn},
+  year = {2006},
+  booktitle = {Proc. 2006 International Conf. on Functional Programming (ICFP 2006)}
+}
+
+@misc{wobbly,
+  author = {Simon {Peyton Jones} and Geoffrey Washburn and Stephanie Weirich},
+  title = {Wobbly types: type inference for generalised algebraic data types},
+  year = {2004},
+  note = {Submitted to POPL 2005}
+}
+
+@misc{epigram-afp,
+    author = {Conor McBride},
+    title = {Epigram: Practical Programming with Dependent Types},
+    year = {2004},
+    howpublished = {Lecture Notes, International Summer School on Advanced Functional Programming}
+}
+
+@book{ml85,
+    author = {Per Martin-L\"{o}f},
+    title = "Intuitionistic Type Theory",
+    year = "1985",
+    publisher = "Bibliopolis"
+}   
+
+@article{modular-fulllazy,
+  title = {A Modular Fully Lazy Lambda Lifter in {Haskell}},
+  author = {Simon {Peyton Jones} and David Lester},
+  year = {1991},
+  month = {May},
+  journal = {Software Practice and Experience},
+  volume = {21},
+  number = {5},
+  pages = {479--506}
+}
+
+@article{ghani-jay95,
+  author = 	 {Barry Jay and Neil Ghani},
+  title = 	 {The Virtues of Eta-Expansion},
+  journal = 	 {Journal of Functional Programming},
+  year = 	 {1995},
+  volume = 	 {5},
+  number = 	 {2},
+  pages = 	 {135-154},
+}
+
+@misc{nkpat,
+    author = {Lennart Augustsson},
+    title = {n+k patterns},
+    year = {1993},
+    howpublished = {Message to the haskell mailing list, Mon, 17 May 93}
+}
+
+@article{ danvy98functional,
+    author = "Olivier Danvy",
+    title = "Functional Unparsing",
+    journal = "Journal of Functional Programming",
+    volume = "8",
+    number = "6",
+    pages = "621-625",
+    year = "1998",
+    url = "citeseer.ist.psu.edu/danvy98functional.html" }
+
+@inproceedings{SeveriPoll94,
+   author = {Paula Severi and Erik Poll},
+   booktitle = {Logical Foundations of Computing Science, LFCS'94},
+   editor = {A. Nerode and Yu. V. Matiyasevich},
+   number = {813},
+   pages = {316--328},
+   publisher = {Springer},
+   series = {LNCS},
+   title = {{P}ure {T}ype {S}ystems with {D}efinitions},
+   year = {1994}
+}
+
+@inproceedings{coinductive,
+  title = {An Application of Co-Inductive Types in Coq: Verification of the Alternating Bit Protocol},
+  booktitle = {Proceedings of the 1995 Workshop on Types for Proofs and Programs},
+  series = {LNCS},
+  year = {1995},
+  volume = {1158}, 
+  pages = {135-152},
+  publisher = {Springer-Verlag},
+  author = {Eduardo Gim\'{e}nez}
+}
+
+@book{erlang,
+    author = "Joe Armstrong and Robert Virding and Claes Wikstr{\"o}m and Mike Williams",
+    title = "Concurrent Programming in Erlang",
+    edition = "Second",
+    publisher = "Prentice-Hall",
+    year = "1996",
+    url = "citeseer.ist.psu.edu/armstrong93concurrent.html" 
+}
+
+@PhdThesis{alti:phd93,
+  author =       "Thorsten Altenkirch",
+  title =        "Constructions, Inductive Types and Strong Normalization",
+  school =       "University of Edinburgh",
+  year =         "1993",
+  month =        "November",
+}
+
+@inproceedings{coq-modules,
+  author = "Jacek Chrzaszcz",
+  title = "Modules in {Coq} Are and Will Be Correct",
+  year = {2004},
+   booktitle = {Types for Proofs and Programs 2003},
+   editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
+   publisher = {Springer},
+   volume = {3085}
+}
+
+@inproceedings{comp-polymorphism,
+  author = "Robert Harper and Greg Morrisett",
+  title = "Compiling Polymorphism Using Intensional Type Analysis",
+  year = "1995",
+  booktitle = "Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages",
+  pages = "130 -- 141"
+}
+
+@misc{runtime-loader,
+  author = "Andre Pang",
+  title = "{GHC} Runtime Loading",
+  year = "2004",
+  howpublished = {Available from \verb+http://www.algorithm.com.au/wiki/hacking/haskell.ghc_runtime_loading+}
+}
+
+@article{mccarthy-lisp,
+  author = "John McCarthy",
+  title = "Recursive Functions of Symbolic Expressions and Their Computation By Machine",
+  year = "1960",
+  journal = "Communications of the ACM",
+  volume = "3",
+  number = "4",
+  pages = "184--195"
+}
+
+@book{stl,
+  author = " David R. Musser and Atul Saini and Gillmer J. Derge",
+  title= "The {STL} Tutorial and Reference Guide: {C++} Programming with the Standard Template Library",
+  year = "2001",
+  publisher = "Addison Wesley"
+}
+
+@misc{ phase-distinction,
+    author = "Luca Cardelli",
+    title = "Phase Distinctions in Type Theory",
+    howpublished = "Manuscript",
+    year = "1988",
+    url = "citeseer.ist.psu.edu/cardelli88phase.html" }
+
+@book {pierce-types,
+  author = "Benjamin C. Pierce",
+  title = "Type and Programming Languages",
+  year = "2002",
+  publisher = "MIT Press"
+}
+
+@article{ coqcc,
+  Author = "Thierry Coquand and G\'{e}rard Huet",
+  title = "The calculus of constructions",
+  year = "1988",
+  journal = "Information and Computation",
+  volume = "76",
+  pages = "95--120"
+}
+
+@article{ miller91jlc,
+  Author = "Dale Miller",
+  Title = "A Logic Programming Language with Lambda-Abstraction,
+    Function Variables, and Simple Unification",
+  Journal = "Journal of Logic and Computation",
+  Volume = "1",
+  Number = "4",
+  Pages = "497-536",
+  Year = "1991",
+  URL = "citeseer.ist.psu.edu/miller91logic.html",
+  URL = "file://ftp.cis.upenn.edu/pub/papers/miller/jlc91.dvi.Z" }
+
+@article{miller-unity,
+   author = "Dale Miller",
+   title = "Unification Under a Mixed Prefix",
+   journal = "Journal of Symbolic Computation",
+   volume = "14",
+   pages = "321--358",
+   year = 1992
+}
+
+@inproceedings{ cynthia,
+    author = "Jon Whittle and Alan Bundy and Richard J. Boulton and Helen Lowe",
+    title = "An {ML} Editor Based on Proofs-As-Programs",
+    booktitle = "Automated Software Engineering",
+    pages = "166-173",
+    year = "1999",
+    url = "citeseer.ist.psu.edu/whittle99ml.html" }
+
+
+@misc{ewd340,
+   title={The Humble Programmer},
+   author={Edsger Dijkstra},
+   year={1972},
+   note={Turing Award Lecture, EWD 340}
+}
+
+@misc{fortran,
+   title={Specifications for the {IBM} Mathematical FORmula TRANslating System, {FORTRAN}},
+   author={{IBM Applied Science Division}},
+   key={IBM},
+   year={1954},
+   month={November}
+}
+
+@inproceedings{quickcheck,
+   title = {{QuickCheck}: A Lightweight Tool For Random Testing Of {Haskell} Programs},
+   author = {Koen Claessen and John Hughes},
+   year = {2000},
+   booktitle = {International Conference on Functional Programming}
+}
+
+@inproceedings{currylam,
+   title = {Functionality in Combinatory Logic},
+   author = {Haskell Curry},
+   year = {1934},
+   booktitle = {Proc. Nat. Acad. Sci, USA},
+   volume = {20},
+   pages = {584--590}
+}
+
+@article{churchsimplelam1,
+   title = {A set of postulates for the foundation of logic},
+   author = {Alonzo Church},
+   year = {1932},
+   journal = {Annals of Mathematics},
+   volume = {2},
+   number = {33},
+   pages = {346--366}
+}
+
+@article{churchsimplelam2,
+   title = {A set of postulates for the foundation of logic},
+   author = {Alonzo Church},
+   year = {1933},
+   journal = {Annals of Mathematics},
+   volume = {2},
+   number = {34},
+   pages = {839--864}
+}
+
+@article{churchlam,
+   title = {A Formulation of the Simple Theory of Types},
+   author = {Alonzo Church},
+   year = {1940},
+   journal = {Journal of Symbolic Logic},
+   volume = {5},
+   pages = {56--58}
+}
+
+@book{mitchell,
+   title = {Concepts in Programming Languages},
+   author = {John C. Mitchell},
+   year = {2003},
+   publisher = {Cambridge University Press}
+}
+
+@inproceedings{harrison-hol99,
+   title = {A Machine-Checked Theory of Floating Point Arithmetic},
+   year = {1999},
+   booktitle = {Theorem Proving in Higher Order Logics: 12th International Conference, TP},
+   pages = {113--130},
+   author = {John Harrison},
+   crossref = {hol99}
+}
+
+@inproceedings{c--,
+   title = {C--: A portable assembly language},
+   year = {1997},
+   booktitle = {Workshop on Implementing Functional Languages, St Andrews},
+   author = {Simon {Peyton Jones} and Thomas Nordin and Dino Oliva},
+   crossref = {func-imp97}
+}
+
+@proceedings{func-imp97,
+   title = {Workshop on Implementing Functional Languages, St Andrews},
+   year = {1997},
+   editor = {C Clack},
+   publisher = {Springer-Verlag}
+}
+
+@proceedings{hol99,
+   volume = {1690},
+   title = {Theorem Proving in Higher Order Logics:        12th International Conference, TPHOLs'99},
+   year = {1999},
+   editor = {Yves Bertot and Gilles Dowek and Andr{\'e}        Hirschowitz and Christine Paul},
+   publisher = {Springer-Verlag},
+   address = {Nice, France},
+   series = {LNCS}
+}
+
+@book{mathlogic,
+   title = {Mathematical Logic and Programming Languages},
+   year = {1985},
+   editor = {C.A.R. Hoare and J.C. Shepherdson},
+   publisher = {Prentice-Hall}
+}
+
+@book{automath,
+   title = {Selected Papers on Automath},
+   year = {1994},
+   editor = {S. Abramsky and J. Barwise and K. Fine and H.J. Keisler and        A.S. Troelstr},
+   publisher = {North-Holland}
+}
+
+@misc{gimps,
+   howpublished = {http://www.mersenne.org/prime.htm},
+   title = {Great Internet Mersenne Prime Search}
+}
+
+@misc{haskell-report,
+   title = {Haskell 98 Language and Libraries --- The Revised Report},
+   year = {2002},
+   month = {December},
+   author = {Simon {Peyton Jones} and others},
+   howpublished = {Available from \verb+http://www.haskell.org/+}
+}
+
+@inproceedings{cayenne-icfp,
+    author = "Lennart Augustsson",
+    title = "Cayenne - a Language with Dependent Types",
+    booktitle = "Proc. 1998 International Conf. on Functional Programming (ICFP '98)",
+    pages = "239--250",
+    year = "1998",
+    url = "citeseer.nj.nec.com/augustsson98cayenne.html" 
+}
+
+
+@misc{equality-cayenne,
+   howpublished = {\verb+http://www.cs.chalmers.se/~augustss/cayenne/+},
+   title = {Equality Proofs in Cayenne},
+   year = {1999},
+   author = {Lennart Augustsson}
+}
+
+@misc{interp-cayenne,
+   howpublished = {\url{http://www.cs.chalmers.se/~augustss/cayenne/}},
+   title = {An exercise in dependent types: A well-typed interpreter},
+   year = {1999},
+   author = {Lennart Augustsson and Magnus Carlsson}
+}
+
+@inproceedings{balaa00fixpoint,
+   title = {Fix-Point Equations for Well-Founded Recursion in Type Theory},
+   year = {2000},
+   booktitle = {Theorem Proving in Higher Order Logics},
+   pages = {1-16},
+   author = {Antonia Balaa and Yves Bertot}
+}
+
+@inproceedings{isabelle-maple,
+   title = {Theorems and algorithms: An interface between Isabelle and Maple},
+   year = {1995},
+   booktitle = {International Symposium on Symbolic and Algebraic Computation},
+   author = {Ballarin, C. and Homann, K., and Calmet, J.}
+}
+
+@book{barendregt-num,
+   title = {The Lambda Calculus, Its Syntax and Semantics},
+   year = {1984},
+   publisher = {North-Holland},
+   author = {Henk Barendregt}
+}
+
+@book{beiler,
+   title = {Recreations in the Theory of Numbers},
+   year = {1964},
+   publisher = {Dover},
+   author = {Albert H. Beiler}
+}
+
+@article{multidigit,
+   journal = {Advances in Applied Mathematics},
+   title = {Multidigit Multiplication for Mathematicians},
+   year = {1998},
+   author = {Daniel J. Bernstein}
+}
+
+@article{buhler-fox,
+   journal = {ACM Crossroads 2.1.},
+   month = {September},
+   title = {The Fox project: A language-structured approach to networking        software.},
+   year = {1995},
+   author = {Buhler, J.},
+   note = {Available at http://www.acm.org/crossroads/xrds2-1/foxnet.html}
+}
+
+@techreport{burstall91,
+   title = {Computer Assisted Proof for Mathematics: an Introduction Using        the \textsc{Lego} Proof System},
+   year = {1991},
+   institution = {University of Edinburgh},
+   author = {Rod Burstall}
+}
+
+@article{plastic,
+   title = {An Implementation of {LF} with Coercive Subtyping and Universes}, 
+   author = {Paul Callaghan and Zhaohui Luo},
+   journal = {Journal of Automated Reasoning},
+   volume = {27},
+   number = {1},
+   pages = {3--27},
+   year = {2001}
+}
+
+@article{coercive,
+   title = {Coercive subtyping},
+   author = {Zhaohui Luo},
+   journal = {J. Logic Comput.},
+   volume = {9},
+   number = {1},
+   year = {1991},
+   pages = {105--130}
+}
+
+@inproceedings{calmet-homann,
+   title = {Classification of communication and cooperation mechanisms for        logical and symbolic computation systems},
+   year = {1996},
+   booktitle = {Proceedings of the First International Workshop 'Frontiers of        Combining S},
+   pages = {133-146},
+   publisher = {Kluwer},
+   author = {J. Calmet and K. Homann}
+}
+
+@techreport{comm-proofs,
+   title = {On Communicating Proofs in Interactive Mathematical Documents},
+   year = {2000},
+   institution = {Eindhoven University of Technology},
+   author = {Olga Caprotti and Martijn Oostdijk}
+}
+
+@article{prime2999,
+   title = {How to formally and efficiently prove Prime(2999)},
+   year = {2001},
+   author = {Olga Caprotti and Martijn Oostdijk},
+   journal = {Symbolic Computation and Automated Reasoning},
+   pages = {114--125}
+}
+
+@book{church-num,
+   title = {The Calculi of Lambda-Conversion},
+   year = {1941},
+   publisher = {Princeton University Press},
+   author = {Alonzo Church}
+}
+
+@book{nuprl86,
+   title = {Implementing Mathematics with the NuPrl Proof Development System},
+   year = {1986},
+   publisher = {Prentice-Hall},
+   address = {NJ},
+   author = {Constable, Robert L. and others}
+}
+
+@book{conway,
+   title = {On Numbers and Games},
+   year = {1976},
+   publisher = {Academic Press},
+   author = {J.H. Conway}
+}
+
+@misc{coq-manual,
+   howpublished = {\verb+http://coq.inria.fr/+},
+   title = {The {Coq} Proof Assistant --- Reference Manual},
+   year = {2001},
+   author = {{Coq Development Team}}
+}
+
+@misc{tt-prog,
+   month = {June},
+   title = {Type Theory and Programming},
+   year = {1994},
+   author = {Thierry Coquand and Bengt Nordstr\"{o}m and Jan M. Smith and Bj\"{o}rn von Sydow}
+}
+
+@book{func-appr,
+   title = {The Functional Approach to Programming},
+   year = {1998},
+   publisher = {Cambridge University Press},
+   author = {Guy Cousineau and Michel Mauny}
+}
+
+@misc{ibmspec,
+   howpublished = {http://www2.hursley.ibm.com/decimal/},
+   month = {January},
+   title = {Standard Decimal Arithmetic Specification},
+   year = {2001},
+   author = {Mike Cowlishaw},
+   note = {\copyright IBM Corporation 2001}
+}
+
+@book{dummett,
+   title = {Elements of Intuitionism},
+   year = {2000},
+   edition = {2nd},
+   publisher = {Oxford: Clarendon},
+   author = {Michael A.E. Dummet}
+}
+
+@article{dybjer94,
+   title = {Inductive Families},
+   year = {1994},
+   author = {Peter Dybjer},
+   journal = {Formal Aspects Of Computing},
+   volume = {6},
+   pages = {440--465}
+}
+
+@misc{octave,
+   howpublished = {http://www.octave.org/},
+   month = {February},
+   title = {GNU Octave --        A high-level interactive language for numerical computations},
+   year = {1997},
+   author = {John W. Eaton}
+}
+
+@book{comp-methods,
+   title = {Computing methods for scientists and engineers},
+   year = {1968},
+   publisher = {Oxford : Clarendon Press},
+   author = {L. Fox and D.F. Mayers}
+}
+
+@misc{guile,
+   howpublished = {http://www.gnu.org/software/guile/guile.html},
+   title = {Guile -- Project GNU's extension language},
+   year = {2001},
+   author = {{Free Software Foundation}}
+}
+
+@article{need-dep,
+   journal = {Journal of Functional Programming},
+   number = {4},
+   volume = {10},
+   title = {Do we need dependent types?},
+   year = {2000},
+   pages = {409-415},
+   author = {Daniel Fridlender and Mia Indrika}
+}
+
+@book{primes-programming,
+   title = {Primes and Programming -- An Introduction to Number Theory with Computing},
+   year = {1993},
+   publisher = {Cambridge University Press},
+   author = {Peter Giblin}
+}
+
+@misc{rec-coq,
+   month = {May},
+   title = {A Tutorial on Recursive Types in \textsc{Coq}},
+   year = {1998},
+   author = {Eduardo Gim\'{e}nez}
+}
+
+@article{goldberg91,
+   journal = {ACM Computing Surveys},
+   number = {1},
+   volume = {23},
+   title = {What every computer scientist should know about floating point        arithmetic},
+   year = {1991},
+   pages = {5-48},
+   author = {D. Goldberg}
+}
+
+@article{binary-lambda,
+   journal = {Journal of Functional Programming},
+   number = {6},
+   volume = {10},
+   title = {An adequate and efficient left associated binary numeral        system in the $\lambda$-calculus},
+   year = {2000},
+   author = {Mayer Goldberg}
+}
+
+@book{hol,
+   title = {Introduction to HOL},
+   year = {1993},
+   publisher = {Cambridge University Press},
+   author = {M. Gordon and T. Melham}
+}
+
+@misc{gmp,
+   howpublished = {Available from \verb+http://www.swox.com/gmp/manual/+},
+   title = {The {GNU Multiple Precision} Arithmetic Library 4.1.3 --- Manual},
+   year = {2004},
+   author = {Torbj\"{o}rn Granlund and others}
+}
+
+@article{harrison-fmsd94,
+   journal = {Formal Methods in System Design},
+   volume = {5},
+   title = {Constructing the Real Numbers in {HOL}},
+   year = {1994},
+   pages = {35--59},
+   author = {John Harrison}
+}
+
+@book{harrison-thesis,
+   title = {Theorem Proving with the Real Numbers},
+   year = {1998},
+   publisher = {Springer-Verlag},
+   author = {John Harrison}
+}
+
+@techreport{hol-maple,
+   title = {Reasing about the Reals: the marriage of HOL and Maple},
+   year = {1993},
+   institution = {University of Cambridge Computer Laboratory},
+   author = {John Harrison and Laurent Th\'{e}ry}
+}
+
+@misc{coq-tutorial,
+   howpublished = {http://pauillac.inria.fr/coq},
+   title = {The \textsc{Coq} Proof Assistant - A Tutorial},
+   author = {G\'{e}rard Huet and Gilles Kahn and Christine Paulin-Mohring}
+}
+
+@misc{restr-haskell,
+   howpublished = {http://citeseer.nj.nec.com/253599.html},
+   month = {September},
+   title = {Restricted Data Types in Haskell},
+   year = {1999},
+   author = {John Hughes}
+}
+
+@misc{javadec,
+   howpublished = {http://www2.hursley.ibm.com/decimalj/decimald.html},
+   month = {September},
+   title = {Decimal Arithmetic for Java -- a Proposal},
+   year = {2000},
+   author = {{IBM Corporation}}
+}
+
+@misc{ieee754,
+   title = {IEEE Standard for Binary Floating Point Arithmetic},
+   year = {1985},
+   author = {{IEEE Standard 754}}
+}
+
+@misc{ieee854,
+   title = {IEEE Standard for Radix-Independent Floating-Point Arithmetic},
+   year = {1987},
+   author = {{IEEE Standard 854}}
+}
+
+@inproceedings{jon91,
+   title = {Completing the Rational and Metric Spaces in \textsc{Lego}},
+   year = {1991},
+   booktitle = {Proceedings of the Second Workshop on Logical Frameworks},
+   author = {Claire Jones}
+}
+
+@misc{ typinghaskell,
+  author = "Mark Jones",
+  title = "Typing {Haskell} in {Haskell}",
+  howpublished = "In Haskell Workshop, September 1999.",
+  year = "1999",
+  url = "citeseer.ist.psu.edu/article/jones99typing.html" }
+
+@article{karatsuba,
+   journal = {Soviet Physics-Doklady},
+   volume = {7},
+   title = {Multiplication of multidigit numbers by automata},
+   year = {1963},
+   pages = {595--596},
+   author = {A. Karatsuba and Y. Ofman}
+}
+
+@book{knuth2,
+   volume = {2},
+   title = {The Art of Computer Programming - Seminumerical Algorithms},
+   year = {1969},
+   publisher = {Addison Wesley},
+   author = {Donald E. Knuth}
+}
+
+@article{next700,
+   journal = {Communications of the ACM},
+   number = {3},
+   month = {March},
+   volume = {9},
+   title = {The next 700 programming languages},
+   year = {1966},
+   author = {P.J. Landin}
+}
+
+@techreport{luo-spec,
+   month = {January},
+   title = {Program Specification and Data Refinement in Type Theory},
+   year = {1993},
+   institution = {Department of Computer Science, University of Edinburgh},
+   author = {Zhaohui Luo}
+}
+
+@phdthesis{luo90,
+   school = {University of Edinburgh},
+   title = {An Extended Calculus Of Constructions},
+   year = {1990},
+   author = {Zhaohui Luo}
+}
+
+@techreport{lego-manual,
+   title = {\textsc{Lego} Proof Development System: User's Manual},
+   year = {1992},
+   institution = {Department of Computer Science, University of Edinburgh},
+   author = {Zhaohui Luo and Robert Pollack}
+}
+
+@inproceedings{alf,
+   title = {The {ALF} proof editor and its proof engine},
+   year = {1994},
+   booktitle = {Formal Proceeding of the 1993 Workshop on Types for Proofs        and Programs},
+   author = {Lena Magnusson and Bengt N\"{o}rdstrom}
+}
+
+@misc{happy,
+   howpublished = {http://www.haskell.org/happy/},
+   title = {Happy User Guide},
+   year = {2001},
+   author = {Simon Marlow and Andy Gill}
+}
+
+@inproceedings{generic-haskell,
+   title = {Generic Haskell, Specifically},
+   author = {Dave Clarke and Andres L\"{o}h},
+   editor = {Jeremy Gibbons and Johan Jeuring},
+   booktitle = {Proceedings of the IFIP TC2 Working Conference on Generic Programming},
+   year = {2002},
+   publisher = {Kluwer Academic Publishers},
+   pages = {21--48}
+}
+
+@article{faking-it,
+   title = {Faking It -- Simulating Dependent Types in {Haskell}},
+   year = {2002},
+   author = {Conor McBride},
+   journal = {Journal of Functional Programming},
+   volume = {12},
+   number = {4+5},
+   pages = {375--392}
+}
+
+@misc{mcbride-inverting,
+   title = {Inverting Inductively Defined Relations in \textsc{Lego}},
+   year = {1996},
+   author = {Conor McBride}
+}
+
+@phdthesis{mcbride-thesis,
+   month = {May},
+   school = {University of Edinburgh},
+   title = {Dependently Typed Functional Programs and their         proofs},
+   year = {2000},
+   author = {Conor McBride}
+}
+
+@article{mcbride-unification,
+   title = {First-Order Unification by Structural Recursion},
+   year = {2003},
+   author = {Conor McBride},
+   journal = {Journal of Functional Programming},
+   volume = {13},
+   number = {6},
+   pages = {1061--1075}
+}
+
+@misc{mckinna-pollack,
+   howpublished = {Kluwer Academic Publishers},
+   title = {Some Lambda Calculus and Type Theory formalized},
+   year = {1998},
+   author = {James McKinna and Robert Pollack}
+}
+
+@book{num-theory,
+   title = {An Introduction to the Theory of Numbers},
+   year = {1980},
+   publisher = {John Wiley and Sons},
+   author = {Ivan Niven and Herbert S. Zuckerman}
+}
+
+@book{prog-mltt,
+   title = {Programming in Martin-L\"{o}f's Type Theory -- An Introduction},
+   year = {1990},
+   publisher = {Oxford University Press},
+   author = {Bengt Nordstr\"{o}m and Kent Petersson and Jan M. Smith},
+   note = {Out of print. Available from http://www.cs.chalmers.se/Cs/Research/Logic}
+}
+
+@book{okasaki,
+   title = {Purely Functional Data Structures},
+   year = {1998},
+   publisher = {Cambridge University Press},
+   author = {Chris Okasaki}
+}
+
+@book{arith-systems,
+   title = {Computer Arithmetic Systems},
+   year = {1994},
+   publisher = {Prentice-Hall},
+   author = {Amos R. Omondi}
+}
+
+@book{pj-imp,
+   title = {The Implementation of Functional Programming Languages},
+   year = {1987},
+   publisher = {Prentice-Hall},
+   author = {Simon {Peyton Jones}}
+}
+
+@book{cp-bjc,
+   title = {Computational Numerical Methods},
+   year = {1986},
+   publisher = {John Wiley and Sons},
+   author = {C. Phillips and B. Cornelius}
+}
+
+@book{nag,
+   title = {The NAG Library: a beginner's guide},
+   year = {1986},
+   publisher = {Oxford : Clarendon Press},
+   author = {Jen Phillips}
+}
+
+@misc{believe,
+   month = {September},
+   title = {How to Believe a Machine-Checked Proof},
+   year = {1996},
+   author = {Robert Pollack}
+}
+
+@phdthesis{pollack94,
+   school = {University of Edinburgh},
+   title = {The Theory of LEGO -- A Proof Checker for the Extended Calculus of Constructions},
+   year = {1994},
+   author = {Robert Pollack}
+}
+
+@inproceedings{intel-bug,
+   series = {LNCS},
+   volume = {915},
+   title = {Anatomy of the Pentium Bug},
+   publisher = {Springer-Verlag},
+   year = {1995},
+   pages = {97--107},
+   author = {V.R. Pratt}
+}
+
+@book{maple,
+   title = {The Maple Handbook: Maple V Release 4},
+   year = {1996},
+   publisher = {Springer},
+   author = {Darren Redfern}
+}
+
+@book{crypto,
+   title = {Applied Cryptography: protocols, algorithms and source code in C.},
+   year = {1996},
+   publisher = {Wiley},
+   author = {Bruce Schneier}
+}
+
+@article{adts,
+   journal = {Mathematical Structures in Computer Science},
+   number = {2},
+   volume = {10},
+   title = {On lists and other abstract data types in the calculus of        construction},
+   year = {2000},
+   pages = {261-276},
+   author = {Jonathan P. Seldin}
+}
+
+@article{seldin97,
+   journal = {Annals of Pure and Applied Logic},
+   number = {1},
+   month = {January},
+   volume = {83},
+   title = {On the proof theory of Coquand's calculus of constructions},
+   year = {1997},
+   pages = {23--101},
+   author = {Jonathan P. Seldin}
+}
+
+@article{wichmann,
+   journal = {The Computer Journal},
+   volume = {32},
+   title = {Towards a Formal Specification of Floating Point},
+   year = {1989},
+   pages = {432-436},
+   author = {B.A. Wichmann}
+}
+
+@book{mathematica,
+   title = {Mathematica : a system for doing mathematics by computer},
+   year = {1991},
+   publisher = {Addison Wesley},
+   author = {Stephen Wolfram}
+}
+
+@inproceedings{xi-imp,
+author = "Hongwei Xi",
+title = {{Imperative Programming with Dependent Types}},
+booktitle = "Proceedings of 15th IEEE Symposium on Logic in Computer Science",
+year = 2000,
+month = "June",
+address = "Santa Barbara",
+pages = "375--387"
+}
+
+@phdthesis{xi-thesis,
+   month = {December},
+   school = {Department of Mathematical Sciences, Carnegie Mellon University},
+   title = {Dependent Types in Practical Programming},
+   year = {1998},
+   author = {Hongwei Xi}
+}
+
+
+@techreport{dtal,
+author = {Hongwei Xi and Robert Harper},
+title = {A Dependently Typed Assembly Language},
+institution = {Computer Science and Engineering Department, Oregon Graduate Institute},
+year = 1999,
+number = {OGI-CSE-99-008},
+month = {July},
+}
+
+@misc{bignum-cmp,
+   month = {February},
+   title = {Comparison of three public-domain multiprecision libraries:        BigNum, Gmp and Pari},
+   year = {1998},
+   author = {Paul Zimmerman}
+}
+
+@book{perl,
+   title = {Programming Perl},
+   author = {Larry Wall and Tom Christiansen and Jon Orwant},
+   year = {2000},
+   edition = {3rd},
+   publisher = {O'Reilly}
+}
+
+@misc{python,
+   howpublished = {http://www.python.org/doc/current/tut/tut.html},
+   month = {April},
+   title = {Python Tutorial},
+   year = {2001},
+   author = {Guido van {Rossum} and Fred L. {Drake, Jr}}
+}
+
+@book{logic,
+   title = {The Language of First Order Logic},
+   year = {1992},
+   publisher = {CSLI Lecture Notes},
+   author = {Jon Barwise and John Etchemendy}
+}
+
+@book{haskell,
+   title = {Haskell -- The Craft of Functional Programming},
+   year = {1999},
+   publisher = {Addison Wesley},
+   author = {Simon Thompson}
+}
+
+@inproceedings{coq-hol,
+   title = {A Comparative Study of Coq and HOL},
+   year = {1997},
+   booktitle = {Theorem Proving in Higher Order Logics},
+   pages = {323-337},
+   author = {Vincent Zammit}
+}
+
+@misc{gay90,
+   month = {November},
+   title = {Correctly Rounded Binary-Decimal and Decimal-Binary Conversions},
+   year = {1990},
+   author = {David M. Gay},
+   note = {AT&T Bell Laboratories, Numerical Analysis Manuscript 90-10}
+}
+
+@article{hughes-matters,
+   journal = {Computer Journal},
+   number = {2},
+   volume = {32},
+   title = {Why Functional Programming Matters},
+   year = {1989},
+   pages = {98--107},
+   author = {J. Hughes}
+}
+
+@inproceedings{proofpointing,
+   title = {Proof by Pointing},
+   year = {1994},
+   booktitle = {Proceedings of the International Symposium on Theoretical Aspects of Computer So},
+   pages = {141--160},
+   editor = {M. Hagiya and J. C. Mitchell},
+   publisher = {Springer-Verlag},
+   series = {LNCS},
+   volume = {789},
+   address = {Sendai, Japan},
+   author = {Yves Bertot and Gilles Kahn and Laurent Th{\'e}ry}
+}
+
+@misc{inductive-coq,
+   month = {December},
+   title = {Inductive Definitions in the System Coq -- Rules and Properties},
+   year = {1992},
+   author = {Christine Paulin-Mohring}
+}
+
+@misc{leiserson98,
+   month = {July},
+   title = {Using de Bruijn Sequences to Index a 1 in a Computer Word},
+   year = {1998},
+   author = {{Charles E. Leiserson} and {Harald Prokop} and {Keith H. Randall}}
+}
+
+@inproceedings{proofchecking,
+   title = {A two-level approach towards lean proof-checking},
+   year = {1996},
+   booktitle = {TYPES},
+   pages = {16--35},
+   author = {G. Barthe and M.P.J. Ruys and H.P. Barendregt}
+}
+
+@inproceedings{congruence,
+   title = {Congruence Types},
+   year = {1995},
+   booktitle = {CSL},
+   pages = {36--51},
+   author = {Gilles Barthe and Herman Geuvers}
+}
+
+@phdthesis{geuvers-thesis,
+   title = {Logic and Type Systems},
+   author = {Herman Geuvers},
+   year = 1993,
+   school = {Katholieke Universiteit Nijmegen}
+}
+
+@techreport{multiple-values,
+   title = {Multiple Values in {Standard ML}},
+   year = {1994},
+   number = {94-312},
+   institution = {LFCS, Dept of Computer Science, University of Edinburgh},
+   author = {Kevin Mitchell}
+}
+
+@inproceedings{oracle-checking,
+   month = {January},
+   title = {Oracle-Based Checking of Untrusted Software},
+   year = {2001},
+   booktitle = {Proceedings of the 28th ACM Symposium on Principles of Programming Languages},
+   pages = {142--154},
+   author = {{George C. Necula} and {S.P. Rahul}}
+}
+
+@article{adams93jfp,
+   journal = {Journal of Functional Programming},
+   number = {4},
+   volume = {3},
+   title = {Efficient Sets -- A Balancing Act},
+   year = {1993},
+   pages = {553--561},
+   author = {Stephen Adams}
+}
+
+@inproceedings{hughes-sized,
+   title = {Proving the Correctness of Reactive Systems Using Sized Types},
+   year = {1996},
+   booktitle = {Proceedings of the 23rd ACM SIGPLAN-SIGACT symposium on Principles of programmin},
+   pages = {410--423},
+   author = {John Hughes and Lars Pareto and Amr Sabry}
+}
+
+@inproceedings{whittle99ml,
+   title = {An {ML} Editor Based on Proofs-As-Programs},
+   year = {1999},
+   booktitle = {Automated Software Engineering},
+   pages = {166--173},
+   author = {Jon Whittle and Alan Bundy and Richard J. Boulton and Helen Lowe}
+}
+
+@book{efp-typeinf,
+   title = {Elements of Functional Programming},
+   year = {1989},
+   publisher = {Addison-Wesley},
+   author = {Chris Reade},
+   series = {International Computer Science Series}
+}
+
+@incollection{ wadler-views,
+    author = "Philip Wadler",
+    title = "Views: {A} Way for Pattern Matching to Cohabit with Data Abstraction",
+    booktitle = "Proceedings, 14th Symposium on Principles of Programming Languages",
+    publisher = "Association for Computing Machinery",
+    editor = "Steve Munchnik",
+    pages = "307--312",
+    year = "1987",
+    url = "citeseer.nj.nec.com/wadler87views.html" }
+
+@article{ coquand-checking,
+    author = "Thierry Coquand",
+    title = "An Algorithm for Type-Checking Dependent Types",
+    journal = "Science of Computer Programming",
+    volume = "26",
+    number = "1-3",
+    pages = "167-177",
+    year = "1996",
+    url = "citeseer.nj.nec.com/coquand96algorithm.html" }
+
+@misc{coquand-pm,
+    author = "Thierry Coquand",
+    title = "Pattern Matching with Dependent Types",
+    year = "1992",
+    howpublished = "Available from \verb+http://www.cs.chalmers.se/~coquand/type.html+"
+}
+
+@misc{pollack-records,
+   month = {August},
+   title = {Dependently Typed Records for Representing Mathematical Structure},
+   year = {2000},
+   author = {Robert Pollack}
+}
+
+@article{checking-betarte,
+   journal = {Journal of Functional Programming},
+   number = {2},
+   month = {March},
+   volume = {10},
+   title = {Type checking dependent (record) types and subtyping},
+   year = {2000},
+   pages = {137--166},
+   author = {Gustavo Betarte}
+}
+
+
+@article{ gcode,
+    author = "Thomas Johnsson",
+    title = "Efficient Compilation of Lazy Evaluation",
+    booktitle = "Proceedings of the {ACM} {SIGPLAN}'84 Symposium on Compiler Con struction",
+    journal = "SIGPLAN Notices",
+    volume = "19",
+    number = "6",
+    month = "June",
+    publisher = "ACM Press",
+    pages = "58--69",
+    year = "1984",
+    url = "citeseer.nj.nec.com/johnsson84efficient.html" }
+
+@misc{kamareddine01,
+   month = {February},
+   title = {Reviewing the classical and the de Bruijn notation for $\lambda$-calculus and pure type systems},
+   year = {2001},
+   author = {Fairouz Kamareddine}
+}
+
+@book{prooftheory,
+   title = {Basic Proof Theory},
+   year = {1996},
+   publisher = {Cambridge University Press},
+   author = {A.S. Troelstra and H. Schwichtenberg},
+   series = {Cambridge Tracts in Theoretical Computer Science}
+}
+
+@misc{nbe_staged,
+   title = {Integrating Normalization-by-Evaluation into a Staged Programming Language},
+   year = {1998},
+   author = {Tim Sheard}
+}
+
+@inproceedings{nbe2,
+   title = {Normalization by evaluation},
+   year = {1998},
+   author = {Ulrich Berger and Matthias Eberl and Helmut Schwichtenberg},
+   booktitle = {Prospects for Hardware Foundations 1998},
+   pages = {117--137},
+   series = {LNCS}
+}
+
+
+
+@misc{rtcg_jfp,
+   title = {Compiling for Run-time Code Generation},
+   year = {2000},
+   author = {Frederick Smith and Dan Grossman and Greg Morrisett and Luke Hornof and Trevor J},
+   note = {Under consideration for J. Functional Programming}
+}
+
+@phdthesis{fredsmith_thesis,
+   month = {January},
+   school = {Cornell University},
+   title = {Certified Run-time Code Generation},
+   year = {2002},
+   author = {Frederick Smith}
+}
+
+@inproceedings{xi_arraybounds,
+author = "Hongwei Xi and Frank Pfenning",
+title = {Eliminating Array Bound Checking through Dependent Types},
+booktitle = "Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation",
+year = 1998,
+month = "June",
+address = "Montreal",
+pages = "249--257",
+}
+
+@inproceedings{xi_deadcode,
+author = "Hongwei Xi",
+title = {Dead Code Elimination through Dependent Types},
+booktitle = "The First International Workshop on Practical Aspects of Declarative Languages",
+year = 1999,
+month = "January",
+address = "San Antonio",
+pages = "228--242"
+}
+
+@book{compilers,
+   title = {Compilers --- Principles, Techniques and Tools},
+   year = {1986},
+   publisher = {Addison-Wesley},
+   author = {Alfred Aho and Ravi Sethi and Jeffrey Ullman}
+}
+
+@inproceedings{nhc,
+   title = {Highlights from nhc: A space efficient {Haskell} Compiler},
+   year = {1995},
+   author = "Niklas R{\"o}jemo",
+   booktitle = "Functional Programming Languages and Computer Architecture",
+   pages = "282--292"
+}
+
+
+@misc{mlmatch,
+   title = {SML/NJ Match Compiler Notes},
+   year = {1992},
+   author = {William Aitken}
+}
+
+@misc{mlmatch_sestoft,
+   title = {ML pattern match compilation and partial evaluation},
+   year = {1992},
+   author = {Peter Sestoft}
+}
+
+@inproceedings{compiledstrongreduction,
+   title = {A Compiled Implementation of Strong Reduction},
+   year = {2002},
+   author = {Benjamin Gr\'{e}goire and Xavier Leroy},
+   booktitle = {Proc. 2002 International Conf. on Functional Programming (ICFP 2002)},
+   pages = {235--246}
+}
+
+@misc{tclhaskell,
+   howpublished = {http://www.dcs.gla.ac.uk/~meurig/TclHaskell/usermanual.html},
+   month = {August},
+   title = {TclHaskell - User Manual},
+   year = {1999},
+   author = {Meurig Sage}
+}
+
+
+@InProceedings{nbe-cat,
+  author =	 "Thorsten Altenkirch and Martin Hofmann and Thomas Streicher",
+  title =	 "Categorical reconstruction of a reduction free
+		  normalization proof",
+  year =	 "1995",
+  booktitle = 	 "Category Theory and Computer Science",
+  editor =	 {David Pitt and David E. Rydeheard and Peter Johnstone},
+  series =	 {LNCS},
+  volume = {953},
+  pages =	 {182-199}
+}
+
+@inproceedings{presburgerEFSM,
+   title = {A Comparison of Presburger Engines for EFSM Reachability},
+   year = {1998},
+   booktitle = {Computer Aided Verification '98},
+   pages = {280--292},
+   author = {Thomas R. Shiple and James H. Kukula and Rajeev K. Ranjan}
+}
+
+@misc{typesafecast,
+   title = {Type-Safe Cast},
+   year = {2000},
+   author = {Stephanie Weirich}
+}
+
+@phdthesis{grobauer-thesis,
+   school = {University of Aarhus},
+   title = {Topics in Semantics Based Program Manipulation},
+   year = {2001},
+   author = {Bernd Grobauer}
+}
+
+@misc{monads-moggi,
+   title = {Computational Lambda Calculus and Monads},
+   year = {1989},
+   author = {Eugenio Moggi}
+}
+
+@article{gmp-proof,
+   title = {A proof of {GMP} square root},
+   year = {2002},
+   journal = {Journal of Automated Reasoning},
+   volume = {29},
+   pages = {225--252},
+   author = {Yves Bertot and Nicolas Magaud and Paul Zimmerman}
+}
+
+@article{F-tal,
+   journal = {ACM Transactions on Programming Languages and Systems},
+   number = {3},
+   month = {May},
+   volume = {21},
+   title = {From {System F} to Typed Assembly Language},
+   year = {1999},
+   pages = {528--569},
+   author = {Greg Morrisett and David Walker and Karl Crary and Neal Glew}
+}
+
+@techreport{nbe-rtcg,
+   month = {December},
+   title = {Strong Normalization by Type-Directed Partial Evaluation and Run-Time Code Generation},
+   year = {1997},
+   institution = {BRICS},
+   author = {Vincent Balat and Oliver Danvy}
+}
+
+@misc{yong-schemata,
+   howpublished = {http://www.dur.ac.uk/yong.luo/},
+   title = {A Methodology for Implementing Inductive Schemata},
+   year = {2002},
+   author = {Yong Luo and Zhaohui Luo}
+}
+
+@inproceedings{harper93,
+   title = {Explicit Polymorphism and CPS Conversion},
+   year = {1993},
+   booktitle = {20th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages},
+   pages = {206--219},
+   publisher = {ACM Press, New York, NY, USA},
+   author = {Robert Harper and Mark Lillibridge}
+}
+
+@techreport{backends,
+   month = {November},
+   title = {Functional Back-Ends within the Lambda-Sigma Calculus},
+   year = {1996},
+   institution = {INRIA},
+   author = {Th\'{e}r\`{e}se Hardin and Luc Maranget and Bruno Pagano}
+}
+
+@article{stg,
+   title = {Implementing lazy functional languages on stock hardware -- the {Spineless Tagless G-machine}},
+   year = {1992},
+   journal = {Journal of Functional Programming},
+   volume = {2},
+   number = {2},
+   pages = {127--202},
+   month = {April},
+   author = {Simon {Peyton Jones}}
+}
+
+@article{debruijn,
+   journal = {Indagationes Mathematicae},
+   volume = {34},
+   title = {Lambda calculus notation with nameless dummies},
+   year = {1972},
+   pages = {381--392},
+   author = {N.G. de Bruijn}
+}
+
+@book{assembly,
+   month = {January},
+   title = {PC Assembly Language},
+   year = {2002},
+   publisher = {http://www.drpaulcarter.com/},
+   author = {Paul A. Carter}
+}
+
+@inproceedings{poly99,
+   title = {Once Upon A Polymorphic Type},
+   year = {1999},
+   booktitle = {26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages},
+   publisher = {ACM},
+   author = {Keith Wansbrough and Simon {Peyton Jones}}
+}
+
+@misc{lazy_intro,
+   title = {Compiling Lazy Functional Languages: An introduction},
+   year = {1986},
+   author = {Thomas Johnsson}
+}
+
+@inproceedings{unboxed-fp,
+   month = {Sept},
+   title = {Unboxed Values as First Class Citizens in a Non-Strict Functional Language},
+   year = {1991},
+   author = {Simon {Peyton Jones} and John Launchbury},
+   booktitle = {Functional Programming Languages and Computer Architecture (FPCA'91)},
+   crossref = {fplca91},
+   pages = {636--666}
+}
+
+@inproceedings{abc-machine,
+ author = {Sjaak Smetsers and Eric N{\"{o}}cker and John {van Groningen} and Rinus Plasmeijer},
+ title = {Generating efficient code for lazy functional languages},
+ booktitle = {Functional programming Languages and Computer Architecture},
+ year = {1991},
+ pages = {592--617},
+ crossref = {fplca91}
+}
+
+@proceedings{fplca91,
+   title = {Functional programming Languages and Computer Architecture},
+   year = {1991},
+   volume = {523},
+   series = {LNCS},
+   publisher = {Springer-Verlag},
+   editor = {John Hughes}
+}
+
+
+
+@inproceedings{nbe,
+   title = {An inverse of the evaluation functional for typed $\lambda$-calculus},
+   year = {1991},
+   booktitle = {Proc. 1991 IEEE Symp. on Logic in Comp. Sci.},
+   pages = {203--211},
+   editor = {R. Vemuri},
+   author = {Ulrich Berger and Helmut Schwichtenberg}
+}
+
+@inproceedings{typed-closure,
+   title = {Typed Closure Conversion},
+   year = {1996},
+   booktitle = {Symposium on Principles of Programming Languages},
+   pages = {271--283},
+   author = {Yasuhiko Minamide and J. Gregory Morrisett and Robert Harper}
+}
+
+@misc{ghc-commentary,
+   howpublished = {http://www.cse.unsw.edu.au/~chak/haskell/ghc/comm/},
+   title = {The Glasgow Haskell Compiler (GHC) Commentary},
+   year = {2002},
+   author = {Manuel M. T. Chakravarty and Sigbjorn Finne and Simon Marlow and Simon {Peyton Jones} and Julian Seward and Reuben Thomas},
+   note = {Available from GHC CVS repository}
+}
+
+@inproceedings{lambdalift,
+   month = {September},
+   title = {Lambda Lifting: Transforming Programs to Recursive Equations},
+   year = {1985},
+   booktitle = {Functional Programming Languages and Computer Architecture},
+   pages = {190--203},
+   editor = {Jean-Pierre Jouannaud},
+   publisher = {Springer-Verlag},
+   author = {Thomas Johnsson}
+}
+
+@inproceedings{til,
+   title = {TIL: A Type-Directed Optimizing Compiler for ML},
+   year = {1996},
+   booktitle = {Proc. {ACM} {SIGPLAN} '96 Conference on Programming Language Design and Implementation},
+   pages = {181--192},
+   author = {D. Tarditi and G. Morrisett and P. Cheng and C. Stone and R. Harper and P. Lee}
+}
+
+@phdthesis{shao94,
+   school = {Princeton University},
+   title = {Compiling Standard {ML} for Efficient Execution on Modern Machines},
+   year = {1994},
+   author = {Zhong Shao}
+}
+
+@inproceedings{gmachine,
+   month = {September},
+   title = {The {G-Machine}: A fast, graph-reduction evaluator},
+   year = {1985},
+   booktitle = {Functional Programming Languages and Computer Architecture},
+   pages = {400--413},
+   editor = {Jean-Pierre Jouannaud},
+   publisher = {Springer-Verlag},
+   author = {R.B. Kieburtz}
+}
+
+@inproceedings{strictness,
+   month = {September},
+   title = {Strictness Analysis - A practical approach},
+   year = {1985},
+   booktitle = {Functional Programming Languages and Computer Hardware},
+   pages = {35--49},
+   editor = {Jean-Pierre Jouannaud},
+   publisher = {Springer-Verlag},
+   author = {Chris Clack and Simon {Peyton Jones}}
+}
+
+@book{fl-impl,
+   title = {Implementing Functional Languages - A Tutorial},
+   year = {1992},
+   publisher = {Prentice Hall International},
+   author = {Simon {Peyton Jones} and David Lester}
+}
+
+@phdthesis{capretta-thesis,
+   school = {Katholieke Universiteit Nijmegen},
+   title = {Abstraction and Computation},
+   year = {2002},
+   author = {Venanzio Capretta}
+}
+
+@article{bird-pointer,
+   journal = {Journal of Functional Programming},
+   number = {3},
+   month = {May},
+   volume = {11},
+   title = {Unfolding Pointer Algorithms},
+   year = {2001},
+   pages = {347--358},
+   author = {Richard S. Bird}
+}
+
+@article{impl-tp,
+   journal = {Journal of Functional Programming},
+   number = {2},
+   month = {March},
+   volume = {9},
+   title = {Implementing Theorem Provers in a Purely Functional Style},
+   year = {1999},
+   pages = {147--166},
+   author = {Keith Hanna}
+}
+
+@article{shrink-lambda,
+   journal = {Journal of Functional Programming},
+   number = {5},
+   month = {September},
+   volume = {7},
+   title = {Shrinking Lambda Expressions in Linear Time},
+   year = {1997},
+   pages = {515--540},
+   author = {Andrew W. Appel and Trevor Jim}
+}
+
+@article{stack-tal,
+   journal = {Journal of Functional Programming},
+   number = {1},
+   month = {January},
+   volume = {12},
+   title = {Stack-based Typed Assembly Language},
+   year = {2002},
+   pages = {43--88},
+   author = {Greg Morrisset and Karl Crart and Neal Glew and David Walker}
+}
+
+@article{runtime-lamsig,
+   journal = {Journal of Functional Programming},
+   number = {2},
+   month = {March},
+   volume = {8},
+   title = {Functional Runtime Systems within the lambda-sigma Calculus},
+   year = {1998},
+   pages = {131--176},
+   author = {Th\'{e}r\`{e}se Hardin and Luc Maranget and Bruno Pagano}
+}
+
+@article{busylazy,
+   journal = {Journal of Functional Programming},
+   number = {6},
+   month = {November},
+   volume = {11},
+   title = {How to look busy while being as lazy as ever: the Implementation of a lazy functional debugger},
+   year = {2001},
+   pages = {629--671},
+   author = {Henrik Nilsson}
+}
+
+@article{lazyveager,
+   journal = {Journal of Functional Programming},
+   number = {5},
+   month = {September},
+   volume = {7},
+   title = {More haste, less speed: lazy versus eager evaluation},
+   year = {1997},
+   pages = {541--547},
+   author = {Richard Bird and Geraint Jones and Oege {de Moor}}
+}
+
+@article{jvm-fp,
+   journal = {Journal of Functional Programming},
+   number = {6},
+   month = {November},
+   volume = {9},
+   title = {Compiling lazy functional programs for the Java Virtual Machine},
+   year = {1999},
+   pages = {579--603},
+   author = {David Wakeling}
+}
+
+@book{isabelle,
+   publisher = {Springer-Verlag},
+   series = {LNCS},
+   volume = {2283},
+   month = {March},
+   title = {Isabelle/HOL - A proof assistant for higher order logic},
+   year = {2002},
+   author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}
+}
+
+@article{ghc-inliner,
+   journal = {Journal of Functional Programming},
+   number = {4},
+   month = {September},
+   volume = {12},
+   title = {Secrets of the {Glasgow Haskell Compiler} inliner},
+   year = {2002},
+   pages = {393--434},
+   author = {Simon {Peyton Jones} and Simon Marlow}
+}
+
+@article{dynamic-fp,
+   journal = {Journal of Functional Programming},
+   number = {1},
+   month = {January},
+   volume = {8},
+   title = {The dynamic compiliation of lazy functional programs},
+   year = {1998},
+   pages = {61--81},
+   author = {David Wakeling}
+}
+
+@misc{isabelle-ref,
+   month = {March},
+   title = {Isabelle Reference Manual},
+   year = {2002},
+   author = {Lawrence C. Paulson}
+}
+
+@article{debruijn-nested,
+   journal = {Journal of Functional Programming},
+   number = {1},
+   month = {January},
+   volume = {9},
+   title = {de Bruijn notation as a nested datatype},
+   year = {1999},
+   pages = {77--91},
+   author = {Richard S. Bird and Ross Paterson}
+}
+
+@article{perfect-trees,
+   journal = {Journal of Functional Programming},
+   number = {3},
+   month = {May},
+   volume = {10},
+   title = {Perfect trees and bit-reversal permutations},
+   year = {2000},
+   pages = {305--317},
+   author = {Ralf Hinze}
+}
+
+@phdthesis{paulin-extraction,
+   school = {Paris 7},
+   title = {Extraction de programmes dans le Calcul des Constructions},
+   year = {1989},
+   author = {Christine Paulin-Mohring}
+}
+
+@phdthesis{santos95,
+   school = {University of Glasgow},
+   title = {Compilation By Transformation In Non-Strict Functional Languages},
+   year = {1995},
+   author = {{Andr\'{e} Lu\'{i}s de Medeiros} Santos}
+}
+
+@book{cps,
+   title = {Compiling With Continuations},
+   year = {1992},
+   publisher = {Cambridge University Press},
+   author = {Andrew W. Appel}
+}
+
+@techreport{SKIM,
+   number = {31},
+   title = {The {SKIM} microprogrammer's guide},
+   year = {1983},
+   institution = {University of Cambridge},
+   author = {W.R. Stoye}
+}
+
+@misc{NORMA,
+   title = {An Overview of Burroughs {NORMA}},
+   year = {1985},
+   author = {H. Richards}
+}
+
+@book{ml,
+   title = {The Definition of Standard ML --- Revised},
+   year = {1997},
+   publisher = {MIT Press},
+   author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}
+}
+
+@misc{ml71,
+   title = {An intuitionistic theory of types},
+   year = {1971},
+   author = {Per Martin-L\"{o}f}
+}
+
+@phdthesis{girard-thesis,
+   school = {Universit\'{e} Paris VII},
+   title = {Interpr\'{e}tation fonctionelle et \'{e}limination des coupures de l'arithm\'{e}tique d'ordre sup\'{e}rieur},
+   year = {1972},
+   author = {Jean-Yves Girard}
+}
+
+@inproceedings{ml75,
+   title = {An intuitionistic theory of types: predicative part},
+   year = {1975},
+   booktitle = {Logic Colloquium '73},
+   editor = {H. Rose and J.C. Shepherdson},
+   publisher = {North-Holland},
+   author = {Per Martin-L\"{o}f}
+}
+
+@inproceedings{cpm90,
+   title = {Inductively defined types},
+   year = {1990},
+   author = {Thierry Coquand and Christine Paulin-Mohring},
+   series = {LNCS},
+   volume = {417},
+   publusher = {Springer-Verlag}
+}
+
+@phdthesis{fpcustom,
+   month = {May},
+   school = {Computer Lab, University of Cambridge},
+   title = {The Implementation of Functional Languages using Custom Hardware},
+   year = {1985},
+   author = {W.R. Stoye}
+}
+
+@phdthesis{hughesthesis,
+   month = {September},
+   school = {Programming Research Group, Oxford},
+   title = {The design and implementation of programming languages},
+   year = {1984},
+   author = {John Hughes}
+}
+
+@inproceedings{tim,
+   volume = {274},
+   title = {{TIM} -- A simple lazy abstract machine to execute supercombinators},
+   year = {1987},
+   booktitle = {Functional Programming Languages and Computer Architecture},
+   publisher = {Springer-Verlag},
+   author = {John Fairbairn and Stuart Wray},
+   pages = {34--45},
+   series = {LNCS}
+}
+
+@techreport{abc,
+   title = {The {ABC} machine -- A Sequential Stack-based Abstract Machine For Graph Rewriting},
+   year = {1990},
+   institution = {University of Nijmegen},
+   author = {P.W.M.  Koopman and M.C.J.D. van {Eekelen} and E.G.J.M.H. Ncker and J.E.W. Smetsers and M.J. Plasmeijer}
+}
+
+@techreport{implicit,
+   title = {On Implicit Arguments},
+   year = {1994},
+   institution = {Faculty of Science, University of Tokyo},
+   author = {Masami Hagiya and Yozo Toda}
+}
+
+@book{semantics,
+   title = {Denotational Semantics},
+   year = {1986},
+   publisher = {Wm. C. Brown},
+   author = {David A. Schmidt}
+}
+
+@inproceedings{lazyml,
+   month = {August},
+   title = {A compiler for {Lazy} {ML}},
+   year = {1984},
+   booktitle = {Proceedings of the {ACM} Symposium on Lisp and Functional Programming},
+   pages = {218--227},
+   author = {Lennart Augustsson}
+}
+
+@inproceedings{nu-g,
+   title = {Parallel graph reduction with the $\langle\nu,G\rangle$-machine},
+   year = {1989},
+   booktitle = {Functional Programming Languages and Computer Architecture},
+   publisher = {ACM Press},
+   author = {Lennart Augustsson and Thomas Johnsson}
+}
+
+@book{k&r,
+   title = {The C programming language},
+   year = {1988},
+   publisher = {Prentice-Hall},
+   author = {Brian W. Kernighan and Dennis M. Ritchie}
+}
+
+@misc{c--garbage,
+   title = {C--: a portable assembly language that supports garbage collection},
+   year = {1999},
+   author = {Simon {Peyton Jones} and Norman Ramsey and Fermin Reig},
+   note = {Invited talk at PPDP'99}
+}
+
+@misc{epigram,
+   howpublished = {http://www.dur.ac.uk/CARG/epigram.html},
+   title = {Project Proposal: {Epigram}: Innovative Programming via Inductive Families},
+   year = {2002},
+   author = {Zhaohui Luo and James McKinna and Paul Callaghan and Conor McBride}
+}
+
+@misc{ghc-rewrite,
+   title = {Playing by the Rules: Rewriting as a practical optimisation technique in {GHC}},
+   year = {2001},
+   author = {Simon {Peyton Jones} and Andrew Tolmach and Tony Hoare}
+}
+
+@UNPUBLISHED{implicit-pollack,
+  AUTHOR = {Robert Pollack},
+  TITLE = {Implicit Syntax},
+  NOTE = {Informal Proceedings of First Workshop on 
+                 Logical Frameworks, Antibes},
+  YEAR = {1990},
+  MONTH = MAY
+}
+
+
+@article{transform-haskell,
+   journal = {Science of Computer Programming},
+   volume = {32},
+   title = {A transformation-based optimiser for {Haskell}},
+   year = {1998},
+   pages = {3--47},
+   author = {Simon {Peyton Jones} and Andr\'{e} L. M. Santos}
+}
+
+@inproceedings{knuth-bendix,
+   title = {Simple Word Problems in Universal Algebras},
+   year = {1970},
+   booktitle = {Computational Problems in Abstract Algebra},
+   pages = {263--298},
+   editor = {John Leech},
+   publisher = {Pergamon Press},
+   author = {Donald E. Knuth and Peter B. Bendix}
+}
+
+@inproceedings{phantomfun,
+   title = {Fun With Phantom Types},
+   author = {Ralf Hinze},
+   pages = {245--262},
+   year = {2003},
+   crossref = {funprogramming},
+   booktitle = {The Fun Of Programming},
+   publisher = {Palgrave}
+}
+
+@book{funprogramming,
+   month = {March},
+   title = {The Fun Of Programming},
+   year = {2003},
+   editor = {Jeremy Gibbons and Oege {de Moor}},
+   publisher = {Palgrave},
+   series = {Cornerstones of Computing}
+}
+
+@inproceedings{anderson-proof,
+   title = {Representing Proof Transformations For Program Optimization},
+   year = {1994},
+   booktitle = {International Conference On Automated Deduction},
+   publisher = {Springer Verlag},
+   author = {Penny Anderson}
+}
+
+@phdthesis{daria-thesis,
+   month = {April},
+   school = {Institute of Informatics, Warsaw University},
+   title = {Termination of Rewriting in the Calculus of Constructions},
+   year = {2003},
+   author = {Daria Walukiewicz-Chrzaszcz}
+}
+
+@inproceedings{change-data,
+   title = {Changing Data Structures In Type Theory: A Study Of Natural Numbers},
+   year = {2001},
+   booktitle = {Types For Proofs And Programs 2000},
+   pages = {181--196},
+   editor = {Paul Callaghan and Zhaohui Luo and James McKinna and Robert Pollack},
+   publisher = {Springer},
+   author = {Nicolas Magaud and Yves Bertot}
+}
+
+@phdthesis{nico-thesis,
+   title = {Changement de Representation des donn\'{e}es dans le Calcul de Constructions},
+   author = {Nicolas Magaud},
+   year = {2003},
+   month = {October},
+   school = {Universit\'{e} de Nice - Sophia Antipolis}
+}
+   
+
+@book{patterns,
+   title = {Design Patterns},
+   year = {1995},
+   publisher = {Addison Wesley},
+   author = {Erich Gamma and Richard Helm and Ralph Johnson and John Vlissides}
+}
+
+@misc{ghchugs,
+   month = {August},
+   title = {The New {GHC}/{Hugs} Runtime System},
+   year = {1998},
+   author = {Simon Marlow and Simon {Peyton Jones}}
+}
+
+@misc{stgrevised,
+   month = {February},
+   title = {The {STG} runtime system (revised)},
+   year = {1999},
+   author = {Simon {Peyton Jones} and Simon Marlow and Alastair Reid},
+   howpublished = {Available from \verb+http://www.haskell.org/ghc/documentation.html+}
+}
+
+@inproceedings{optimistic,
+   month = {March},
+   title = {Optimistic Evaluation --- an adaptive evaluation strategy for non-strict programs},
+   year = {2003},
+   author = {Robert Ennals and Simon {Peyton Jones}},
+   booktitle = {International Conference on Functional Programming},
+   pages = {287--298}
+}
+
+@phdthesis{ennals-thesis,
+   title = {Adaptive Evaluation of Non-Strict Programs},
+   author = {Robert Ennals},
+   year = {2003},
+   month = {December},
+   school = {King's College, University of Cambridge}
+}
+
+@article{garbage,
+   journal = {ACM Computing Surveys},
+   number = {3},
+   volume = {13},
+   title = {Garbage Collection of Linked Data Structures},
+   year = {1981},
+   pages = {341--367},
+   author = {Jacques Cohen}
+}
+
+@article{baker-gc,
+   journal = {Communications of the ACM},
+   number = {4},
+   month = {April},
+   volume = {21},
+   title = {List Processing In Real Time On A Serial Computer},
+   year = {1978},
+   pages = {280--294},
+   author = {Henry G. {Baker Jr}}
+}
+
+@misc{bc-rec,
+   month = {February},
+   title = {Modelling General Recursion in Type Theory},
+   year = {2003},
+   note = {Under consideration for publication in Math. Struct. in Comp. Science. Draft, DCS, CTH --- INRIA, Sophia Antipolis, France},
+   author = {Ana Bove and Venanzio Capretta}
+}
+
+@misc{global-tag,
+   title = {Global Tagging Optimization by Type Inference},
+   year = {1992},
+   author = {Fritz Henglein}
+}
+
+@book{esr,
+   month = {October},
+   title = {The Cathedral And The Bazaar},
+   year = {1999},
+   publisher = {O'Reilly},
+   author = {Eric Raymond}
+}
+
+@book{manmonth,
+   title = {The Mythical Man-month: Essays on Software Engineering},
+   year = {1975},
+   publisher = {Addison Wesley},
+   author = {Frederick P. Brooks}
+}
+
+@inproceedings{evalpush,
+   title = {How to make a fast curry: push/enter vs eval/apply},
+   year = {2004},
+   author = {Simon Marlow and Simon {Peyton Jones}},
+   booktitle = {International Conference on Functional Programming, Snowbird},
+   pages = {4--15}
+}
+
+@phdthesis{boquist-thesis,
+   month = {April},
+   school = {Chalmers University of Technology},
+   title = {Code Optimisation Techniques for Lazy Functional Languages},
+   year = {1999},
+   author = {Urban Boquist}
+}
+
+@book{formal-spec,
+   title = {Formal Specification Of Programming Languages},
+   year = {1981},
+   publisher = {Prentice-Hall},
+   author = {Frank G. Pagan}
+}
+
+@inproceedings{elim-motive,
+   title = {Elimination With A Motive},
+   year = {2000},
+   booktitle = {Types for Proofs and Programs},
+   pages = {197--216},
+   editor = {Paul Callaghan and Zhaohui Luo and James McKinna and Robert Pollack},
+   publisher = {Springer},
+   author = {Conor McBride}
+}
+
+@article{telescope,
+   journal = {Information and Computation},
+   number = {2},
+   month = {April},
+   volume = {91},
+   title = {Telescoping Mappings in Typed Lambda Calculus},
+   year = {1991},
+   pages = {189--204},
+   author = {N.G. de Bruijn}
+}
+
+@misc{typeintype,
+   title = {Typechecking is undecidable when 'type' is a type},
+   year = {1989},
+   author = {Mark B. Reinhold}
+}
+
+@misc{core,
+   month = {September},
+   title = {An External Representation for the {GHC} Core Language},
+   year = {2001},
+   author = {Andrew Tolmach and {The GHC Team}}
+}
+
+@article{deforestation,
+   journal = {Theoretical Computer Science},
+   volume = {73},
+   title = {Deforestation: Transforming programs to eliminate trees},
+   year = {1990},
+   pages = {231--248},
+   author = {Philip Wadler}
+}
+
+@misc{hep,
+   month = {July},
+   title = {Architecture of the {Haskell} Execution Platform},
+   year = {1999},
+   author = {Julian Seward and Simon Marlow and Andy Gill and Sigbjorn Finne and Simon {Peyton Jones} },
+   note = {Version 6},
+   howpublished = {Available from \verb+http://www.haskell.org/ghc/documentation.html+}
+}
+
+@mastersthesis{wahlstedt-thesis,
+   month = {October},
+   school = {Chalmers University Of Technology},
+   title = {Detecting Termination Using Size Change In Parameter Values},
+   year = {2000},
+   author = {David Wahlstedt}
+}
+
+@inproceedings{size-change,
+   title = {The size-change principle for program termination},
+   year = {2001},
+   booktitle = {Proceedings of the 28th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages},
+   author = {Chin Soon Lee and Neil D. Jones and Amir Ben-Amram. }
+}
+
+@article{ski-turner,
+   journal = {Software -- Practice and Experience},
+   volume = {9},
+   title = {A new implementation technique for applicative languages},
+   year = {1979},
+   pages = {31--49},
+   author = {David Turner}
+}
+
+@inproceedings{turner-strong,
+   number = {1022},
+   title = {Elementary Strong Functional Programming},
+   year = {1996},
+   booktitle = {First International Symposium on Functional Programming Languages in Education, Nijmegen, Netherlands, December 1995.},
+   pages = {1--13},
+   publisher = {Springer},
+   author = {David Turner},
+   series = {LNCS}
+}
+
+@misc{clean,
+   title = {The {Concurrent CLEAN} Language Report (draft)},
+   year = {2003},
+   author = {Rinus Plasmeijer and Marko van Eekelen},
+   howpublished = {Available from \verb+http://www.cs.kun.nl/~clean/+}
+}
+
+@article{burstall-struct,
+   journal = {Computer Journal},
+   number = {1},
+   volume = {12},
+   title = {Proving Properties of Programs By Structural Induction},
+   year = {1969},
+   pages = {41--48},
+   author = {Rod Burstall}
+}
+
+@incollection{ barendregt-types,
+    author = "Henk Barendregt",
+    title = "Lambda Calculi with Types",
+    booktitle = "Handbook of Logic in Computer Science, Volumes 1 (Background: Mathematical Structures) and 2 (Background: Computational Structures), Abramsky \& Gabbay \& Maibaum (Eds.)",
+    publisher = "Clarendon",
+    volume = "2",
+    year = "1992",
+    url = "citeseer.nj.nec.com/barendregt92lambda.html" }
+
+@book{curry-feys,
+   title = {Combinatory Logic, volume 1},
+   year = {1958},
+   publisher = {North Holland},
+   author = {Haskell B. Curry and Robert Feys}
+}
+
+@phdthesis{bove-thesis,
+   month = {November},
+   school = {Chalmers University of Technology},
+   title = {General Recursion in Type Theory},
+   year = {2002},
+   author = {Ana Bove}
+}
+
+@inbook{ml-cm,
+   title = {Constructive Mathematics and Computer Programming},
+   year = {1985},
+   booktitle = {Mathematical Logic and Programming Languages},
+   publisher = {Prentice Hall},
+   author = {Per Martin-L\"{o}f}
+}
+
+@inproceedings{howard,
+   title = {The formulae-as-types notion of construction},
+   year = {1980},
+   booktitle = {To H.B.Curry: Essays on combinatory logic, lambda calculus and formalism},
+   editor = {Jonathan P. Seldin and J. Roger Hindley},
+   publisher = {Academic Press},
+   author = {William A. Howard},
+   note = {A reprint of an unpublished manuscript from 1969}
+}
+
+@inproceedings{talx86,
+   title = {TALx86: A Realistic Typed Assembly Language},
+   year = {1999},
+   booktitle = {ACM SIGPLAN Workshop on Compiler Support for System Software},
+   pages = {25--35},
+   author = {Greg Morrisett and Karl Crary and Neal Glew and Dan Grossman and Richard Samuels and Frederick Smith and David Walker and Stephanie Weirich and Steve Zdancewic}
+}
+
+@inproceedings{bove-capretta,
+   volume = {2152},
+   title = {Nested General Recursion and Partiality in Type Theory},
+   year = {2001},
+   booktitle = {Theorem Proving in Higher Order Logics, 14th International Conference, TPHOLS 2001},
+   pages = {121--135},
+   editor = {Richard J. Boulton and Paul B. Jackson},
+   publisher = {Springer-Verlag},
+   author = {Ana Bove and Venanzio Capretta},
+   series = {LNCS}
+}
+
+@misc{lvm,
+   month = {November},
+   title = {LVM, the lazy virtual machine},
+   year = {2002},
+   author = {Daan Leijen}
+}
+
+@misc{ocaml,
+   howpublished = {\verb+http://caml.inria.fr/ocaml/htmlman/+},
+   month = {August},
+   title = {The {Objective Caml} system release 3.06},
+   year = {2002},
+   author = {Xavier Leroy}
+}
+
+@misc{lambdagoto,
+   title = {Lambda : The Ultimate Goto},
+   year = {1977},
+   author = {Guy L. {Steele Jr}},
+   note = {MIT AI Memo 443}
+}
+
+@inproceedings{ liu-tail,
+    author = "Yanhong A. Liu and Scott D. Stoller",
+    title = "From Recursion to Iteration: What are the Optimizations?",
+    booktitle = "Partial Evaluation and Semantic-Based Program Manipulation",
+    pages = "73-82",
+    year = "2000",
+    url = "citeseer.nj.nec.com/liu00from.html" }
+
+@inproceedings{aczel77,
+   title = {An Introduction To Inductive Definitions},
+   year = {1977},
+   booktitle = {Handbook of Mathematical Logic},
+   editor = {J. Barwise},
+   publisher = {North Holland},
+   author = {Peter Aczel}
+}
+
+@inproceedings{inductive-plastic,
+   volume = {1956},
+   title = {Implementation Techniques for Inductive Types in {Plastic}},
+   year = {1999},
+   booktitle = {Types for Proofs and Programs},
+   pages = {94--113},
+   editor = {Thierry Coquand and Peter Dybjer and Bengt Nordstr\"{o}m and Jan Smith},
+   publisher = {Springer-Verlag},
+   author = {Paul Callaghan and Zhaohui Luo},
+   series = {LNCS}
+}
+
+@misc{graham,
+   howpublished = {Available from \verb+http://www.paulgraham.com/+},
+   month = {April},
+   title = {The Hundred Year Language},
+   year = {2003},
+   author = {Paul Graham},
+   note = {Keynote address at PyCon 2003}
+}
+
+@inproceedings{gimenez98,
+   volume = {1443},
+   title = {Structural Recursive Definitions in Type Theory},
+   year = {1998},
+   booktitle = {Proceedings of ICALP '98},
+   publisher = {Springer-Verlag},
+   author = {Eduardo Gim\'{e}nez},
+   series = {LNCS}
+}
+
+@article{quicksort,
+   journal = {Computer Journal},
+   number = {1},
+   volume = {5},
+   title = {Quicksort},
+   year = {1962},
+   pages = {10--15},
+   author = {C.A.R. Hoare}
+}
+
+@phdthesis{goguen-thesis,
+   school = {University of Edinburgh},
+   title = {A Typed Operational Semantics for Type Theory},
+   year = {1994},
+   author = {Healfdene Goguen}
+}
+
+@article{ph-universes,
+   journal = {Theoretical Computer Science},
+   number = {1},
+   volume = {89},
+   title = {Type Checking With Universes},
+   year = {1991},
+   pages = {107--136},
+   author = {Robert Harper and Randy Pollack}
+}
+
+@inproceedings{pm-compile,
+   month = {September},
+   title = {Compiling Pattern Matching},
+   year = {1985},
+   booktitle = {Functional Programming Languages and Computer Architecture},
+   pages = {368--381},
+   editor = {Jean-Pierre Jouannaud},
+   publisher = {Springer-Verlag},
+   author = {Lennart Augustsson}
+}
+
+@phdthesis{lena-thesis,
+   school = {Chalmers University of Technology, G\"{o}teborg},
+   title = {The implementation of {ALF} -- A Proof Editor based on {Martin-L\"{o}f}'s Monomorphic Type Theory with Explicit Substitutions},
+   year = {1994},
+   author = {Lena Magnusson}
+}
+
+@article{view-left,
+   journal = {Journal of Functional Programming},
+   number = {1},
+   volume = {14},
+   title = {The View From The Left},
+   year = {2004},
+   author = {Conor McBride and James McKinna},
+   pages = {69--111}
+}
+
+@inproceedings{not-a-number,
+  author = {Conor McBride and James McKinna},
+  title = {I am not a number, {I} am a free variable},
+  year = {2004},
+  booktitle = {Proceedings of the ACM SIGPLAN Haskell Workshop}
+}
+
+
+@misc{profiling,
+   title = {Time and Space Profiling for Non-Strict, Higher Order  Functional Languages},
+   year = {1995},
+   author = {Patrick M. Sansom and Simon {Peyton Jones}}
+}
+
+@inbook{pattern-matching,
+   title = {The Implementation of Functional Programming Languages},
+   year = {1987},
+   booktitle = {The Implementation of Functional Programming Languages},
+   pages = {78--103},
+   editor = {Simon {Peyton Jones}},
+   chapter = {5},
+   publisher = {Prentice Hall},
+   author = {Philip Wadler},
+   crossref = {pj-imp}
+}
+
+@misc{tag-elim,
+   title = {Tag Elimination -- or -- Type Specialisation is a Type Indexed Effect},
+   year = {2000},
+   author = {Walid Taha and Henning Makholm}
+}
+
+@inproceedings{extraction-coq,
+   title = {A New Extraction for {Coq}},
+   year = {2002},
+   booktitle = {Types for proofs and programs},
+   editor = {Herman Geuvers and Freek Wiedijk},
+   publisher = {Springer},
+   author = {Pierre Letouzey},
+   series = {LNCS}
+}
+
+@phdthesis{mcbride-snr-thesis,
+   school = {Queen's University of Belfast},
+   title = {Computer Aided Manipulation of Symbols},
+   year = {1970},
+   author = {Fred McBride}
+}
+
+@article{ho-strictness,
+   journal = {Science of Computer Programming},
+   volume = {7},
+   title = {Strictness analysis for higher-order functions},
+   year = {1986},
+   pages = {249--278},
+   author = { Geoffrey L. Burn and Chris Hankin and Samson Abramsky}
+}
+
+@phdthesis{mycroft-thesis,
+   school = {Dept Computer Science, University of Edinburgh},
+   title = {Abstract interpretation and optimising transformations for applicative programs},
+   year = {1981},
+   author = {A. Mycroft}
+}
+
+@inproceedings{bc-nested,
+   month = {September},
+   volume = {2152},
+   title = {Nested General Recursion and Partiality in Type Theory},
+   year = {2001},
+   booktitle = {Theorem Proving In Higher Order Logics: 14th International Conferences, TPHOLS 2001},
+   pages = {121--135},
+   publisher = {Springer--Verlag},
+   author = {Ana Bove and Venanzio Capretta},
+   series = {LNCS}
+}
+
+@techreport{bove-mutual,
+   month = {May},
+   title = {Mutual General Recursion in Type Theory},
+   year = {2002},
+   institution = {Department of Computing Science, Chalmers University of Technology},
+   author = {Ana Bove}
+}
+
+@article{berardi-pruning,
+   journal = {Journal of Logic and Computation},
+   number = {5},
+   volume = {6},
+   title = {Pruning Simply Typed Lambda Terms},
+   year = {1996},
+   pages = {663--681},
+   author = {Stefano Berardi}
+}
+
+@article{milner-tc,
+   journal = {Journal of Computer and System Science},
+   volume = {17},
+   title = {A Theory of Type Polymorphism in Programming},
+   year = {1978},
+   pages = {348--75},
+   author = {R. Milner}
+}
+
+@inproceedings{extt,
+   title = {Inductive Families Need Not Store Their Indices},
+   year = {2004},
+   booktitle = {Types for Proofs and Programs 2003},
+   author = {Edwin Brady and Conor McBride and James McKinna},
+   editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
+   publisher = {Springer},
+   volume = {3085},
+   pages = {115--129}
+}
+
+@book{luo94,
+   title = {Computation and Reasoning -- A Type Theory for Computer Science},
+   year = {1994},
+   publisher = {OUP},
+   author = {Zhaohui Luo},
+   series = {Intl. Series of Monographs on Comp. Sci.}
+}
+
+@article{backus78,
+   journal = {Communications of the ACM},
+   month = {August},
+   volume = {21},
+   title = {Can Programming Be Liberated From the {Von Neumann} Style?},
+   year = {1978},
+   pages = {280--294},
+   author = {John Backus}
+}
+
+@misc{henk,
+   month = {May},
+   title = {Henk: A Typed Intermediate Language},
+   year = {1997},
+   author = {Simon {Peyton Jones} and Erik Meijer}
+}
+
+@article{thunks,
+   journal = {Journal of Functional Programming},
+   number = {3},
+   month = {May},
+   volume = {7},
+   title = {Thunks and the $\lambda$-calculus},
+   year = {1997},
+   pages = {303--319},
+   author = {John Hatcliff and Olivier Danvy}
+}
+
+@inproceedings{grin-project,
+    author = "Urban Boquist and Thomas Johnsson",
+    title = "The {GRIN} Project: A Highly Optimising Back End for Lazy Functional Languages",
+    booktitle = "Implementation of Functional Languages",
+    pages = "58--84",
+    year = "1996",
+    url = "citeseer.ist.psu.edu/boquist96grin.html" }
+
+@misc{boehm-gc,
+   howpublished = {\verb+http://www.hpl.hp.com/personal/Hans_Boehm/gc/+},
+   title = {A garbage collector for {C} and {C++}},
+   year = {2001},
+   author = {Hans-J. Boehm and Alan J. Demers and {Xerox Corporation Silicon Graphic} and {Hewlett-Packard Company}}
+}
+
+@misc{art-interpreter,
+   month = {May},
+   title = {The Art of the Interpreter or, the Modularity Complex (Parts Zero, One, and Two)},
+   year = {1978},
+   author = {Guy Lewis {Steele, Jr.} and Gerald Jay Sussman},
+   note = {MIT AI Lab. AI Lab Memo AIM-453}
+}
+
+@inproceedings{gimenez,
+   title = {Codifying Guarded Definitions With Recursive Schemes},
+   year = {1994},
+   booktitle = {Proceedings of TYPES 1994},
+   pages = {39--59},
+   author = {Eduardo Gim\'{e}nez}
+}
+
+@manual{ghc-manual,
+   title = {The Glasgow Haskell Compiler User's Guide, Version 6.0},
+   year = {2003},
+   author = {The {GHC Team}}
+}
+
+@article{rbtree,
+   journal = {Journal of Functional Programming},
+   number = {4},
+   month = {May},
+   volume = {9},
+   title = {Red-Black Trees In A Functional Setting},
+   year = {1999},
+   pages = {471--477},
+   author = {Chris Okasaki}
+}
+
+@inproceedings{dt-data,
+author = "Hongwei Xi",
+title = {{Dependently Typed Data Structures}},
+booktitle = "Proceedings of Workshop of Algorithmic Aspects of Advanced Programming Languages (WAAAPL '99)",
+year = 1999,
+month = "September",
+pages = "17--32",
+address = "Paris",
+}
+
+@misc{krivine,
+   title = {On the Correctness and Efficiency of the {Krivine} Machine},
+   year = {2003},
+   month = {October},
+   author = {Mitchell Wand and Daniel P. Friedman},
+   howpublished = {Submitted for publication}
+   }
+
+@inproceedings{nbe-filinski,
+   title = {Normalization by Evaluation for the Computational Lambda-Calculus},
+   year = {2001},
+   month = {May},
+   booktitle = {Typed Lambda Calculi and Applications: 5th International Conference, TLCA 2001},
+   author = {Andrzej Filinski},
+   pages = {151--165},
+   publisher = {Springer-Verlag},
+   series = {LNCS},
+   volume = {2044}
+}
+
+@inproceedings{filinski-nbesem,
+   title = {A semantic account of type-directed partial evaluation},
+   year = {1999},
+   author = {Andrzej Filinski},
+   editor = {G. Nadathur},
+   booktitle = {International Conference on Principles and Practice of Declarative Programming},
+   volume = {1702},
+   series = {LNCS},
+   pages = {378--395},
+   publisher = {Springer-Verlag}
+}
+
+@article{secd,
+   title = {The mechanical evaluation of expressions},
+   author = {P.J. Landin},
+   year = {1964},
+   journal = {Computer Journal},
+   volume = {6},
+   pages = {308--320}
+}
+
+@misc{lispkit,
+   title = {The {LispKit} Manual},
+   author = {Peter Henderson and Geraint Jones and Simon Jones},
+   year = {1982},
+   howpublished = {Oxford University Computing Laboratory}
+}
+
+@inproceedings{wells-undecidable,
+   title = {Typability and Type Checking in the Second-order $\lambda$-calculus are equivalent and undecidable},
+   author = {J. Wells},
+   year = {1994},
+   month = {July},
+   booktitle = {Proc. 9th Ann. IEEE Symp. Logic Comput. Sci.}
+}
+
+@misc{patguards,
+   title = {Pattern Guards and Transformational Patterns},
+   author = {Martin Erwig and Simon {Peyton Jones}},
+   year = {2000},
+   howpublished = {Haskell Workshop}
+}
+
+@misc{alfa-manual,
+  title = {Alfa Users' Guide},
+  author = {Thomas Hallgren},
+  year = {2001},
+  howpublished = {Available from \verb+http://www.cs.chalmers.se/~hallgren/Alfa/+}
+}
+   
+@inproceedings{nofib,
+  title = {The nofib Benchmark Suite of {Haskell} Programs},
+  author = {Will Partain},
+  year = {1992},
+  booktitle = {Functional Programming},
+  editor = {J. Launchbury and P.L. Sansom},
+  series = {Workshops in Computing},
+  publisher = {Springer Verlag}
+}
+
+@article{shape,
+   title = {Shape in Computing},
+   author = {Barry Jay},
+   journal = 	 "{ACM} Computing Surveys",
+   year = 	 "1996",
+   volume = 	 "28",
+   number = 	 "2",
+   pages = 	 "355--357",
+}
+
+@misc{ffi,
+   title = {The {Haskell 98} Foreign Function Interface 1.0: An Addendum to the {Haskell 98} Report},
+   editor = {Manuel Chakravarty},
+   key = {FFI},
+   year = {2002},
+   month = {December},
+   howpublished = {Available from \verb+http://www.haskell.org/+}
+}
+
+@misc{perlxs,
+   title = {Perl {XS} Reference Manual},
+   author = {Dean Roehrich and {The Perl Porters}},
+   year = {1996},
+   howpublished = {\verb+http://www.perldoc.com/perl5.6/pod/perlxs.html+}
+}
+
+@misc{swig,
+   title = {{SWIG} : An Easy to Use Tool for Integrating Scripting Languages with {C} and {C++}},
+   author = {David M. Beazley},
+   year = {1996},
+   howpublished = {\verb+http://www.swig.org/papers/Tcl96/tcl96.html+}
+}
+
+@inproceedings{types-prog,
+   title = {Type Systems for Programming Languages},
+   booktitle = {Handbook of Theoretical Computer Science},
+   author = {John C. Mitchell},
+   pages = {365--458},
+   year = {1990},
+   crossref = {htcs}
+}
+
+@book{htcs,
+   title = {Handbook of Theoretical Computer Science},
+   editor = {J. van Leeuwen},
+   publisher = {Elsevier Science},
+   year = {1990}
+}
+
+@misc{r5rs,
+   title = {Revised$^5$ Report on the Algorithmic Language Scheme},
+   author = {Richard Kelsey and William Clinger and Jonathan Rees},
+   year = {1998},
+   month = {February},
+   howpublished = {Available from \verb+http://www.schemers.org/+}
+ }
diff --git a/papers/ivor/Makefile b/papers/ivor/Makefile
new file mode 100644
--- /dev/null
+++ b/papers/ivor/Makefile
@@ -0,0 +1,27 @@
+all: ivor.pdf
+
+SOURCES = ivor.tex intro.tex corett.tex tactics.tex code.tex \
+          examples.tex conclusions.tex ../bib/literature.bib
+
+ivor.pdf: $(SOURCES)
+	pdflatex ivor
+	-bibtex ivor
+	-pdflatex ivor
+
+ivor.ps: ivor.dvi
+	dvips -o ivor.ps ivor
+
+ivor.dvi: $(SOURCES)
+	-latex ivor
+	-bibtex ivor
+	-latex ivor
+	-latex ivor
+
+package: ifl06.tar
+
+ifl06.tar: ivor.dvi ivor.ps ivor.pdf .PHONY
+	mkdir -p ifl06
+	cp ../bib/*.bib *.tex *.ltx *.bib *.ps *.pdf *.dvi *.cls ifl06
+	tar cvf ivor06.tar ifl06
+
+.PHONY:
diff --git a/papers/ivor/alink.bib b/papers/ivor/alink.bib
new file mode 100644
--- /dev/null
+++ b/papers/ivor/alink.bib
@@ -0,0 +1,22382 @@
+Journals, books, and series
+@String{AI =     "Artificial Intelligence"}
+
+@String{Acta =   "Acta Informatica"}
+
+@String{CACM =   "Communications of the {ACM}"}
+
+@String{CJ =     "Computer Journal"}
+
+@String{ESOP =   "European Symposium on Programming"}
+
+@String{FPCA =   "International Conf. on Functional Programming
+                 Languages and Computer Architecture"}
+
+@String{IFIP =   "IFIP World Congress Proceedings"}
+
+@String{IPL =    "Information Processing Letters"}
+
+@String{JACM =   "Journal of the {ACM}"}
+
+@String{JCSS =   "Journal of Computer and System Sciences"}
+
+@String{JFP =    "Journal of Functional Programming"}
+
+@String{JSC =    "Journal of Symbolic Computation"}
+
+@String{JTASPEFL = "Analyse Statique en Programmation {\'E}quationnelle,
+                 Fonctionnelle, et Logique, Bordeaux, France, Octobre
+                 1991 (Bigre, vol. 74)"}
+
+@String{LASC =   "{LISP} and Symbolic Computation"}
+
+@String{LFP =    "{ACM} Conf. on {LISP} and Functional Programming"}
+
+@String{LICS =   "{IEEE} Symposium on Logic in Computer Science"}
+
+@String{LNCS =   "LNCS"}
+
+@String{MFCS =   "Mathematical Foundations of Computer Science"}
+
+@String{MFPLS =  "Mathematical Foundations of Programming Language
+                 Semantics"}
+
+@String{NGC =    "New Generation Computing"}
+
+@String{PEMC =   "Partial Evaluation and Mixed Computation"}
+
+@String{PEPM91 =   "Partial Evaluation and Semantics-Based Program
+                 Manipulation, New Haven, Connecticut (Sigplan Notices,
+                 vol. 26, no. 9, September 1991)"}
+
+@String{PEPM92 = "Partial Evaluation and Seman\-tics-Based Program
+                 Manipulation, San Francisco, California, June 1992
+                 (Technical Report {YALEU/DCS/RR}-909)"}
+
+@String{PEPM93 = "Partial Evaluation and Seman\-tics-Based Program
+                 Manipulation, Copenhagen, Denmark, June 1993"}
+
+@String{PEPM94 = "Partial Evaluation and Seman\-tics-Based Program
+                 Manipulation, Orlando, Florida, June 1994 (Technical
+                 Report 94/9, Department of Computer Science, University
+                 of Melbourne)"}
+
+@String{PDO =    "Programs as Data Objects, Copenhagen, Denmark (Lecture
+                 Notes in Computer Science, vol. 217)"}
+
+@String{POPL =   "ACM Symposium on Principles of Programming Languages"}
+
+@String{SCP =    "Science of Computer Programming"}
+
+@String{SIGPLAN = "Sigplan Notices"}
+
+@String{SMD =    "Soviet Mathematics Doklady"}
+
+@String{SPE =    "Software -- Practice and Experience"}
+
+@String{TCS =    "Theoretical Computer Science"}
+
+@String{TOPLAS = "ACM Transactions on Programming Languages and
+                 Systems"}
+
+@String{TSE =    "IEEE Transactions on Software Engineering"}
+
+@String{WSA92 =  "WSA '92, Static Analysis, Bordeaux, France, September
+                 1992. Bigre vols 81--82, 1992"}
+
+Publishers
+@String{ACM =    "ACM Press"}
+
+@String{A-W =    "Addison-Wesley"}
+
+@String{AP =     "Academic Press"}
+
+@String{CSP =    "Computer Science Press"}
+
+@String{CUP =          "Cambridge University Press"}
+@String{CUPtracts =    "Cambridge Tracts in Theoretical Computer Science"}
+
+@String{IEEE =   "IEEE"}
+
+@String{IEEECSP = "IEEE Computer Society"}
+
+@String{ISO =    "ISO"}
+
+@String{JWS =    "John Wiley \& Sons"}
+
+@String{MIT =    "MIT Press"}
+
+@String{N-H =    "North-Holland"}
+
+@String{OUP =    "Oxford University Press"}
+
+@String{P-H =    "Prentice Hall"}
+
+@String{S-V =    "Springer-Verlag"}
+
+@String{SL =     "Studentlitteratur"}
+
+@String{WHF =    "W.H. Freeman"}
+
+@String{Yale =   "Yale University"}
+
+Institutions and people
+@String{BEJ =    "D. Bj{\o}rner and A.P. Ershov and N.D. Jones"}
+
+@String{CCN =    "Computing Center"}
+
+@String{CTH =    "Chalmers University of Technology"}
+
+@String{DIKU =   "DIKU, University of Copenhagen, Denmark"}
+
+@String{IDDTH =  "Department of Computer Science, Technical University
+                 of Denmark"}
+
+@String{ISI =    "Informatics Systems Institute, Novosibirsk, USSR"}
+
+@String{PMG =    "Programming Methodology Group, Chalmers University of
+                 Technology"}
+
+@String{PROCOS = "ProCoS II, ESPRIT BRA 7071"}
+
+@String{UPMAIL = "UPMAIL, Uppsala University, Sweden"}
+		  
+From:  James Hook -- bibliography data base
+
+First some helpfull abbreviations.  These should eventually
+become standard:
+
+@String { TAMS = "Transactions of the American Mathematical Society"}
+@String {  LNM = "Lecture Notes in Mathematics"}
+@String {  TSE = "IEEE Transactions on Software Engineering" }
+@string{lncs = "Lecture Notes in Computer Science"}
+@string{LNCS = "Lecture Notes in Computer Science"}
+
+@string{nh =    "North-Holland"}
+@string{sv =    "Springer-Verlag"}
+@string{aw =    "Addison-Wesley"}
+@string{ab =    "Allyn and Bacon"}
+@string{ph =    "Prentice-Hall"}
+ 
+
+I am assuming that the names of POPL Conf.s are as regular as
+they appear.
+
+@String{ POPL19 ="Conf. Record of the Nineteenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL18 ="Conf. Record of the Eighteenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL17 ="Conf. Record of the Seventeenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL16 ="Conf. Record of the Sixteenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL15 ="Conf. Record of the Fifteenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL14 ="Conf. Record of the Fourteenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL13 ="Conf. Record of the Thirteenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL12 ="Conf. Record of the Twelfth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL11 ="Conf. Record of the Eleventh Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL10 ="Conf. Record of the Tenth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL9 ="Conf. Record of the Ninth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL8 ="Conf. Record of the Eigth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL7 ="Conf. Record of the Seventh Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL6 ="Conf. Record of the Sixth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL5 ="Conf. Record of the Fifth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL4 ="Conf. Record of the Fourth Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL3 ="Conf. Record of the Third Annual
+		ACM Symp. on Principles of Programming Languages" }
+@String{ POPL2 ="Conf. Record of the Second Annual
+		ACM Symp. on Principles of Programming Languages" }
+
+@String{CuCS = "Cornell University, Department of Computer Science"}
+@String{DECSRC = "Digital Equipment Corporation, Systems Research Center"}
+@String{SRICSL = "SRI International, Computer Science Laboratory"}
+@String{ORA = "Odyssey Research Associates"}
+@String{LFCS = "Laboratory for the Foundations of Computer Science, 
+	Dept. of Computer Science, University of Edinburgh"}
+@String{OGICSE = "Oregon Grad. Inst."}
+
+@MISC{KirchnerKirchner-greco-98,
+        AUTHOR = {Kirchner, Claude and Kirchner, H\'{e}l\`{e}ne},
+        TITLE = {Rewriting, Solving, Proving},
+        HOWPUBLISHED = {Notes de cours de l'\'{e}cole jeunes chercheurs
+                        en programmation}, 
+        year = 1998,
+        ADDRESS = {Nantes (France)}}
+
+@Article{Nielson:1988:TSC,
+author =       "Flemming Nielson and Hanne Riis Nielson",
+title =        "Two-level semantics and code generation",
+journal =      "Theoretical Computer Science",
+volume =       "56",
+number =       "1",
+pages =        "59--133",
+year =         1988,
+coden =        "TCSCDI",
+ISSN =         "0304-3975",
+bibdate =      "Sat Nov 22 13:29:49 MST 1997",
+acknowledgement = ack-nhfb,
+classification = "C4240 (Programming and algorithm theory); C6150C
+               (Compilers, interpreters and other processors)",
+corpsource =   "Dept. of Comput. Sci., Tech. Univ. of Denmark, Lyngby,
+               Denmark",
+keywords =     "activation records; code generation; compile-time;
+                 correctness; data flow analysis; Kripke-like relations;
+                 Pascal-like languages; program compilers; program
+                 verification; programming theory; run-time;
+                 stack-machine; syntactic restrictions; two-level
+                 denotational metalanguage; two-level semantics",
+pubcountry =   "Netherlands A04",
+treatment =    "T Theoretical or Mathematical",
+}
+
+
+
+@InProceedings{MTBS99,
+  author =       "Eugenio Moggi and Walid Taha and Zine El-Abidine Benaissa
+                  and Tim Sheard",
+  title =        "An Idealized {M}eta{ML}:  
+                  Simpler, and More Expressive",
+  booktitle =    "European Symposium on Programming {(ESOP)}",
+  pages =        "193--207",
+  year =         1999,
+  volume =       1576,
+  series =       LNCS,
+  publisher =    "Springer-Verlag",
+  OPTnote =         "An extended version appears in \cite{MTBS98TR}",
+}
+
+@InProceedings{Flanagan99,
+  author =       "Cormac Flanagan and Mart{\'\i}n Abadi",
+  title =        "Types for Safe Locking",
+  booktitle =    "European Symposium on Programming {(ESOP)}",
+  volume =       "1576",
+  series =       LNCS,
+  publisher =    "Springer-Verlag",
+  pages =        "91--108",
+  year =         "1999",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Tue Sep 14 06:09:05 MDT 1999",
+  acknowledgement = ack-nhfb,
+  keywords =     "ESOP; ETAPS; programming; software",
+}
+
+@inproceedings{scp91-felleisen,
+  author =       "Matthias Felleisen",
+  year =         "1991",
+  booktitle =    "Science of Computer Programming",
+  volume =       "17",
+  pages =        "35-75",
+  note =         "Preliminary version in: {\it Proc. European
+                  Symposium on Programming}, Lecture Notes in Computer Science,
+                  432. Springer-Verlag (1990), 134--151.",
+  title =        "On the Expressive Power of Programming Languages"
+}
+
+@InProceedings{Thiemann99,
+  author =       "Peter Thiemann",
+  title =        "Higher-Order Code Splicing",
+  booktitle =    "European Symposium on Programming (ESOP)",
+  OPTcrossref =  {},
+  OPTkey =       {},
+  year =         1999,
+  OPTeditor =    {},
+  volume =       1576,
+  OPTnumber =    {},
+  series =       LNCS,
+  OPTaddress =   {},
+  OPTorganization = {},
+  publisher =    "Springer-Verlag",
+  OPTannote =    {}
+}
+
+@TechReport{MTBS98TR,
+  author = 	 "Eugenio Moggi and Walid Taha and Zine El-Abidine Benaissa
+                  and Tim Sheard",
+  title = 	 "An Idealized {M}eta{ML}:  
+                  Simpler, and More Expressive (Includes Proofs)",
+  institution =  "OGI",
+  year = 	 1998,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-98-017",
+  note  =        "Available from \cite{ogi-tr-site}"
+}
+
+@Article{Moggi:91,
+Author={Moggi, Eugenio},
+Title={Notions of Computation and Monads},
+Journal={Information and Computation},
+Volume=93,
+Number=1,
+Year=1991}
+
+@InProceedings{Moggi:98,
+Author={Moggi, Eugenio},
+Title={Functor Categories and two-level Languages},
+Booktitle={Foundations of Software Science and Computation
+           Structures {(FoSSaCS)}},
+Volume=1378,
+Series=LNCS,
+Publisher={Springer Verlag},
+Year=1998}
+
+@InProceedings{Wickline:98,
+  title =        "Run-time Code Generation and {Modal-ML}",
+  author =       "Philip Wickline and Peter Lee and Frank Pfenning",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implementation
+                 ({PLDI})",
+  address =      "Montreal",
+  pages =        "224--235",
+  year =         1998,
+  references =   "\cite{PLDI::AuslanderPCEB1996}
+                 \cite{POPL::ConselN1996} \cite{SCP::cousineauCM1987}
+                 \cite{LICS::Davies1996} \cite{POPL::DaviesP1996}
+                 \cite{POPL::EnglerHK996} \cite{POPL::JorringS1986}
+                 \cite{PLDI::LeeL1996} \cite{ACMCS::LeoneL1998}
+                 \cite{SPE::PikeLR1985} \cite{ACMCS::WicklineLPD1998}",
+}
+@InCollection{Barendregt91,
+  author =       "Henk P. Barendregt",
+  title =        "Lambda Calculi with Types",
+  year =         1991,
+  booktitle =    "Handbook of Logic in Computer Science",
+  editor =       "S. Abramsky and D. M. Gabbay and T. S. E. Maibaum",
+  publisher =    "Oxford University Press",
+  address =      "Oxford",
+}
+@Book{Hindley97,
+  author =       "J. Roger Hindley",
+  title =        "Basic Simple Type Theory",
+  publisher =    CUP,
+  year =         1997,
+  key =          "Hindley",
+  volume =       42,
+  series =       CUPtracts,
+  address =      "Cambridge",
+  annote =       "Many references.",
+}
+
+@Article{Kohlbecker:86,
+  author =       "Eugene E. Kohlbecker and Daniel P. Friedman and
+                 Matthias Felleisen and Bruce Duba",
+  year =         "1986",
+  journal =      "{ACM} Conf. on {LISP} and Functional Programming",
+  pages =        "151--161",
+  title =        "Hygienic macro expansion",
+}
+
+@InProceedings{lfp86*151,
+  author =       "Eugene Kohlbecker and Daniel P. Friedman and Matthias
+                 Felleisen and Bruce Duba",
+  title =        "Hygienic Macro Expansion",
+  pages =        "151--181",
+  ISBN =         "0-89791-200-4",
+  editor =       "Richard P. Gabriel",
+  booktitle =    "Proc. {ACM} Conf. on {LISP} and
+                 Functional Programming",
+  address =      "Cambridge, MA",
+  month =        aug,
+  year =         "1986",
+  publisher =    "ACM Press",
+}
+
+@Article{purelyFunctional,
+  author =       "Amr Sabry",
+  title =        "What is a Purely Functional Language?",
+  journal =      jfp,
+  year =         1998,
+  volume = "8",
+  number = "1",
+  pages = "1-22",
+  month = jan
+}
+
+@InProceedings{impcbneed,
+  author =       "Zena M. Ariola and Amr Sabry",
+  title =        "Correctness of Monadic State: An Imperative
+                  Call-by-Need Calculus",
+  booktitle =    popl,
+  year =         1998,
+  publisher =    acm,
+  pages = "62-74"
+}
+
+@InProceedings{erkok-launchbury,
+   author    = "Levent {Erk\"{o}k} and John Launchbury",
+   title     = "Recursive Monadic Bindings",
+   booktitle = "Proc. Fifth {ACM} {SIGPLAN} International
+                Conf. on Functional Programming, {ICFP'00}",
+   year      = "2000",
+   month     = "September",
+   ISBN      = "1-58113-202-6",
+   pages     = "174--185",
+   publisher = "ACM Press",
+}                  
+
+
+@InProceedings{Steele:93,
+  author =       "Guy L. {Steele, Jr.} and Richard P. Gabriel",
+  title =        "The Evolution of {LISP}",
+  pages =        "231--270",
+  ISBN =         "0-89791-570-4",
+  editor =       "Richard L. Wexelblat",
+  booktitle =    "Proc. Conf. on History of
+                 Programming Languages",
+  series =       "ACM Sigplan Notices",
+  volume =       "28(3)",
+  publisher =    ACM,
+  address =      "New York",
+  year =         1993,
+}
+
+@Article{Nielson:1989:TSA,
+  author =       "Flemming Nielson",
+  title =        "Two-level semantics and abstract interpretation",
+  journal =      "Theoretical Computer Science",
+  volume =       "69",
+  number =       "2",
+  pages =        "117--242",
+  day =          "11",
+  year =         1989,
+  coden =        "TCSCDI",
+  ISSN =         "0304-3975",
+  bibdate =      "Sat Nov 22 13:24:22 MST 1997",
+  acknowledgement = ack-nhfb,
+  classification = "C4240 (Programming and algorithm theory); C6150G
+                 (Diagnostic, testing, debugging and evaluating
+                 systems)",
+  corpsource =   "Dept. of Comput. Sci., Tech. Univ. of Denmark, Lyngby,
+                 Denmark",
+  keywords =     "abstract interpretation; binding time; collecting
+                 semantics; compile-time; correctness; data flow
+                 analysis; denotational semantics; implementable
+                 analysis; most precise analysis; partial evaluation;
+                 program analysis; program verification; run-time;
+                 static semantics",
+  pubcountry =   "Netherlands",
+  treatment =    "B Bibliography; P Practical; T Theoretical or
+                 Mathematical",
+}
+
+@Book{Barwise:78:Kleene,
+  author = 	 "J. Barwise and  H. J.  Keisler and  K. Kunen (Editors)",
+  title = 	 "The Kleene Symposium",
+  publisher = 	 "North-Holland",
+  year = 	 1978,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  number = 	 101,
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+
+
+
+@InProceedings{Bondorf:92,
+  author =       "Anders Bondorf",
+  title =        "Improving binding times without explicit
+                 {CPS}-conversion",
+  booktitle =    "1992 ACM Conf. on Lisp and Functional
+                 Programming. San Francisco, California",
+  year =         1992,
+  pages =        "1--10",
+  summary =      "Binding times are improved by transforming a
+                 specializer written in continuation passing style. The
+                 improvements enable straightforward safe treatment of
+                 partially static data structures.",
+  keywords =     "partial evaluation, context propagation,
+                 continuations, frozen expressions, generating
+                 extensions, dynamic choice of static values, Similix",
+}
+
+@PhdThesis{Bondorf90,
+  author = 	 "Anders Bondorf",
+  title = 	 "Self-{A}pplicable {P}artial {E}valuation",
+  school = 	 "University of Copenhagen",
+  year = 	 1990,
+  OPTkey = 	 {},
+  OPTaddress = 	 {},
+  OPTtype = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Bondorf:89:ASelf-Applicable,
+  author =       "Anders Bondorf",
+  title =        "A Self-Applicable Partial Evaluator for Term Rewriting
+                 Systems",
+  booktitle =    "TAPSOFT '89. Proc. International Conf. Theory and Practice of
+                 Software Development, Barcelona, Spain. (Lecture Notes
+                 in Computer Science, Vol. 352)",
+  editor =       "J. Diaz and F. Orejas",    
+  publisher =    S-V,                        
+  pages =        "81--95",                   
+  year =         "1989",                     
+  semno =        "D-4",                      
+  summary =      "A self-applicable partial evaluator for restricted
+                 call-by-value term rewriting systems is described. The
+                 problem of partially evaluating pattern matching is
+                 solved by translating patterns into decision trees.",
+  keywords =     "self-application, partial evaluation, term rewriting
+                 systems",                   
+}                                            
+
+@Misc{ogi-tr-site,
+  key = 	 "Oregon Gradute Institute",
+  OPTauthor = 	 {},
+  title = 	 "{O}regon {G}raduate {I}nstitute
+                  {T}echnical {R}eports.  {P.O. Box 91000, Portland, OR 97291-1000,USA.}",
+  howpublished = "Available online from 
+                  \fr{ftp://cse.ogi.edu/pub/tech-reports/README.html}",
+  OPTyear = 	 {},
+  note = 	 "Last viewed August 1999",
+  OPTannote = 	 {},
+}
+
+@Misc{PhD, key = "{Resources for PhD Students}", OPTauthor = {}, title =
+  "{Resources for PhD Students}",
+  howpublished = "Available online from
+  \fr{http://www.cs.rice.edu/~taha/phd-reading.html}", year = 2003,
+  OPTnote = "", OPTannote = {}, }
+
+@Misc{MetaOCaml, key = "{MetaOCaml} Homepage", title =
+  "{M}eta{OC}aml: A Compiled, Type-safe Multi-stage Programming
+  Language", howpublished = "Available online from
+  \fr{http://www.cs.rice.edu/~taha/MetaOCaml/}", year = 2001,
+  OPTnote = "", OPTannote = {}, }
+
+
+@Misc{LVFPGA, 
+      key = "{LabVIEW FPGA Module}", author = "{National Instruments}", title =
+  "{LabVIEW FPGA Module}"
+  , howpublished = "Available online from
+  \fr{http://sine.ni.com/apps/we/nioc.vp?cid=11784\&lang=US}", year = 2003,
+}
+
+@Misc{LVRT, key = "{Introduction to LabVIEW Real-Time}", author = "{National Instruments}", title =
+  "{Introduction to LabVIEW Real-Time}"
+  , howpublished = "Available online from
+  \fr{http://volt.ni.com/niwc/labviewrt/lvrt\_intro.jsp?node=2381\&node=2381}", year = 2003,
+  OPTnote = "", OPTannote = {}, }
+
+@Misc{TwelfOnline, key = "{Twelf} Homepage", OPTauthor = {}, title =
+  "{Twelf}:  A Meta-Logical Framework", howpublished = "Available online from
+  \fr{http://www.twelf.org}", year = 2001,
+  OPTnote = "", OPTannote = {} }
+
+@TechReport{BMTS98TR,
+  author = 	 "Zine El-Abidine Benaissa and Eugenio Moggi and Walid Taha 
+                  and Tim Sheard",
+  title = 	 "A Categorical Analysis of Multi-Level Languages (Extended 
+                  Abstract)",
+  institution =  "Department of Computer Science, Oregon Graduate Institute",
+  year = 	 1998,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-98-018",
+  note  =        "Available from \cite{ogi-tr-site}",
+  OPTannote = 	 {}
+}
+
+@InProceedings{BMTS99,
+  author = 	 "Zine El-Abidine Benaissa and Eugenio Moggi and Walid Taha 
+                  and Tim Sheard",
+  title = 	 "Logical Modalities and Multi-Stage Programming",
+  booktitle = 	 "Federated Logic Conf. ({FLoC}) 
+                  Satellite Workshop on Intuitionistic
+                  Modal Logics and Applications ({IMLA})",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1999,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTaddress = 	 {},
+  OPTpages = 	 {},
+  OPTannote = 	 {}
+}
+
+@TechReport{TS99TR,
+  author = 	 "Walid Taha and Tim Sheard",
+  title = 	 "{MetaML} and Multi-Stage Programming 
+                  with Explicit Annotations",
+  institution =  "Department of Computer Science, Oregon Graduate Institute",
+  year = 	 1999,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-99-007",
+  note  =        "Extended version of \cite{TS97}.  
+                  Available from \cite{ogi-tr-site}",
+  OPTannote = 	 {}
+}
+
+@Book{Boerger:89:Computability,
+  author = 	 "E. Boerger",
+  title = 	 "Computability",
+  publisher = 	 "North-Holland",
+  year = 	 1989,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  number = 	 128,
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+
+@TechReport{AITR1427,
+       address =      MITad,
+       keywords =     "reflection, matching, equiation, reification,
+                      higher-order",
+       year =         1993,
+       pages =        "180",
+       author =       "Guillermo J. Rozas",
+       title =        "Translucent Procedures, Abstraction without Opacity",
+       contract =     "N00014-92-J-4097, MIP-9001651",
+       number =       "AI TR 1427",
+       abstract =     "This report introduces TRANSLUCENT PROCEDURES as a new
+                      mechanism for implementing behavioral abstractions.
+                      Like an ordinary procedure, a translucent procedure can
+                      be invoked, and thus provides an obvious way to capture
+                      a BEHAVIOR. Translucent procedures, like ordinary
+                      procedures, can be manipulated as first-class objects
+                      and combined using functional composition. But unlike
+                      ordinary procedures, translucent procedures have
+                      structure that can be examined in well-specified
+                      non-destructive ways, without invoking the procedure.",
+       institution =  MIT,
+       url =          "ftp://publications.ai.mit.edu/ai-publications/1993/AITR-1427.ps.Z",
+     }
+
+@TechReport{AITR901,
+       address =      MITad,
+       keywords =     "knowledge representation, representation languages,
+                      meta-representation, reflection, artificial
+                      intelligence, AI languages, RLL",
+       year =         1986,
+       pages =        "95",
+       author =       "Kenneth W. {Haase and Jr.}",
+       title =        "{ARLO}: Another Representation Language Offer",
+       number =       "AI TR 901",
+       institution =  MIT,
+     }
+
+
+@Misc{Amphion:Page,
+  OPTkey = 	 {},
+  OPTauthor = 	 {},
+  title = 	 "Amphion Home Page",
+  OPThowpublished = {},
+  OPTyear = 	 {},
+  note = 	 "\mc{http://ic-www.arc.nasa.gov/ic/projects/amphion/}",
+}
+
+@Unpublished{Appel:88:Reopening,
+  author = 	 "Andrew W. Appel",
+  title = 	 "Re-opening Closures",
+  note = 	 "(Unpublished manuscript)",
+  OPTkey = 	 {},
+  year = 	 1988,
+}
+
+
+@Book{Appel:92:Compiling,
+  author = 	 "Andrew W. Appel",
+  title = 	 "Compiling with Continuations",
+  publisher = 	 "Cambridge University Press",
+  year = 	 1992,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Book{vanHeijenoort:1977,
+  editor =       "J. van Heijenoort",
+  title =        "From Frege to Goedel, a Source Book in Mathematical
+                 Logic, 1879-1931",
+  edition =      "3",
+  publisher =    "Harvard University Press",
+  address =      "Cambridge",
+  year =         1977,
+  ISBN =         "0-674-32449-8",
+  descriptor =   "Mathematische Logik",
+  annote =       "Eine Auswahl klassischer Arbeiten auf dem Gebiet der
+                 mathematischen Logik",
+}
+
+@InProceedings{Thiemann:96:Full,
+  author =       "Peter Thiemann",
+  title =        "Towards Partial Evaluation of Full {S}cheme",
+  pages =        "95--106", 
+  booktitle =    "Reflection'96",
+  year =         1996,
+  editor =       "Gregor Kiczales",
+  address =      "San Francisco",
+}
+
+@Book{Arnberg:87:Bilingually,
+  author = 	 "Lenore Arnber",
+  title = 	 "Raising Children Bilingually:  The Pre-school Years",
+  publisher = 	 "Multilingual Matter",
+  year = 	 1987,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  address = 	 "Bank House, 8a Hill Road, Clevedon, Avon BS21 7HH, UK",
+  OPTedition = 	 {},
+  note = 	 "ISBN 0-905028-70-8",
+}
+
+@TechReport{BOWEN81,
+       key =          "Bowen \& Kowalski",
+       author =       "K. A. Bowen and R. A. Kowalski",
+       title =        "Amalgamating Language and Meta-Language in Logic
+                      Programming",
+       institution =  "School of Computer and Information Science Syracuse
+                      University",
+       year =         1981,
+       keywords =     "Foundations, theory manipulation; reflection",
+       bibdate =      "Tue Jul 5 11:21:16 1983",
+     }
+
+@Book{Barendregt84,
+	Author = "Henk P. Barendregt",
+	Title = "The Lambda Calculus:  Its Syntax and Semantics",
+	Publisher = "North-Holland",
+	Edition =  "Revised",
+	Address = "Amsterdam",
+	Year = 1984,
+	Series = "Studies in Logic and the Foundations of Mathematics",
+	Volume = 103
+}
+
+@PhDThesis{Bates79,
+	Author = "Joseph L. Bates",
+	Title = "A Logic for Correct Program Development",
+	School = "Cornell University",
+	Address = "Ithaca",
+	Year = 1979
+}
+
+@TechReport{Bates86,
+	Author = "Joseph L. Bates",
+	Title = "***GET REF from TANYA***",
+	Institution = CUCS,
+	Year = 1985,
+	Number = "TR 85--684",
+	Address = "Ithaca"
+}
+
+@InProceedings{Batory:94:Reengineering,
+  author = 	 "Don Batory and Jeff Thomas and Marty Sirkin",
+  title = 	 "Reengineering a Complex Application Using a Scalable Data Structure Compiler",
+  booktitle = 	 "
+     Proc. ACM SIGSOFT '94 Conf.",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1994,
+  OPTorganization = {},
+  OPTpublisher = {},
+  address = 	 "New Orleans",
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+}
+
+Bibliography on sources for partial eval examples BibTeX format).
+Mostly based on bib on PE by Peter Sestoft.  (The annotations have all
+been added locally, though).
+		  
+The collections is mainly of papers containing concrete examples of
+partial evaluation, in addition to a few significant papers in partial
+evaluation and reflection.
+
+Author: Walid Taha.  Last update: Wed Dec 20 15:06:49 PST 1995
+		 
+NB:  This file needs the file abbreviations.bib.  (Also extracted from
+     the bib by Peter Sestoft.)
+		  
+
+
+
+@InProceedings{Bawden:acm:lfp:1988,
+       author =       "Alan Bawden",
+       title =        "Reification without Evaluation",
+       crossref =     "acm:lfp:1988",
+       pages =        "342--351",
+       refs =         "7",
+       checked =      "19940504",
+       source =       "dept. library",
+       keywords =     "reification, reflection, Scheme, source",
+       abstract =     "Constructing self-referential systems, such as Brian
+                      Smith's 3-Lisp language, is actually more
+                      straightforward than you think. Anyone can build an
+                      infinite tower of processors (where each processor
+                      implements the processor at the next level below) by
+                      employing some common sense and one simple trick. In
+                      particular, it is {\em not} necessary to re-design
+                      quotation, take a stand on the relative merits of
+                      evaluation vs. normalization, or treat continuations as
+                      meta-level objects. This paper presents a simple
+                      programming language interpreter that illustrates how
+                      this can be done. By keeping its expression evaluator
+                      entirely separate from the mechanisms that implement
+                      its infinite tower, this interpreter avoids many
+                      troublesome aspects of previous self-referential
+                      programming languages. Given these basically
+                      straightforward techniques, processor towers might be
+                      easily constructed for a wide variety of systems to
+                      enable them to manipulate and reason about
+                      themselves.",
+       sjb =          "Amongst other things, describes how the two versions
+                      of \fr{call/cc} defined
+                      in~\cite{Wand:Friedman:acm:lfp:1986} are incorrect.",
+     }
+
+@mastersthesis{Bell94,
+	Author = "Jeffrey M. Bell",
+	Title = "An Implementation of {Reynold's} Defunctionalization Method 
+		for a Modern Functional Language",
+	School = ogicse,
+	year = 1994
+}
+
+@misc{Bell95a,
+	author = "Jeffrey M. Bell",
+	title = "{MTV-G} System Documentation",
+	year = 1995,
+	note = intooldocs
+}
+		        
+@misc{Bell95b,
+	author = "Jeffrey M. Bell",
+	title = "Lambda-Lifter Tool Documentation",
+	year = 1995,
+	note = intooldocs
+}		  
+		  
+@misc{Bell95c,
+	author = "Jeffrey M. Bell",
+	title = "Firstify Tool Documentation",
+	year = 1995,
+	note = intooldocs
+}
+
+@misc{Bell95d,
+	author = "Jeffrey M. Bell",
+	title = "{MTV-G} Test Case Generator Tool Documentation",
+	year = 1995,
+	note = intooldocs
+}
+
+@techreport{Bellegarde90,
+        Author = {Francoise Bellegarde},
+        Title = {Program transformation and rewriting},
+        Institution = OGICSE,
+        Number = "CSE-90-021",
+  note  =        "Available from \cite{ogi-tr-site}",
+        Year = 1990
+}
+
+@techreport {Bellegarde94a,
+	Author = "Fran\c{c}oise Bellegarde",
+	Title = "Automatic Transformations by Rewriting Techniques",
+	Institution = ogicse,
+	Number = "CSE-94-009",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+		  
+
+
+@techreport {Bellegarde94b,
+	Author = "Fran\c{c}oise Bellegarde",
+	Title = "A Transformation System Combining Partial Evaluation with Term Rewriting",
+	Institution = ogicse,
+	Number = "CSE-94-010",
+	Year = 1994,
+  note  =        "Available from \cite{ogi-tr-site}",
+}
+
+@techreport {Bellegarde94c,
+	Author = "Fran\c{c}oise Bellegarde",
+	Title = "Induction and Synthesis for Automatic Program Transformation",
+	Institution = ogicse,
+	Number = "CSE-94-022",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+
+@techreport {Bellegarde94d,
+	Author = "Fran\c{c}oise Bellegarde",
+	Title = "Automating Synthesis by Completion",
+	Institution = ogicse,
+	Number = "CSE-94-020",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+		  
+@misc{Bellegarde94e,
+	author = "Fran\c{c}oise Bellegarde",
+	title = "Astre: A Transformation System for First-Order Functional Programs",
+	year = 1994
+}
+
+@techreport {Bellegarde94f,
+	Author = "Fran\c{c}oise Bellegarde",
+	Title = "ASTRE: Towards A Fully Automated Program Transformation System",
+	Institution = ogicse,
+	Number = "CSE-94-027",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+
+@techreport {Bellegarde94g,
+	Author = "Fran\c{c}oise Bellegarde",
+	Title = "Termination Issues in Automated Synthesis",
+	Institution = ogicse,
+	Number = "CSE-94-028",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+
+@Article{Beraducci:Venturini:93,
+  author = 	 "Berarducci, A. and Venturini Zilli, M.",
+  title = 	 "Generalization of Unification",
+  journal = 	 JSC,
+  year = 	 1993,
+  OPTkey = 	 {},
+  volume = 	 16,
+  number = 	 5,
+  pages = 	 "478--492",
+  note = 	 {},
+}
+
+@Article{Bird:84,
+  author = 	 "R. S. Bird",
+  title = 	 "The Promotion and Accumulation Strategies in
+		  Transformational Programming",
+  journal = 	 TOPLAS,
+  year = 	 1984,
+  OPTkey = 	 {},
+  volume = 	 6,
+  number = 	 4,
+  pages = 	 "487--504",
+  note = 	 {},
+}
+		  
+@PHDTHESIS{Boehm84,
+	AUTHOR = {Hans-Juergen Karl Hermann Boehm},
+	TITLE = {A Logic for the {Russell} Programming Language },
+	SCHOOL = {Cornell University},
+	YEAR = 1984,
+	ADDRESS = "Ithaca",
+}
+
+@ARTICLE{Boehm87,
+	AUTHOR = {Hans-Juergen Boehm},
+	TITLE = {Constructive Real Interpretation of Numerical Programs},
+	JOURNAL = {{SIGPLAN} Notices},
+	YEAR = 1987,
+	VOLUME = {22},
+	NUMBER = {7},
+	PAGES = {214--221},
+	NOTE = {Proc. Symposium on
+		Interpreters and Interpretive Techniques}
+}
+
+@Article{Boudet:93,
+  author = 	 "Alexandre Boudet",
+  title = 	 "Combining Unification Algorithms",
+  journal = 	 JSC,
+  year = 	 1993,
+  OPTkey = 	 {},
+  volume = 	 16,
+  number = 	 6,
+  pages = 	 "597--626",
+  note = 	 {},
+}
+
+@Book{Bramer:Bramer:84,
+  author = 	 "Max Bramer and Dawn Bramer",
+  title = 	 "The Fifth Generation:  An Annotated Bibliography",
+  publisher = 	 "Addison-Wesley Publishing Company",
+  year = 	 1984,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  note = 	 {},
+}
+
+@Book{Bridges:94:Computability,
+  author = 	 "Douglas S. Bridges",
+  title = 	 "Computability:  A Mathematical Sketchbook",
+  publisher = 	 "Springer-Verlag",
+  year = 	 1994,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  series = 	 "Graduate Texts in Mathematics",
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+
+@article{Bruijn72,
+        author = "Bruijn, N. G. de",
+        title = "Lambda Calculus Notation with Nameless Dummies,
+                 a Tool for Automatic Formula Manipulation, with
+		 Application to the {Church-Rosser} Theorem",
+        journal = "Indagaciones Mathematische",
+        volume = 34,
+        year = 1972,
+        pages = "381--392",
+	NOTE = {This also appeared in the Proc.
+		Koninklijke Nederlandse Akademie van Wetenschappen,
+		Amsterdam, series A, 75, No. 5}
+}
+
+@INPROCEEDINGS{Bruijn78,
+	AUTHOR = {Bruijn, N. G. de},
+	TITLE = {Lambda calculus with namefree formulas involving
+		 symbols that represent reference transforming mappings},
+	BOOKTITLE = {Proc. Koninklijke Nederlandse
+		     Akaemie van Wetenschappen},
+	YEAR = 1978,
+	PAGES = {348--356},
+        volume = 81,
+        number = 3,
+	Address = "Amsterdam",
+	NOTE = {This paper was dedicated to A. Heyting at the occasion
+		of his 80th birthday on May 9, 1978}
+}
+		  
+@InCollection{Bruijn80,
+	Author = "Bruijn, N. G. de",
+	Title = "A Survey of the Project {AUTOMATH}",
+	BookTitle = "To {H.~B. Curry}:  Essays on Combinatory Logic,
+		Lambda Calculus and Formalism",
+	Editor = "J. P. Seldin and J. Roger Hindley",
+	Publisher = "Academic Press",
+	Address = "New York",
+	Year = 1980
+}
+
+@InCollection{Cardelli91,
+  key =          "Cardelli",
+  author =       "Luca Cardelli",
+  title =        "Typeful Programming",
+  booktitle =    "Formal Description of Programming Concepts",
+  publisher =    "Springer-Verlag",
+  year =         1991,
+  editor =       "E. J. Neuhold and M. Paul",
+  series =       "IFIP State-of-the-Art Reports",
+  pages =        "431--507",
+  address =      "New York",
+  annote =       "ISBN 0-387-53961-1. 52 references.",
+}
+
+@Article{Lescanne96,
+  title =        "{$\lambda\nu$}, a calculus of explicit substitutions
+                 which preserves strong normalisation",
+  author =       "Zine-El-Abidine Benaissa and Daniel Briaud and Pierre
+                 Lescanne and Jocelyne Rouyer-Degli",
+  pages =        "699--722",
+  journal =      "Journal of Functional Programming",
+  year =         1996,
+  volume =       "6",
+  number =       "5",
+}
+
+@InCollection{Cardelli97,
+  author =       "Cardelli, Luca",
+  publisher =    "CRC Press",
+  title =        "Type Systems",
+  editor="{Tucker, Jr.}, Allen B.",
+  booktitle =    "The Computer Science and Engineering Handbook",
+  year =         1997,
+}
+
+@TechReport{Cardelli86,
+	Author = "Luca Cardelli",
+	Title = "A Polymorphic lambda-calculus with Type:Type",
+	Institution = DECSRC,
+	Year = 1986,
+	Address = "Palo Alto"
+}
+		  
+@MISC{Cardelli87pc,
+	AUTHOR = {Luca Cardelli},
+	YEAR = 1987,
+	NOTE = {Personal communication.}
+}
+
+@unpublished{Chin93,
+	author = "Wei-Ngan Chin and John Darlington",
+	title = "Higher-order removal: A modular approach",
+	note = "Unpublished work",
+	year = 1993
+}
+		  
+@book{Church41,
+        author = "Alonzo Church",
+        title = "The Calculi of Lambda Conversion",
+        publisher = "Princeton University Press",
+        address = "Princeton",
+        year = 1941
+}
+
+
+@InProceedings{Consel:90:FromInterpreting,
+  author =       "Charles Consel and Olivier Danvy",
+  title =        "From Interpreting to Compiling Binding Times",
+  booktitle =    "ESOP '90. 3rd European Symposium on Programming,
+                 Copenhagen, Denmark, May 1990 (Lecture Notes in
+                 Computer Science, vol. 432)",
+  year =         1990,
+  editor =       "N. Jones",
+  pages =        "88--105",
+  publisher =    S-V,
+  note =         "",
+}
+
+@Article{H98,
+  author =       "R.J.M. Hughes",
+  title =        "Type specialization",
+  journal =      "ACM Computing Surveys",
+  volume =       "30",
+  number =       "3es",
+  year =         "1998",
+  coden =        "CMSVAN",
+  ISSN =         "0360-0300",
+  bibdate =      "Mon Jan 4 05:41:38 MST 1999",
+  acknowledgement = ack-nhfb,
+}
+
+@InProceedings{Consel:91:ForABetter,
+  author =       "Charles Consel and Olivier Danvy",
+  title =        "For a Better Support of Static Data Flow",
+  booktitle =    "Functional Programming Languages and Computer
+                 Architecture",
+  year =         1991,
+  editor =       "R.J.M. Hughes",
+  pages =        "496--519",
+  organization = ACM,
+  series = LNCS,
+  volume = 523,
+  publisher =    S-V,
+  address = "Cambridge",
+  note =         "",
+}
+
+
+
+@Article{Hilbert:MathematicsProblems,
+  author = 	 "David Hilbert",
+  title = 	 "Mathematics Problems",
+  journal = 	 "Bulletin of the American Mathematical Society",
+  year = 	 1901,
+  OPTkey = 	 {},
+  volume = 	 "8",
+  OPTnumber = 	 {},
+  pages = 	 "437--479",
+  note = 	 "Reproduced in \cite[Vol. I]{CampbellHiggins}",
+  OPTannote = 	 {}
+}
+
+
+
+
+@Proceedings{CampbellHiggins,
+  title = 	 "Mathematics:  People.  Problems.  Results.",
+  year = 	 1984,
+  OPTkey = 	 {},
+  editor = 	 "Douglas M. Campbell and John C. Higgins",
+  volume = 	 "I-III",
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  publisher =    "Wadsworth International",
+  OPTorganization = {},
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Consel:92:AProgramming,
+  author =       "Charles Consel and S. Pai",
+  title =        "A Programming Environment for Binding-Time Based
+                 Partial Evaluators",
+  booktitle =    PEPM92,
+  publisher =    Yale,
+  year =         1992,
+  pages =        "62--66",
+  note =         "",
+}
+
+@InProceedings{Consel:93:ATour,
+  author =       "Charles Consel",
+  title =        "A Tour of Schism: {A} Partial Evaluation System for
+                 Higher-Order Applicative Languages",
+  booktitle =    PEPM93,
+  year =         1993,
+  pages =        "145--154",
+  publisher =    ACM,
+  note =         "",
+}
+
+@InProceedings{Consel:93:IncrementalPartial,
+         author =       "Charles Consel and Calton Pu and Jonathan Walpole",
+         title =        "Incremental Partial Evaluation: The Key to High
+                        Performance, Modularity and Portability in {OP}erating
+                        Systems",
+         booktitle =    PEPM93,
+         year =         1993,
+         pages =        "44--46",
+         publisher =    ACM,
+       }
+
+@InProceedings{Consel:93:Tutorial,
+  author = 	 "Charles Consel and Olivier Danvy",
+  title = 	 "Tutorial Notes on Partial Evaluation",
+  booktitle = 	 POPL,
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1993,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTaddress = 	 {},
+  pages = 	 "493--501",
+  OPTnote = 	 {},
+}
+
+@TechReport{Constable85,
+	Author = "Robert L. Constable",
+	Title = "The Semantics of Evidence",
+	Institution = CUCS,
+	Year = 1985,
+	Number = "85--684",
+	Address = "Ithaca"
+}
+		  
+@phdthesis{Coquand85,
+	Author = "Thierry Coquand",
+	Title = "Une Th{\'e}orie des Constructions",
+	Type = "Th{\`e}se de troisi{\`e}me cycle",
+	School = "Universit{\'e} Paris VII",
+	Year = 1985
+}
+
+@InProceedings{Coquand86a,
+	Author = "Thierry Coquand",
+	Title = "An Analysis of {Girard's} Paradox",
+	BookTitle = "Proc. Symposium on 
+			Logic in Computer Science",
+	Publisher = "IEEE Computer Society Press",
+	Address = "Washington",
+	Year = 1986,
+	pages = "227--236"
+}
+
+@unpublished{Coquand86b,
+        author = "Thierry Coquand",
+        title = "A Calculus of Constructions",
+        note = "Privately circulated.",
+        year = 1986
+}
+
+@phdthesis{Daalen80,
+        author = "Daalen, Diederik Ton von",
+        title = "The Language Theory of {AUTOMATH}",
+        school = "Technische Hogeschool Eindhoven",
+        year = 1980
+}
+
+
+@InProceedings{Danvy88,
+  author = 	 "Olivier Danvy",
+  title = 	 "Across the Bridge between Reflection and Partial Evaluation",
+  booktitle = 	 PEMC,
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  editor = 	 "D. Bjorner and A. P. Ershov and N. D. Jones" ,
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1988,
+  OPTorganization = {},
+  publisher =    "North-Holland",
+  OPTaddress = 	 {},
+  pages = 	 "83--116",
+  note = 	 "",
+}
+
+@InProceedings{Danvy:88:Intensions,
+       author =       "Olivier Danvy and Karoline Malmkj{\ae}r",
+       title =        "Intensions and Extensions in a Reflective Tower",
+       booktitle =    "Proc. 1988 ACM Conf. on {LISP} and
+                      Functional Programming",
+       year =         1988,
+       semno =        "D-9",
+       pages =        "327--341",
+       publisher =    ACM,
+       keywords =     "reflective language, denotational semantics,
+                      intensions, extensions, Tower of Interpreters",
+     }
+
+@TechReport{Danvy:95:EtaExpansion,
+  author = 	 "Olivier Danvy and Karoline Malmkjaer and Jens Palsberg",
+  title = 	 "Eta-Expansion Does The Trick",
+  institution =  "University of Aarhus",
+  year = 	 1995,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "RS-95-41",
+  address = 	 "Aarhus",
+  OPTnote = 	 {},
+  OPTannote = 	 "[Work Extending (The Essence)]",
+}
+
+@ARTICLE{Danvy:95:TheEssence,
+  author = 	 "Olivier Danvy and Karoline Malmkjaer and Jens Palsberg",
+  title = 	 "The Essence of Eta-Expansion in Partial Evaluation",
+  journal = 	 "{LISP} and Symbolic Computation",
+  year = 	 1995,
+  OPTkey = 	 {},
+  volume = 	 1,
+  number = 	 19,
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+}
+		  
+
+
+		  
+@InProceedings{Danvy:96:TypeDirected,
+  author = 	 "Olivier Danvy",
+  title = 	 "Type-Directed Partial Evaluation",
+  booktitle = 	 POPL,
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1996,
+  organization = ACM,
+  OPTpublisher = {},
+  address = 	 "Florida",
+  pages = 	 "242--257",
+  OPTnote = 	 {},
+}
+
+I am assuming that the names of POPL Conf.s are as regular as
+they appear.
+
+@String{ POPL17 ="Conf. Record of the Seventeenth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL16 ="Conf. Record of the Sixteenth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL15 ="Conf. Record of the Fifteenth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL14 ="Conf. Record of the Fourteenth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL13 ="Conf. Record of the Thirteenth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL12 ="Conf. Record of the Twelfth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL11 ="Conf. Record of the Eleventh Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL10 ="Conf. Record of the Tenth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL9 ="Conf. Record of the Ninth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL8 ="Conf. Record of the Eigth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL7 ="Conf. Record of the Seventh Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL6 ="Conf. Record of the Sixth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL5 ="Conf. Record of the Fifth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL4 ="Conf. Record of the Fourth Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL3 ="Conf. Record of the Third Annual
+		ACM Symposium on Principles of Programming Languages" }
+@String{ POPL2 ="Conf. Record of the Second Annual
+		ACM Symposium on Principles of Programming Languages" }
+
+@String{CuCS = "Cornell University, Department of Computer Science"}
+@String{DECSRC = "Digital Equipment Corporation, Systems Research Center"}
+@String{SRICSL = "SRI International, Computer Science Laboratory"}
+@String{ORA = "Odyssey Research Associates"}
+
+%GROUP(LICS87,
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = {7--17},
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+)
+
+
+
+@INPROCEEDINGS{Amadio&86,
+	AUTHOR = {Roberto Amadio and Kim B. Bruce and Giuseppe Longo},
+	TITLE = {The Finitary Projection Model of Second Order Lambda
+		 Calculus and Solutions to Higher Order Domain Equations},
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = {7--17},
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+}
+
+@Book{Davis:65:Undecidable,
+  author = 	 "Martin Davis (editor)" ,
+  title = 	 "The Undecidable:  Basic Papers On Undecidable
+		  Propositions, Unsolvable Problems, and Computable Functions",
+  publisher = 	 "Raven Press",
+  year = 	 1965,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+@Article{Dershowitz:85,
+  author = 	 "Nachum Dershowitz",
+  title = 	 "Program Abstraction and Instantiation",
+  journal = 	 TOPLAS,
+  year = 	 1985,
+  OPTkey = 	 {},
+  volume = 	 7,
+  number = 	 3,
+  pages = 	 "446--477",
+  note = 	 {},
+}
+@Article{Dershowitz:85:Computing,
+  author = 	 "Nachum Dershowitz",
+  title = 	 "Computing with Rewrite Systems",
+  journal = 	 "Information and Control",
+  year = 	 1985,
+  OPTkey = 	 {},
+  volume = 	 65,
+  OPTnumber = 	 {},
+  pages = 	 "122--157",
+  OPTnote = 	 {},
+}
+
+@TECHREPORT{Boehm&80,
+	AUTHOR = {Hans-Juergen Boehm and Alan J. Demers and James E. Donahue},
+	TITLE = {An Informal Description of {Russell}},
+	INSTITUTION = CUCS,
+	YEAR = 1980,
+	NUMBER = {80--430},
+	ADDRESS = "Ithaca",
+	Note = {Revision of \cite{Demers&80a}}
+}
+
+
+@BOOK{Dijkstra76,
+	AUTHOR = {E. W. Dijkstra},
+	TITLE = {A Discipline of Programming},
+	PUBLISHER = {Prentice Hall},
+	YEAR = 1976,
+	ADDRESS = "Englewood Cliffs"
+}
+@ARTICLE{Boehm&86a,
+	AUTHOR = {Hans-Juergen Boehm and Alan J. Demers},
+	TITLE = {Implementing {Russell}},
+	JOURNAL = {{SIGPLAN} Notices},
+	YEAR = 1986,
+	VOLUME = {21},
+	NUMBER = {7},
+	PAGES = {186--195},
+	NOTE = {Proc. symposium on compiler
+		construction.}
+}
+
+@INPROCEEDINGS{Boehm&86b,
+	AUTHOR = {Hans-Juergen Boehm and Robert Cartwright and Michael
+		  J. {O'Donnell} and Mark Riggle},
+	TITLE = {Exact Real Arithmetic:  A Case Study in Higher Order
+		 Programming},
+	BOOKTITLE = {Proc. 1986 ACM Conf. on {LISP}
+		     and Functional Programming},
+	YEAR = 1986,
+	PAGES = {162--173},
+	ORGANIZATION = {ACM}
+}
+
+@ARTICLE{Donahue79,
+	AUTHOR = {James Donahue},
+	TITLE = {On the Semantics of ``Data Type''},
+	JOURNAL = sicomp,
+	YEAR = 1979,
+	VOLUME = {8},
+	NUMBER = {4},
+	PAGES = {546--560},
+}
+
+@TECHREPORT{Boehm&85,
+	AUTHOR = {Hans-Juergen Boehm and Alan J. Demers and James E. Donahue},
+	TITLE = {A Programmer's Introduction to Russell},
+	INSTITUTION = {Rice University},
+	YEAR = 1985,
+	NUMBER = {85-16}
+}
+
+@INPROCEEDINGS{Breazu-Tannen&87a,
+	AUTHOR = {Val Breazu-Tannen and Albert R. Meyer},
+	TITLE = {Computable Values Can Be Classical (Preliminary Report)},
+	BOOKTITLE = POPL14,
+	YEAR = 1987,
+	PAGES = {238--245},
+	ORGANIZATION = {ACM},
+}
+
+@INPROCEEDINGS{Breazu-Tannen&87b,
+	AUTHOR = {Val Breazu-Tannen and Albert R. Meyer},
+	TITLE = {Polymorphism is conservative over simple types
+		 (Preliminary Report) },
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = {7--17},
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+}
+
+@Article{Donahue:Demmers:85,
+  author = 	 "James Donahue and Alan Demers",
+  title = 	 "Data Types are Values",
+  journal = 	 TOPLAS,
+  year = 	 1985,
+  OPTkey = 	 {},
+  volume = 	 7,
+  number = 	 3,
+  pages = 	 "426--445",
+  note = 	 {},
+}
+
+
+@Article{Dougherty:Johann:92,
+  author = 	 "Daniel J. Dougherty and Patricia Johann",
+  title = 	 "An Improved General E-Unification Method",
+  journal = 	 JSC,
+  year = 	 1992,
+  OPTkey = 	 {},
+  volume = 	 14,
+  number = 	 4,
+  pages = 	 "303--320",
+  note = 	 {},
+}
+
+@misc{ESC94,
+	author = "Electronics Systems Center",
+	title = "Statement of Work: Software Design for Reliability and Reuse (SDRR) 
+	Phase II Project",
+	year = 1994
+}	
+@INPROCEEDINGS{Burstall&80,
+	AUTHOR = {R. M. Burstall and J. A. Goguen},
+	TITLE = {The semantics of {Clear}, a specification language},
+	BOOKTITLE = {Proceedings of Advanced Course on Abstract
+		     Software Specifications},
+	YEAR = 1980,
+	PAGES = {292--332},
+	PUBLISHER = {Springer-Verlag, Lecture Notes in Computer Science}
+}
+
+@InProceedings{Burstall&84,
+	Author = "R. Burstall and B. Lampson",
+	Title = "A Kernel Language for Abstract Data Types and Modules",
+	BookTitle = "Semantics of Data Types, 
+		International Symposium, Sophia-Antipolis, France",
+	Year = 1984,
+	Editor = "G. Kahn and D.B. MacQueen and G. Plotkin",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Series = LNCS,
+	Volume = 173
+}
+@Book{Enderton:72:Logic,
+  author = 	 "Herbert B. Enderton",
+  title = 	 "A Mathematical Introduction to Logic",
+  publisher = 	 "Academic Press",
+  year = 	 1972,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+@Article{Feather:82,
+  author = 	 "Martin S. Feather",
+  title = 	 "A system for Assisting Program Transformation",
+  journal = 	 TOPLAS,
+  year = 	 1982,
+  OPTkey = 	 {},
+  volume = 	 4,
+  number = 	 1,
+  pages = 	 "1--20",
+  note = 	 {},
+}
+
+@INPROCEEDINGS{Floyd67,
+	AUTHOR = {R. Floyd},
+	TITLE = {Assigning meaning to programs},
+	BOOKTITLE = {Mathematical Asspects of Computer Science {XIX}},
+	YEAR = 1967,
+	PAGES = "19--32",
+	ORGANIZATION = {American Mathematical Society}
+}
+
+@article{Church&36,
+        author = "Alonzo Church and {J. B.} Rosser",
+        title = "Some Properties of Conversion",
+        journal = "Transactions of the American Mathematical Society",
+        volume = 39,
+        year = 1936,
+        pages = "472--482"
+}
+
+@BOOK{Clocksin,
+	AUTHOR = {W. F. Clocksin and C. S. Mellish},
+	TITLE = {Programming in Prolog},
+	PUBLISHER = {Springer-Verlag},
+	YEAR = 1981
+}
+
+@Article{Fradet:Metayer:91,
+  author = 	 "Pascal Fradet and Daniel Le Metayer",
+  title = 	 "Compilation of Functional Languages by Program
+		  Transformation",
+  journal = 	 TOPLAS,
+  year = 	 1991,
+  OPTkey = 	 {},
+  volume = 	 13,
+  number = 	 1,
+  pages = 	 "21--51",
+  note = 	 {},
+}
+
+@INPROCEEDINGS{Constable&85a,
+	AUTHOR = {Robert L. Constable and N. P. Mendlar},
+	TITLE = {Recursive Definitions in Type Theory},
+	BOOKTITLE = {Proceedings Logic of Programs, Lecture Notes in
+		     Computer Science Vol 193.},
+	YEAR = 1985,
+	PUBLISHER = {Springer-Verlag}
+}
+@article{Constable&85b,
+        author = "Robert L. Constable and Todd B. Knoblock and Joseph L. Bates",
+        title = "Writing Programs that Construct Proofs",
+        journal = "Journal of Automated Reasoning",
+        volume = 1,
+        year = 1985,
+        pages = "285--326"
+}
+
+@InProceedings{hils:2000,
+  author =       {Erik Hilsdale and Daniel P. Friedman},
+  title =        {Writing Macros in Continuation-passing Style},
+  booktitle =    {Proc. Workshop on Scheme and Functional
+Programming},
+  pages =        {53-60},
+  year =         {2000},
+  month =        sep,
+  annote =       {Rice University Technical Report 00-368}
+}
+
+@ARTICLE{Constable&84,
+	AUTHOR = {Rober L. Constable and Daniel R. Zlatin},
+	TITLE = {The type theory of {PL/CV3}},
+	JOURNAL = toplas,
+	YEAR = 1984,
+	VOLUME = {7},
+	NUMBER = {1},
+	PAGES = {72--93}
+}
+
+
+@Book{Constable&86,
+	Author = "Robert L. Constable and others",
+	Title ="Implementing Mathematics 
+		with the Nuprl Proof Development System",
+	Publisher = "Prentice Hall",
+	Address = "Englewood Cliffs",
+	Year = 1986
+}
+
+@INPROCEEDINGS{Constable&87,
+	AUTHOR = {Robert L. Constable and Scott Fraser Smith},
+	TITLE = {Partial Objects in Constructive Type Theory},
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = "183--193",
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+}
+
+@unpublished{Coquand&84,
+       author = "Thierry Coquand and G\'erard Huet",
+       title = "A Theory of Constructions",
+       note = "Presented at the International Symposium on
+               Semantics of Data Types, {Sophia-Antipolis}",
+       year = 1984
+}
+
+@unpublished{Coquand&85,
+       Author = "Thierry Coquand and G\'erard Huet",
+       Title = "Concepts Math\'ematiques et Informatiques Formalis\'es
+                  dans le Calcul des Constructions",
+       Note = "Colloque de Logique, Orsay (July 1985), North-Holland,
+               forthcoming"
+}
+
+@inproceedings{Coquand&86,
+       Author = "Thierry Coquand and G\'erard Huet",
+       Title = "Constructions: A Higher Order Proof System for Mechanizing
+                Mathematics",
+        Booktitle = "EUROCAL85",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Series = "Lecture Notes in Computer Science",
+	Volume = 203,
+	Year = 1986,
+        pages = "151--184"
+}
+@Article{Freudenberged:83,
+  author = 	 "Stefan M. Freudenberger, Jacob THE. Schwartz and
+		  Micha Sharir",
+  title = 	 "Experience with the SETL Optimizer",
+  journal = 	 TOPLAS,
+  year = 	 1983,
+  OPTkey = 	 {},
+  volume = 	 5,
+  number = 	 1,
+  pages = 	 "26--45",
+  note = 	 {},
+}
+@InProceedings{Friedman84a,
+       author =       "Daniel P. Friedman and Mitchell Wand",
+       title =        "Reification: Reflection Without Metaphysics",
+       booktitle =    "Conf. Record of the 1984 ACM Symposium on {LISP}
+                      and Functional Programming",
+       pages =        "348--355",
+       address =      "Austin",
+       year =         1984,
+     }
+
+@Article{Fuller:88:Mixed,
+  author = 	 "D. A. Fuller and S. Abramsky",
+  title = 	 "Mixed Computation of Prolog Programs",
+  journal = 	 "New Generation Computing",
+  year = 	 1988,
+  OPTkey = 	 {},
+  volume = 	 6,
+  number = 	 "2,3",
+  pages = 	 "119--142",
+  OPTnote = 	 {},
+}
+@misc{Cousineau&84,
+	title = "The {ML} Handbook, version 6.1",
+	author = "Guy Cousineau and G\'erard Huet and Larry Paulson",
+	note = "INRIA memeographed manuscript."
+}
+
+@Book{Curry&58,
+	Author = "H.  B. Curry and R. Feys",
+	Title = "Combinatory Logic",
+	Volume = "I",
+	Publisher = "North-Holland",
+	Address = "Amsterdam",
+	Year = 1958
+}
+@Article{Futamura:71:PartialEvaluation,
+  author = 	 "Yoshihiko Futamura",
+  title = 	 "Partial Evaluation of Computation Process -- an
+		  Approach to a Compiler-Compiler",
+  journal = 	 "Systems, Computers and Control",
+  year = 	 1971,
+  OPTkey = 	 {},
+  volume = 	 2,
+  number = 	 5,
+  pages = 	 "45--50",
+  note = 	 "[Via \cite{Jones:95:TenYears}]",
+}
+@INPROCEEDINGS{Demers&78,
+	AUTHOR = {Alan J. Demers and James E. Donahue and G. Skinner},
+	TITLE = {Data Types as Values:  Polymorphism, Type-checking,
+		Encapsulation},
+	BOOKTITLE = POPL5,
+	YEAR = 1978,
+	PAGES = "23--30",
+	PUBLISHER = {{ACM}}
+}
+
+@TECHREPORT{Demers&79,
+	AUTHOR = {Alan J. Demers and James E. Donahue},
+	TITLE = {Revised report on {Russell}},
+	INSTITUTION = CUCS,
+	YEAR = 1979,
+	NUMBER = {79--389},
+	ADDRESS = "Ithaca"
+}
+@TECHREPORT{Demers&80a,
+	AUTHOR = {Alan J. Demers and James E. Donahue and Hans-Juergen Boehm},
+	TITLE = {An Informal Description of {Russell}},
+	INSTITUTION = CUCS,
+	YEAR = 1980,
+	NUMBER = {80--430},
+	ADDRESS = "Ithaca",
+	Note = {Superceded by \cite{Boehm&80}, a revised version
+		prepared September}
+}
+@TECHREPORT{Demers&80b,
+	AUTHOR = {Alan J. Demers and James E. Donahue},
+	TITLE = {The Semantics of {Russell}:  An Exercise in Abstract
+		 Data Types},
+	INSTITUTION = CUCS,
+	YEAR = 1980,
+	NUMBER = {80--431},
+	ADDRESS = "Ithaca"
+}
+
+@INPROCEEDINGS{Demers&80c,
+	AUTHOR = {Alan J. Demers and James E. Donahue},
+	TITLE = {Data Types, Parameters and Type-Checking},
+	BOOKTITLE = POPL7,
+	YEAR = 1980,
+	PAGES = "12--23",
+	ORGANIZATION = {{ACM}}
+}
+@INPROCEEDINGS{Demers&80d,
+	AUTHOR = {Alan J. Demers and James E. Donahue},
+	TITLE = {Type Completeness as a Language Principle},
+	BOOKTITLE = POPL7,
+	YEAR = 1980,
+	PAGES = "234--244",
+	ORGANIZATION = {{ACM}}
+}
+
+@INPROCEEDINGS{Demers&83,
+	AUTHOR = {Alan J. Demers and James E. Donahue},
+	TITLE = {Making Variables Abstract: an Equational Theory for
+		 {Russell}},
+	BOOKTITLE = POPL10,
+	INSTITUTION = CUCS,
+	PAGES = "59--72",
+	YEAR = 1983,
+}
+
+@InCollection{Futamura:82:PartialComputation,
+  author = 	 "Yoshihiko Futamura",
+  title = 	 "Partial Computation of Programs",
+  booktitle = 	 "RIMS Symposia on Software Science and Engineering",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  publisher =    "Springer-Verlag",
+  year = 	 1982,
+  editor = 	 "Eiichi Goto and Koichi Furukawa and Reiji Nakajima
+		  and Ikuo Nakata and Akinori Yonezawa",
+  volume = 	 147,
+  OPTnumber = 	 {},
+  series = 	 LNCS,
+  OPTchapter = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  pages = 	 "1--31",
+  OPTnote = 	 {},
+}
+
+@article{Gentzen34,
+        author = "Gerhard Gentzen",
+        title = "Untersuchungen {{\"u}ber} das logische {Schliessen}",
+        journal = "Mathematische Zeitschrift",
+        volume = 39,
+        year = 1934,
+        pages = "176--210, 405--431",
+        note = "Translated in Sabo (ed.), {\em The Collected Papers
+                of Gerhard Gentzen} as ``Investigations into Logical
+                Deduction''"
+}
+@misc{Eichenlaub&88,
+	Author = {Carl Eichenlaub and James Hook},
+	title = {Preliminary Manual for Theory Manager Interface},
+	note = {Odyssey Research Associates, internal report.},
+	year = 1988
+}
+
+@incollection{Gentzen69,
+        author = "Gerhard Gentzen",
+        title = "Investigations into Logical Deduction",
+        booktitle = "The Collected Papers of Gerhard Gentzen",
+        editor = "M. E. Szabo",
+        publisher = "North-Holland Publishing Company",
+        address = "Amsterdam and London",
+        year = 1969,
+        pages = "68--131"
+}
+
+@Article{Fortune&83,
+	Author = "Steven Fortune and Daniel Leivant and Michael {O'Donnell}",
+	Title = "The Expressiveness of Simple and Second-Order Type 
+		 Structures",
+	Journal = JACM,
+	Year = 1983,
+	Volume = 30,
+	pages = "151--185"
+}
+@INPROCEEDINGS{Futasugi&85,
+	AUTHOR = {Kokichi Futasugi and Joseph A. Goguen and
+		  {Jean-Pierre} Jouannaud and {Jos\'e} Meseguer},
+	TITLE = {Principles of {OBJ2}},
+	BOOKTITLE = POPL12,
+	YEAR = 1985,
+	PAGES = "52--66",
+	ORGANIZATION = {ACM},
+}
+
+@InProceedings{Girard71,
+	Author = "{J.-Y.} Girard",
+	Title = "Une Extension de l'interpr{\'e}tation de {G\"odel} {\`a}
+		{l'analyse}, et son application {\`a} {l'\'elimination} des 
+		coupures dans {l'analyse} et la {th\'eorie} des types",
+	BookTitle = "Second Scandinavian Logic Symposium",
+	Editor = "J. E. Fenstad",
+	Publisher = "North-Holland",
+	Address = "Amsterdam",
+	Year = 1971,
+	pages = "63--92"
+}
+
+@phdthesis{Girard72,
+	Author = "{J.-Y.} Girard",
+	Title = "Interpr{\'e}tation fonctionelle et {\'e}limination 
+		des coupures dans l'arithm{\'e}tique d'ordre sup{\'e}rieur",
+	Type = "Th{\`e}se de Doctorat d'Etat" ,
+	School = "University of Paris {VII}",
+	Year = 1972
+}
+@Article{Gomard:92,
+  author = 	 "Carsten K. Gomard",
+  title = 	 "A Self-Applicable Partial Evaluator for the Lambda
+		  Calculus:  Correctness and Pragmatics",
+  journal = 	 TOPLAS,
+  year = 	 1992,
+  OPTkey = 	 {},
+  volume = 	 14,
+  number = 	 2,
+  pages = 	 "147--172",
+  note = 	 {},
+}
+@INPROCEEDINGS{Goguen&75,
+	AUTHOR = {Joseph A. Goguen and James Thatcher and Eric Wagner and
+		  J.B. Wright },
+	TITLE = {Abstract Types as Initial Algebras and Correctness of
+		 Data Representations},
+	BOOKTITLE = {Proceedings from the Conf. on Computer
+		     Graphics, Pattern Recognition and Data Structures},
+	YEAR = 1975,
+	PAGES = "89--93",
+	ORGANIZATION = {ACM},
+}
+
+@Article{Masini93,
+  title =        "2-{Sequent} Calculus: Intuitionism and Natural
+                 Deduction",
+  author =       "Masini, A.",
+  journal =      "Journal of Logic and Computation",
+  year =         1993,
+  volume =       "3",
+  number =       "5"
+}
+		  
+@InCollection{Masini96,
+  title =        "A computational interpretation of modal proofs",
+  booktitle =	 "Proof Theory of Modal Logic",
+  author =       "Martini, S. and Masini, A.",
+  editor =       "Wansing, H.",
+  publisher =    "Kluwer",
+  year =         1996
+}
+		  
+@InProceedings{Benton:1995:MLN,
+  author =       "Nick Benton",
+  title =        "A Mixed Linear and Non-Linear Logic: Proofs, Terms and
+                 Models",
+  series =       LNCS,
+  volume =       "933",
+  year =         1995,
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Sat May 11 13:45:32 MDT 1996",
+  acknowledgement = ack-nhfb,
+}
+
+
+
+@InProceedings{GHJ:99,
+  AUTHOR       = {Gl{\"u}ck, Robert and Hatcliff, John and J{\o}rgensen, Jesper},
+  YEAR         = 1999,
+  TITLE        = {Generalization in Hierarchies of Online Program Specialization
+                  Systems},
+  BOOKTITLE    = {Logic-Based Program Synthesis and Transformation},
+  editor       = {Flener, P.},
+  publisher    = {Springer-Verlag},
+  series       = {Lecture Notes in Computer Science},
+  volume       = {1559},
+  pages        = "179--198",
+  keywords     = {program transformation, metasystem transition, self-application,  
+                  generalization, program specialization},
+  summary      = {In recent work, we proposed a simple functional language S-graph-n 
+      to study meta-programming aspects of self-applicable online program 
+      specialization. The primitives of the language provide support for multiple 
+      encodings of programs. An important component of online program specialization
+      is the termination strategy. In this paper we show that such a representation 
+      has the great advantage of simplifying generalization of multiply encoded data.
+      We extend two basic methods to multiply encoded data: most specific 
+      generalization and the homeomorphic embedding relation. Examples illustrate 
+      their working in hierarchies of programs.},
+  supersedes   = {},
+  SEMNO        = {D-380},
+  PUF          = {Artikel i proceedings (med censur)},
+  ID           = {KonR}
+ }
+
+@InProceedings{Lazysml98,
+  author =       "Philip Wadler and Walid Taha and David B. MacQueen",
+  title =        "How to add laziness to a strict language withouth even
+                 being odd",
+  booktitle =    "Proc. 1998 ACM Workshop on {ML}",
+  address =      "Baltimore",
+  year =         1998,
+  pages =        "24--30",
+}
+
+@InProceedings{BW96,
+  title =        "Linear Logic, Monads and the Lambda Calculus",
+  author = "Nick Benton and Phil Wadler",
+  OPTpages =        "420--431",
+  booktitle =    "the Symposium on Logic in Computer Science ({LICS} '96)",
+  year =         1996,
+  address =      "New Brunswick",
+  organization = "IEEE Computer Society Press",
+  references =   "\cite{JFP::AchtenP1995} \cite{IC::CroleP1992}
+                 \cite{TCS::Girard1987} \cite{LICS::LincolnM1992}
+                 \cite{IC::Moggi1991} \cite{TCS::Plotkin1975}
+                 \cite{MSCS::Wadler1992}",
+}
+
+@InSeries{Bierman:95,
+  author =       "G. M. Bierman",
+  title =        "What is a categorical model of intuitionistic linear
+                 logic?",
+  series =      LNCS,
+  volume =       "902",
+  year =         1995,
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743"
+}
+		  
+@TECHREPORT{Goguen&76,
+	AUTHOR = {Joseph A. Goguen and James Thatcher and Eric Wagner},
+	TITLE = {An Initial Algebra Approach to the Specification,
+		 Correctness and Implementation of Abstract Data Types},
+	INSTITUTION = {IBM T.~J.~Watson Research Center},
+	YEAR = 1976,
+	TYPE = {RC},
+	NUMBER = {6487},
+	NOTE = {Appears in {\em Current Trends in Programming
+		Methodology, {IV}}, Raymond Yeh, Editor, 
+		Prentice-Hall, 1978, pages {80--149}}
+}
+
+@INCOLLECTION{Goguen&79,
+	AUTHOR = {Joseph A. Goguen and J. Tardo},
+	TITLE = {An Introduction to {OBJ}:  A Language for Writing
+		   and Testing Software},
+	BOOKTITLE = {Specification of Reliable Software},
+	PUBLISHER = {{IEEE} Press},
+	YEAR = 1979,
+	PAGES = "170--189"
+}
+
+@ARTICLE{Goguen&82,
+	AUTHOR = {Joseph A. Goguen and {Jos\'e} Meseguer},
+	TITLE = {Rapid Prototyping in the {OBJ} Executable
+		 Specification Language},
+	JOURNAL = {Software Engineering Notes},
+	YEAR = 1982,
+	VOLUME = {7},
+	NUMBER = {5},
+	PAGES = "75--84",
+	NOTE = {Proceedings of Rapid Prototyping Workshop.}
+}
+
+@INCOLLECTION{Goguen&83,
+	AUTHOR = {Joseph A. Goguen and {Jos\'e} Meseguer and D. Plaisted},
+	TITLE = {Programming with Parameterized Abstract Objects in {OBJ}},
+	BOOKTITLE = {Theory and Practice of Software Technology},
+	PUBLISHER = {North-Holland},
+	YEAR = 1983,
+	EDITOR = {D. Ferrari and M Bolognani and J. Goguen},
+	PAGES = "163--193"
+}
+
+@INPROCEEDINGS{Goguen&87,
+	AUTHOR = {Joseph A. Goguen and {Jos\'e} Meseguer},
+	TITLE = {Order-Sorted Algebra Solves the Constructor-Selector,
+		 Multiple Representation and Coercion Problems},
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = "18--29",
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+}
+
+@TechReport{Good84,
+	Author = "Donald Good",
+	Title = "Revised Report on Gypsy 2.1 (draft)",
+	Institution = "University of Texas",
+	Year = 1984
+}
+@Misc{Good86,
+	Author = "Donald Good",
+	Title = "The Foundations of Computer Security---We Need Some",
+	Note = "{ARPANET} Computer Security Forum, 29 {September} 1986."
+}
+@Book{Gordon&79,
+	Author = "Michael J. Gordon and 
+		Robin Milner and 
+		Christopher P. Wadsworth",
+	Title = "Edinburgh LCF",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Series = LNCS,
+	Volume = 78,
+	Year = 1979
+}
+@BOOK{Gries81,
+	AUTHOR = {David Gries},
+	TITLE = {The Science of Programming},
+	PUBLISHER = {Springer-Verlag},
+	YEAR = 1981
+}
+@misc{Gries87,
+	author = "David Gries",
+	title = "What Programmers Don't and Should Know",
+	year = 1987,
+	institution = CUCS,
+	address = "Ithaca",
+	note = "Paper prepared for the Twentieth University of Newcastle upon
+		Tyne International Seminar on the Teaching of Computing Science at
+		University Level, titled Logic and its Application to Computing Science."
+}
+
+@Misc{Griffin,
+	Author = "Tim Griffin",
+	Note = "Personal Communication."
+}
+
+@TECHREPORT{Griffin87,
+	AUTHOR = {Timothy G. Griffin},
+	TITLE = {An Environment for Formal Systems},
+	INSTITUTION = CUCS,
+	YEAR = 1987,
+	NUMBER = {87-846},
+	ADDRESS = "Ithaca",
+}
+@TECHREPORT{Griffin88,
+        AUTHOR = {Griffin, Timothy G.},
+        TITLE = {A formal account of notational definition},
+        INSTITUTION = {Department of Computer Science, Cornell University},
+        YEAR = 1988,
+        NUMBER = {88-901}
+}
+
+@INPROCEEDINGS{Griffin88b,
+        AUTHOR = {Griffin, Timothy G.},
+        TITLE = {Notational definitions --- a formal account},
+        BOOKTITLE = {Proc. Third Symposium 
+                on Logic in Computer Science},
+        YEAR = 1988,
+}
+@PhDThesis{Griffin88c,
+	Author = {Griffin, Timothy George},
+	Title = "Notational Definition and Top-Down Refinement for Interactive Proof Development Systems",
+	School = "Cornell University",
+	Address = "Ithaca",
+	Year = 1988,
+	Note = "Available as Cornell University Department of 
+		Computer Science Technical Report {TR 88-937}."
+}
+
+@TechReport{Grue:87:AnEfficientFormalTheory,
+       semno =        "D-73",
+       author =       "Klaus E. Grue",
+       title =        "An Efficient Formal Theory",
+       institution =  DIKU,
+       year =         1987,
+       number =       "87/14",
+       keywords =     "proof system, reflection, metamathematics, syntax",
+     }
+@Inproceedings{Harper&87,
+	Author = "Robert Harper and Furio Honsell and Gordon Plotkin",
+	Title = "A framework for defining logics",
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = "194--204",
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+}
+@Inproceedings{Harper&87a,
+	Author = "Robert Harper and Robin Milner and Mads Tofte",
+	Title = "A Type Discipline for Program Modules",
+	BOOKTITLE = {{TAPSOFT '87}},
+	YEAR = 1987,
+	PAGES = "308--319",
+	PUBLISHER = {Springer-Verlag},
+}
+@Misc{Harper&89a,
+	Author = "Robert Harper and Donnald Sannella and Andrzej Tarlecki",
+	Title = "Logic Representation, Report on work in progress",
+	Year = 1989
+}
+@INPROCEEDINGS{Harper&89b,
+	AUTHOR = "Robert Harper and Donnald Sannella and Andrzej Tarlecki",
+	TITLE = "Structure and Representation in {LF}",
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1989,
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+}
+@inproceedings{Harper&90,
+	author = "Robert Harper and John C. Mitchell and Eugenio Moggi",
+	title = "Higher-Order Modules and the Phase Distinction",
+	booktitle = POPL17,
+	year = 1990,
+	pages = "341--354",
+	organization = {ACM}
+}
+@InProceedings{Hansen:89:ExperimentsWithImplementations,
+       author =       "Torben Amtoft Hansen and Thomas Nikolajsen and Jesper
+                      Larsson Tr{\"a}ff and Neil D. Jones",
+       title =        "Experiments with Implementations of two Theoretical
+                      Constructions",
+       booktitle =    "Lecture Notes in Computer Science 363",
+       year =         1989,
+       semno =        "D-19",
+       pages =        "119--133",
+       publisher =    "Springer Verlag",
+       keywords =     "S-M-N theorem, recursion theorem, 2 way pushdown
+                      automata, partial evaluation, reflection",
+     }
+@Book{Harel:87:Algorithmics,
+  author = 	 "David Harel",
+  title = 	 "Algorithmics:  The Spirit of Computing",
+  publisher = 	 "Addison-Wesley Publishing Company",
+  year = 	 1987,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+
+@PhDThesis{Harper85,
+	Author = "Harper, Jr., Robert William",
+	Title = "Aspects of the Implementation of Type Theory",
+	School = "Cornell University",
+	Address = "Ithaca",
+	Year = 1985
+}
+@TECHREPORT{Hook&86,
+	AUTHOR = {James G. Hook and Douglas J. Howe},
+	TITLE = {Impredicative Strong Existential Equivalent to {Type:Type}},
+	INSTITUTION = CUCS,
+	YEAR = 1986,
+	NUMBER = {86-760},
+	ADDRESS = "Ithaca",
+}
+@techreport{Hook&89,
+       author = "James Hook and Garrel Pottinger",
+       title = "Ulysses Theories:  The modular implementation of mathematics",
+       institution = "Odyssey Research Associates",
+       number = "TR 11-14",
+       year = 1989
+}
+@Article{Hindley69,
+	Author = "J. Roger  Hindley",
+	Title = "The Principal Type-Scheme of an Object in 
+		Combinatory Logic",
+	Journal = TAMS,
+	Year = 1969,
+	Volume = 146,
+	pages = "29--60"
+}
+@misc{Hook&88,
+       author = "James Hook and Carl Eichenlaub",
+       title = "Prototype Environment for Tactics Users Manual",
+       note = "Odyssey Research Associates internal report.",
+       year = 1988
+}
+@unpublished{Hook&89b,
+        author = "James Hook and Garrel Pottinger",
+        title = "Natural {L}-systems",
+        note = "Presented to the meeting of the Association for Symbolic Logic
+		held at UCLA in January 1989.  An abstract will appear in the 
+		{\em Journal of Symbolic Logic}.",
+        year = 1989
+}
+
+@Book{Hopcroft&79,
+	Author = "John E. Hopcroft and Jeffrey D. Ullman",
+	Title = "Introduction to Automata Theory, Languages, and 
+		Computation",
+	Publisher = "Addison Wesley",
+	Year = 1979,
+	Address = "Reading"
+}
+@Book{Hindley:86,
+  author = 	 "J. Roger Hindley and Jonathan P. Seldin",
+  title = 	 "Introduction to Cobminators and $\lambda$-Calculus" ,
+  publisher = 	 "Cambridge University Press",
+  year = 	 1986,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  number = 	 1,
+  series = 	 "London Mathematical Society Student Texts",
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}	
+
+@ARTICLE{Hoare69,
+	AUTHOR = {C. A. R. Hoare},
+	TITLE = {An Axiomatic basis for Computer Programming },
+	JOURNAL = cacm,
+	YEAR = 1969,
+	VOLUME = {12},
+	PAGES = "576--580, 583",
+}
+@Article{Hoffmann:Odonnell:82,
+  author = 	 "Christoph M. Hoffmann and Michael J. O'Donnell",
+  title = 	 "Programming with Equations",
+  journal = 	 TOPLAS,
+  year = 	 1982,
+  OPTkey = 	 {},
+  volume = 	 4,
+  number = 	 1,
+  pages = 	 "1--20",
+  note = 	 {},
+}
+@InProceedings{Holst:91:PartialEvaluation,
+  author =       "C. K. Holst and Carsten K. Gomard",
+  title =        "Partial Evaluation is Fuller Laziness",
+  booktitle =    PEPM91,
+  year =         1991,
+  pages =        "223--233",
+  publisher =    ACM,
+  note =         "",
+}
+
+@InProceedings{Hook84,
+	Author = "James G. Hook",
+	Title = "Understanding {Russell}---A First Attempt",
+	BookTitle = "Semantics of Data Types, 
+		International Symposium, Sophia-Antipolis, France",
+	Year = 1984,
+	Editor = "G. Kahn and D.B. MacQueen and G. Plotkin",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Series = LNCS,
+	Volume = 173
+}
+@PhDThesis{Hook88,
+	Author = "Hook, James Garvin",
+	Title = "Abstract Types and Dependence in Programming Languages",
+	School = "Cornell University",
+	Address = "Ithaca",
+	Year = 1988,
+}
+
+@Book{Jensen&75,
+	Author = "K. Jensen and N. Wirth",
+	Title = "Pascal User Manual and Report",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Year = 1975
+}
+@InProceedings{Knoblock&86,
+	Author = "Todd B. Knoblock and Robert L. Constable",
+	Title = "Formalized Metareasoning in Type Theory",
+	BookTitle = "Proc. Symposium on 
+			Logic in Computer Science",
+	Publisher = "IEEE Computer Society Press",
+	Address = "Washington",
+	Year = 1986,
+	pages = "237--248"
+}
+@InCollection{Howard80,
+	Author = "W. A. Howard",
+	Title = "The Formulae-as-types Notion of Construction",
+	BookTitle = "To {H.~B. Curry}:  Essays on Combinatory Logic,
+		Lambda Calculus and Formalism",
+	Editor = "J. P. Seldin and J. Roger  Hindley",
+	Publisher = "Academic Press",
+	Address = "New York",
+	Year = 1980,
+	Note = "A version of this paper was privately circulated in 
+		1969."
+}
+
+@INPROCEEDINGS{Howe87,
+	AUTHOR = {Douglas J. Howe},
+	TITLE = {The Computational Behaviour of {Girard's} Paradox},
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = "205--221",
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+}
+@PHDTHESIS{Howe88,
+	AUTHOR = {Douglas J. Howe},
+	TITLE = {Automating Reasoning in an Implementation of
+		 Constructive Type Theory},
+	SCHOOL = {Cornell University},
+	YEAR = 1988,
+	ADDRESS = "Ithaca",
+}
+@InProceedings{ICFP::SabryW1996,
+  title =        "A Reflection on Call-by-Value",
+  author =       "Amr Sabry and Philip Wadler",
+  pages =        "13--24",
+  booktitle =    "Proc. International
+                 Conf. on Functional Programming",
+  year =         1996,
+  address =      "Philadelphia",
+  references =   "\cite{POPL::AriolaFMOW1995} \cite{POPL::HatcliffD1994}
+                 \cite{POPL::LawallD1993} \cite{LICS::Moggi1989}
+                 \cite{IC::Moggi1991} \cite{TCS::Plotkin1975}",
+}
+@Article{Hudak:92:Report,
+         author =       "Paul Hudak Simon {Peyton Jones} and
+		         Philip Wadler
+			 and Brian
+			 Boutel and John Fairbairn and Joseph Fasel 
+			 and Maria M. Guzman and Kevin Hammond 
+		         and John Hughes and Thomas Johnsson
+ 		         and Dick Kieburtz and Rishiyur Nikhil 
+			 and Will Partain and John Peterson",
+         title =        "Report on the programming language {Haskell}",
+         journal =      "SIGPLAN Notices",
+         volume =       "27",
+         number =       "5",
+         year =         1992,
+         pages =        "Section R",
+         note =         "",
+       }
+@unpublished{Huet86,
+        author = "G\'erard Huet",
+        title = "Formal Structures for Computation and Deduction",
+        note = "Notes prepared for a graduate-level course given in the Computer 
+	        Science Department of Carnegie Mellon University during the 
+		Spring of 1986.",
+        year = 1986
+}
+
+@Article{Landwehr&84,
+	Author = "Carl E. Landwehr and Constance L. Heitmeyer and John McLean",
+	Title = "A Security Model for Military Message Systems",
+	Journal = "ACM Transactions on Computer Systems",
+	Volume = 2,
+	Number = 3,
+	Year = 1984,
+	pages = "198--222"
+}
+@Book{Liskov&81,
+	Author = "B. Liskov and R. Atkinson and T. Bloom and 
+		E. Moss and J. C. Schaffert and R. Scheifler 
+		and A. Snyder",
+	Title = "CLU Reference Manual",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Series = LNCS,
+	Volume = 114,
+	Year = 1981
+}
+@unpublished{Huet87,
+        author = "G\'erard Huet",
+        title = "A Uniform Approach to Type Theory",
+        note = "Notes distributed at the University of Texas Institute
+               on Logical Foundations of Functional Programming.",
+        year = 1987
+}
+
+
+@MISC{Huet87pc,
+	AUTHOR = { G\'erard Huet},
+	YEAR = 1987,
+	NOTE = {Personal Communication.}
+}
+@InProceedings{MacQueen&84,
+	Author = "David B. MacQueen and Gordon Plotkin and Ravi Sethi",
+	Title = "An Ideal Model of Types",
+	BookTitle = POPL11,
+	Year = 1984
+}
+@Misc{MacQueen&86,
+	Author= "David B. MacQueen and Gordon Plotkin and Ravi Sethi",
+	Note = "Forthcomming"
+}
+@PhdThesis{JamesHook,
+  author = 	 "James Garvin Hook",
+  title = 	 "Type Dependencies and Programming Languages",
+  school = 	 "Cornell University",
+  year = 	 1988,
+  OPTkey = 	 {},
+  OPTaddress = 	 {},
+  OPTtype = 	 {},
+  note = 	 "(Chapter 2)[*]",
+}	
+@InProceedings{Joerring:86:Compilers,
+       author =       "U. J{\o}rring and W. L. Scherlis",
+       title =        "Compilers and Staging Transformations",
+       booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+       address = "St. Petersburg, Florida",
+       year =         1986,
+       pages =        "86--96",
+       publisher =    ACM,
+     }	
+@inproceedings{Johnsson_lambda_lift,
+        Author = {Thomas Johnsson},
+        Title = {Lambda lifting: transforming programs to recursive equations},
+        Booktitle = {Functional Programming Languages and Computer Architecture},
+        Editor = {J-P. Jouannaud},
+        Publisher = {Springer-Verlag},
+        Series = LNCS,
+        Volume = 201,
+        Year = 1985,
+        Pages = "190--203"
+}
+@InCollection{Jones:85:AnExperiment,
+  author = 	 "Neil D. Jones and Peter Sestoft and Harald Sondergraard",
+  title = 	 "An Experiment in Partial Evaluation:  The Generation
+		  of a Compiler Generator",
+  booktitle = 	 "Rewriting Techniques and Applications",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  publisher =    "Springer-Verlag",
+  year = 	 1985,
+  editor = 	 "Jean-Pierre Jouannaud",
+  volume = 	 "202",
+  OPTnumber = 	 {},
+  series = 	 LNCS,
+  OPTchapter = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  pages = 	 "124--140",
+  OPTnote = 	 {},
+}
+@Book{Jones:93:Partial,
+  author = 	 "Neil D. Jones and Carsten K. Gomard and Peter Sestoft",
+  title = 	 "Partial Evaluation and Automatic Program Generation",
+  publisher = 	 "Prentice-Hall",
+  year = 	 1993,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  note = 	 "",
+}
+
+@InProceedings{Jones:95:TenYears,
+  author = 	 "Neil D. Jones",
+  title = 	 "Mix Ten Years Later",
+  booktitle = 	 "Proc. {S}ymposium on
+                 {P}artial {E}valuation and {S}emantics-{B}ased {P}rogram
+                 {M}anipulation",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1995,
+  publisher =    ACM,
+  OPTaddress = 	 {},
+  pages = 	 "24--38",
+  OPTnote = 	 {},
+}
+
+@INPROCEEDINGS{Mendler&86,
+	AUTHOR = {N. P. Mendler and P. Pananganden and R. L. Constablee},
+	TITLE = {Infinite Objects in Type Theory},
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1986,
+	PAGES = "249--255",
+	PUBLISHER = {{IEEE} Computer Society press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held in Cambridge, Massachusetts.}
+}
+
+@InCollection{Jones:Sheeran,
+  author = 	 "Geraint Jones and Mary Sheeran",
+  title = 	 "Designing arithmetic circuits by refinement in Ruby",
+  booktitle = 	 "Mathematics of Program Construction",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  publisher =    "Springer Verlag",
+  year = 	 1993,
+  editor = 	 "R. S. Bird, C. C. Morgan and J. C. P. Woodcock",
+  volume = 	 "669",
+  OPTnumber = 	 {},
+  series = 	 LNCS,
+  OPTchapter = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+}
+
+@Article{Kamin:83,
+  author = 	 "Samuel Kamin",
+  title = 	 "Final Data Types and Their Specification",
+  journal = 	 TOPLAS,
+  year = 	 1983,
+  OPTkey = 	 {},
+  volume = 	 5,
+  number = 	 1,
+  pages = 	 "97--123",
+  note = 	 {},
+}
+
+@INPROCEEDINGS{Meyer&87,
+	AUTHOR = {Albert R. Meyer and John C. Mitchell and Eugenio
+		  Moggi and Richard Statman},
+	TITLE = {Empty Types in Polymorphic Lambda Calculus
+		 (Preliminary Report)}, 
+	BOOKTITLE = POPL14,
+	YEAR = 1987,
+	PAGES = "253--262",
+	ORGANIZATION = {ACM},
+	NOTE = {The Conf. was held in Munich, West Germany}
+}
+
+@InProceedings{Meyer&86,
+	Author = "Albert R. Meyer and Mark B. Reinhold",
+	Title = "`Type' Is Not a Type",
+	BookTitle = POPL13,
+	Year = 1986,
+	Organization = "Association for Computing Machinery, SIGACT, SIGPLAN"
+}
+
+@TechReport{Keppel:91:ACase,
+  author = 	 "David Keppel and Susan J. Eggers and Robert R. Henry",
+  title = 	 "A Case for Runtime Code Generation",
+  institution =  "University of Washington",
+  year = 	 1991,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "91-11-04",
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+}
+@InProceedings{Mitchell&M85,
+	Author = "John C. Mitchell and Albert R. Meyer",
+	Title = "Second-order logical relations (extended abstract)",
+	BookTitle = "Logics of Programs, Brooklyn",
+	Year = 1985,
+	Editor = "Rohit Parikh",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Series = LNCS,
+	Volume = 193
+}
+@InProceedings{Mitchell&85,
+	Author = "John C. Mitchell and Gordon Plotkin",
+	Title = "Abstract types have existential type",
+	BookTitle = POPL12,
+	Year = 1985,
+	Organization = "Association for Computing Machinery, SIGACT, SIGPLAN"
+}
+@Misc{Mitchell&pc86,
+	Author = "John C. Mitchell and Robert W. Harper",
+	Note = "Personal communication"
+}
+@InProceedings{Mitchell&88,
+	Author = "John C. Mitchell and Robert Harper",
+	Title = "The Essence of {ML}",
+	BookTitle = POPL15,
+	Year = 1988,
+	Pages = "28--46",
+	Organization = "Association for Computing Machinery, SIGACT, SIGPLAN"
+}
+
+
+@Misc{Kiczales:96:Open,
+  OPTkey = 	 {},
+  author = 	 "Gregor Kiczales and Andreas Paepcke",
+  title = 	 "Open Implementations and Metaobject Protocols",
+  OPThowpublished = {},
+  year = 	 1996,
+  note = 	 "Available at \cite{Kiczales:Page}",
+}
+@Misc{Kiczales:Page,
+  OPTkey = 	 {},
+  OPTauthor = 	 {},
+  title = 	 "Gregor {K}iczales' Home Page",
+  OPThowpublished = {},
+  OPTyear = 	 {},
+  note = 	 "\mc{http://www.parc.xerox.com/spl/members/gregor/}",
+}
+
+@techreport {Kieburtz93,
+	Author = "Richard Kieburtz",
+	Title = "Software Design for Reliability and Reuse---Preliminary Method Definition",
+	Institution = ogicse,
+	Number = "CSE-93-021",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1993
+}
+
+@unpublished {Kieburtz94,
+	Author = "Richard Kieburtz",
+	Title = "Generating Programs from Specifications",
+	Note = "",
+	Year = 1994
+}
+@book{milner&90,
+	author = "Robin Milner and Mads Tofte and Robert Harper",
+	title = "The Definition of Standard {ML}",
+	publisher = "{MIT} Press",
+	address = "Cambridge",
+	year = 1990
+}
+@misc{Kieburtz95,
+	author = "Richard B. Kieburtz",
+	title = "Software Design for Reliability and Reuse---{Method} Definition",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+@InProceedings{Moriconi&85,
+	Author = "Mark Moriconi and Dwight F. Hare",
+	Title = "The {PegaSys} System:  Using Pictures as Formal 
+		Documentation",
+	BookTitle = "Proceedings of Symposium on 
+		Language Issues in Programming Environments", 
+	Year = 1985,
+	Organization = "Association for Computing Machinery, SIGPLAN",
+	Address = "Seattle",
+	pages = "148--160"
+}
+@Article{Moriconi&85b,
+	Author = "Mark Moriconi and Dwight F. Hare",
+	Title = "Visualizing Program Designs Through {PegaSys}",
+	Journal = "IEEE Computer",
+	Volume = 18,
+	Number = 8,
+	Pages = "72--85",
+	Year = 1985
+}
+@misc{Kieburtz95b,
+	author = "Richard B. Kieburtz",
+	title = "Results of the SDRR Validation Experiment",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+@Article{Kieburtz:Silberschatz:83,
+  author = 	 "Richard B. Kieburtz and Abraham Silberschatz",
+  title = 	 "Access-Right Expressions",
+  journal = 	 TOPLAS,
+  year = 	 1983,
+  OPTkey = 	 {},
+  volume = 	 5,
+  number = 	 1,
+  pages = 	 "78--96",
+  note = 	 {},
+}
+@PHDTHESIS{Knoblock87,
+	AUTHOR = {Todd B. Knoblock},
+	TITLE = {Mathematical Extensibility in Type Theory, Correct
+		 Programs that Construct Proofs},
+	SCHOOL = {Cornell University},
+	YEAR = 1988,
+	ADDRESS = "Ithaca",
+}
+
+@INPROCEEDINGS{Korelski88,
+	AUTHOR = {Tanya Korelsky and others},
+	TITLE = {Ulysses: a computer-security modeling environment},
+	BOOKTITLE = {Proc. 11th National Computer Security Conf. },
+	YEAR = 1988,
+}
+@techreport {Kotov94,
+	Author = "Alexei Kotov",
+	Title = "Application of a New Software Metric in a Research Environment",
+	Institution = ogicse,
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+@misc{Kotov95,
+	author = "Alexei Kotov",
+	title = "Measurement Final Report",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+@TECHREPORT{Kreitz86,
+	AUTHOR = {Christoph Kreitz},
+	TITLE = {Constructive Automata Theory Implemented with the
+		 Nuprl Proof Development System},
+	INSTITUTION = cucs,
+	YEAR = 1986,
+	NUMBER = {86-779},
+	ADDRESS = "Ithaca",
+}
+@Article{Laeufer:Odersky,
+  author = 	 "Konstantin Laeufer and Martin Odersky",
+  title = 	 "Polymorphic Type Inference and Abstract",
+  journal = 	 "ACM Transaction of Programming Languages and Systems",
+}
+@TechReport{Platek&87,
+	Author = "Richard Platek and James Hook and 
+		  Tanya Korelsky and Daryl McCullough",
+	Title = "Ulysses:  A Computer Security Modelling Environment",
+	Institution = ORA,
+	Year = 1987,
+	Note = "Submitted to 1987 NBS Computer Security Conf.."
+}
+@ARTICLE{Lamport78,
+	AUTHOR = {Leslie Lamport},
+	TITLE = {Time, clocks and the ordering of events in a distributed system},
+	JOURNAL = cacm,
+	YEAR = 1978,
+	VOLUME = {21},
+	NUMBER = {7}
+}
+
+@ARTICLE{Landin66,
+	AUTHOR = {P. J. Landin},
+	TITLE = {The next 700 programming languages},
+	JOURNAL = cacm,
+	YEAR = 1966,
+	VOLUME = {9},
+	NUMBER = {3}
+}
+@misc{Launchbury95,
+	author = "John Launchbury",
+	title = "Phase II Technology Transition Plan",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+@PhdThesis{Launchbury:90:Thesis,
+  author = 	 "John Launchbury",
+  title = 	 "Projection Factorisations in Partial Evaluation",
+  school = 	 "University of Glasgow",
+  year = 	 1990,
+  OPTkey = 	 {},
+  address = 	 "Glasgow",
+  OPTtype = 	 {},
+  OPTnote = 	 "(Also published in Distinguished Disertations series)",
+}
+@misc{Pottinger&88,
+	author = "Garrel Pottinger and James Hook and Carl Eichenlaub and Carl Klapper",
+	title = "Ulysses: Theories",
+	year = 1988,
+	note = "Odyssey Research Associates internal report."
+}
+@InProceedings{Launchbury:95:WarmFusion,
+  author = 	 "John Launchbury and Tim Sheard",
+  title = 	 "Warm Fusion: Deriving Build-Catas from Recursive
+		  Definitions",
+  booktitle = 	 "Functional Programming Languages and Computer Architecture",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1995,
+  OPTorganization = {},
+  publisher =    ACM,
+  OPTaddress = 	 {},
+  pages = 	 "314--323",
+  OPTnote = 	 {},
+} 
+@Article{Lescanne:92,
+  author = 	 "Pierre Lescanne",
+  title = 	 "Well rewrite orderings and well quasi-orderings",
+  journal = 	 JSC,
+  year = 	 1992,
+  OPTkey = 	 {},
+  volume = 	 14,
+  number = 	 5,
+  pages = 	 "419--435",
+  note = 	 {},
+}
+@Article{Levy:86:AMeta,
+  author = 	 "Leon S. Levy",
+  title = 	 "A Meta-programming Method and Its Economic Justification",
+  journal = 	 TSE,
+  year = 	 1986,
+  OPTkey = 	 {},
+  volume = 	 12,
+  number = 	 2,
+  pages = 	 "272--277",
+  OPTnote = 	 {},
+}
+@techreport {Lewis94,
+	Author = "Jeffrey R. Lewis",
+	Title = "A Specification for an {MTV} Generator",
+	Institution = ogicse,
+	Number = "CSE-94-003",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+@unpublished{Lewis95a,
+	Author = "Jeffrey R. Lewis",
+	Title = "The {P}acSoft {SML} Library",
+	Year = 1995,
+	note = intooldocs
+}	
+@InProceedings{Reps&84,
+	Author = "Thomas Reps and Tim Teitelbaum",
+	Title = "The Synthesizer Generator",
+	BookTitle = "Proc.   
+		Software Engineering Symposium on Practical 
+		Software Development Environments",
+	Year = 1984,
+	Organization = "Association for Computing Machinery, SIGPLAN",
+	Address = "Baltimore",
+	pages = "42--48"
+}
+
+@misc{Lewis95b,
+	author = "Jeffrey R. Lewis",
+	title = "{ADL} Translator Tool Documentation",
+	year = 1995,
+	note = intooldocs
+}
+
+@InProceedings{Amphion,
+  author = 	 "Michael Lowry and Andrew Philpot and Thomas Pressburger and Ian Underwood",
+  title = 	 "Amphion:  Automatic Programming for Scientific 
+                  Subroutine Libraries",
+  booktitle = 	 "Proc. 8th Intl. Symp. on Methodologies for 
+                  Intelligent Systems",
+  year = 	 1994,
+  address = 	 "Charlotte",
+  pages = 	 "326--335",
+}
+
+@Article{Lowry:94:Amphion,
+  author = 	 "", 
+  title = 	 "{AMPHION}:  Automatic Programming for Scientific Subroutine Libraries",
+  journal = 	 "{NASA} Science Information Systems Newsletter",
+  year = 	 1994,
+  OPTkey = 	 {},
+  volume = 	 31,
+  OPTnumber = 	 {},
+  pages = 	 "22--25",
+  OPTnote = 	 "Available at \cite{Amphion:Page}",
+}
+
+@Book{MacLennan87,
+  author = 	 "Bruce J. MacLennan",
+  title = 	 "Principles of Programming Languages:  Design,
+		  Evaluation, and Implementation",
+  publisher = 	 "Holt, Rinehart and Winston",
+  year = 	 1987,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  edition = 	 "Second",
+  OPTnote = 	 {},
+}
+@inproceedings{Sannella&83,
+	author = "D. T. Sannella and R. M. Burstall",
+	title = "Structured theories in {LCF}",
+	booktitle = "Proc. 8th Colloquium on Algebra and
+			Trees in Programming",
+	pages = "377--391",
+	address = "L'Aquila",
+	year = 1983
+}
+@inproceedings{Sannella&83,
+	author = "D. T. Sannella and R. M. Burstall",
+	title = "Structured theories in {LCF}",
+	booktitle = "Proc. 8th Colloquium on Algebra and
+			Trees in Programming",
+	pages = "377--391",
+	address = "L'Aquila",
+	year = 1983
+}
+@inproceedings{Sannella&85,
+	author = "Donald Sannella and Andrzej Tarlecki",
+	Title = "Program specification and development in standard {ML}",
+	Booktitle = POPL12,
+	pages = "67--77",
+	year = 1985,
+	organization = {ACM},
+}
+@inproceedings{Sannella&86,
+	author = "Donald Sannella and Andrzej Tarlecki",
+	Title = "Extended {ML}:  an institution-indepdendent framework for formal program development",
+	Booktitle = "Category Theory and Computer Programming Tutorial and Workshop",
+	pages = "364--389",
+	year = 1986,
+	Editor = "David Pitt and Samson Abramsky and Axel Poign\'e and David Rydeheard",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Series = LNCS,
+	Volume = 240,
+	Note = "Meeting was held in September 1985 in Guildford, UK."
+}
+@InProceedings{MacQueen86,
+	Author = "David B. MacQueen",
+	Title = "Using Dependent Types to Express Modular Structure",
+	BookTitle = POPL13,
+	Year = 1986,
+	Pages = "277--286"
+}
+@InProceedings{Maeda92,
+       author =       "Munenori Maeda",
+       title =        "Implementing a Process Oriented Debugger with
+                      Reflection and Program Transformation",
+       pages =        "961--968",
+       crossref =     "FGCS92",
+     }
+
+
+@TechReport{Maes87,
+       author =       "Pattie Maes",
+       title =        "Computational Reflection",
+       institution =  "Vrije Universiteit Br{\"u}ssel",
+       address =      "Br{\"u}ssel",
+       number =       "87-2",
+       keywords =     "Meta-Knowledge, Object-Oriented Language, Programming
+                      Language, Reflection, Refletive Architecture,
+                      Self-Reference",
+       year =         1987,
+     }
+
+@InProceedings{Maes87b,
+       author =       "Patti Maes",
+       title =        "Concepts and Experiments in Computational Reflection",
+       booktitle =    "OOPSLA-87Proceedings",
+       address =      "Florida",
+       keywords =     "LISP",
+       year =         1987,
+     }
+
+@InProceedings{Malmkjaer:90:OnSomeSemanticIssues,
+       semno =        "D-63",
+       author =       "Karoline Malmkj{\ae}r",
+       title =        "On Some Semantic Issues in the Reflective Tower",
+       booktitle =    "Mathematical Foundations of Programming Semantics.
+                      (Lecture Notes in Computer Science, vol. 442)",
+       year =         1989,
+       editor =       "M. Main and A. Melton and M. Mislove and D. Schmidt",
+       pages =        "229--246",
+       keywords =     "reflection, semantics, reification",
+     }
+@InProceedings{Malmkjaer:93:TowardsEfficient,
+  author =       "K. Malmkj{\ae}r",
+  title =        "Towards Efficient Partial Evaluation",
+  booktitle =    PEPM93,
+  year =         1993,
+  pages =        "33--43",
+  publisher =    ACM,
+  note =         "",
+}
+@InProceedings{Malmkjaer:95:Polyvariant,
+  author = 	 "Karoline Malmkjaer and Peter Orbaek",
+  title = 	 "Polyvariant Specialisation for Higher-Order,
+		  Block-Structured Languages",
+  booktitle = 	 "Proc. {S}ymposium on
+                 {P}artial {E}valuation and {S}emantics-{b}ased {P}rogram
+                 {M}anipulation",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1994,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTaddress = 	 {},
+  pages = 	 "66--76",
+  OPTnote = 	 {},
+}
+@Unpublished{Martin-Lof71,
+	Author = "Per {Martin-L\"of}",
+	Title = "A Theory of Types",
+	Note = "Mimeographed manuscript.",
+	Year = 1971
+}
+@Unpublished{Martin-Lof72,
+	Author = "Per {Martin-L\"of}",
+	Title = "An Intuitionistic Theory of Types",
+	Note = "Mimeographed manuscript. This is an unpublished
+		version of {\cite{Martin-Lof75}}.  It contains a
+		presentation of Girard's paradox that does not
+		appear in the final version.",
+	Year = 1972
+}
+@InCollection{Martin-Lof75,
+	Author = "Per {Martin-L\"of}",
+	title = "An Intuitionistic Theory of Types: Predicative Part",
+	BookTitle = "Logic Colloquium '73",
+	Editor = "H. E. Rose and J. C. Shepherdson",
+	Pages = "73--118",
+	Publisher = "North Holland",
+	year = 1975
+}
+@InProceedings{Martin-Lof82,
+	Author = "Per {Martin-L\"of}",
+	title = "Constructive Mathematics and Computer Programming",
+	BookTitle = "Sixth International Congress for Logic, Methodology,
+		and Philosophy of Science",
+	Pages = "153--175",
+	Publisher = "North Holland",
+	year = 1982
+}
+@BOOK{Whitehead&25,
+	AUTHOR = {Alfred North Whitehead and Bertrand Russell },
+	TITLE = {Principia mathematica},
+	PUBLISHER = {Cambridge University Press},
+	YEAR = 1925,
+	VOLUME = {1},
+	ADDRESS = "Cambridge",
+	EDITION = "Second"
+}
+
+@PHDTHESIS{Matthews83,
+	AUTHOR = {David Charles James Matthews},
+	TITLE = {Programming Language Design with Polymorphism},
+	SCHOOL = {University of Cambridge},
+	YEAR = 1983,
+	NOTE = "This dissertation is availiable as technical report
+		number 49 from the University of Cambridge computer
+		laboratory, Corn Exchange Street, Cambridge CB2 3QG,
+		UK."
+}
+
+@TECHREPORT{Matthews85,
+	AUTHOR = {David C. J. Matthews},
+	TITLE = {{POLY} Manual},
+	INSTITUTION = {University of Cambridge Computer Laboratory},
+	YEAR = 1985,
+	NUMBER = {63},
+	ADDRESS = "Cambridge",
+}
+
+@InProceedings{Mauny:92:ParsersInML,
+  author =       "Michel Mauny and Daniel de Rauglaudre",
+  title =        "",
+  booktitle =    LFP,
+  publisher =    ACM,
+  year =         1992,
+  pages =        "76--85",
+  note =         "",
+}
+
+@Article{Freese:Jezek:Nation:93,
+  author = 	 "Ralph Freese, J. Jezek and J. B. Nation",
+  title = 	 "Term Rewrite Systems for Lattice Theory",
+  journal = 	 JSC,
+  year = 	 1993,
+  OPTkey = 	 {},
+  volume = 	 16,
+  number = 	 3,
+  pages = 	 "279--288",
+  note = 	 {},
+}
+
+		  
+@PHDTHESIS{McCracken79,
+	AUTHOR = {Nancy Jean McCracken},
+	TITLE = {An investigation of a programming language with a
+		 polymorphic type structure},
+	SCHOOL = {Syracuse University},
+	YEAR = 1979
+}
+
+@Article{McGraw:82,
+  author = 	 "James R. McGraw",
+  title = 	 "The VAL Language:  Description and Analysis",
+  journal = 	 TOPLAS,
+  year = 	 1982,
+  OPTkey = 	 {},
+  volume = 	 4,
+  number = 	 1,
+  pages = 	 "1--20",
+  note = 	 {},
+}
+
+@misc{McKinney95,
+	author = "Laura McKinney",
+	title = "Tool Survey",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+
+@Misc{Church:35:Unsolvable,
+  OPTkey = 	 {},
+  author = 	 "Alonzo Church",
+  title = 	 "An Unsolvable Problem of Elementry Number Theory",
+  howpublished = "Presented to the American Mathematical Society,
+		  April 9, 1935",
+  year = 	 1935,
+  note = 	 "Available in \cite{Davis:65:Undecidable}",
+  OPTannote = 	 {}
+}
+
+@INPROCEEDINGS{Mendler87,
+	AUTHOR = {N. P. Mendler},
+	TITLE = {Recursive Types and Type Constraints in Second-Order
+		 Lambda Calculus},
+	BOOKTITLE = {Proceedings Symposium on Logic in Computer Science},
+	YEAR = 1987,
+	PAGES = "30--36",
+	PUBLISHER = {{IEEE} Computer Society Press},
+	ADDRESS = "Washington",
+	NOTE = {The Conf. was held at Cornell University, Ithaca,
+		New York.}
+}
+
+@PHDTHESIS{Mendler88,
+	AUTHOR = {Paul Francis Mendler},
+	TITLE = {Inductive Definition in Type Theory},
+	SCHOOL = {Cornell University},
+	YEAR = 1988,
+	ADDRESS = "Ithaca",
+	NOTE = {This thesis is available as Cornell University
+		computer science department technical report number
+		87-870 (September 1987).  Paul Francis Mendler prefers
+		the name ``Nax'' and generally uses the initials ``N. P.''}
+}
+
+
+@Article{Mitchell&88,
+	Author = "John C. Mitchell and Gordon Plotkin",
+	Title = "Abstract Types Have Existential Type",
+	Journal = toplas,
+	Year = 1988,
+	volume = 10,
+	number = 3,
+	pages = "470--502",
+        contribution = "
+		  
+		  The observation that data abstract types (or, more
+		  precisely, their ``data algebras'')  have existential
+		  types. \\
+		  
+		  "
+}		  
+		  
+@Article{Metayer:88,
+  author = 	 "Daniel Le Metayer",
+  title = 	 "ACE:  An Automatic Complexity Evaluator",
+  journal = 	 TOPLAS,
+  year = 	 1988,
+  OPTkey = 	 {},
+  volume = 	 10,
+  number = 	 2,
+  pages = 	 "248--266",
+  note = 	 {},
+}
+@Article{Middeldorp:Toyama:93,
+  author = 	 "Aart Middeldorp and Yoshihito Toyama",
+  title = 	 "Completeness of Combinations of Constructor Systems",
+  journal = 	 JSC,
+  year = 	 1993,
+  OPTkey = 	 {},
+  volume = 	 15,
+  number = 	 3,
+  pages = 	 "331--348",
+  note = 	 {},
+}
+
+@TECHREPORT{Milner72a,
+	AUTHOR = {Robin Milner},
+	TITLE = {Logic for Computable Functions:  description of a
+		 machine implementation},
+	INSTITUTION = {Stanford University},
+	YEAR = 1972,
+	TYPE = {Memo},
+	NUMBER = {AIM-169}
+}
+@INPROCEEDINGS{Milner72b,
+	AUTHOR = {Robin Milner},
+	TITLE = {Implementation and application of {Scott's} logic for
+		 computable functions},
+	BOOKTITLE = {Proceedings {ACM} Conf. on Proving
+		     Assertions about Programs},
+	YEAR = 1972,
+	ORGANIZATION = {SIGPLAN},
+	PUBLISHER = {ACM},
+	NOTE = {SIGPLAN notices 7,1}
+}
+@Article{Milner78,
+	Author = "Robin Milner",
+	Title = "A Theory of Type Polymorphism in Programming",
+	Journal = jcss,
+	Volume = 17,
+	Pages = "348--375",
+	Year = 1978
+}
+@TechReport{Milner84,
+	Author ="Robin Milner",
+	Title = "{S}tandard {ML} Report",
+	Institution = "University of Edinburgh, Department of Computer Science",
+	Year = 1984
+}
+
+@Book{Milner:90:TheDefinition,
+  author = 	 "Robin Milner and Mads Tofte and Robert Harper",
+  title = 	 "The Definition of {Standard ML}",
+  publisher = 	 "MIT Press",
+  year = 	 1990,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+@Article{Mitchell-ATHET,
+  author = 	 {John C. Mitchell and Gordon D. Plotkin},
+  title = 	 {Abstract Types Have Existential Type},
+  journal = 	 {TOPLAS},
+  year = 	 1988,
+  volume =	 {10(3)},
+  pages =	 "470--502",
+}
+
+@InProceedings{Mitchell86,
+	Author = "John C. Mitchell",
+	Title = "Representation Independence",
+	BookTitle = POPL13,
+	Year = 1986,
+	Organization = "Association for Computing Machinery, SIGACT, SIGPLAN",
+}
+@Article{Mitchell:88,
+        Author = "John C. Mitchell and Gordon D. Plotkin",
+        Title = "Abstract Types Have Existential Type",
+        Journal = toplas,
+        Year = 1988,
+        volume = 10,
+        number = 3,
+        pages = "470--502"
+}
+@InProceedings{Mogensen:89:BindingTimeAnalysis,
+  author =       "T. Mogensen",
+  title =        "Binding Time Analysis for Polymorphically Typed Higher
+                 Order Languages",
+  booktitle =    "TAPSOFT '89. Proc. International Conf. Theory and Practice of
+                 Software Development, Barcelona, Spain, March 1989
+                 (Lecture Notes in Computer Science, vol. 352)",
+  editor =       "J. Diaz and F. Orejas",
+  publisher =    S-V,
+  pages =        "298--312",
+  year =         1989,
+  note =         "",
+}
+@Unpublished{Moriconi85,
+	Author = "Mark Moriconi",
+	Title = "Formal Documentation and Analysis of Dependencies in 
+		Large Programs",
+	Note = "Submitted for publication.",
+	Year = 1985
+}
+@Article{Nielson:85,
+  author = 	 "Flemming Nielson",
+  title = 	 "Program Transformations in a Denotational Setting",
+  journal = 	 TOPLAS,
+  year = 	 1985,
+  OPTkey = 	 {},
+  volume = 	 7,
+  number = 	 3,
+  pages = 	 "359--379",
+  note = 	 {},
+}
+
+@TechReport{ORAAda,
+	Author = "Staff",
+	Title = "Formal Verification of {Ada} Programs for Mission Critical
+		{SDI} Software",
+	Institution = ORA,
+	Year = 1986,
+	Number = "ORA PR 8502-1",
+	Note = "Revised version"
+}
+@Unpublished{Odersky:Laeufer,
+  author = 	 "Martin Odersky and Konstantin Laeufer",
+  title = 	 "Putting Type Annotations To Work",
+  note = 	 "(Preliminary)",
+  OPTkey = 	 {},
+  OPTyear = 	 {},
+}
+@misc{Oliva95a,
+	author = "Dino P. Oliva",
+	title = "Program Instantiator Tool Documentation",
+	year = 1995,
+	note = intooldocs
+}
+@misc{Oliva95b,
+	author = "Dino P. Oliva",
+	title = "Program Instantiator Templates Documentation",
+	year = 1995,
+	note = intooldocs
+}
+@misc{Oliva95c,
+	author = "Dino P. Oliva",
+	title = "Baseline Performance Measurements for Unoptimized Generated Code",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+@Article{Oliva:96:Generating,
+  author = 	 "D.P. Oliva  and A.P. Tolmach",
+  title = 	 "Generating Typed Imperative Language Components from
+		  Functional Code",
+  year = 	 1196,
+  OPTkey = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+}
+@TechReport{PWMNIPKRHCmar92,
+       author =       "Peter W. Madany and Nayeem Islam and Panos Kougiouris
+                      and Roy H. Campbell",
+       title =        "Reification and Reflection in {C}++: an operating
+                      systems perspective",
+       institution =  "University of Illinois",
+       address =      "Department of Computer Science, Urbana-Champaign, 
+                       IL, USA",
+       number =       "{UIUCDCS--R--92--1736}",
+       year =         1992,
+       abstract =     "The paper discusses using reification (the
+                      representation of an attribute of an object-oriented
+                      program such as method dispatch, inheritance, or object
+                      structure within the program) and reflection (the
+                      ability to make attributes like method invocation,
+                      interface, inheritance, object implementation the
+                      subject of computation) in Choices. Reification is
+                      used, for example, to modify the behaviour of pointers
+                      so reference-counting can be done safely. The system
+                      includes inheritance and classes as run-time entities,
+                      allowing dynamic extension of the system functions.",
+       keyword =      "Choices, garbage collection, object-oriented
+                      programming, inheritance, class structure, run-time
+                      extension",
+     }
+@misc{PacSoft93a,
+	Author = "Pacific Software Research Center",
+	Title = "Measurement Plan for the {OGI} {SDRR} Technology Development 
+	and Validation Program",
+	Year = 1993
+}
+
+@misc{PacSoft93b,
+	Author = "Pacific Software Research Center",
+	Title = "Management Plan for the {OGI} {SDRR} Technology Development 
+	and Validation Program",
+	Year = 1993
+}
+@misc{PacSoft93c,
+	Author = "Pacific Software Research Center",
+	Title = "Technical Plan for the {OGI} {SDRR} Technology Development 
+	and Validation Program",
+	Year = 1993
+}
+@misc{PacSoft93d,
+	Author = "Pacific Software Research Center",
+	Title = "Technology Transition Plan for the {OGI} {SDRR} Technology Development 
+	and Validation Program",
+	Year = 1993
+}
+@misc{PacSoft94,
+	Author = "Pacific Software Research Center",
+	Title = "Software Design for Reliability and Reuse---Phase II Project Proposal",
+	Year = 1994
+}
+
+		  
+@Misc{CardelliPhase,
+  author =       "L. Cardelli",
+  title =        "Phase Distinctions in Type Theory",
+  howpublished = "(Unpublished manuscript.)  Available online
+                  from \fr{http://www.luca.demon.co.uk/Bibliography.html}",
+  year =         1988,
+}
+
+@misc{PacSoft95,
+	Author = "Pacific Software Research Center",
+	Title = "{SDRR} Project {Phase I} Final Scientific and Technical Report",
+	Year = 1995
+}
+
+
+@Article{ParlamentoP:JAR91,
+       author =       "Franco Parlamento and Alberto Policriti",
+       title =        "Decision Procedures for Elementary Sublanguages of Set
+                      Theory:{XIII. M}odel Graphs, Reflection and
+                      Decidability",
+       journal =      JAR,
+       volume =       "7",
+       number =       "2",
+       year =         1991,
+       pages =        "271--284",
+     }
+
+
+@INPROCEEDINGS{Paulin-Mohring89,
+	AUTHOR = {Christine Paulin-Mohring},
+	TITLE = {Extracting {$F_\omega$}'s Programs from Proofs
+		in the Calculus of Constructions},
+	BOOKTITLE = POPL16,
+	YEAR = 1989,
+	PAGES = "89--104",
+	ORGANIZATION = {ACM},
+}
+
+@Article{Paulson86,
+	Author = "Lawrence C. Paulson",
+	Title = "Natural Deduction as Higer-order Resolution",
+	Journal = "The Journal of Logic Programming",
+	Volume = 3,
+	Pages = "237--258",
+	Year = 1986
+}
+		  
+@Article{Paulson89,
+	Author = "Lawrence C. Paulson",
+	Title = "The foundation of a generic theorem prover",
+	Journal = "The Journal of Automated Reasoning",
+	Volume = 5,
+	Pages = "363--397",
+	Year = 1989
+}
+
+		  
+		  
+		  
+		  
+		  
+@TechReport{PegaSys,
+	Author = "Mark Moriconi and Dwight F. Hare",
+	Title = "The {PegaSys} System: Three Papers",
+	Institution = SRICSL,
+	Year = 1985,
+	Number = 145,
+	Address = "Menlo Park",
+	Note = "This is a collection of three papers:  revised versions of 
+		{\cite{Moriconi&85}} and {\cite{Moriconi&85b}} and a complete
+		version of {\cite{Moriconi85}}."
+}
+
+@Unpublished{PfenningLee89,
+       author =       "Pfenning Frank and Peter Lee",
+       title =        "Reflection in the polymorphic lambda-calculus",
+       note =         "manuscript",
+       year =         1989,
+     }
+
+
+		  
+		  This is basically the bibliography I prepared for the rpe paper.
+		  
+		  
+@InCollection{Phillips:92:Recursion,
+  author = 	 "I. C. C. Phillips",
+  title = 	 "Recursion Theory",
+  booktitle = 	 "Handbook of Logic in Computer Science",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  publisher =    "Oxford University Press",
+  year = 	 1992,
+  editor = 	 "S. Abramsky and Dov M. Gabbay and T. S. E. Maibaum",
+  volume = 	 1,
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTchapter = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  pages = 	 "83, 133--135",
+  OPTnote = 	 {},
+}
+@techreport{Plinta89,
+    	    Author = "Plinta, Charles and Lee, Kenneth and Rissman, Michael",
+    	    Title = "A Model Solution for {C$^{3}$I} Message Translation and
+Validation", 
+    	    Institution= "Software Engineering Institute, Carnegie Mellon
+University", 
+    	    Year = 1989,
+    	    Note= "CMU/SEI-89-TR-12 ESD-89-TR-20"
+}
+
+@Misc{Plotkin-personal,
+	Author ="Plotkin, Gordon D.",
+	Note = "Personal Communication"
+}
+
+
+@Unpublished{Plotkin78,
+	Author ="Gordon D. Plotkin",
+	Title = "Domain Theory",
+	Note = "Pisa Sumer school lecture notes", 
+	Year = 1978
+}
+
+@TechReport{Plotkin81,
+	Author ="Gordon D. Plotkin",
+	Title = "A Structural Approach to Operational Semantics",
+	Institution = "Computer Science Department, Aarhus University",
+	Year = 1981
+}
+
+@TechReport{Plotkin82,
+	Author ="Gordon D. Plotkin",
+	Title = "An Operational Semantics for {CSP}",
+	Institution = "University of Edinburgh, Department of Computer Science",
+	Year = 1982
+}
+@techreport{Bell&94a,
+	Author = "Jeffrey M. Bell and James  Hook",
+	Title = "Defunctionalization of Typed Programs",
+	year = 1994,
+	institution = ogicse,
+	number = "CSE-94-025"
+}
+@inproceedings{Bell&94b,
+	author = "Jeffrey Bell and others",
+	title = "Software Design for Reliability and Reuse: 
+		A proof-of-concept demonstration",
+	booktitle = "{TRI-Ada} '94 Proceedings",
+	Publisher = ACM,
+	year = 1994,
+	pages = "396--404"
+}
+@techreport{Pottinger87,
+       author = "Garrel Pottinger",
+       title = "Strong Normalization for Terms of the Theory of
+                Constructions",
+       institution = "Odyssey Research Associates",
+       number = "TR 11-7",
+       year = 1987
+}
+@techreport{Pottinger88a,
+       author = "Garrel Pottinger",
+       title = "Ulysses:  Logical Foundations of the Definition Facility",
+       institution = "Odyssey Research Associates",
+       number = "TR 11-9",
+       year = 1988
+}
+@techreport{Pottinger88b,
+       author = "Garrel Pottinger",
+       title = "Ulysses:  Logical and Computational Foundations of the
+               Primitive Inference Engine",
+       institution = "Odyssey Research Associates",
+       number = "TR 11-8",
+       year = 1988
+}
+@misc{Pottinger88c,
+	author = "Garrel Pottinger",
+	title = "Meta-{TOC}",
+	year = 1988,
+	note = "Odyssey Research Associates internal report, in preparation."
+}
+@book{Prawitz65,
+       author = "Dag Prawitz",
+       title = "Natural Deduction",
+       publisher = "Almqvist $\&$ Wiksell",
+       address = "Stockholm, {G\"{o}teborg}, and Uppsala",
+       year = 1965
+}
+@inproceedings{Bellegarde&93,
+	author = "Fran\c{c}oise Bellegarde and James Hook",
+	title = "Monads, Indexes, and Transformations",
+	date = Apr,
+	year = 1993,
+	Booktitle = "{TAPSOFT} '93:  Theory and Practice of Software
+		Development", 
+	publisher = "Springer-Verlag",
+	series = LNCS,
+	volume = 668,
+	pages = "314--327"
+}
+@inproceedings{Prawitz71,
+       Author = "Dag Prawitz",
+       Title = "Ideas and Results in Proof Theory",
+       Booktitle = "Proc. Second Scandinavian Logic Symposium",
+       editor = "{J. E.} Fenstad",
+       year = 1971,
+       publisher = "North-Holland",
+       address = "Amsterdam",
+       pages = "235--307"
+}
+@InCollection{Pressburger:96:Amphion,
+  author = 	 "Thomas Pressburger and Michael Lowry",
+  title = 	 "Automating Software Reuse with Amphion",
+  booktitle = 	 "NASA Workshop on Software Reuse",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpublisher = {},
+  year = 	 1996,
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTchapter = 	 {},
+  OPTtype = 	 {},
+  address = 	 "Fairfax",
+  OPTedition = 	 {},
+  OPTpages = 	 {},
+  note = 	 "Available at \cite{Amphion:Page}",
+}
+@InProceedings{Pu:95:Optimistic,
+  author = 	 "Calton Pu and Tito Autrey and Andrew Black and 
+		  Charles Consel and Crispin Cowan and
+		  Jon Inouye and Lakshmi Kethana and 
+		  Jonathan Walpole and and Ke Zhang",
+  title = 	 "Optimistic Incremental Specialization:
+		  Streamlining a Commercial Operating System",
+  booktitle = 	 "ACM Symposium on Operating Systems Principles (SOSP'95)",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1995,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTaddress = 	 {},
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+}
+@Article{Puel:Suarez:93,
+  author = 	 "Laurence Puel and Ascander Suarez",
+  title = 	 "Compiling Pattern Matching by Term Decomposition",
+  journal = 	 JSC,
+  year = 	 {},
+  OPTkey = 	 {},
+  volume = 	 15,
+  number = 	 1,
+  pages = 	 "1--26",
+  note = 	 {},
+}
+@InProceedings{Queinnec:Cointe:acm:lfp:1988,
+       author =       "Christian Queinnec and Pierre Cointe",
+       title =        "An Open Ended Data Representation Model for {\sc
+                      Eu\_Lisp}",
+       email =        "{queinnec,cointe}@inria.inria.fr",
+       crossref =     "acm:lfp:1988",
+       pages =        "298--308",
+       refs =         "18",
+       checked =      "19940504",
+       source =       "dept. library",
+       keywords =     "reflection, metatype, EuLisp",
+       abstract =     "The goal of this paper is to describe an open-ended
+                      type system for Lisp with explicit and full control of
+                      bit-level data representations. This description uses a
+                      reflective architecture based on a metatype facility.
+                      This low-level formalism solves the problem of an
+                      harmonious design of a class taxonomy inside a type
+                      system. A prototype for this framework has been written
+                      in Le-Lisp and is used to built the integrated type and
+                      object systems of the {\sc Eu\_Lisp} proposal.",
+     }
+@InProceedings{Ramsey89,
+	Author = "Norman Ramsey",
+	Title = "Developing fromally verified {Ada} programs",
+	BookTitle = "Proc. fifth International 
+		Conf. on Software Specificationand Design",
+	Year = 1989
+}
+@TechReport{Rees:91:Scheme,
+       title =        "$\mbox{Revised}^4$ Report on the Algorithmic
+                      Language {S}cheme",
+       year =         1992,
+       number =       "AI Memo 848b",
+       pages =        "69",
+       editor =       "Jonathan Rees and William Clinger",
+       author =       "Jonathan Rees and William Clinger and H.
+                      Abelson and N. I. {Adams IV} and D. Bartley and G. Brooks
+                      and R. K. Dybvig and D. P. Friedman and R. Halstead and
+                      C. Hanson and C. T. Haynes and E. Kohlbecker and D.
+                      Oxley and K. M. Pitman and G. J. Rozas and G. J.
+                      Sussman and M. Wand",
+       institution =  MIT,
+     }
+
+@Book{Shalit97,
+  key =          "Shalit",
+  title =        "The {Dylan} Reference Manual: The Definitive Guide to
+                 the New Object-Oriented Dynamic Language",
+  author =       "Andrew Shalit",
+  publisher =    "Addison-Wesley",
+  address =      "Reading, Mass.",
+  year =         "1997",
+}
+
+@Article{Dybvig:1992:SAS,
+  author =       "R. Kent Dybvig and Robert Hieb and Carl Bruggeman",
+  title =        "Syntactic Abstraction in {Scheme}",
+  journal =      "Lisp and Symbolic Computation",
+  volume =       "5",
+  number =       "4",
+  pages =        "295--326",
+  month =        dec,
+  year =         "1992",
+  coden =        "LSCOEX",
+  ISSN =         "0892-4635",
+  bibdate =      "Fri Feb 12 08:11:22 MST 1999",
+  acknowledgement = ack-nhfb,
+  journalabr =   "LISP Symb Comput",
+}
+@Article{Dybvig:2000:MSA,
+  author =       "R. Kent Dybvig",
+  title =        "From Macrogeneration to Syntactic Abstraction",
+  journal =      "Higher-Order and Symbolic Computation",
+  volume =       "13",
+  number =       "1--2",
+  pages =        "57--63",
+  month =        apr,
+  year =         "2000",
+  coden =        "LSCOEX",
+  ISSN =         "1388-3690",
+  bibdate =      "Tue Oct 10 07:41:47 MDT 2000",
+  url =          "http://www.wkap.nl/oasis.htm/258015",
+  acknowledgement = ack-nhfb,
+}
+
+@article{Bellegarde&94,
+	author = "Fran\c{c}oise Bellegarde and James Hook",
+	title = "Substitution:  A formal methods case study using 
+		monads and transformations",
+	journal = "Science of Computer Programming",
+	volume = "23",
+	number = "2--3",
+	pages = "287--311",
+	year = 1994
+}
+@Book{Reps84,
+	Author = "Thomas Reps",
+	Title = "Generating language-based environments",
+	Year = 1984,
+	Publisher = "MIT Press",
+	Address = "Cambridge"
+}
+
+@Unpublished{Machkasova99,
+  author = 	 "Elena Machkasova and Franklyn A. Turbak",
+  title = 	 "A Calculus for Link-time Compilation (Extended Abstract)",
+  note = 	 "(Unpublished manuscript.)  
+                  By way of Franklyn A. Turbak 
+                  (\fr{fturbak@wellesley.edu})",
+  OPTkey = 	 {},
+  year = 	 1999,
+  OPTannote = 	 {}
+}
+
+@Article{Reynolds:HOSC98,                         
+  author =      "John C. Reynolds",               
+  title =       "Definitional Interpreters for Higher-Order
+                 Programming Languages",          
+  journal =     "Higher-Order and Symbolic Computation",
+  year =        1998,                             
+  volume =      11,                               
+  number =      4,                                
+  OPTpages =    "7-105",                          
+  note ="(Reprinted from the Proc. 25th {ACM}
+ National Conf. (1972) \cite{Reynolds72})"                      
+}                                                 
+@inproceedings{Reynolds72,
+	author = "John C. Reynolds",
+	title = "Definitional Interpreters for higher-order programming languages",
+	booktitle = "ACM National Conf.",
+	pages = "717--740",
+	publisher = "{ACM}",
+	year = 1972
+}
+@inproceedings {Fegaras&94,
+	Author = "Leonidas Fegaras and Tim Sheard and Tong Zhou",
+	Title = "Improving Programs which Recurse over Multiple Inductive Structures",
+	Booktitle = "Proceedings from Workshop on Partial Evaluation and Semantics-Based Program Manipulation",
+	Year = 1994
+}
+@techreport {Hook&93,
+	Author = "James Hook and Tim Sheard",
+	Title = "A Semantics of Compile-time Reflection",
+	Institution = ogicse,
+	Number = "CSE-93-019",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1993
+}
+@misc{Hook&95,
+	author = "James Hook and Jeffrey M. Bell",
+	title = "Design of the SDRR Pipeline",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+@INCOLLECTION{Reynolds74,
+	AUTHOR = {John C. Reynolds},
+	TITLE = {Towards a theory of types structure},
+	BOOKTITLE = {Proceedings Colloque sur la Programmation},
+	PUBLISHER = {Springer-Verlag},
+	YEAR = 1974,
+	PAGES = "408--423",
+	ADDRESS = "New York"
+}
+@INCOLLECTION{Reynolds83,
+	AUTHOR = {John C. Reynolds},
+	TITLE = {Types, Abstraction and Parametric Polymorphism},
+	BOOKTITLE = {Information Processing 83},
+	PUBLISHER = {North-Holland},
+	YEAR = 1983,
+	PAGES = "513--523",
+	ADDRESS = "Amsterdam"
+}
+@unpublished {Kieburtz&93a,
+	Author = "Richard Kieburtz and Jeffrey R. Lewis",
+	Title = "Programming with Algebras",
+	Note = "",
+	Year = 1993
+}
+@InCollection{Rivieres88,
+       author =       "Jim des Rivieres",
+       title =        "Control-Related Meta-Level Facilities in {LISP}",
+       booktitle =    "Meta-Level Architectures and Reflection",
+       pages =        "101--110",
+       editor =       "Patti Maes and D. Nardi",
+       publisher =    "Elsevier Science",
+       address =      "North-Holland",
+       keywords =     "LISP",
+       year =         1988,
+     }
+@techreport {Kieburtz&94a,
+	Author = "Richard Kieburtz and Jeffrey R. Lewis",
+	Title = "Algebraic Design Language",
+	Institution=ogicse,
+	Year = 1994,
+  note  =        "Available from \cite{ogi-tr-site}",
+	Number = "CSE-94-002"
+}
+@techreport{Kieburtz&94b,
+	Title = {Calculating Software Generators from Solution Specifications},
+	Author = {Richard B. Kieburtz and Fran\c{c}oise Bellegarde and Jef Bell \
+		and James Hook and Jeffrey Lewis and Dina Oliva and Tim Sheard\
+		and Lisa Walton and Tong Zhou},
+	Number = "CSE-94-032B",
+	Institution = ogicse,
+	Year = 1994,
+  note  =        "Available from \cite{ogi-tr-site}",
+	Notes = {A revised version will appear in {TAPSOFT'95} ({LNCS}).}
+}
+@PhdThesis{Ruf:93:Thesis,
+  author = 	 "Erik Ruf",
+  title = 	 "Topics in Online Partial Evaluation",
+  school = 	 "Stanford University",
+  year = 	 1993,
+  OPTkey = 	 {},
+  OPTaddress = 	 {},
+  OPTtype = 	 {},
+  note = 	 "(Also CSL-TR-93-563)",
+}
+@InCollection{Russell:OnDenoting,
+  author = 	 "Bertran Russell",
+  title = 	 "On Denoting",
+  booktitle = 	 "Bertrand Russell.  Logic and Knowledge.  Essays 1901-1950",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  publisher =    "Capricorn Books",
+  year = 	 1971,
+  editor = 	 "Robert Charles Marsh",
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTchapter = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@BOOK{Russell03,
+	AUTHOR = {Bertrand Russell},
+	TITLE = {Principles of Mathematics},
+	PUBLISHER = {Cambridge University Press},
+	Year = 1903,
+	NOTE = {The second edition is published by Norton, New York.
+		There is no date of publication in the work.}
+}
+@misc{Kieburtz&95,
+	author = "Richard B. Kieburtz and Jeffrey R. Lewis",
+	title = "Algebraic Design Language (Definition)",
+	year = 1995,
+	note = "In \cite{Pacsoft95}"
+}
+@InProceedings{Rytz:92:APolyvariant,
+  author =       "B. Rytz and M. Gengler",
+  title =        "A Polyvariant Binding Time Analysis",
+  booktitle =    PEPM92,
+  publisher =    Yale,
+  year =         1992,
+  pages =        "21--28",
+  note =         "",
+}
+@PhDThesis{Sasaki86,
+	Author = "Sasaki, James Toshio",
+	Title = "Extracting Efficient Programms from Constructive Proofs", 
+	School = "Cornell University",
+	Address = "Ithaca",
+	Year = 1986,
+}
+@TechReport{Schneider87,
+	Author = "Fred B. Schneider",
+	Title = "The State Machine Approach:  A Tutorial",
+	Institution = CUCS,
+	Year = 1987
+}
+@InProceedings{SchroederHeister93elp,
+       author =       "Peter Schroeder-Heister",
+       title =        "Definitional Reflection and the Completion",
+       editor =       "R. Dyckhoff",
+       booktitle =    "Proc. 4th International Workshop on
+                      Extensions of Logic Programming",
+       year =         1993,
+       publisher =    "Springer-Verlag LNAI 798",
+       pages =        "333--347",
+       keywords =     "Pi",
+     }
+@InProceedings{SchroederHeister93lics,
+       author =       "Peter Schroeder-Heister",
+       title =        "Rules of Definitional Reflection",
+       editor =       "M. Vardi",
+       pages =        "222--232",
+       booktitle =    "Proc. Eighth Annual {IEEE} Symposium on
+                      Logic in Computer Science",
+       address =      "Montreal",
+       year =         1993,
+       keywords =     "Pi",
+     }
+@INPROCEEDINGS{Scott70,
+	AUTHOR = {Dana Scott},
+	TITLE = {Constructive Validity},
+	BOOKTITLE = {the Symposium on Automatic Demonstration, Lecture 
+		     Notes in Mathematics },
+	YEAR = 1970,
+	PUBLISHER = {Springer-Verlag},
+	ADDRESS = "New York"
+}
+@INPROCEEDINGS{Scott72,
+	AUTHOR = {Dana Scott},
+	TITLE = {Lattice theoretic models for various type-free calculi},
+	BOOKTITLE = {Proceedings 4th International Congress in Logic,
+		     Methodology and the Philosophy of Science},
+	YEAR = 1972,
+	NOTE = {Bucharest}
+}
+@TechReport{SecurityFoundations,
+	Author = "Staff",
+	Title = "Foundations: Theory of Security",
+	Institution = ORA,
+	Year = 1987
+}
+@unpublished{Seldin87,
+        author = "Jonathan P. Seldin",
+        title = "Theory of Mathesis",
+        note = "Internal technical report,
+                Odyssey Research Associates.  The Air Force will
+		publish a version of this technical report in the near
+		future.",
+        year = 1987
+}
+@unpublished{Seldin89,
+        author = "Jonathan P. Seldin",
+        title = "On the proof theory of {Coquand}'s calculus
+		of constructions",
+        note = "Presented to the meeting of the Association for Symbolic Logic
+		held at UCLA in January 1989.  An abstract will appear in the 
+		{\em Journal of Symbolic Logic}.",
+        year = 1989
+}
+@Article{Sestoft:88:Annotated,
+  author = 	 "P. Sestoft and A. V. Zamaulin",
+  title = 	 "Annotated Bibliography on Partial Evaluation and
+		  Mixed Computation",
+  journal = 	 "New Generation Computing",
+  year = 	 1988,
+  OPTkey = 	 {},
+  volume = 	 6,
+  number = 	 "2,3",
+  pages = 	 "309--354",
+  OPTnote = 	 "[A copy of this bibliography is constantly updated
+		  on the Web.]",
+}
+@InProceedings{Seward:93:Polymorphic-Strictness-Analysis,
+  author =       "Julian Seward",
+  title =        "Polymorphic Strictness Analysis using Frontiers",
+  booktitle =    PEPM93,
+  year =         1993,
+  pages =        "186--193",
+  publisher =    ACM,
+  note =         "",
+}
+@unpublished {Sheard93a,
+	Author = "Tim Sheard",
+	Title = "Type Parametric Programming with Compile-time Reflection",
+	Year = 1993
+}
+@unpublished {Sheard93b,
+	Author = "Tim Sheard",
+	Title = "Guide to Using {CRML}",
+	Note = "",
+	Year = 1993
+}
+@techreport {Sheard93c,
+	Author = "Tim Sheard",
+	Title = "Type Parametric Programming",
+	Institution = ogicse,
+	Number = "CSE-93-018",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1993,
+}
+
+@misc{Sheard95a,
+	author = "Tim Sheard",
+	title = "{HOT} Tool Documentation",
+	year = 1995,
+	note = intooldocs
+}
+@misc{Sheard95b,
+	author = "Tim Sheard",
+	title = "Chin, a Program Specializer---{Tool} documentation",
+	year = 1995,
+	note = intooldocs
+}
+@Misc{Sheard:94:Attribute,
+  OPTkey = 	 {},
+  author = 	 "Tim Sheard and Jef Bell",
+  title = 	 "Attribute Grammar Computations in {CRML}",
+  howpublished = "Unpublished manuscript",
+  year = 	 1994,
+  OPTnote = 	 {},
+}
+@Misc{Sheard:95:WellTyped,
+  OPTkey = 	 {},
+  author = 	 "Tim Sheard",
+  title = 	 "Well Typed Meta-Programming Systems",
+  howpublished = "Unpublished Draft",
+  year = 	 1995,
+  OPTnote = 	 {},
+}
+@TechReport{Sheard:96:Hitchhicker,
+  author = 	 "Tim Sheard and Walid Taha",
+  title = 	 "The Hitchhicker's Guide to Writing Program Generators
+		  in {MetaML}",
+  institution =  "Oregon Graudate Institute",
+  year = 	 1996,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  OPTnumber = 	 {},
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+}
+@Unpublished{Sheard:Meta,
+  author = 	 "Tim Sheard",
+  title = 	 "Well Typed Meta-Programming Systems",
+  note = 	 "(Draft)[*]",
+  OPTkey = 	 {},
+  year = 	 1995,
+}
+@inproceedings{Sheard&93,	
+	author = "Tim Sheard and Leonidas Fegaras",
+	title = "A Fold for All Seasons",
+	booktitle = "Proc. Conf. on Functional
+		Programming and Computer Architecture",
+	address = "Copenhagen",
+	year = 1993
+
+}
+
+
+@inproceedings{NielsonNielson:97:Perscriptive,
+  author = 	 "Flemming Nielson and Hanne Riis Nielson",
+  title = 	 "A Prescriptive Framework for Designing 
+                  Multi-Level Lambda-Calculi",
+
+	booktitle = "Proc. Symposium on Partial Evaluation
+                    and Semantics-Based Program Manipulation",
+	address = "Amsterdam",
+        publisher = ACM,
+        pages = "193--202",
+	year = 1997
+}
+@inproceedings{Launchbury:96:Monadic,
+  author = 	 "John Launchbury and Amr Sabry",
+  title = 	 "Monadic State: Axiomatization and Type Safety",
+
+	booktitle = "Proc. International Conf. 
+                     on Functional Programming",
+	address = "Amsterdam",
+	year = 1997
+}
+@inproceedings{Sheard:96:TypeDirected,
+  author = 	 "Tim Sheard",
+  title = 	 "A Type-Directed, On-line Partial Evaluator for a Polymorphic Language",
+
+	booktitle = "Proc. Symposium on Partial Evaluation
+                    and Semantics-Based Program Manipulation",
+	address = "Amsterdam",
+        pages = "22--3",
+	year = 1997
+}
+
+
+
+@techreport {Sheard&94a,
+	Author = "Tim Sheard and Leonidas Fegaras",
+	Title = "Optimizing Algebraic Programs",
+	Institution = ogicse,
+	Number = "CSE-94-004",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+@unpublished {Sheard&94b,
+	Author = "Tim Sheard and James Hook",
+	Title = "Meta-Programming Tools for {ML}",
+	Note = "",
+	Year = 1994
+}
+@InProceedings{Singh:FPGA,
+  author = 	 "Santam Singh",
+  title = 	 "Architectural Descriptions for FPGA Circuits",
+  booktitle = 	 "IEEE Symposium on FPGAs for Custom Computing Machines",
+  editor = 	 "Peter Athanas and Kennet L. Pocek",
+  year = 	 1995,
+  organization = "IEEE",
+  publisher =    "IEEE Computer Society Press",
+  address = 	 "Napa Valley",
+  note =         "[*]"
+}
+@PhdThesis{Smith:82:Reflection,
+  author = 	 "Brian Cantwell Smith",
+  title = 	 "Reflection and Semantics in a Procedural Language",
+  school = 	 "Massachusetts Institute of Technology",
+  year = 	 1982,
+  OPTkey = 	 {},
+  OPTaddress = 	 {},
+  OPTtype = 	 {},
+  pages =        "23--35"
+}
+@InProceedings{Smith:84:ReflectionInLisp, 
+  author = 	 "Brian Cantwell Smith",
+  title = 	 "Reflection and Semantics in {LISP}",
+  booktitle = 	 POPL,
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1984,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTaddress = 	 {},
+  pages = 	 "23--35",
+  OPTnote = 	 {},
+}
+@INPROCEEDINGS{Staff88a,
+	AUTHOR = {Ulysses Staff},
+	TITLE = {Ulysses: a computer-security modeling environment},
+	BOOKTITLE = {Proc. 11th National Computer Security Conf. },
+	YEAR = 1988,
+}	
+@techreport {Walton&94a,
+	Author = "Lisa Walton and James Hook",
+	Title = "A Preliminary Definition of a Domain Specific Design Language for Message Translation and Validation",
+	Institution = ogicse,
+	Number = "CSE-94-006",
+  note  =        "Available from \cite{ogi-tr-site}",
+	Year = 1994
+}
+@techreport{Walton&95a,
+        author = "Lisa Walton and James Hook",
+        title = "Message Specification Language {(MSL)}:
+                 A Domain Specific Design Language for Message Translation and Validation",
+        institution = ogicse,
+  note  =        "Available from \cite{ogi-tr-site}",
+        year = 1995
+}
+@techreport{Walton&95b,
+        author = "Lisa Walton and James Hook",
+        title = "Message Specification Language {(MSL)}:
+                 Reference Manual",
+        institution = ogicse,
+  note  =        "Available from \cite{ogi-tr-site}",
+        year = 1995
+}
+@misc{Walton&95c,
+	author = "Lisa Walton and James Hook",
+	title = "Design Automation:  Making formal methods relevant",
+	year = 1995,
+	note = "To be presented at {ICSE-17} Workshop on Formal Methods Application 
+	in Software Engineering Practice"
+}
+@misc{Walton&95d,
+	author = "Lisa Walton and James Hook",
+	title = "MSL Compiler Tool Documentation",
+	year = 1995,
+	note = intooldocs
+}
+
+@inproceedings{Staff88b,
+	AUTHOR = {Ulysses Staff},
+	TITLE = {Security Modeling in the {Ulysses} Environment},
+	BOOKTITLE = {Fourth Aerospace Computer Security Conf.},
+	YEAR = 1988,
+}
+@Book{Stenlund72,
+	Author = "{S\"oren} Stenlund",
+	Title = "Combinators, Lambda-Terms and Proof Theory",
+	Year = 1972,
+	Publisher = "D. Reidel",
+	Address = "Dordrecht"
+}
+@InProceedings{Stickel:94:Deductive,
+  author = 	 "Mark Stickel and Richard Waldinger and Michael Lowry and Thomas Pressburger and Ian Underwood",
+  title = 	 "Deductive Composition of Astronomical Software from Subroutine Libraries",
+  booktitle = 	 "12th Conf. on Automated Deduction",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1994,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTaddress = 	 {},
+  pages = 	 "341--355",
+  note = 	 "Available at \cite{Amphion:Page}",
+}
+
+@Book{Stoy77,
+	Author ="Joseph E. Stoy",
+	Title = "Denotational Semantics:  The Scott-Strachey
+		Approach to Programming Language Theory",
+	Publisher = "MIT Press",
+	Address = "Cambridge",
+	Year = 1977
+}
+
+@TechReport{Taha:95:OnUsing,
+  author = 	 "Walid Taha",
+  title = 	 "On Using an OODBMS in a CASE Environment",
+  institution =  "The Oregon Graduate Institute",
+  year = 	 1995,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-95-007",
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+  note  =        "Available from \cite{ogi-tr-site}",
+}
+
+@Article{Georgeff:84,
+  author = 	 "Michael Georgeff",
+  title = 	 "Transformatinos and Reduction Strategies for Typed
+		  Lambda Expressions",
+  journal = 	 TOPLAS,
+  year = 	 1984,
+  OPTkey = 	 {},
+  volume = 	 6,
+  number = 	 4,
+  pages = 	 "603--631",
+  note = 	 {},
+}
+
+@Unpublished{Taha:96:Intro,
+  author = 	 "Walid Taha",
+  title = 	 "A Quick Introduction to Offline Partial Evaluation
+		  and Related Topics",
+  note = 	 "Term Paper",
+  OPTkey = 	 {},
+  year = 	 1996,
+}
+
+@InProceedings{Talcott:88:Partial,
+       author =       "Carolyn L. Talcott and R. Weyhrauch",
+       title =        "Partial Evaluation, Higher-Order Abstractions, and
+                      Reflection Principles as System Building Tools",
+       booktitle =    PEMC,
+       editor =       BEJ,
+       pages =        "507--529",
+       publisher =    N-H,
+       year =         1988,
+     }
+
+@Book{Tourlakis:83:Computability,
+  author = 	 "George J. Tourlakis",
+  title = 	 "Computability",
+  publisher = 	 "Reston",
+  year = 	 1983,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTedition = 	 {},
+  OPTnote = 	 {},
+}
+@InCollection{VanHarmelen:89:TheLimitations,
+  author =       "F. van Harmelen",
+  title =        "The Limitations of Partial Evaluation",
+  booktitle =    "Logic-Based Knowledge Representation",
+  publisher =    MIT,
+  year =         1989,
+  editor =       "P. Jackson and H. Reichgelt and F. van Harmelen",
+  note =         "",
+}
+		  
+@inproceedings{Volpano85,
+        author = "Dennis Volpano and Richard B. Kieburtz",
+	title = "Software Templates",
+	booktitle = "Proc. Eighth International Conf. on Software Engineering",
+	pages = "55--60",
+	publisher = "IEEE Computer Society",
+	year = 1985
+}		  
+@inproceedings{Volpano89,
+        author = "Dennis Volpano and Richard B. Kieburtz",
+	title = "The templates approach to software reuse",
+	booktitle = "Software Reusability",
+	pages = "247--255",
+	editor = "Ted J. Biggersstaff and Alan J. Perlis",
+	publisher = ACM,
+	year = 1989
+}
+@InCollection{Wand88,
+       author =       "Mitchell Wand and Daniel P. Friedman",
+       editor =       "P. Maes and D. Nardi",
+       title =        "The Mystery of the Tower Revealed: {A} Non-Reflective
+                      Description of the Reflective Tower",
+       booktitle =    "Meta-Level Architectures and Reflection",
+       pages =        "111--134",
+       publisher =    "Elsevier Science",
+       year =         1988,
+     }
+@Article{WandFriedman88,
+       author =       "Mitchell Wand and Daniel P. Friedman",
+       title =        "The Mystery of the Tower Revealed: {A} Non-Reflective
+                      Description of the Reflective Tower",
+       journal =      "{LISP} and Symbolic Computation",
+       year =         1988,
+       volume =       "1",
+       pages =        "11--37",
+       note =         "Reprinted in {\it Meta-Level Architectures and
+                      Reflection} (P. Maes and D. Nardi, eds.) North-Holland,
+                      Amsterdam, 1988, pp. 111--134",
+     }
+@InProceedings{Yonezawa89,
+       author =       "A. Yonezawa and T. Watanabe",
+       title =        "An Introduction to Object-Based, Reflective,
+                      Concurrent Computation",
+       booktitle =    "Proc. Workshop on Object-Based Concurrent
+                      Programming, ACM SIGPLAN Notices",
+       pages =        "50",
+       year =         1989,
+       abstract =     "Extends the notion of reflection to object-based
+                      concurrent computation.",
+       note =         "Published as Proc. ACM SIGPLAN Workshop on
+                      Object-Based Concurrent Programming, ACM SIGPLAN
+                      Notices, volume 24, number 4",
+     }
+@InProceedings{desRivieres:Smith:acm:lfp:1984,
+       author =       "Jim des Rivi{\`e}res and Brian Cantewell Smith",
+       title =        "The implementation of Procedurally Reflective
+                      Languages",
+       crossref =     "acm:lfp:1984",
+       pages =        "331--347",
+       refs =         "18",
+       checked =      "19940322",
+       source =       "dept. library",
+       sjb =          "3-LISP is an extended Scheme.",
+       keywords =     "reflection, Lisp, Scheme",
+       abstract =     "In a procedurally reflective programming language, all
+                      programs are executed not through the agency of a
+                      primitive and inaccessible interpreter, but rather by
+                      the explicit running of a program that represents that
+                      interpreter. In the corresponding virtual machine,
+                      therefore, there are an infinite number of levels at
+                      which programs are processed, all simultaneously
+                      active. It is therefore a substantial question to show
+                      whether, and why, a reflective language is
+                      computationally tractable. We answer this question by
+                      showing how to produce an efficient implementation of a
+                      procedurally reflective language, based on the notion
+                      of a {\em level-shifting} processor. A series of
+                      general techniques, which should be applicable to
+                      reflective variants of any standard applicative or
+                      imperative programming languages, are illustrated in a
+                      complete implementation for a particular reflective
+                      LISP dialect called 3-LISP.",
+       reffrom =      Queinnec:Cointe:acm:lfp:1988,
+       reffrom =      Danvy:Malmkjaer:acm:lfp:1988,
+       reffrom =      Bawden:acm:lfp:1988,
+     }		  
+		  
+		  
+		  @Manual{Wile:POPART,
+  title = 	 "POPART:  Produce of Parsers and Related Tools,
+		  System Builders' Manual",
+  author =	 "David S. Wile",
+  organization = "USC/Information Sciences Institute",
+  address =	 "Marina Del Rey, CA 90292,(310)822-15511,wile@isi.edu",
+  edition =	 "DRAFT",
+  year =	 1993,
+  note =	 "[via Hook]",
+}
+
+
+		  
+@InProceedings{Bawden99,
+  title =        "Quasiquotation in {LISP}",
+  author =       "Alan Bawden",
+  booktitle =    "Proc. Workshop on
+                 Partial Evaluation and Semantics-Based Program
+                 Manipulation",
+  editor = 	 "O. Danvy",
+  address = 	 "San Antonio",
+  publisher =    "University of Aarhus, Dept. of Computer Science",
+  pages =        "88--99",
+  note =         "Invited talk",
+  year =         1999
+}
+
+
+@inproceedings{Kieburtz&95a,
+	Title = {Calculating Software Generators from Solution Specifications},
+	Author = {Richard B. Kieburtz and Francoise Bellegarde and Jef Bell 
+		and James Hook and Jeffrey Lewis and Dino Oliva and Tim Sheard
+		and Lisa Walton and Tong Zhou},
+	Booktitle = {{TAPSOFT'95}},
+	Publisher = {Springer-Verlag},
+	Series = LNCS,
+	Volume = 915,
+	Pages = "546--560",
+	Year = 1995
+}
+
+@Inproceedings{Kieburtz&96a,
+	Author = "Richard B. Kieburtz and  Laura McKinney and Jeffrey Bell and  James Hook and  Alex Kotov and  Jeffrey Lewis and  Dino Oliva and  Tim Sheard and  Ira Smith and Lisa Walton",
+	Title = "A Software Engineering Experiment in Software Component Generation",
+	Booktitle = "18th International Conf. in Software Engineering",
+	Year = 1996,
+        pages = "542-553",
+}
+		  
+
+@Article{Plotkin75,
+author =       "Gordon D. Plotkin",
+title =        "Call-by-name, call-by-value and the lambda-calculus",
+journal =      "Theoretical Computer Science",
+volume =       "1",
+pages =        "125--159",
+year =         1975,
+keywords =     "lambda calculus call be value call by need normal
+                order lazy evaluation functional programming FP",
+}
+
+
+
+@TechReport{Leone&Lee93,
+       year =         1993,
+       author =       "Mark Leone and Peter Lee",
+       title =        "Deferred Compilation: The Automation of Run-time 
+                       Code Generation",
+       number =       "CMU-CS-93-225",
+       institution =  "Carnegie Mellon University"
+     }
+
+@Article{Launchbury:95,
+       author =       "John Launchbury and Simon L. {Peyton Jones}",
+       title =        "State in Haskell",
+       pages =        "293--342",
+       journal =      "{LISP} and Symbolic Computation",
+       year =         1995,
+       volume =       "8",
+       number =       "4",
+       note =         "pldi94",
+     }
+@InProceedings{Nielson:96,
+  author =       "Flemming Nielson and Hanne Riis Nielson",
+  title =        "Multi-Level Lambda-Calculi: An Algebraic Description",
+  booktitle =    "Partial Evaluation. Dagstuhl Castle, Germany, February
+                 1996",
+  year =         1996,
+  editor =       "O. Danvy and R. Gl{\"u}ck and P. Thiemann",
+  volume =       "1110",
+  series =       "Lecture Notes in Computer Science",
+  publisher =    "Berlin:\ Springer-Verlag",
+  pages =        "338--354",
+}
+@Book{Nielson:92,
+  author =       "Flemming Nielson and Hanne Riis Nielson",
+  title =        "Two-Level Functional Languages",
+  publisher =    CUP,
+  year =         1992,
+  OPTkey =       {},
+  OPTeditor =    {},
+  OPTvolume =    {},
+  number =       34,
+  series =       CUPtracts,
+  address =      "Cambridge",
+  OPTedition =   {},
+  note =         "",
+}
+@InProceedings{Moggi:97,
+  author = 	 "Eugenio Moggi",
+  title = 	 "A categorical account of two-level languages",
+  booktitle = 	 "Mathematics Foundations of Program Semantics",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1997,
+  OPTorganization = {},
+  publisher =    "Elsevier Science",
+  OPTaddress = 	 {},
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{TS97,
+  author       = {Taha, Walid and Sheard, Tim},
+  YEAR         = 1997,
+  mouth        = jun,
+  TITLE        = {Multi-Stage Programming with Explicit Annotations},
+  publisher =    "ACM Press",
+  booktitle    = {Proc. Symposium on Partial
+                  Evaluation and Semantic-Based Program Manipulation
+                  {(PEPM)}},
+  address      = "Amsterdam",
+  pages        = "203--217",
+  OPTnote = "An extended and revised version appears in \cite{TS00}"
+}
+
+@InProceedings{Auslander:96,
+  title =        "Fast, Effective Dynamic Compilation",
+  author =       "Joel Auslander and Matthai Philipose and Craig
+                 Chambers and Susan J. Eggers and Brian N. Bershad",
+  pages =        "149--159",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implementation",
+  year =         1996,
+  address =      "Philadelphia",
+}
+
+
+@Article{Batory:95,
+  author = 	 "Don Batory and Jeff Thomas",
+  title = 	 "P2: A Lightweight DBMS Generator",
+  journal = 	 "Journal of Intelligent Information Systems",
+  year = 	 1995,
+  OPTkey = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Article{Batory:97,
+  author = 	 "Don Batory and Bart J. Geraci",
+  title = 	 "Composition Validation and Subjectivity in GenVoca Generators",
+  journal = 	 "IEEE Transactions on Software Engineering",
+  year = 	 1997,
+  OPTkey = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTpages = 	 "67--82",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Article{Wright:94,
+  title =        "A Syntactic Approach to Type Soundness",
+  author =       "Andrew K. Wright and Matthias Felleisen",
+  pages =        "38--94",
+  journal =      "Information and Computation",
+  year =         1994,
+  volume =       "115",
+  number =       "1",
+}
+
+@InProceedings{Consel:93,
+  author =       "Charles Consel and Calton Pu and Jonathan Walpole",
+  title =        "Incremental Specialization: The Key to High
+                 Performance, Modularity, and Portability in Operating
+                 Systems",
+  pages =        "44--46",
+  ISBN =         "0-89791-594-1",
+  booktitle =    "Proc. Symposium on Partial Evaluation and
+                 Semantics-Based Program Manipulation",
+  publisher =    ACM,
+  address =      "New York",
+  year =         1993,
+}
+
+@InProceedings{Consel:96,
+  title =        "A General Approach for Run-Time Specialization and its
+                 Application to {C}",
+  author =       "Charles Consel and Fran{\c{c}}ois No{\"e}l",
+  pages =        "145--156",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  year =         1996,
+  address =      "St. Petersburg Beach",
+}
+
+
+@InProceedings{Davies:96,
+  author =       "Rowan Davies and Frank Pfenning",
+  title =        "A Modal Analysis of Staged Computation",
+  booktitle =    "the Symposium on Principles of
+                  Programming Languages {(POPL '96)}",
+  year =         1996,
+  address =      "St. Petersburg Beach",
+  pages   =      "258--270",
+}
+
+@InProceedings{WS99,
+  author =       "Mitchell Wand and Igor Siveroni",
+  title =        "Constraint Systems for Useless Variable Elimination",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  year =         1999,
+  pages   =      "291-302",
+}
+
+@InProceedings{Davies:96b,
+  title =        "A Temporal-Logic Approach to Binding-Time Analysis",
+  author =       "Rowan Davies",
+  pages =        "184--195",
+  booktitle =    "the Symposium on Logic in Computer Science {(LICS '96)}",
+  year =         1996,
+  address =      "New Brunswick",
+  organization = "IEEE Computer Society Press",
+}
+
+@InCollection{Detlefs:91,
+  author =       "David L. Detlefs",
+  title =        "Concurrent Garbage Collection for {C++}",
+  booktitle =    "Topics in Advanced Language Implementation",
+  editor =       "Peter Lee",
+  publisher =    "MIT Press",
+  year =         1991,
+}
+
+@InProceedings{Engler:96,
+  author =       "Dawson R. Engler",
+  title =        "{VCODE} : {A} Retargetable, Extensible, Very Fast
+                 Dynamic Code Generation System",
+  pages =        "160--170",
+  ISBN =         "0-89791-795-2",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implemantation",
+  publisher =    ACM,
+  address =      "New York",
+  year =         1996,
+}
+
+@InProceedings{Engler:96b,
+  title =        "{`C}: {A} Language for High-Level, Efficient, and
+                 Machine-Independent Dynaic Code Generation",
+  author =       "Dawson R. Engler and Wilson C. Hsieh and M. Frans
+                 Kaashoek",
+  pages =        "131--144",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  year =         1996,
+  address =      "St. Petersburg Beach",
+}
+
+@InProceedings{Glueck:95,
+  author =       "Robert Gl{\"u}ck and Jesper J{\o}rgensen",
+  year =         1995,
+  title =        "Efficient Multi-Level Generating Extensions for
+                 Program Specialization",
+  booktitle =    "Programming Languages: Implementations, Logics and
+                 Programs (PLILP'95)",
+  editor =       "S. D. Swierstra and M. Hermenegildo",
+  publisher =    "Springer-Verlag",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "982",
+  pages =        "259--278",
+}
+
+@InProceedings{Glueck:96,
+  author =       "Robert Gl{\"u}ck and Jesper J{\o}rgensen",
+  year =         1996,
+  title =        "Fast Binding-Time Analysis for Multi-Level
+                 Specialization",
+  booktitle =    "Perspectives of System Informatics",
+  editor =       "Dines Bj{\o}rner and Manfred Broy and Igor V.
+                 Pottosin",
+  publisher =    "Springer-Verlag",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "1181",
+  pages =        "261--272",
+}
+
+@Article{Glueck:97,
+  author =       "Robert Gl{\"u}ck and Jesper J{\o}rgensen",
+  year =         1997,
+  title =        "An Automatic Program Generator for Multi-Level
+                 Specialization",
+  journal =      "{LISP} and Symbolic Computation",
+  volume =       "10",
+  number =       "2",
+  pages =        "113--158",
+}
+
+@InProceedings{Grant:97,
+  title =        "Annotation-Directed Run-Time Specialization in~{C}",
+  author =       "Brian Grant and Markus Mock and Matthai Philipose and
+                 Craig Chambers and Susan J. Eggers",
+  pages =        "163--178",
+  booktitle =    "Proc. Symposium on
+                 Partial Evaluation and Semantics-Based Program
+                 Manipulation",
+  year =         1997,
+  address =      "Amsterdam",
+  ISBN =         "ISBN 0-89791-917-3",
+}
+
+@InProceedings{Guillermo:97,
+  author = 	 "Guillermo Jimenez-Perez and Don Batory",
+  title = 	 "Memory Simulators and Software Generators",
+  booktitle = 	 "the Symposium on Software Reuse",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1997,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTaddress = 	 {},
+  pages = 	 "136--145",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@INCOLLECTION{Huet:91,
+	AUTHOR = {Huet, G. and L{\'e}vy, J.-J.},
+	TITLE = {Computations in Orthogonal Rewriting Systems, {I}},
+	BOOKTITLE = {Computational Logic},
+	PAGES = "395--414",
+	EDITOR = {Lassez, J.-L. and Plotkin, G.},
+	PUBLISHER = "MIT press",
+	YEAR = 1991,
+	CHAPTER = {11}
+}
+
+@InCollection{Klop:92,
+  author	= {Klop, J. W.},
+  title		= {Term Rewriting Systems},
+  volume	= 2,
+  pages		= "1--116",
+  booktitle	= {Handbook of Logic in Computer Science},
+  publisher	= {Oxford University Press},
+  year		= 1992,
+  editor	= {S. Abramsky and Dov M. Gabbay and T. S. E. Maibaum}
+}
+
+@InProceedings{Koopman:89,
+  title =        "Cache Performance of Combinator Graph Reduction",
+  author =       "Philip J. Koopman and Peter Lee and Daniel P.
+                 Siewiorek",
+  booktitle =    "Proc. Conf. on Programming
+                 Languages Design and Implementation",
+  address =      "Portland",
+  year =         1989,
+  publisher =    ACM,
+  series =       "ACM SIGPLAN Notices",
+  volume =       "24(7)",
+  pages =        "110--119",
+}
+
+@InProceedings{Koopman:89b,
+  author =       "Philip J. {Koopman, Jr.} and Peter Lee",
+  title =        "A Fresh Look at Combinator Graph Reduction",
+  pages =        "110--119",
+  ISBN =         "0-89791-306-X",
+  editor =       "Bruce Knobe",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implementation
+                 ({SIGPLAN} '89)",
+  address =      "Portland",
+  year =         1989,
+  publisher =    ACM,
+}
+
+@Article{Lee:88,
+  key =          "Lee, {\em et al.}",
+  author =       "Peter Lee and Frank Pfenning and Gene Rollins and
+                 William Scherlis",
+  title =        "The Ergo Support System: An Integrated Set of Tools
+                 for Prototyping Integrated Environments",
+  journal =      "ACM SIGSOFT Software Engineering Notes",
+  volume =       "13",
+  number =       "5",
+  year =         1988,
+  pages =        "25--34",
+  note =         "Proc. Software
+                 Engineering Symposium on Practical Software Development
+                 Environments",
+  annote =       "Prototyping formal methods. 30 references.",
+}
+		  
+@Book{Lee:89,
+  author =       "Peter Lee",
+  title =        "Realistic Compiler Generation",
+  year =         1989,
+  publisher =    "MIT Press",
+  series =       "Foundations of Computing Series",
+  annote =       "This book is based on {\em High-Level Semantics\/},
+                 which is essentially a variant of action semantics,
+                 especially suited to the purposes of compiler
+                 generation for conventional programming languages.",
+  keywords =     "action semantics",
+}
+
+@InProceedings{Lee:96,
+  author =       "Peter Lee and Mark Leone",
+  title =        "Optimizing {ML} with Run-Time Code Generation",
+  pages =        "137--148",
+  ISBN =         "0-89791-795-2",
+  booktitle =    "Proceedingsof the Conf. on
+                 Programming Language Design and Implemantation",
+  publisher =    ACM,
+  address =      "New York",
+  year =         1996,
+}
+
+@TechReport{Leone:93,
+  author =       "Mark Leone and Peter Lee",
+  institution =  "Carnegie Mellon, Department of Computer Science",
+  title =        "Deferred Compilation: The Automation of Run-Time Code
+                 Generation",
+  year =         1993,
+  address =      "Pittsburgh",
+  url =          "ftp://reports.adm.cs.cmu.edu/usr0/anon/1993/CMU-CS-93-225.ps",
+  number =       "CMU-CS-93-225",
+}
+
+@InProceedings{Leone:94,
+  author =       "Mark Leone and Peter Lee",
+  booktitle =    "Proc. Workshop on
+                 Partial Evaluation and Semantics-Based Program
+                 Manipulation",
+  title =        "Lightweight Run-Time Code Generation",
+  year =         1994,
+  url =          "ftp://ftp.cs.cmu.edu/afs/cs.cmu.edu/user/mleone/papers/lw-rtcg.ps",
+  pages =        "97--106",
+  publisher =    "Technical Report 94/9, Department of Computer Science,
+                 University of Melbourne",
+}
+
+@TechReport{Leone:95,
+  author =       "Mark Leone and Peter Lee",
+  institution =  "School of Computer Science, Carnegie Mellon
+                 University",
+  title =        "Optimizing {ML} with Run-Time Code Generation",
+  year =         1995,
+  address =      "Pittsburgh",
+  url =          "http://www.cs.cmu.edu/afs/cs.cmu.edu/user/mleone/papers/ml-rtcg.ps",
+  keywords =     "Run-time code generation, dynamic optimization,
+                 partial evaluation, specialization, staged
+                 computation",
+  number =       "CMU-CS-95-205",
+}
+
+@InProceedings{Leone:96,
+  author =       "Mark Leone and Peter Lee",
+  title =        "{A} Declarative Approach to Run-Time Code Generation",
+  year =         1996,
+  url =          "http://www.cs.cmu.edu/afs/cs.cmu.edu/user/mleone/papers/declarative-rtcg.ps",
+  keywords =     "run-time code generation, dynamic optimization,
+                 specialization, partial evaluation",
+  scope =        "implemen",
+  booktitle =    "Workshop on Compiler Support for System Software
+                 (WCSSS)",
+}
+
+
+@InProceedings{implicit,
+  author =       "Jeffrey R. Lewis and John Launchbury and Erik Meijer
+                 and Mark Shields",
+  title =        "Implicit Parameters: Dynamic Scoping with Static
+                 Types.",
+  pages =        "108--118",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  month =        jan # " ~19--21",
+  publisher =    "ACM Press",
+  address =      "N.Y.",
+  year =         "2000",
+}
+
+@PhdThesis{Okasaki96,
+  author = 	 "Chris Okasaki",
+  title = 	 "Purely Functional Data Structures",
+  school = 	 "School of Computer Science, 
+Carnegie Mellon University",
+  year = 	 1996,
+  OPTkey = 	 {},
+  OPTaddress = 	 {},
+  OPTtype = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+
+
+@InProceedings{okasakiViews,
+  author = 	 "Chris Okasaki",
+  title = 	 "Views for Standard ML",
+  booktitle = 	 "ACM SIGPLAN Workshop on ML",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 1998,
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTmonth = 	 {},
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Article{Okasaki:94,
+  author =       "Chris Okasaki and Peter Lee and David Tarditi",
+  journal =      "{LISP} and Symbolic Computation",
+  title =        "Call-by-need and Continuation-passing Style",
+  year =         1994,
+  url =          "http://foxnet.cs.cmu.edu/people/cokasaki/lazy-cps.ps",
+  keywords =     "call-by-need, continuation-passing style,
+                 continuations, lazy evaluation",
+  number =       "1",
+  pages =        "57--82",
+  volume =       "7",
+}
+
+@InProceedings{Pfenning:88,
+  author =       "Frank Pfenning and Peter Lee",
+  title =        "{LEAP}: {A} Language with Eval And Polymorphism",
+  editor =       "Josep D{\'\i}az and Fernando Orejas",
+  booktitle =    "{TAPSOFT}'89: Proc. International Joint
+                 Conf. on Theory and Practice of Software
+                 Development,",
+  year =         "1989",
+  publisher =    "Springer-Verlag",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "352",
+  pages =        "345--359",
+}
+
+
+@InProceedings{Pu:97,
+  author = 	 "Calton Pu and Andrew Black and Crispin Cowan and Jonathan
+Walpole",
+  title = 	 "Microlanguages for Operating System Specialization",
+  booktitle = 	 "Proc. Workshop
+on Domain-Specific Languages",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1997,
+  OPTorganization = {},
+  OPTpublisher = {},
+  address = 	 "Paris",
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+In Proc. 1998 , Baltimore, Maryland, September 1998.
+
+@InProceedings{Yang:1999:ETM,
+  author =       "Zhe Yang",
+  title =        "Encoding Types in {ML}-like Languages",
+  booktitle =    "Proc. 
+                  International Conf. on
+                   Functional Programming ({ICFP})",
+  pages =        "289--300",
+  publisher =    ACM,
+  address   =    "Baltimore",
+  year =         "1998",
+}
+
+@InProceedings{Sperber:96,
+  title =        "Realistic Compilation by Partial Evaluation",
+  author =       "Michael Sperber and Peter Thiemann",
+  pages =        "206--214",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implementation",
+  year =         1996,
+  address =      "Philadelphia",
+}
+		  
+@InProceedings{Sperber:97,
+  title =        "Two for the Price of One: Composing Partial Evaluation
+                 and Compilation",
+  author =       "Michael Sperber and Peter Thiemann",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implementation
+                 ({PLDI})",
+  address =      "Las Vegas",
+  year =         1997,
+  pages =        "215--225",
+}
+
+
+@TechReport{TahaBenaissaSheard97,
+  author =       {Taha, Walid  and Benaissa, Zine-el-abidine and Sheard, Tim},
+  title =        {The essence of staged programming},
+  institution =  {OGI},
+  number =       {},
+  address =      "Portland",
+  year =         1997,
+  keywords =     "metaml"
+}
+
+@TechReport{Tarditi:90,
+  author =       "David Tarditi and Anurag Acharya and Peter Lee",
+  institution =  "School of Computer Science, Carnegie Mellon
+                 University",
+  title =        "No assembly required: Compiling Standard {ML} to {C}",
+  year =         1990,
+  url =          "ftp://dravido.soar.cs.cmu.edu/usr/nemo/sml2c/sml2c-techreport.ps",
+  number =       "CMU-CS-90-187",
+}
+
+@InProceedings{Thiemann:96,
+  title =        "Cogen in Six Lines",
+  author =       "Peter J. Thiemann",
+  pages =        "180--189",
+  booktitle =    "Proc. 1996 International
+                 Conf. on Functional Programming",
+  year =         1996,
+  address =      "Philadelphia",
+}
+
+@Article{Touretzky:89,
+  key =          "Touretzky \& Lee",
+  author =       "David S. Touretzky and Peter Lee",
+  title =        "Visualizing Evaluation in Applicative Languages",
+  journal =      "CACM",
+  year =         1992,
+  volume =       "35",
+  number =       "10",
+  pages =        "49--59",
+  OPTannote =    "7 references.",
+}
+
+
+@InProceedings{Volanschi:96,
+  author = 	 "Eugen-Nicolae Volanschi and Gilles Muller and Charles Consel",
+  title = 	 "Safe Operating System Specialization: the RPC Case Study",
+  booktitle = 	 "1st Workshop on Compiler Support for System Software (WCSSS'96)",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  year = 	 1996,
+  OPTorganization = {},
+  OPTpublisher = {},
+  address = 	 "Tuscon",
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Waldinger:94,
+  author =       "Richard Waldinger and Michael Lowry",
+  title =        "{AMPHION}:  Towards kinder, gentler formal methods",
+  booktitle = "Proc. 1994 Monterey Workshop on Formal Methods",
+  year =         1994,
+  organization = "{U.S. Naval Postgraduate School}",
+}
+
+
+@InProceedings{SSP98,
+  author = 	 "Mark Shields and Tim Sheard and Simon L. {Peyton Jones}",
+  title = 	 "Dynamic Typing through Staged Type Inference",
+  booktitle = 	 "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  year = 	 1998,
+  OPTorganization = {},
+  pages = "289--302",
+}
+
+@InProceedings{HengleinMossin94,
+  author =  "Fritz Henglein and  Christian Mossin",
+  title  =   "Polymorphic Binding-Time Analysis", 
+  year =  1994,
+  pages = "287--301" ,
+  booktitle = "Programming Languages and Systems - ESOP\'94\, 5th 
+               European Symposium on Programming",
+  editor = "Donald Sannella",
+  volume =       "788",
+  publisher =    "Springer-Verlag",
+  series =       "Lecture Notes in Computer Science",
+  isbn = "ISBN 3-540-57880-3",
+  address = "Edinburgh",
+}
+@TechReport{Albano90,
+  author =       "A. Albano and A. L. Brown and A. Dearle and R. C. H.
+                 Connor and L. Fegaras and G. Ghelli and R. Hull and C.
+                 D. Marlin and F. Matthes and R. Morrison and R. Orsini
+                 and J. W. Schmidt and T. Sheard and D. Stemple",
+  title =        "Type Systems and Database Programming Languages",
+  institution =  "University of St Andrews",
+  number =       "CS/90/3",
+  year =         1990,
+}
+
+@Unpublished{CRML,
+  author = 	 "Tim Sheard",
+  title = 	 "Guide to using {CRML}, Compile-Time Reflective {ML}",
+  note = 	 "Available 
+                  \fr{http://www.cse.ogi.edu/\es{sheard}/CRML.html}",
+  OPTkey = 	 {},
+  year = 	 1993,
+  OPTannote = 	 {}
+}
+
+@TechReport{CSE-92-015,
+  author = 	 "James Hook and Dick Kieburtz and Tim Sheard",
+  title = 	 "Generating Programs by Reflection",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1992,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-92-015",
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+  note  =        "Available from \cite{ogi-tr-site}",
+  OPTannote = 	 {}
+}
+@TechReport{CSE-93-018,
+  author = 	 "Tim Sheard",
+  title = 	 "Type Parametric Programming",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1993,
+  note  =        "Available from \cite{ogi-tr-site}",
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-93-018",
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+@TechReport{CSE-93-019,
+  author = 	 "James Hook and Tim Sheard",
+  title = 	 "A Semantics of Compile-time Reflection",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1993,
+  OPTkey = 	 "Oregon Graduate Institute",
+  OPTtype = 	 {},
+  number = 	 "CSE 93-019",
+  OPTaddress = 	 {},
+  note  =        "Available from \cite{ogi-tr-site}",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+@TechReport{CSE-94-032B,
+  author = 	 "Richard Kieburtz and
+                  Francoise Bellegarde and
+                  Jef Bell and
+                  James Hook and 
+                  Jeffrey Lewis and
+                  Dino Oliva and
+                  Tim Sheard and Lisa Walton and Tong Zhou",
+  title = 	 "Calculating Software Generators 
+                  from Solution Specifications",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1994,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  note  =        "Available from \cite{ogi-tr-site}",
+  number = 	 "CSE-94-032B",
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+
+@InProceedings{CMT00,
+  author       = {Calcagno, Cristiano and Moggi, Eugenio and Taha, Walid},
+  title =        "Closed Types as a Simple Approach to Safe Imperative Multi-Stage Programming",
+  booktitle =    "the International Colloquium on Automata, Languages, and
+  Programming {(ICALP '00)}",
+  year =         2000,
+  series =       LNCS,
+  volume =       1853,
+  pages =        "25--36",
+  address =      "Geneva",
+  publisher =    "Springer-Verlag",
+}
+
+@InProceedings{SBP99,
+  author =   "Sheard, Tim and Benaissa, Zine El-Abidine and Pa\v{s}ali\'{c}, Emir",
+  title =   "{DSL} Implementation Using Staging and Monads ",
+  booktitle = "2nd. Conf. on Domain-Specific Languages (DSL'99)",
+  year =   "1999",
+  address =   "Austin, Texas",
+}
+
+@Article{Sheard:1999:UMS,
+  author =       "T. Sheard",
+  title =        "Using {MetaML}: {A} Staged Programming Language",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "1608",
+  pages =        "207--239",
+  year =         "1999",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Mon Sep 13 16:57:02 MDT 1999",
+  acknowledgement = ack-nhfb,
+}
+
+@InProceedings{TBS98,
+  author       = {Taha, Walid and Benaissa, Zine-El-Abidine and Sheard, Tim},
+  title =        "Multi-Stage Programming: Axiomatization and Type-Safety",
+  booktitle =    "25th
+  International Colloquium on Automata, Languages, and
+  Programming {(ICALP)}",
+  year =         1998,
+  series =       LNCS,
+  volume =       1443,
+  pages =        "918--929",
+  address =      "Aalborg",
+}
+
+@TechReport{CSE-98-002,
+  author = 	 "Walid Taha and Zine-El-Abidine Benaissa and Tim Sheard",
+  title = 	 "Multi-Stage Programming:  Axiomatization and Type Safety",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1998,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-98-002",
+  OPTaddress = 	 {},
+  OPTnote = 	 {},
+  note  =        "Available from \cite{ogi-tr-site}",
+  OPTannote = 	 {}
+}
+
+@InProceedings{Hornof1997,
+  title =        "Accurate Binding-Time Analysis for Imperative
+                 Languages: Flow, Context, and Return Sensitivity",
+  author =       "Luke Hornof and Jacques Noy{\'e}",
+  pages =        "63--73",
+  booktitle =    "Proc. Symposium on
+                 Partial Evaluation and Semantics-Based Program
+                 Manipulation",
+  year =         1997,
+  address =      "Amsterdam",
+  ISBN =         "ISBN 0-89791-917-3",
+  annote=        "Run-time code generation systems that 
+                  performs automatic BTA.  It is actually 
+                  preceded by both alias and side-effect
+                  analyses [to deal with effects]. 
+                  In general, Tempo is fully automated given user-supplied
+                  binding-time declarations of the program inputs, of course."
+}
+
+@InProceedings{Hornof1997B,
+  title =        "Effective specialization of realistic programs via use sensitivity",
+  author =       "Luke Hornof and Charles Consel and Jacques Noy{\'e}",
+  pages =        "293--314",
+  booktitle =    "SAS 1997",
+  year =         1997,
+  address =      "Paris",
+  ISBN =         {},
+  annote=        {}
+}
+
+@PhdThesis{HornofThesis,
+  author = 	 "Luke Hornof",
+  title = 	 "Static Analyses for the Effective 
+                  Specialization of Realistic Programs",
+  school = 	 "University of Rennes",
+  year = 	 1997,
+  OPTkey = 	 {},
+  address = 	 "France",
+  OPTtype = 	 {},
+  OPTnote = 	 {}, 
+  OPTannote = 	 {}
+}
+
+@PhdThesis{IB-B881033,
+  author =       "Timothy E. Sheard",
+  title =        "Proving the Consistency of Database Transactions",
+  address =      "Ann Arbor",
+  year =         1985,
+  descriptor =   "Automatisches Beweisen, Datenbankentwurf,
+                 Datenbanksystem, Formale Spezifikation, Integritaet,
+                 Logik, Relationenalgebra, Transaktion, Verifikation",
+}
+
+@InProceedings{Jones:96:whatnot,
+  author =       "Neil D. Jones",
+  year =         1996,
+  title =        "What Not to Do When Writing an Interpreter for
+                 Specialisation",
+  booktitle =    "Partial Evaluation",
+  editor =       "Olivier Danvy and Robert Gl{\"u}ck and Peter
+                 Thiemann",
+  publisher =    "Springer-Verlag",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "1110",
+  pages =        "216--237",
+  summary =      "",
+  semno =        "D-266",
+  puf =          "Artikel i proceedings (med censur)",
+  id =           "KonR",
+}
+
+@Article{Sheard:1991:AGU,
+  author =       "Tim Sheard",
+  title =        "Automatic Generation and Use of Abstract Structure
+                 Operators",
+  journal =      "ACM Transactions on Programming Languages and
+                 Systems",
+  volume =       "13",
+  number =       "4",
+  pages =        "531--557",
+  year =         1991,
+  coden =        "ATPSDT",
+  ISSN =         "0164-0925",
+  bibdate =      "Fri Jan 5 07:58:42 MST 1996",
+  url =          "http://www.acm.org/pubs/toc/Abstracts/0164-0925/115369.html",
+  acknowledgement = ack-nhfb # " and " # ack-pb,
+  keywords =     "algorithms; design; languages",
+  subject =      "{\bf D.3.3}: Software, PROGRAMMING LANGUAGES, Language
+                 Constructs and Features, Abstract data types. {\bf
+                 D.3.3}: Software, PROGRAMMING LANGUAGES, Language
+                 Constructs and Features, Recursion. {\bf D.1.1}:
+                 Software, PROGRAMMING TECHNIQUES, Applicative
+                 (Functional) Programming.",
+}
+
+@InProceedings{Hughes,
+  author =       "R.J.M. Hughes",
+  title =        "{Lazy memo-functions}",
+  booktitle =    "Functional Programming Languages and Computer
+                 Architecture",
+  publisher =    "Springer-Verlag LNCS 201",
+  pages =        "129--146",
+  year =         "1985",
+}
+
+@InProceedings{Cook,
+  title =        "Disposable memo Functions (Extended Abstract)",
+  author =       "Byron Cook and John Launchbury",
+  pages =        "310",
+  booktitle =    "Proc. 1997 International
+                 Conf. on Functional Programming",
+  year =         "1997",
+  address =      "Amsterdam, The Netherlands",
+}
+
+@TechReport{Stemple92a,
+  author =       "D. Stemple and R. B. Stanton and T. Sheard and P.
+                 Philbrow and R. Morrison and G. N. C. Kirby and L.
+                 Fegaras and R. L. Cooper and R. C. H. Connor and M. P.
+                 Atkinson and S. Alagic",
+  title =        "Type-Safe Linguistic Reflection: {A} Generator
+                 Technology",
+  institution =  "ESPRIT BRA Project 3070 FIDE",
+  number =       "FIDE/92/49",
+  year =         1992,
+  url =          "http://www-ppg.dcs.st-and.ac.uk/Publications/1992.html#linguistic.reflection",
+  abstract =     "Reflective systems allow their own structures to be
+                 altered from within. In a programming system reflection
+                 can occur in two ways: by a program altering its own
+                 interpretation or by it changing itself. Reflection has
+                 been used to facilitate the production and evolution of
+                 data and programs in database and programming language
+                 systems. This paper is concerned with a particular
+                 style of reflection, called linguistic reflection, used
+                 in compiled, strongly typed languages. Two major
+                 techniques for this have evolved: compile-time
+                 reflection and run-time reflection. These techniques
+                 are described together with a definition and anatomy of
+                 reflective systems using them. Two illustrative
+                 examples are given and the uses of type-safe reflective
+                 techniques in a database programming language context
+                 are surveyed. These include attaining high levels of
+                 genericity, accommodating changes in systems,
+                 implementing data models, optimising implementations
+                 and validating specifications.",
+}
+@TechReport{TRPL,
+  author = 	 "Tim Sheard",
+  title = 	 "A user's guide to {TRPL}, A compile-time reflective programming                   language",
+  institution =  "Dept. of Computer and Information Science,
+                  University of Massachusetts",
+  year = 	 1990,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "COINS 90-109",
+  OPTaddress = 	 "Amherst",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Clinger:91,
+  author =       "William Clinger and Jonathan Rees",
+  title =        "Macros That Work",
+  pages =        "155--162",
+  ISBN =         "0-89791-419-8",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  address =      "Orlando",
+  year =         1991,
+  publisher =    ACM,
+}
+
+@Book{SML,
+  author =       "Robin Milner and Mads Tofte and Robert Harper and
+                 David MacQueen",
+  year =         1997,
+  title =        "The {Definition} of {Standard ML} (Revised)",
+  publisher =    "MIT Press",
+}
+@Book{Curry:Feys:58,
+  author =       "Haskell Brookes Curry and Robert Feys",
+  title =        "Combinatory Logic, Volume {I}",
+  series =       "Studies in Logic and the Foundations of Mathematics",
+  publisher =    "North-Holland",
+  address =      "Amsterdam",
+  year =         1958,
+  pages =        "xvi+417",
+  comments =     "with two sections by William Craig",
+  note =         "Second printing 1968",
+  callno =       "510.1 C97c",
+  checked =      "19 January 1986",
+}
+
+@Book{DiCosmo95,
+  author =       "Roberto {Di~Cosmo}",
+  title =        "Isomorphisms of Types: from $\lambda$-calculus to
+                  information retrieval and language design",
+  publisher =    {Birkh\"{a}user},
+  year =         1995,
+  OPTkey =       {},
+  OPTeditor =    "Ronald V. Book",
+  OPTvolume =    {},
+  OPTnumber =    {},
+  series =       "Progress in Theoretical Computer Science",
+  OPTaddress =   {},
+  OPTedition =   {},
+  OPTnote =      {},
+  OPTannote =    {}
+}
+@TechReport{Sheard:95:Generators,
+  author = 	 "Tim Sheard and Neal Nelson",
+  title = 	 "Type safe abstractions using program generators",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1995,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-95-013",
+  OPTaddress = 	 "",
+  OPTnote = 	 {},
+  note  =        "Available from \cite{ogi-tr-site}",
+  OPTannote = 	 {}
+}
+
+@Book{Aho:86:Compilers, 
+ author
+     =
+      "Alfred V. Aho and Ravi Sethi and Jeffrey D. Ullman", 
+ title
+     =
+      "Compilers Principles, Techniques, and Tools", 
+ publisher
+     =
+      "Addison Wesley", 
+ ISBN
+     =
+      "0-201-10194-7", 
+ year
+     =
+      1986, 
+ reffrom
+     =
+      "Lipton:Snyder:fdopc:1978", 
+ reffrom
+     =
+      "Cardelli:acm:lfp:1984", 
+ reffrom
+     =
+      "Shyu:acm:sigplan:1986", 
+ reffrom
+     =
+      "Karinthi:Weiser:iait:1987", 
+ reffrom
+     =
+      "Koskimies:Paakki:iait:1987", 
+ reffrom
+     =
+      "Offutt:King:iait:1987", 
+ reffrom
+     =
+      "Norman:acm:lfp:1988", 
+ reffrom
+     =
+      "Mossenbock:spe:1988", 
+ reffrom
+     =
+      "Consel:esop:1988", 
+ reffrom
+     =
+      "Jones:acm:sigplan:1988", 
+ reffrom
+     =
+      "Paakki:acm:sigplan:1988", 
+ reffrom
+     =
+      "Snelting:acm:sigplan:1990", 
+ reffrom
+     =
+      "vanHorebeek:Lewi:acm:sigplan:1990", 
+ reffrom
+     =
+      "Dobler:Pirklbauer:acm:sigplan:1990", 
+ reffrom
+     =
+      "Burshtenyn:acm:sigplan:1990", 
+ reffrom
+     =
+      "Berlin:Wise:ieee:c:1990", 
+ reffrom
+     =
+      "Hanson:acm:lfp:1990", 
+ reffrom
+     =
+      "Consel:acm:lfp:1990", 
+ reffrom
+     =
+      "Rosendahl:agata:1990", 
+ reffrom
+     =
+      "Augusteijn:agata:1990", 
+ reffrom
+     =
+      "Smesters:Nocker:vanGronigen:Plasmeijer:fplca:1991", 
+ reffrom
+     =
+      "Mauny:deRauglaudre:acm:lfp:1992", 
+ reffrom
+     =
+      "Nielson:Nielson:acm:lfp:1992", 
+ reffrom
+     =
+      "Flanagan:Sabry:Duba:Felleisen:acm:pldi:1993", 
+ reffrom
+     =
+      "Baker:acm:om:1993", 
+
+} 
+
+@Article{Gomard:91:Untyped, 
+ author
+     =
+     "Carsten K. Gomard and Neil D. Jones", 
+ title
+     =
+     "A Partial Evaluator for untyped lambda calculus", 
+ journal
+     =
+     "Journal of Functional Programming", 
+ volume
+     =
+     "1", 
+ number
+     =
+     "1", 
+ pages
+     =
+     "21--69", 
+ year
+     =
+     1991, 
+ reffrom
+     =
+     "Bondorf:acm:lfp:1992", 
+
+} 
+@InProceedings{Hatcliff:96:Reasoning,
+ author
+     =
+      "John Hatcliff and Robert Gl{\"u}ck", 
+ year
+     =
+      1996, 
+ title
+     =
+      "Reasoning about hierarchies of online specialization systems", 
+ booktitle
+     =
+      "Partial Evaluation", 
+ editor
+     =
+      "Olivier Danvy and Robert Gl{\"u}ck and Peter Thiemann", 
+ publisher
+     =
+      "Springer-Verlag", 
+ series
+     =
+      "Lecture Notes in Computer Science", 
+ volume
+     =
+      "1110", 
+ pages
+     =
+      "161--182", 
+ keywords
+     =
+      "program specialization, program transformation, metacomputation, metasystem transition", 
+ summary
+     =
+      "We present the language S-Graph-n --- the core of a multilevel metaprogramming environment for exploring foundational issues of self-applicable online program specialization. We
+      illustrate how special-purpose S-Graph-n primitives can be used to obtain an efficient and conceptually simple encoding of programs as data objects. The key feature of the encoding scheme is the
+      use of numerical indices which indicate the number of times that a program piece has been encoded. Evaluation of S-Graph-n is formalized via an operational semantics. This semantics is used to
+      justify the fundamental operations on metavariables --- special-purpose tags for tracking unknown values in self-applicable online specialization systems. We show how metavariables can be
+      used to construct biased generating extensions without relying on a separate binding-time analysis phase.", 
+ semno
+     =
+      "D-269", 
+ puf
+     =
+      "Artikel i proceedings (med censur)", 
+ id
+     =
+      "KonR", 
+
+} 
+
+@InProceedings{Meijer1991:Bananas, 
+ author
+       =
+        "E. Meijer and M. M. Fokkinga and R. Paterson", 
+ booktitle
+       =
+        "Functional Programming and Computer Architecture", 
+ title
+       =
+        "Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire", 
+ year
+       =
+        1991, 
+ abstract-url
+       =
+        "http://hydra.cs.utwente.nl/~fokkinga/mmf91m.html", 
+ pages
+       =
+        "124--144", 
+ publisher
+       =
+        "Springer-Verlag", 
+ scope
+       =
+        "trans", 
+
+} 
+@InProceedings{Meijer:95:Exponential, 
+ author
+       =
+        "Erik Meijer and Graham Hutton", 
+ title
+       =
+        "Bananas in Space: Extending Fold and Unfold to Exponential Types", 
+ booktitle
+       =
+        "Proc. International Conf. on Functional Programming Languages and Computer Architecture (FPCA)", 
+ address
+       =
+        "La Jolla", 
+ organization
+       =
+        "ACM SIGPLAN/SIGARCH and IFIP WG2.8", 
+ publisher
+       =
+        ACM, 
+ url
+     =
+      "http://www.cs.nott.ac.uk/Department/Staff/gmh/bananas.ps", 
+ year
+       =
+        1995, 
+ pages
+       =
+        "324--333", 
+
+} 
+@Article{Mogensen:92:Efficient, 
+ semno
+     =
+      "D-101", 
+ author
+     =
+      "Torben {\AE}. Mogensen", 
+ title
+     =
+      "Efficient Self-Interpretation in Lambda Calculus", 
+ journal
+     =
+      "Functional Programming", 
+ year
+     =
+      1992, 
+ volume
+     =
+      "2", 
+ number
+     =
+      "3", 
+ pages
+     =
+      "345--364", 
+ summary
+     =
+      "A compact representation of $\lambda$-terms in pure lambda calculus is presented and it is shown that this gives possibility for efficient self-interpretation and self-reduction. The
+      representation also gives an efficient construction of the second recursion theorem. Proofs or proof outlines are given of all constructions.", 
+ keywords
+     =
+      "lambda calculus, representation, self-interpretation, second recursion theorem, self-reduction", 
+
+} 
+@InProceedings{Nielson:95:Correctness, 
+ author
+     =
+      "Flemming Nielson", 
+ title
+     =
+      "Correctness of code generation from a two-level meta-language", 
+ pages
+     =
+      "30--40", 
+ ISBN
+     =
+      "3-540-16442-1", 
+ editor
+     =
+      "B. Robinet and R. Wilhelm", 
+ booktitle
+     =
+      "Proc. European Symposium on Programming ({ESOP} 86)", 
+ address
+     =
+      "Saarbr{\"u}cken", 
+ year
+     =
+      1986, 
+ series
+     =
+      LNCS, 
+ volume
+     =
+      "213", 
+ publisher
+     =
+      "Springer", 
+
+} 
+@InCollection{Nielson89,
+  author =       "Flemming Nielson",
+  editor =       "K. Odijk and M. Rem and J.-C. Syre",
+  title =        "The Typed $\lambda$-Calculus with First-Class
+                 Processes",
+  booktitle =    "PARLE '89: Parallel Languages and Architectures
+                 Europe, volume 1",
+  pages =        "357--373",
+  publisher =    "Springer-Verlag",
+  address =      "New York",
+  year =         1989,
+  keywords =     "lambda calculus CCS CSP functional",
+  abstract =     "The author extends the typed lambda-calculus with CCS-
+                 or CSP-like processes and allows these to be
+                 first-class citizens just as functions are first-class
+                 citizend in functional languages. The main novel
+                 feature of the language is the use of types to record
+                 the communication possibilities possessed by processes
+                 and in this we give up the causality between
+                 communications, i.e. the types do not model whether or
+                 not one communication may takeplace before another. In
+                 analogy with the semantics of the lambda-calculus, and
+                 of CCS, we develop a structural operational semantics
+                 for the language. We then prove that the operational
+                 semantics preserves the types and we use this to give
+                 examples of `errors' that cannot arise for well-typed
+                 programs.",
+  note =         "Lecture Notes in Computer Science 365.",
+}
+ 
+@InCollection{Nielson87,
+  author =       "Flemming Nielson",
+  title =        "A formal type system for comparing partial
+                 evaluators",
+  editor =       "D Bj{\o}rner and Ershov and Jones",
+  booktitle =    "Proc. workshop on Partial Evaluation and
+                 Mixed Computation (1987)",
+  pages =        "349--384",
+  publisher =    "North-Holland",
+  year =         1988,
+}
+@InProceedings{PeytonJones:91:Unboxed, 
+ author
+         =
+         "Simon L. {Peyton Jones} and John Launchbury", 
+ booktitle
+         =
+         "Functional Programming and Computer Architecture", 
+ title
+         =
+         "Unboxed values as first class citizens in a non-strict functional language", 
+ year
+         =
+         1991, 
+ document-size
+         =
+         "96.9 kbytes", 
+ url
+         =
+         "ftp://ftp.dcs.gla.ac.uk/pub/glasgow-fp/papers/unboxed-values.ps.Z", 
+ scope
+         =
+         "implemen", 
+
+} 
+
+@Book{Tennent:91:Semantics, 
+ author
+     =
+      "Robert D. Tennent", 
+ title
+     =
+      "Semantics of Programming Languages", 
+ publisher
+     =
+      "Prentice Hall", 
+ address
+     =
+      "New York", 
+ year
+     =
+      1991, 
+ pages
+     =
+      "7", 
+ ISBN
+     =
+      "0-13-805607-2 (hardcover) 0-13-805599-8 (paperback)", 
+ callno
+     =
+      "QA76.7.T473", 
+ checked
+     =
+      "13 August 1992", 
+
+}
+
+@Book{Quine:71:LPV,
+  author = 	 "Willard van Orman Quine",
+  title = 	 "From a Logical Point of View",
+  publisher = 	 "Harper \& Row",
+  year = 	 1971,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  series = 	 "Logic-Philosphical Essays",
+  OPTaddress = 	 {},
+  edition = 	 "Second, revised",
+  OPTannote = 	 {}
+}
+
+@Book{WhiteheadRussell:Principia,
+  author =       "Alfred North Whitehead and Bertrand Russell",
+  title =        "Principia Mathematica",
+  publisher =    "Cambridge University Press",
+  address =      "Cambridge",
+  year =         1925,
+}
+
+@Book{quine:1963a,
+  author =       "Willard van Orman Quine",
+  title =        "Set Theory and Its Logic",
+  publisher =    "Harvard University Press",
+  year =         1963,
+  address =      "Cambridge",
+}
+@Book{Quine:51:ML,
+  author = 	 "Willard van Orman Quine",
+  title = 	 "Mathematical Logic",
+  publisher = 	 "Harvard University Press",
+  year = 	 1951,
+  OPTkey = 	 {},
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  edition = 	 "Revised",
+  note = 	 "First published in 1940 by Norton",
+  OPTannote = 	 {}
+}
+
+@PhdThesis{Schmidt81,
+  author =       "D. A. Schmidt",
+  title =        "Compiler Generation from Lambda Calculus Definitions
+                 of Programming Languages",
+  school =       "Kansas State University",
+  type =         "Ph.{D}. Thesis",
+  address =      "Manhattan",
+  year =         1981,
+  keywords =     "functional",
+}
+@InProceedings{Mosses76,
+  author =       "P. D. Mosses",
+  title =        "Compiler Generation Using Denotational Semantics",
+  pages =        "436--441",
+  ISBN =         "3-540-07854-1",
+  editor =       "A. Mazurkiewicz",
+  booktitle =    "Proc. 5th Symposium on Mathematical
+                 Foundations of Computer Science",
+  address =      "Gda{\'n}sk",
+  year =         1976,
+  series =       LNCS,
+  volume =       "45",
+  publisher =    "Springer",
+}
+@PhdThesis{Palsberg92,
+  author =       "Jens Palsberg",
+  title =        "Provably Correct Compiler Generation",
+  year =         1992,
+  school =       "Department of Computer Science, University of Aarhus",
+  note =         "xii+224 pages",
+  annote =       "We have designed , implemented, and proved the
+                 correctness of a compiler generator that accepts action
+                 semantic descriptions of imperative programming
+                 languages. We have used it to generate compilers for
+                 both a toy language and a non-trivial subset of Ada.
+                 The generated compliers emit absolute code for an
+                 abstract RISC machine language that is assembled into
+                 code for the SPARC and the HP Precision Architecture.
+                 The generated code is an order of magnitude better than
+                 that produced by compilers generated by the classical
+                 systems of Mosses, Paulson, and Wand. Our machine
+                 language needs no runtime type-checking and is thus
+                 more realistic than those considered in previous
+                 compiler proofs. We use solely algebraic
+                 specifications; proofs are given in the initial model.
+                 The use of action semantics makes the processable
+                 language specification easy to read and pleasant to
+                 work with. We view our compiler generator as the first
+                 step towards user-friendly and automatic generation of
+                 realistic and provably correct compilers.",
+  keywords =     "action semantics",
+  available =    "Aarhus: DAIMI PB-422",
+}
+@Book{Lee89,
+  author =       "Peter Lee",
+  title =        "Realistic Compiler Generation",
+  year =         1989,
+  publisher =    "MIT Press",
+  series =       "Foundations of Computing Series",
+  annote =       "This book is based on {\em High-Level Semantics\/},
+                 which is essentially a variant of action semantics,
+                 especially suited to the purposes of compiler
+                 generation for conventional programming languages.",
+  keywords =     "action semantics",
+}
+@Book{Tofte90,
+  semno =        "D-85",
+  author =       "Mads Tofte",
+  title =        "Compiler Generators - What They Can Do, What They
+                 Might Do and What They Probably Never Do",
+  publisher =    "Springer-Verlag",
+  year =         1990,
+  volume =       "19",
+  summary =      "Contains a description of the CERES Compiler Generator
+                 and other systems. CERES was developed by Neil Jones
+                 and Mads Tofte.",
+  keywords =     "compiler generation, CERES",
+}
+@Proceedings{Jones80,
+  editor =       "Neil D. Jones",
+  title =        "Proceedings of a Workshop on Semantics-Directed
+                 Compiler Generation",
+  booktitle =    "Proceedings of a Workshop on Semantics-Directed
+                 Compiler Generation",
+  publisher =    "Springer Verlag",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "94",
+  year =         1980,
+  reffrom =      "Hannan:Miller:acm:lfp:1990",
+}
+@Book{Paulson,
+  author =       "Larry Paulson",
+  edition =      "Second",
+  publisher =    "Cambridge University Press",
+  title =        "{ML} for the Working Programmer",
+  year =         1992,
+}@Book{Reade89,
+  key =          "Reade",
+  author =       "Chris Reade",
+  title =        "Elements of Functional Programming",
+  publisher =    "Addison-Wesley",
+  year =         1989,
+  series =       "International Computer Science Series",
+  address =      "Wokingham",
+}@InCollection{Paulson84,
+  author =       "Lawrence Paulson",
+  title =        "Compiler Generation from Denotational Semantics",
+  editor =       "B. Lorho",
+  booktitle =    "Methods and Tools for Compiler Construction",
+  publisher =    "Cambridge University Press",
+  year =         1984,
+  pages =        "219--250",
+  reffrom =      "Rosendahl:agata:1990",
+}
+@InProceedings{wand84,
+  author =       "M. Wand",
+  title =        "From Interpreter to Compiler: {A} Representational
+                 Derivation",
+  booktitle =    "Programs as Data Objects",
+  editor =       "H. Ganzinger and N. D. Jones",
+  organization = "Springer-Verlag LNCS, Vol. 217",
+  pages =        "306--324",
+  year =         1984,
+}
+@Article{Clinger84,
+  author =       "William Clinger",
+  year =         1984,
+  journal =      "Conf. Record of the 1984 ACM Symposium on {LISP}
+                 and Functional Programming",
+  pages =        "356--364",
+  title =        "The {S}cheme 311 compiler: An Exercise in Denotational
+                 Semantics",
+}
+
+@Article{Cohen85,
+  key =          "Cohen",
+  author =       "Jacques Cohen",
+  title =        "Describing Prolog by Its Interpretation and
+                 Compilation",
+  journal =      "CACM",
+  volume =       "28",
+  number =       "12",
+  year =         1985,
+  pages =        "1311--1324",
+  annote =       "Overview of Prolog. Good bibliography. 47
+                 references.",
+}
+
+@Book{McKeeman70,
+  key =          "McKeeman \& Horning \& Wortman",
+  author =       "William M. McKeeman and James J. Horning and David B.
+                 Wortman",
+  title =        "A Compiler Generator",
+  publisher =    "Prentice-Hall",
+  year =         1970,
+  address =      "Englewood Cliffs",
+  annote =       "44 refrences.",
+}
+@InProceedings{Hilsdale95,
+  author =       "E. Hilsdale and J. M. Ashley and R. K. Dybvig and D.
+                 P. Friedman",
+  title =        "Compiler construction using {S}cheme",
+  series =       LNCS,
+  volume =       "1022",
+  pages =        "251--??",
+  year =         1995,
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Sat May 11 13:45:32 MDT 1996",
+  acknowledgement = ack-nhfb,
+}
+@InProceedings{Lori85,
+  author =       "Lori L. Pollock and Mary Lou Soffa",
+  title =        "Incremental Compilation of Optimized Code",
+  pages =        "152--164",
+  ISBN =         "0-89791-147-4",
+  editor =       "Brian K. Reid",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  address =      "New Orleans",
+  year =         1985,
+  publisher =    ACM,
+}
+@InProceedings{Cheatham94,
+  author =       "T. Cheatham",
+  title =        "Models, Languages, and Compiler Technology for High
+                 Performance Computers",
+  series =      LNCS,
+  volume =       "841",
+  pages =        "3--??",
+  year =         1994,
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Mon May 13 11:52:14 MDT 1996",
+  acknowledgement = ack-nhfb,
+}
+
+@InProceedings{TH98,
+  author = 	 "Walid Taha and Jim Hook",
+  title = 	 "The Anatomy of a Component Generation System",
+  booktitle = 	 "International Workshop on the Principles of 
+                  Software Evolution",
+  address = 	 "Kyoto",
+  year =         1998,
+}
+
+@Article{TS00,
+author =       "Walid Taha and Tim Sheard",
+title =        "{MetaML}:  Multi-Stage Programming with Explicit 
+                Annotations",
+journal =      "Theoretical Comp. Sci.",
+year =         "2000",
+volume =       248,
+number =       "1-2",
+}
+
+@Article{Partsch83,
+  author =       "H. Partsch and R. Stein Brueggen",
+  title =        "Program Transformation Systems",
+  journal =      "ACM Computing Surveys",
+  year =         1983,
+  volume =       "15",
+  number =       "3",
+  pages =        "199--237",
+  annote =       "My favorite. :) (WT)  [R-2]"
+}
+
+@Book{Smith96,
+  author = 	 "Brian Cantwell Smith",
+  title = 	 "On The Origin of Objects",
+  publisher = 	 "MIT Press",
+  year = 	 1996,
+}
+
+
+@Article{Betz:1994,
+  author =       "Mark Betz",
+  title =        "Interoperable objects",
+  journal =      "Dr. Dobb's Journal of Software Tools",
+  volume =       "19",
+  number =       "11",
+  pages =        "18--20, 24--26, 28, 32, 34, 36--39",
+  year =         1994,
+  coden =        "DDJOEB",
+  ISSN =         "1044-789X",
+  bibdate =      "Thu Jan 9 09:35:43 MST 1997",
+  abstract =     "If the next great battle in the computing wars
+                 revolves around interoperable (or component) objects,
+                 you'd beeter know who the combatants are and what their
+                 arsenals hold. Mark analyzes the specification and
+                 proposals, ranging from CORBA and SOM DSOM to COM and
+                 OpenDoc.",
+  acknowledgement = ack-nhfb,
+  classification = "722.4; 723.1; 723.2; 723.5; 722.2; 723.1.1; C6150N
+                 (Distributed systems); C6110J (Object-oriented
+                 programming)",
+  journalabr =   "Dr Dobb's J Software Tools Prof Program",
+  keywords =     "C (programming language); COM; Compound documents;
+                 Computer architecture; Computer hardware; Computer
+                 hardware description languages; Computer networks;
+                 Computer operating systems; Computer simulation;
+                 Computer-industry battleground; Computing wars; CORBA;
+                 Data structures; Distributed computer systems;
+                 Distributed object computing; Distributed objects;
+                 Distributed processing; Distributed-object computing;
+                 Interfaces (computer); Interoperable objects; Large
+                 scale systems; Object models; Object oriented
+                 programming; Object oriented software; OpenDoc;
+                 Personal computers; Proposals; SOM/DSOM;
+                 Specifications",
+  thesaurus =    "Distributed processing; Object-oriented methods;
+                 Object-oriented programming; Open systems",
+}
+@Article{Morgan:1998,
+  author =       "Bryan Morgan",
+  title =        "Building Distributed Applications with {Java} and
+                 {CORBA}",
+  journal =      "Dr. Dobb's Journal of Software Tools",
+  volume =       "23",
+  number =       "4",
+  pages =        "94, 96--99, 104--105",
+  year =         1998,
+  coden =        "DDJOEB",
+  ISSN =         "1044-789X",
+  bibdate =      "Fri Mar 6 18:42:46 MST 1998",
+  url =          "http://www.ddj.com/ftp/1998/1998_04/corbajav.txt;
+                 http://www.ddj.com/ftp/1998/1998_04/corbajav.zip",
+  abstract =     "Bryan examines the concepts behind CORBA-based
+                 development using Borland's JBuilder and Visigenic's
+                 VisiBroker for Java. Additional resources include
+                 corbajav.txt (listings) and corbajav.zip (source
+                 code).",
+  acknowledgement = ack-nhfb,
+}
+
+
+@Article{Adler95,
+  key =          "adler95a",
+  author =       "Richard M. Adler",
+  title =        "Emerging Standards For Component Software",
+  journal =      "IEEE Computer",
+  year =         1995,
+  volume =       "28",
+  number =       "3",
+  pages =        "68--77",
+  abstract =     "Component software benefits include reusability and
+                 interoperability, among others. What are the
+                 similarities and differences between the competing
+                 standards for this new technology, and how will they
+                 interoperate? Object-oriented technology is steadily
+                 gaining acceptance for commercial and custom
+                 application development through programming languages
+                 such as C++ and Smalltalk, object oriented CASE tools,
+                 databases, and operating systems such as Next
+                 Computer's NextStep. Two emerging technologies, called
+                 compound documents and component software, will likely
+                 accelerate the spread of objectoriented concepts across
+                 system-level services, development tools, and
+                 application-level behaviours. Tied closely to the
+                 popular client/server architecture for distributed
+                 computing, compound documents and component software
+                 define object-based models that facilitate interactions
+                 between independent programs. These new approaches
+                 promise to simplify the design and implementation of
+                 complex software applications and, equally important,
+                 simplify human-computer interactive work models for
+                 application end users. Following unfortunate tradition,
+                 major software vendors have developed competing
+                 standards to support and drive compound document and
+                 component software technologies. These incompatible
+                 standards specify distinct object models, data storage
+                 models, and application interaction protocols. The
+                 incompatibilities have generated confusion in the
+                 market, as independent software vendors, system
+                 integrators, in-house developers, and end users
+                 struggle to sort out the standards' relative merits,
+                 weaknesses, and chances for commercial success. Let's
+                 take a look now at the general technical concepts
+                 underlying compound documents and component software.
+                 Then we examine the OpenDoc, OLE 2, COM, and CORBA
+                 standards being proposed for these two technologies.
+                 Finally, we'll review the work being done to extend the
+                 standards and to achieve interoperability across them
+                 (10 Refs.)",
+}
+@InProceedings{TS97B,
+  author =       "Walid Taha and Tim Sheard",
+  title =        "Multi-stage programming",
+  pages =        "321--321",
+  ISSN =         "0362-1340",
+  booktitle =    "Proc. International
+                 Conf. on Functional Programming ({ICFP})",
+  series =       "ACM SIGPLAN Notices",
+  volume =       "32,8",
+  publisher =    ACM,
+  address =      "New York",
+  year =         1997,
+}
+
+@InCollection{Gentzen35,
+  author =       "Gerhard Gentzen",
+  title =        "Investigations into Logical Deductions, 1935",
+  booktitle =    "The Collected Papers of Gerhard Gentzen",
+  editor =       "M. E. Szabo",
+  publisher =    "North-Holland Publishing Co.",
+  address =      "Amsterdam",
+  year =         1969,
+  pages =        "68--131",
+}
+
+@PhdThesis{Sitaram:92,
+  author =       "Dorai Sitaram",
+  title =        "Models of Control and Their Implications for
+                 Programming Language Design",
+  school =       "Rice University",
+  pages =        "166",
+  year =         1994,
+  refs =         "54",
+  url =          "ftp://cs.rice.edu/public/languages/thesis-sitaram.dvi.Z",
+  url =          "ftp://cs.rice.edu/public/languages/thesis-sitaram.ps.Z",
+}
+
+@Article{Bal81,
+  author = 	 "R. Balzer",
+  title = 	 "Transformational Implementation: an Example",
+  journal = 	 "IEEE Transactions on Software Engineering",
+  year = 	 1981,
+  volume = 	 7,
+  number = 	 1,
+}
+
+@InProceedings{Bal92,
+  author = 	 "R. Balzer",
+  title = 	 "Design Refinement in DSSAs",
+  booktitle = 	 "Proc. JSGCC Software 
+                  Initiative Strategy Workshop",
+  year = 	 1992,
+}
+
+@InProceedings{BH+94,
+  author = 	 "J. Bell and F. Bellegarde and J. Hook and et~al.",
+  title = 	 "Software Design for Reliability and Reuse: 
+                  A Proof-of-Concept Demonstration",
+  booktitle = 	 "Proceedings of TRI-Ada'94",
+  year = 	 1994,
+  pages = 	 "396--404"
+}
+
+@Article{BST+94,
+  author = 	 "D. Batory and V. Singhal and J. Thomas and 
+                  S. Dasari and B. Geraci and M. Sirkin",
+  title = 	 "The GenVoca Model of Software-System Generators",
+  journal = 	 "IEEE Software",
+  year = 	 1994,
+}
+
+@TechReport{GLM+97,
+  author = 	 "G. Kiczales and J. Lamping and A. Mendhekar
+                  and C. Maeda and C. Lopes and J. Loingtier and J. Irwin",
+  title = 	 "Aspect Oriented Programming",
+  institution =  "PARC",
+  year = 	 1997,
+}
+
+@TechReport{[Jon75,
+  author = 	 "S. Johnson",
+  title = 	 "YACC --- Yet Another Compiler-Compiler",
+  institution =  "Bell Laboratories",
+  year = 	 1997,
+  number = 	 "32"
+}
+
+@InProceedings{[KMB96,
+  author = 	 "R. Kieburtz and L. Mckinney and J. Bell and 
+                  J. Hook and  A. Kotov and J. Lewis and
+                  D. Oliva and  T. Sheard and I. Smith and L. Walton",
+  title = 	 "A Software Engineering Experiment in Software 
+                  Component Generation",
+  booktitle = 	 "Proceedings of 18th International Conf. 
+                  on Software Engineering",
+  year = 	 1996,
+  publisher =    "IEEE Computer Society Press",
+  address = 	 "Berlin",
+}
+
+@InProceedings{LB95,
+  author = 	 "M. Lowry and J. van Baalen",
+  title = 	 "Meta-Amphion: Synthesis of Efficient 
+                  Domain-Specific Program Synthesis Systems",
+  booktitle = 	 "Proceedings  of 10th Knowledge-Based 
+                  Software Engineering Conf.",
+  year = 	 1995,
+  address = 	 "Boston",
+  pages = 	 "2--10"
+}
+
+
+@InProceedings{Jones:88,
+  author =       "Neil D. Jones",
+  title =        "Challenging Problems in Partial Evaluation and Mixed
+                 Computation",
+  booktitle =    "Partial Evaluation and Mixed Computation",
+  year =         "1988",
+  semno =        "D-26",
+  editor =       "D. Bj{\o}rner and A. P. Ershov and N. D. Jones",
+  pages =        "1--14",
+  organization = "IFIP World Congress Proceedings",
+  publisher =    "Elsevier Science Publishers B.V.",
+  address =      "North-Holland",
+  summary =      "After a discussion of the state of the art in this
+                 field, a list of challenging problems for future
+                 research is presented.",
+  keywords =     "partial evaluation, mixed computation, program
+                 specialization",
+}
+
+@InProceedings{MKS97,
+  author = 	 "A. Misra and G. Karsai and J. Sztipanovits and 
+                  A. Ledeczi and M. Moore and E. Long",
+  title = 	 "A Model-Integrated Information System for Increasing
+                  Throughput in Discrete Manufacturing",
+  booktitle = 	 "Proceeding of the Engineering of Computer 
+                  Based Systems (ECBS) Conf.",
+  year = 	 1997,
+  address = 	 "Monterey",
+}
+
+@Article{PW92,
+  author = 	 "D. Perry and A. Wolf",
+  title = 	 "Foundations for the Study of Software
+                  Architecture",
+  journal = 	 "ACM SIGSOFT Software Engineering Notes",
+  year = 	 1992,
+  OPTkey = 	 {},
+  volume = 	 "17",
+  number = 	 "4",
+  OPTpages = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Distil,
+  author = 	 "Yannis Smaragdakis and Don Batory",
+  title = 	 "{DiSTiL}: A Transformation Library for Data Structures",
+  booktitle = 	 "USENIX Conf. on Domain-Specific Languages",
+  year = 	 1997,
+}
+
+@InProceedings{SJ94,
+  author = 	 "Y. Srinivas and R. Jullig",
+  title = 	 "SpecWare: Formal Support for Composing Software",
+  booktitle = 	 "Proc. Conf. on Mathematics of
+                  Program Construction",
+  year = 	 1995,
+  address = 	 "Kloster Irsee",
+  note = 	 "Also Kestrel Institute Technical Report KES.U.94.5."
+}
+
+@Article{Smi90,
+  author = 	 "Doug Smith",
+  title = 	 "{KIDS}: A Semi-Automatic Program Development System",
+  journal = 	 "IEEE Transactions on Software Engineering --- 
+                  Special Issue on Formal Methods",
+  year = 	 1990,
+  volume = 	 "16",
+  number = 	 "9",
+}
+
+@TechReport{TahaFacets97,
+  author = 	 "Walid Taha and Tim Sheard",
+  title = 	 "Facets of Multi-Stage Computation in
+                  Software Architectures",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1997,
+  number = 	 "CSE-97-010",
+  note  =        "Available from \cite{ogi-tr-site}",
+}
+
+@TechReport{Wil81,
+  author = 	 "D. Wile",
+  title = 	 "POPART: Producer of Parsers and Related Tools. System
+                  Builders' Manual",
+  institution =  "USC Information Sciences Institute",
+  year = 	 1981
+}
+
+@Article{Wil90,
+  author = 	 "D. Wile",
+  title = 	 "Adding Relational Abstraction to Programming
+                  Languages",
+  journal = 	 "ACM SIGSOFT Software Engineering Notes",
+  year = 	 1990,
+  volume = 	 "15",
+  number = 	 "4",
+  pages = 	 "128--139"
+}
+
+@InProceedings{PfenningElliott88,
+  author =       "Frank Pfenning and Conal Elliott",
+  title =        "Higher-Order Abstract Syntax",
+  booktitle =    "Proc. Symposium on
+                 Language Design and Implementation",
+  address =      "Atlanta",
+  year =         1988,
+  pages =        "199--208",
+  urlps =        "http://www.cs.cmu.edu/~fp/papers/pldi88.ps.gz",
+  keywords =     "lambda-Prolog",
+}
+
+@Article{Takahashi,
+  title =        "Parallel Reductions in {$\lambda$}-Calculus",
+  author =       "Masako Takahashi",
+  pages =        "120--127",
+  journal =      "Information and Computation",
+  year =         1995,
+  volume =       "118",
+  number =       "1",
+}
+
+@Book{Gunter,
+  author =       "Carl A. Gunter",
+  title =        "Semantics of Programming Languages",
+  publisher =    "MIT Press",
+  year =         1992,
+}
+
+@Article{HatcliffD97,
+  title =        "Thunks and the {$\lambda$}-calculus",
+  author =       "John Hatcliff and Olivier Danvy",
+  pages =        "303--319",
+  journal =      "Journal of Functional Programming",
+  year =         "1997",
+  volume =       "7",
+  number =       "3",
+}
+
+@Book{Sterling,
+  author =       "Leon Sterling and Ehud Shapiro",
+  title =        "The Art of Prolog",
+  edition =      "Second",
+  publisher =    "MIT Press",
+  address =      "Cambridge",
+  year =         "1994",
+  annote =       "Explaination of logic programming, Prolog, and related
+                 programming techniques. Many references.",
+}
+
+@Book{Maier,
+  author =       "D. Maier and D. S. Warren",
+  title =        "Computing with logic:  Logic programming with
+                 {P}rolog",
+  year =         "1988",
+  publisher =    "The Benjamin/Cummings Publishing Company, Inc.",
+}
+
+
+
+@Book{Winskel,
+  author =       "Glynn Winskel",
+  title =        "The Formal Semantics of Programming Languages: An
+                 Introduction.",
+  series =       "Foundations of Computing series",
+  pages =        "384",
+  publisher =    "MIT Press",
+  year =         "1993",
+  keywords =     "text, book, denotational, DS, programming language
+                 definition",
+}
+
+@Book{Mitchell,
+  key =          "Mitchell",
+  author =       "John C. Mitchell",
+  title =        "Foundations for Programming Languages",
+  publisher =    "MIT Press",
+  address =      "Cambridge",
+  year =         "1996",
+  ISBN =         "0-262-13321-0",
+  annote =       "Graduate text on programming language theory. Focus on
+                 typed lambda calculus. Hundreds of references.",
+}
+
+@InProceedings{Muller3,
+  title =        "A Staging Calculus and its Application to the
+                 Verification of Translators",
+  author =       "Robert Muller",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  year =         "1994",
+  address =      "Portland",
+  pages =        "389--396",
+}
+
+@Article{Muller2,
+  author =       "Robert Muller",
+  title =        "{M-LISP}: {A} Representation-Independent Dialect of
+                 {LISP} with Reduction Semantics",
+  journal =      "ACM Transactions on Programming Languages and
+                 Systems",
+  volume =       "14",
+  number =       "4",
+  pages =        "589--616",
+  year =         "1992",
+  coden =        "ATPSDT",
+  ISSN =         "0164-0925",
+  url =          "http://www.acm.org/pubs/toc/Abstracts/0164-0925/133254.html",
+  abstract =     "In this paper we introduce M-LISP, a dialect of LISP
+                 designed with an eye toward reconciling LISP's
+                 metalinguistic power with the {\em structural} style of
+                 operational semantics advocated by Plotkin [28]. We
+                 begin by reviewing the original definition of LISP [20]
+                 in an attempt to clarify the source of its
+                 metalinguistic power. We find that it arises from a
+                 problematic clause in this definition. We then define
+                 the abstract syntax and operational semantics of
+                 M-LISP, essentially a hybrid of M-expression LISP and
+                 Scheme. Next, we tie the operational semantics to the
+                 corresponding equational logic. As usual, provable
+                 equality in the logic implies operational equality.\par
+                 Having established this framework we then extend M-LISP
+                 with the metalinguistic {\em eval} and {\em reify}
+                 operators (the latter is a nonstrict operator that
+                 converts its argument to its metalanguage
+                 representation). These operators encapsulate the
+                 matalinguistic representation conversions that occur
+                 globally in S-expression LISP. We show that the naive
+                 versions of these operators render LISP's equational
+                 logic inconsistent. On the positive side, we show that
+                 a naturally restricted form of the {\em eval} operator
+                 is confluent and therefore a conservative extension of
+                 M-LISP. Unfortunately, we must weaken the logic
+                 considerably to obtain a consistent theory of
+                 reification.",
+  acknowledgement = ack-pb,
+  keywords =     "languages; theory",
+  subject =      "{\bf F.3.2}: Theory of Computation, LOGICS AND
+                 MEANINGS OF PROGRAMS, Semantics of Programming
+                 Languages, Operational semantics. {\bf D.3.2}:
+                 Software, PROGRAMMING LANGUAGES, Language
+                 Classifications, LISP. {\bf D.3.1}: Software,
+                 PROGRAMMING LANGUAGES, Formal Definitions and Theory.
+                 {\bf D.3.3}: Software, PROGRAMMING LANGUAGES, Language
+                 Constructs and Features. {\bf D.3.4}: Software,
+                 PROGRAMMING LANGUAGES, Processors. {\bf F.3.3}: Theory
+                 of Computation, LOGICS AND MEANINGS OF PROGRAMS,
+                 Studies of Program Constructs. {\bf F.4.1}: Theory of
+                 Computation, MATHEMATICAL LOGIC AND FORMAL LANGUAGES,
+                 Mathematical Logic, Lambda calculus and related
+                 systems.",
+}
+
+@Article{fexprs,
+  author = 	 "Mitchell Wand",
+  title = 	 "The Theory of Fexprs is Trivial",
+  journal = 	 "Lisp and Symbolic Computation",
+  year = 	 1998,
+  OPTkey = 	 {},
+  volume = 	 10,
+  OPTnumber = 	 189,
+  pages = 	 "189--199",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Todd,
+  title =        "C++ Templates as Partial Evaluation",
+  author =       "Todd L. Veldhuizen",
+  booktitle =    "Proc. Workshop on
+                 Partial Evaluation and Semantics-Based Program
+                 Manipulation",
+  editor = 	 "O. Danvy",
+  address = 	 "San Antonio",
+  publisher =    "University of Aarhus, Dept. of Computer Science",
+  pages =        "13--18",
+  year =         1999
+}
+
+@PhdThesis{T99,
+  author =       "Walid Taha",
+  title =        "Multi-Stage Programming:  Its Theory and Applications",
+  school =       "Oregon Graduate Inst. of Sci. and Tech.",
+  year =         "1999",
+}
+
+@InProceedings{LawallThiemann:97,
+  author =       "J. Lawall and P. Thiemann",
+  title =        "Sound Specialization in the Presence of Computational
+                 Effects",
+  booktitle =    "Theoretical Aspects of Computer Software, Sendai,
+                 Japan, September 1997. (Lecture Notes in Computer
+                 Science, vol. 1281)",
+  year =         "1997",
+  publisher =    "Springer-Verlag",
+  pages =        "165--190",
+}
+
+@InProceedings{Mini-ML:86,
+  author =       {Dominique Clement and Joelle Despeyroux and Thierry
+                  Despeyroux and Gilles Kahn},
+  title =        {A simple applicative language: Mini-{ML}},
+  booktitle =    {Proc. 1986 {ACM} Conf. on Lisp and
+                 Functional Programming},
+  year =         "1986",
+  publisher =    "ACM press",
+  pages =        "13--27",
+}
+
+@InProceedings{DHT97,
+  author =       "D. Dussart and R.J.M. Hughes and P. Thiemann",
+  title =        "Type Specialization for Imperative Languages",
+  pages =        "204--216",
+  booktitle =    "Proc. 
+                  International Conf. on Functional Programming
+                 (ICFP), Amsterdam, The Netherlands, June 1997",
+  year =         "1997",
+  publisher =    "New York:\ ACM",
+}
+
+@Article{HD97,
+  title =        "A computational formalization for partial evaluation",
+  author =       "John Hatcliff and Olivier Danvy",
+  pages =        "507--541",
+  journal =      "Mathematical Structures in Computer Science",
+  year =         "1997",
+  volume =       "7",
+  number =       "5",
+}
+
+@Unpublished{TD,
+  author = 	 "Peter Thiemann and Dirk Dussart",
+  title = 	 "Partial Evaluation for Higher-Order Languages with
+      State",
+  note = 	 "Available online from 
+\fr{http://www.informatik.uni-freiburg.de/$\splicee{}$thiemann/papers/
+index.html}",
+  year =    "1996",
+  OPTkey = 	 {},
+  OPTyear = 	 {},
+  OPTannote = 	 {}
+}
+
+@ARTICLE{Sands:95,
+  author = {David Sands},
+  title = {A Na\"{\i}ve Time Analysis and its
+                 Theory of Cost Equivalence},
+  journal = {Journal of Logic and Computation},
+  year = {1995},
+  volume = {5},
+  number = {4},
+  optpages = {495--541},
+  optpostscript = {},
+  abstract = {Techniques for reasoning about extensional properties of
+functional programs are well-understood, but methods for analysing the
+underlying intensional, or operational properties have been much neglected.
+This paper begins with the development of a simple but useful
+calculus for time analysis of non-strict functional programs with lazy
+lists.  One limitation of this basic calculus is that the ordinary
+equational reasoning on functional programs is not valid. In order to buy
+back some of these equational properties we develop a non-standard
+operational equivalence relation called {\em cost equivalence}, by
+considering the number of computation steps as an ``observable'' component
+of the evaluation process.  We define this relation by analogy with Park's
+definition of bisimulation in {\sc ccs}. This formulation allows us to show
+that cost equivalence is a contextual congruence (and thus is substitutive
+with respect to the basic calculus) and provides useful proof techniques
+for establishing cost-equivalence laws.
+
+It is shown that basic evaluation time can be derived
+by demonstrating a certain form of cost equivalence, and we give a
+axiomatisation of cost equivalence which complete is with respect to
+this application. This shows that cost equivalence subsumes the basic
+calculus.
+
+Finally we show how a new operational interpretation of evaluation
+demands can be used to provide a smooth interface between this time
+analysis and more compositional approaches, retaining the advantages
+of both.},
+}
+
+@InProceedings{Moran-Sands99,
+  key =          "Moran \& Sands",
+  author =       "Andrew Moran and David Sands",
+  title =        "Improvement in a Lazy Context: An Operational Theory
+                 for Call-By-Need",
+  booktitle =    "the Symposium on Principles of
+                  Programming Languages {(POPL '99)}",
+  address =      "San Antonio, Texas",
+  year =         "1999",
+  organization = "ACM",
+  month =        jan,
+  pages =        "43--56",
+  annote =       "Operational theory for reasoning about optimization of
+                 lazy programs. 42 references.",
+}
+
+@InProceedings{T97,
+  author =       "P. Thiemann",
+  title =        "Correctness of a Region-Based Binding-Time Analysis",
+  booktitle =    "Mathematical Foundations of Programming Semantics,
+                 Thirteenth Annual Conf., Pittsburgh, Pennsylvania,
+                 March 1997",
+  year =         "1997",
+  publisher =    "Elsevier",
+  organization = "Carnegie Mellon University",
+  pages =        "26",
+}
+
+
+@InProceedings{MP99@HOOTS,
+  author =       {Moggi, Euegenio and Palumbo, Fabrizio},
+  title =        {Monadic Encapsulation of Effects: a Revised Approach},
+ booktitle =    {HOOTS 3rd International Workshop},
+  series =       {Electronic Notes in Theoretical Computer Science},
+  volume = {26},
+  year =         {1999}
+
+}
+
+@InProceedings{Danvy98,
+  author       = "Olivier Danvy",
+  title =        "A Simple Solution to Type Specialization",
+  booktitle =    "25th
+  International Colloquium on Automata, Languages, and
+  Programming",
+  year =         1998,
+  series =       LNCS,
+  volume =       1443,
+  address =      "Aalborg",
+}
+
+@InProceedings{HengleinJoergensen:94l,
+  author =       "Fritz Henglein and Jesper J{\o}rgensen",
+  title =        "Formally optimal boxing",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  address =      "Portland, Oregon",
+  year =         "1994",
+  semno =        "D-179",
+  pages =        "213--226",
+  summary =      "Representation analysis seeks to optimize the run-time
+                 representation of elements of data types in high-level
+                 programming languages. Using a language with explicit
+                 representation types and boxing/unboxing operations we
+                 axiomatize equationally the set of all explicitly boxed
+                 versions called {\em completions}. We give the equality
+                 axioms a rewriting interpretation that captures
+                 eliminating boxing/unboxing operations without relying
+                 on a specific implementation or even semantics of the
+                 underlying language. The rewriting system produces a
+                 unique ``optimal'' completion.",
+  keywords =     "representation analysis, polymorphism, type systems,
+                 Standard-ML",
+}
+
+@Article{Henglein:92Dynamic,
+  author =       "Fritz Henglein",
+  title =        "Dynamic typing: syntax and proof theory",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "582",
+  pages =        "197--230",
+  year =         "1992",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Wed Sep 15 10:01:31 MDT 1999",
+  acknowledgement = ack-nhfb,
+  keywords =     "ESOP; programming",
+}
+
+@Article{Pier91b,
+  author =       "Mart{\'\i}n Abadi and Luca Cardelli and Benjamin Pierce and
+                 Gordon D. Plotkin",
+  title =        "Dynamic Typing in a Statically Typed Language",
+  journal =      "ACM Transactions on Programming Languages and
+                 Systems",
+  volume =       "13",
+  number =       "2",
+  pages =        "237--268.",
+  year =         "1991",
+  keywords =     "types popl91 binder",
+  url =          "ftp://ftp.cs.indiana.edu/pub/pierce/dynamic.ps.gz",
+  abstract =     "Statically typed programming languages allow earlier
+                 error checking, better enforcement of disciplined
+                 programming styles, and generation of more efficient
+                 object code than languages where all type consistency
+                 checks are performed at run time. However, even in
+                 statically typed languages, there is often the need to
+                 deal with data whose type cannot be determined at
+                 compile time. To handle such situations safely, we
+                 propose to add a type Dynamic whose values are pairs of
+                 a value v and a type tag T where v has the type denoted
+                 by T. Instances of Dynamic are built with an explicit
+                 tagging construct and inspected with a type safe
+                 typecas construct. This paper explores the syntax,
+                 operational semantics, and denotational semantics of a
+                 simple language including the type Dynamic.",
+}
+
+@Unpublished{T00RTE,
+  author = 	 "Walid Taha",
+  title = 	 "Runtime Tag Elimination (Extended Abstract)",
+  note = 	 "Unpublished manuscript vailable online",
+  OPTkey = 	 {},
+  year = 	 2000,
+  OPTannote = 	 {}
+}
+
+
+@InProceedings{Henglein:92,
+  author =       "Fritz Henglein",
+  title =        "Global Tagging Optimization by Type Inference",
+  booktitle =    "1992 {ACM} Conferenc on Lisp and Functional
+                 Programming",
+  publisher =    "ACM Press",
+  year =         "1992",
+  pages =        "205--215",
+  refs =         "41",
+  checked =      "19950204",
+  source =       "Dept. Library",
+  abstract =     "Tag handling accounts for a substantial amount of
+                 execution cost in latently typed languages such as
+                 Common Lisp and Scheme, especially on architectures
+                 that provide no special hardware support. We present a
+                 tagging optimization algorithm based on type inference
+                 that is \begin{description} \item[global:] it traces
+                 tag information across procedure boundaries, not only
+                 withing procedures; \item[efficient:] it runs
+                 assymptotically in almost-linear time with excellent
+                 practical run-time behavior (e.g. 5,000 line Scheme
+                 programs are processed in a matter of seconds);
+                 \item[useful:] it eliminates at compile-time between 60
+                 and 95\% of tag handling operations in nonnumerical
+                 Scheme code (based on preliminary data);
+                 \item[structural:] it traces tag information in higher
+                 order (procedure) values and especially in structured
+                 (e.g. list) values, where reportedly 80\% of tag
+                 handling operations take place; \item[well-founded:] it
+                 is based on a formal static typing discipline with a
+                 special type {\tt Dynamic} that has a robust and
+                 semantically sound ``minimal typing'' property;
+                 \item[implementation-independent:] no tag
+                 implementation technology is presupposed; the results
+                 are displayed as an explicitly typed sources program
+                 and can be interfaced with compiler backends of
+                 statically typed languages such as Standard ML;
+                 \item[user-friendly:] no annotations by the programmer
+                 are necessary; it operates on the program source,
+                 provides useful type information to a programmer in the
+                 spirit of ML's type system, and makes all tag handling
+                 operations necessary at run-time explicit (and thus
+                 shows which ones can be eliminated without endangering
+                 correctness of program execution). \end{description}
+                 This agenda is accomplished by: \begin{itemize} \item
+                 maintaining and tracing only a minimum of information
+                 -- no sets of abstract colsures or cons points {\em
+                 etc.} that may reach a program point are kept, only
+                 their collective tagging information; no repeated
+                 analysis of program points is performed; \item
+                 scheduling processing steps such that each one
+                 contributes to the final result -- no idle or partially
+                 idle traversals of the syntax tree are performed;
+                 instead all relevant constraints are extracted in a
+                 single pass over the syntax tree; \item using
+                 theoretically and practically very efficient data
+                 structures; in particular, the union/find data
+                 structure is used to maintain and solve the extracted
+                 constraints. \end{itemize} This improves and
+                 complements previous work on tagging optimization in
+                 several respects. \begin{itemize} \item In the LISP
+                 compiler for
+                 S1~\cite{Brooks:Gabriel:Steele:acm:lfp:1982}, in
+                 Orbit~\cite{Kranz:Kelsey:Rees:Hudak:Philbin:Adams:acm:cc:1986},
+                 and in
+                 Screme~\cite{Vegdahl:Pleban:acm:asplos:1989,Pleban:tiall:1991}
+                 tagging optimization (representation analysis) is
+                 typically performed for atomic types (numbers), based
+                 on local control flow information. Our analysis is
+                 global and based on abstract data flow information.
+                 \item In TICL~\cite{Ma:Kessler:spe:1990} type analysis
+                 of Common LISP programs relies on costly repeated
+                 analysis and programmer type declarations. \item
+                 Shivers~\cite{Shivers:acm:pldi:1988} similarly uses
+                 potentially expensive and complicated data flow
+                 reanalysis for type recovery in Scheme and relies to
+                 some degree on programmer type declarations; his
+                 analysis works on the CPS transform of a Scheme program
+                 and as such the results are not presentable to the
+                 user/programmer. \end{itemize} The main practical
+                 contribution of our tagging optimization algorithm is
+                 likely to be its combination of execution efficiency
+                 and ability to eliminate tag handling operations in
+                 structured data, especially in lists: Steenkiste and
+                 Hennessy report that 80\% of all dynamic type checking
+                 operations are due to list operations, most of which
+                 are statically eliminated by our type inference
+                 algorithm. The computed information can also be used
+                 for unboxing and closure allocation (reference escape)
+                 analysis, although this is not pursued in this paper.",
+  reffrom =      "Wright:Cartwright:acm:lfp:1994",
+}
+@InProceedings{Peterson89,
+  author =       "J. Peterson",
+  title =        "Untagged Data in Tagged Environments: Choosing Optimal
+                 Representations at Compile Time",
+  booktitle =    "Proc. Conf. on Functional
+                 Programming Languages and Computer Architecture '89,
+                 Imperial College, London",
+  pages =        "89--99",
+  publisher =    "ACM Press",
+  address =      "New York, NY",
+  year =         "1989",
+  abstract =     "The inefficiency of tag bits can be alleviated by
+                 avoiding unnecessary conversions between tagged and
+                 untagged representations. An algorithm which determines
+                 the optimal representation of an object at each program
+                 point is presented.",
+}
+
+
+@InProceedings{Torben,
+  author =       "Torben {\AE}. Mogensen",
+  semno =        "D-159",
+  title =        "Constructor Specialization",
+  booktitle =    "ACM Symposium on Partial Evaluation and
+                 Semantics-Based Program Manipulation",
+  year =         "1993",
+  editor =       "David Schmidt",
+  pages =        "22--32",
+  publisher = "ACM press",
+  keywords =     "Partial evaluation, specialization, data-types,
+                 constructors",
+  summary =      "Constructors are specialized with respect to the
+                 static part of their arguments, similarly to
+                 specialization of functions. This allows specialized
+                 data-types to be invented and in general improves
+                 binding times.",
+}
+
+@InCollection{Pitts,
+  author =       "Andrew M. Pitts",
+  title =        "Operationally-Based Theories of Program Equivalence",
+  booktitle =    "Semantics and Logics of Computation",
+  editor =       "P. Dybjer and Andrew M. Pitts",
+  publisher =    "Cambridge University Press",
+  year =         "1995",
+  note =         "Based on lectures given at the CLICS-II Summer School
+                 on Semantics and Logics of Computation, Isaac Newton
+                 Institute for Mathematical Sciences, Cambridge UK,
+                 September 1995.",
+  citation-source = "Greg Sullivan, Thu Jun 27 11:28:21 1996",
+}
+
+
+@InProceedings{CorrectnessOfTS,
+  author =       "R.J.M. Hughes",
+  title =        "The Correctness of Type Specialisation",
+  booktitle =    "European Symposium on Programming (ESOP)",
+  OPTcrossref =  {},
+  OPTkey =       {},
+  year =         2000,
+  OPTeditor =    {},
+  OPTnumber =    {},
+  OPTaddress =   {},
+  OPTorganization = {},
+}
+
+@InProceedings{Mitchell91,
+  title =        "On Abstraction and the Expressive Power of Programming
+                 Languages",
+  author =       "John C. Mitchell",
+  pages =        "290--310",
+  booktitle =    "Theoretical Aspects of Computer Software",
+  editor =       "T. Ito and A. R. Meyer",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "526",
+  year =         "1991",
+  publisher =    "Springer-Verlag",
+  abstract =     "We present a tentative theory of programming language
+                 expressiveness based on reductions (language
+                 translations) that preserve observational equivalence.
+                 These are called ``abstraction-preserving'' because of
+                 a connection with a definition of ``abstraction'' or
+                 ``information-hiding'' mechanism. If there is an
+                 abstraction-preserving reduction from one language to
+                 another, then essentially every function on natural
+                 numbers that is definable in the first is also
+                 definable in the second. Moreover, regardless of the
+                 set of first-order functions definable in either
+                 language, no programming language with an abstraction
+                 mechanism can be reduced to a language without. Since
+                 Lisp with user-defined special forms does not have an
+                 abstraction mechanism, it is therefore not
+                 ``universal'' in this theory, in spite of the ability
+                 to define every partial recursive function on the
+                 natural numbers. Several examples and counter-examples
+                 to abstraction-preserving reductions are given. We do
+                 not know whether there is a natural universal language
+                 with respect to abstraction-preserving reduction.",
+}
+                                                                               
+@misc{fidel,
+   title = {Towards Principal Type Specialisation},
+   author = {Mart{\'\i}nez L\'opez, Pablo E. and Hughes, R.J.M.},
+   year = 2000,
+   note = {Unpublished manuscript.
+           Available from 
+  \texttt{http://www-lifia.info.unlp.edu.ar/\es{fidel}/Works/TowardsPTS.dvi}},
+}
+
+@TechReport{PST00TR,
+  author =       "Emir Pa\v{s}ali\'{c} and Tim Sheard and 
+                  Walid Taha",
+  title =        "{DALI}: An Untyped, {CBV} Functional Language Supporting
+                  First-Order Datatypes with Binders (Technical Development)",
+  institution =  "OGI",
+  year =         2000,
+  OPTkey =       {},
+  OPTtype =      {},
+  number =       "CSE-00-007",
+  note  =        "Available from \cite{ogi-tr-site}"
+}
+
+@Article{FP91,
+  author =       "Tim Freeman and Frank Pfenning",
+  title =        "Refinement Types for {ML}",
+  booktitle =    "Proc. Conf. on Programming Language Design
+                 and Implementation",
+  year =         "1991",
+  pages =        "268--277",
+  address =      "Toronto",
+  journal =      "SIGPLAN Notices",
+  volume =       "26",
+  number =       "6",
+  annote =       "Adds (explicitely defined) subtypes to MLs type
+                 system, which can help the static type checking.",
+}
+
+@InProceedings{L91,
+  author =       "John Launchbury",
+  title =        "A Strongly-Typed Self-Applicable Partial Evaluator",
+  pages =        "145--164",
+  booktitle =    "Proc. International Conf. on 
+                  Functional Programming Languages and Computer
+                  Architecture (FPCA)",
+  key =          "FPCA",
+  Conf. =   "5th {ACM} Conf.",
+  venue =        "Cambridge, MA, USA",
+  year =         1991,
+  editor =       "R.J.M. Hughes",
+  series =       LNCS,
+  volume =       523,
+}
+
+@InProceedings{Mogensen:93:ConstructorSpecialization,
+  author =       "Torben {\AE}. Mogensen",
+  semno =        "D-159",
+  title =        "Constructor Specialization",
+  booktitle =    "ACM Symposium on Partial Evaluation and
+                 Semantics-Based Program Manipulation",
+  year =         "1993",
+  editor =       "David Schmidt",
+  pages =        "22--32",
+  publisher = "ACM press",
+  keywords =     "Partial evaluation, specialization, data-types,
+                 constructors",
+  summary =      "Constructors are specialized with respect to the
+                 static part of their arguments, similarly to
+                 specialization of functions. This allows specialized
+                 data-types to be invented and in general improves
+                 binding times.",
+}
+
+@InCollection{Pitts95,
+  author =       "Andrew M. Pitts",
+  title =        "Operationally-Based Theories of Program Equivalence",
+  booktitle =    "Semantics and Logics of Computation",
+  editor =       "P. Dybjer and Andrew M. Pitts",
+  publisher =    "Cambridge University Press",
+  year =         "1995",
+  note =         "Based on lectures given at the CLICS-II Summer School
+                 on Semantics and Logics of Computation, Isaac Newton
+                 Institute for Mathematical Sciences, Cambridge UK,
+                 September 1995.",
+  citation-source = "Greg Sullivan, Thu Jun 27 11:28:21 1996",
+}
+
+@InProceedings{CTHL03,
+  title = 	 "Implementing Multi-stage Languages Using
+                  ASTs, Gensym, and Reflection", 
+  booktitle = "Generative Programming and Component Engineering (GPCE)",
+  author = "Cristiano Calcagno and Walid Taha and Liwen Huang and
+            Xavier Leroy",
+  year = 	 2003,
+  editor = 	 "Krzysztof Czarnecki 
+                  and Frank Pfenning and Yannis Smaragdakis",
+  OPTnumber = 	 {},
+  series = 	 "Lecture Notes in Computer Science",
+  OPTorganization = {},
+  publisher =    "Springer-Verlag",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Proceedings{saig00,
+  title = 	 "Semantics, Applications, and Implementation of 
+                  Program Generation",
+  year = 	 2000,
+  key = 	 {SAIG},
+  editor = 	 "Walid Taha",
+  volume = 	 1924,
+  OPTnumber = 	 {},
+  series = 	 "Lecture Notes in Computer Science",
+  address = 	 "Montr\'{e}al",
+  OPTorganization = {},
+  publisher =    "Springer-Verlag",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Proceedings{saig01,
+  title = 	 "Semantics, Applications, and Implementation of 
+                  Program Generation",
+  year = 	 2001,
+  key = 	 {SAIG},
+  editor = 	 "Walid Taha",
+  volume = 	 2196,
+  OPTnumber = 	 {},
+  series = 	 "Lecture Notes in Computer Science",
+  address = 	 "Firenze",
+  OPTorganization = {},
+  publisher =    "Springer-Verlag",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+
+@InProceedings{Batory,
+  title = 	 "Refinements and Product Line Architectures",
+  author = 	 "Don Batory",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "3--4",
+  year = 2000,
+}
+
+@InProceedings{Pfenning,
+  title = 	 "Reasoning About Staged Computation",
+  author = 	 "Frank Pfenning",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "5--6",
+  year = 2000,
+}
+
+@InProceedings{Muller,
+  title = 	 "Specialization of Systems Programs:
+                  Lessons and Perspectives",
+  author = 	 "Gilles Muller",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "7--8",
+  year = 2000,
+}
+
+@inproceedings{fran-dsl
+    ,author={Conal Elliott}
+    ,title={Modeling Interactive {3D} and Multimedia Animation 
+            with an Embedded Language}
+    ,booktitle={Proc. first Conf. on 
+                Domain-Specific Languages}
+    ,organization={USENIX}
+    ,year=1997
+    ,pages={285-296}
+    }
+
+@Inproceedings(FrobIcra99,
+	Author="J. Peterson and G. Hager and P. Hudak",
+	Title="A Language for Declarative Robotic Programming",
+	BookTitle="Proceedings of IEEE Conf. on Robotics and Automation",
+	Year=1999
+        )
+
+@Inproceedings(FrobPadl99,
+	Author="J. Peterson and P. Hudak and C. Elliott",
+	Title="Lambda in Motion: Controlling Robots With {H}askell",
+       	BookTitle="Proc. 1st International Conf. on Practical Aspects of Declarative Languages (PADL'99)",
+        pages = "91-105",
+	Year=1999
+        )
+
+
+@Inproceedings(FVisionICSE99,
+	Author="A. Reid and J. Peterson and P. Hudak and G. Hager",
+	Title="Prototyping Real-Time Vision Systems: An Experiment in {DSL} Design",
+       	BookTitle="Proc. 21st International Conf. on Software Engineering (ICSE'99)",
+	Year=1999
+        )
+
+
+@InProceedings{Elliott,
+  title = 	 "Compiling Embedded Languages",
+  author = 	 "Conal Elliott and  Sigbj\o{}rn Finne and Oege de Moore",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "9--27",
+  year = 2000,
+}
+
+@InProceedings{Kamin,
+  author = 	 "Sam Kamin and Miranda Callahan and Lars Clausen",
+  title = 	 "Lightweight and Generative Components {II}:
+                  Binary-Level Components",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "28--50",
+  year = 2000,
+}
+
+@InProceedings{Helsen,
+  author = 	 "Simon Helsen and Peter Thiemann",
+  title = 	 "Fragmental Specialization",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "51--71",
+  year = 2000,
+}
+
+@InProceedings{Song,
+  author = 	 "Litong Song and Yoshihiko Futamura",
+  title = 	 "A New Termination Approach 
+                  for Specialization",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "72--91",
+  year = 2000,
+}
+
+@InProceedings{Calcagno,
+  author = 	 "Cristiano Calcagno and Eugenio Moggi",
+  title = 	 "Multi-Stage Imperative Languages:  A Conservative 
+                  Extension Result",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "92--107",
+  year = 2000,
+}
+
+@InProceedings{Fischbach,
+  author = 	 "Adam Fischbach and John Hannan",
+  title = 	 "Specification and Correctness of Lambda Lifting",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "108--128",
+  year = 2000,
+}
+
+@InProceedings{Makholm,
+  author = 	 "Henning Makholm",
+  title = 	 "On {J}ones-Optimal Specialization 
+                  for Strongly Typed Languages",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "129--148",
+  year = 2000,
+}
+
+@InProceedings{Ramsey,
+  title = 	 "Pragmatic Aspects of Reusable Software Generators",
+  author = 	 "Norman Ramsey",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "149--171",
+  year = 2000,
+}
+
+@InProceedings{Berardi,
+  title = 	 "Type-Based Useless-Code Elimination for Functional
+                  Programs",
+  author = 	 "Stefano Berardi and Marrio Coppo and Ferruccio Damiani
+                  and Paola Giannini",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "172--189",
+  year = 2000,
+}
+
+@InProceedings{Vuduc,
+  author = 	 "Richard Vuduc and James W. Demmel",
+  title = 	 "Code Generators for Automatic Tuning of Numerical:
+                  Experiences with {FFTW}",
+  booktitle = 	 "\cite{saig00}",
+  pages = 	 "190--211",
+  year = 2000,
+}
+
+@InProceedings{fftc,
+  author =       "Matteo Frigo",
+  title =        "A Fast {F}ourier Transform Compiler",
+  booktitle =    "Proc. ACM Conf. on
+                 Prog. Lang. Design and Impl. (PLDI~'99)",
+  year =         "1999",
+  pages =        "169--180",
+  url =          "http://www.acm.org/pubs/articles/proceedings/pldi/301618/p169-frigo/p169-frigo.pdf",
+  genterms =     "ALGORITHMS, DESIGN, LANGUAGES, MEASUREMENT,
+                 PERFORMANCE, THEORY",
+  categories =   "D.3.4 Software, PROGRAMMING LANGUAGES, Processors,
+                 Compilers. F.2.1 Theory of Computation, ANALYSIS OF
+                 ALGORITHMS AND PROBLEM COMPLEXITY, Numerical Algorithms
+                 and Problems, Computation of transforms.",
+  annote =       "incomplete",
+}
+
+@InProceedings{Dynamo,
+  author =       "V. Bala and E. Duesterwald and S. Banerjia",
+  title =        "Dynamo: A transparent dynamic optimization system",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implementation",
+  year =         "1999",
+  pages =        "1--12",
+}
+
+@InProceedings{Fischer,
+  author = 	 "Bernd Fischer and Johann Schumann and Tom Pressburger",
+  title = 	 "Generating Data Analysis Programs from Statistical
+                  Models",
+  booktitle = 	 "Semantics, Applications, and Implementation of 
+                  Program Generation",
+  year = 	 2000,
+  volume = 	 1924,
+  series = 	 "LNCS",
+  publisher =    "Springer-Verlag",
+  pages = 	 "212--230",
+}
+
+@InCollection{Abramsky:LazyLambda,
+  author = 	 "Samson Abramsky",
+  title = 	 "The Lazy Lambda Calculus",
+  booktitle = 	 "Research topics in Functional Programming",
+  publisher =    "Addison-Wesley",
+  year = 	 "1990",
+  editor = 	 "D. Turner",
+}
+
+@Article{CG:Ambient,
+  author = 	 "Luca Cardelli and Andrew D. Gordon",
+  title = 	 "Mobile ambients",
+  journal = 	 "Theoretical Computer Science",
+  year = 	 "2000",
+  volume = 	 "240",
+  number = 	 "1",
+  pages = 	 "177-213",
+}
+
+@InProceedings{CGG:SecretPi,
+  author = 	 "Luca Cardelli and Giorgio Ghelli and Andrew D. Gordon",
+  title = 	 "Secrecy and Group Creation",
+  booktitle = 	 "CONCUR 2000",
+  year = 	 "2000",
+  editor = 	 "Catuscia Palamidessi",
+  volume = 	 "1877",
+  series = 	 "LNCS",
+  address = 	 "University Park, PA, USA",
+  publisher =    "Springer",
+}
+
+@InProceedings{Ene:Muntean:BPI,
+  author =       "Cristian Ene and Traian Muntean",
+  title =        "Expressivness of Point-to-Point versus Broadcast Communications",
+  bookTitle =    "Fundamentals of Computation Theory",
+  year =         "1999",
+  volume = 	 "1684",
+  series = 	 "LNCS",
+}
+
+@article{FerreiraJH98,
+  author =       "William Ferreira  and Matthew Hennessy and Alan Jeffrey",
+  title =        "A Theory of Weak Bisimulation for Core CML",
+  journal =      "Journal of Functional Programming",
+  pages =        "447--491",
+  year =         "1998",
+  volume =       8,
+  number =       "5"
+}
+
+@InProceedings{FG96:join,
+  author =       "C\'{e}dric Fournet and Georges Gonthier",
+  title =        "The Reflexive Chemical Abstract Machine and the Join-Calculus",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  pages =        "372--385",
+  publisher =    "ACM Press",
+  year =         "1996",
+  OPTaddress =      "St. Petersburg Beach, Florida",
+}
+
+
+
+@TechReport{Gordon:Bisimulation,
+  author =       "Andrew D. Gordon",
+  title =        "Bisimilarity as a theory of functional programming:
+                  mini-course",
+  institution =  "{BRICS}",
+  year =         "1995",
+  type =         "Notes Series",
+  number =       "BRICS-NS-95-3",
+  address =      "Department of Computer Science, University of Aarhus",
+}
+
+@Article{Howe,
+  title =        "Proving Congruence of Bisimulation in Functional
+                  Programming Languages",
+  author =       "Douglas J. Howe",
+  pages =        "103--112",
+  journal =      "Information and Computation",
+  year =         "1996",
+  volume =       "124",
+  number =       "2",
+  abstract =     "We give a method for proving congruence of
+                 bisimulation-like equivalences in functional
+                 programming languages. The method applies to languages
+                 that can be presented as a set of expressions together
+                 with an evaluation relation. We use this method to show
+                 that some generalizations of Abramsky's applicative
+                 bisimulation are congruences whenever evaluation can be
+                 specified by a certain natural form of structured
+                 operational semantics. One of the generalizations
+                 handles nondeterminism and diverging computations.",
+}
+
+@InProceedings{Rosenblum:DSL,
+  author = 	 "N. Medvidovic and D. Rosenblum",
+  title = 	 "Domains of Concern in Software Architectures and
+                  Architecture Description Languages",
+  booktitle = 	 "Proc. USENIX Conf. on Domain-Specific
+                  Languages",
+  address = 	 "Santa Barbara, CA",
+  year =         "1997",
+}
+
+@Book{Milner:CC,
+  author =       "Robin Milner",
+  title =        "Communication and Concurrency",
+  publisher =    "Prentice Hall",
+  year =         "1989",
+  series =       "International Series in Computer Science",
+}
+
+@Book{Milner:PI,
+  author = 	 "Robin Milner",
+  title = 	 "Communicating and Mobile Systems: the $\pi$-Calculus",
+  publisher = 	 "Cambridge University Press",
+  year = 	 "1999"
+}
+
+@TechReport{Milner:piI,
+  author =       "Robin Milner and Joachim Parrow and David Walker",
+  title =        "A Calculus of Mobile Processes, {Part I}",
+  institution =  "University of Edinburgh",
+  type =         "LFCS Report Series",
+  number =       "ECS-LFCS-89-85",
+  year =         "1989",
+}
+
+@TechReport{Milner:piII,
+  author =       "Robin Milner and Joachim Parrow and David Walker",
+  title =        "A Calculus of Mobile Processes, {Part II}",
+  institution =  "University of Edinburgh",
+  type =         "LFCS Report Series",
+  number =       "ECS-LFCS-89-86",
+  year =         "1989",
+}
+
+@TechReport{Milner:Pi91,
+  author =       "Robin Milner",
+  title =        "The Polyadic $\pi$-Calculus: a tutorial",
+  institution =  "Department of Computer Science, University of Edinburgh",
+  number =       "ECS-LFCS-91-180",
+  year =         "1991",
+  keywords =     "pcalc mobility binder",
+  url =          "ftp://ftp.cl.cam.ac.uk/users/rm135/ppi.ps.Z",
+}
+
+@InProceedings{OPT:WM2000,
+  author = 	 "Karol Ostrovsk\'y and K.~V.~S.~Prasad and Walid Taha",
+  title = 	 "A Preliminary Account of {P}rimitive {HOBS}: {A} Calculus
+                  for Higher Order Broadcasting",
+  booktitle = 	 "Proceedings of Winter Meeting",
+  year = 	 "2000",
+  organization = "Deptartment of Computing Science, Chalmers University of Technology",
+}
+
+@Misc{OPT:HOBS:ex,
+  author = 	 "Karol Ostrovsk\'y and K.~V.~S.~Prasad and Walid Taha",
+  title = 	 "Towards a Primitive Higher Order Calculus of Broadcasting Systems
+                  (Extended Version)",
+  howpublished = "available electronically: http://www.cs.chalmers.se/\~{}karol/Papers/,
+                  http://www.cs.chalmers.se/\~{}prasad/",
+  year = 	 "2000",
+}
+
+@Misc{OPT:ESOP2000:ex,
+  author =       "Karol Ostrovsk\'y and K.~V.~S.~Prasad and Walid Taha",
+  title =        "Towards a Primitive Higher Order Calculus of Broadcasting Systems",
+  year =         "2000",
+  note =         "extended version; http://www.cs.chalmers.se/\~{}karol/Papers/,
+                  http://www.cs.chalmers.se/\~{}prasad/",
+  URL =          "http://www.cs.chalmers.se/~karol/Papers\/, http://www.cs.chalmers.se/~prasad/",
+}
+
+@Unpublished{OldHobs,
+  author = 	 "K.~V.~S. Prasad",
+  title = 	 "Status report on ongoing work:  Higher Order
+                  Broadcasting Systems and Reasoning about Broadcasts",
+  note = 	 "Unpublished manuscript",
+  year = 	 "1994",
+}
+
+@Article{PrasadKVS:CalBro95,
+  author =       "K.~V.~S.~Prasad",
+  title =        "A Calculus of Broadcasting Systems",
+  journal =      "Science of Computer Programming",
+  volume =       "25",
+  year =         "1995",
+  URL =          "http://www.cs.chalmers.se/~prasad/scp.html",
+  abstract =     "
+  CBS is a simple and natural CCS-like calculus where processes speak
+  one at a time and are heard instantaneously by all others. Speech is
+  autonomous, contention between speakers being resolved
+  non-deterministically, but hearing only happens when someone else
+  speaks.  Observationally meaningful laws differ from those of CCS.
+  The change from handshake communication in CCS to broadcast in CBS
+  permits several advances. (1) Priority, which attaches only to
+  autonomous actions, is simply added to CBS in contrast to CCS, where
+  such actions are the result of communication.  (2) A CBS simulator
+  runs a process by returning a list of values it broadcasts. This
+  permits a powerful combination, CBS with the host language. It
+  yields several elegant algorithms.  Only processes with a unique
+  response to each input are needed in practice, so weak bisimulation
+  is a congruence. (3) CBS subsystems are interfaced by translators;
+  by mapping messages to silence, these can restrict hearing and hide
+  speech.  Reversing a translator turns its scope inside out. This
+  permits a new specification for a communication link: the
+  environment of each user should behave like the other user.
+  
+  This paper reports the stable aspects of an evolving study."
+}
+
+@InProceedings{PrasadKVS:CalBro91,
+  author =       "K. V. S. Prasad",
+  title =        "A Calculus of Broadcasting Systems",
+  bookTitle =    "TAPSOFT, Volume 1: CAAP",
+  year =         "1991",
+  note =         "Springer-Verlag LNCS 493",
+  URL =          "http://www.cs.chalmers.se/~prasad/caap91.html",
+  abstract =     "
+  Local area networks (LANs) and everyday speech inspire a model of
+  communication by unbuffered broadcast. Computation proceeds by a
+  sequence of messages, each transmitted by one agent and received by
+  zero or more others. Transmission is autonomous, but reception is not.
+  Each message is received instantaneously by all agents except the
+  transmitter, but is read only by those who were monitoring it at the
+  time; others discard it. As in CCS, agents learn about the environment
+  only through the messages they read. Programming such a system is hard
+  because we have to ensure that messages are read.
+
+  Testing resembles a viva-voce examination. Observation, restriction
+  and hidden actions differ from their CCS counterparts, as does testing
+  equivalence.
+
+  We capture this model in a Calculus of Broadcasting Systems (CBS). We
+  use transition systems with transmit, read and discard actions.
+  Discards are self-loops, and only auxiliary. We have some results on
+  strong bisimulation and testing, but much work remains to make CBS
+  tractable."
+}
+
+@phdthesis{Sangiorgi:PhD,
+   author =      "Sangiorgi, Davide",
+   title =       "Expressing Mobility in Process Algebras: First-Order and 
+                  Higher-Order Paradigms", 
+   school =      "Department of Computer Science, University of Edinburgh",
+   year =        "1992",
+   type =        "{PhD} thesis  {CST}--99--93"
+}
+
+@Article{Thomsen:1993:PCS,
+  author =       "Bent Thomsen",
+  title =        "Plain {CHOCS}: {A} Second Generation Calculus for
+                 Higher Order Processes",
+  journal =      "Acta Informatica",
+  volume =       "30",
+  number =       "1",
+  pages =        "1--59",
+  year =         "1993",
+  coden =        "AINFA2",
+  ISSN =         "0001-5903 (printed version), 1432-0525 (electronic
+                 version)",
+  mrclass =      "68Q65 (68Q60)",
+  mrnumber =     "94i:68197",
+  mrreviewer =   "Ferucio Laurentiu Tiplea",
+  bibdate =      "Sat Oct 9 09:56:22 MDT 1999",
+  acknowledgement = ack-nhfb,
+  source =       "nestmann",
+}
+
+@Article{Thomsen:IC:1995,
+  refkey =       "C1219",
+  title =        "A Theory of Higher Order Communicating Systems",
+  author =       "Bent Thomsen",
+  pages =        "38--57",
+  journal =      "Information and Computation",
+  year =         "1995",
+  volume =       "116",
+  number =       "1",
+  abstract =     "{\em A Calculus of Higher Order Communicating
+                  Systems\/} was presented in Thomsen [1989]. This
+                  calculus considers sending and receiving processes to
+                  be as fundamental as nondeterminism and parallel
+                  composition. In this paper we present an investigation
+                  of the foundation of the theory of this calculus,
+                  together with the full proofs of all major theorems.
+                  \par The calculus called CHOCS is an extension of
+                  Milner's CCS in the sense that all the constructions of
+                  CCS are included or may be derived from more
+                  fundamental constructs. Most of the mathematical
+                  framework of CCS carries over almost unchanged. The
+                  operational semantics of CHOCS is given as a labelled
+                  transition system and it is a direct extension of the
+                  semantics of CCS with value passing. A set of algebraic
+                  laws satisfied by the calculus is presented. These are
+                  similar to the CCS laws only introducing obvious extra
+                   laws for sending and receiving processes. The power of
+                  process passing is underlined by a result showing that
+                  recursion can be simulated by means of process passing
+                  and communication.",
+}
+
+@MastersThesis{Ostrovsky:MSc,
+  author = 	 "Karol Ostrovsk\'y",
+  title = 	 "Mobile Calculus Semantics of Concurrent Object-Oriented Languages",
+  school = 	 "Faculty of Mathematics and Physics, Comenius University",
+  address = 	 "Bratislava",
+  year = 	 "1998",
+}
+
+@PhdThesis{Turner:PhD,
+  author =       "David N. Turner",
+  title =        "The Polymorphic Pi-Calculus: Theory and
+                 Implementation",
+  school =       "Dept. of Computer Science, University of Edinburgh",
+  year =         "1996",
+  type =         "{PhD} thesis  {CST}--126--96",
+  note =         {(also published as ECS-LFCS-96-345)},
+}
+
+@misc{ocaml,
+    author = "Xavier Leroy",
+    title  = "Objective {C}aml",
+    year   = 2000,
+    note   = "Available from \fr{http://caml.inria.fr/ocaml/}",
+}
+
+@InProceedings{Wand85a,
+  author =      "Wand, Mitchell",
+  title =       "Embedding Type Structure in Semantics",
+  booktitle =   "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  year =        "1985",
+  pages =       "1--6",
+  source =  {/proj/wand/old/popl85/paper.tex},
+  URL = {ftp://ftp.ccs.neu.edu/pub/people/wand/papers/popl-85.ps},        
+  abstract = "We show how a programming language designer may embed
+the type structure of of a programming language in the more robust
+type structure of the typed lambda calculus.  This is done by
+translating programs of the language into terms of the typed lambda
+calculus.  Our translation, however, does not always yield a
+well-typed lambda term.  Programs whose translations are not
+well-typed are considered meaningless, that is, ill-typed.  We give a
+conditionally type-correct semantics for a simple language with
+continuation semantics.  We provide a set of static type-checking
+rules for our source language, and prove that they are sound and
+complete: that is, a program passes the typing rules if and only if
+its translation is well-typed.  This proves the correctness of our
+static semantics relative to the well-established typing rules of the
+typed lambda-calculus."  }
+
+@Article{OlivaRamsdellWand95,
+  author =      "Dino P. Oliva and John D. Ramsdell and Mitchell Wand",
+  title =       "The {VLISP} Verified PreScheme Compiler",
+  journal =     "Lisp and Symbolic Computation",
+  year =        "1995",
+  URL = {ftp://ftp.ccs.neu.edu/pub/people/wand/vlisp/lasc/prescheme.dvi},
+  volume =      "8",
+  number =      "1/2",
+  pages =       "111-182",
+  abstract =   "This paper describes a verified compiler for PreScheme, the
+implementation language for the {\vlisp} run-time system.  The
+compiler and proof were divided into three parts: A transformational
+front end that translates source text into a core language, a
+syntax-directed compiler that translates the core language into
+combinator-based tree-manipulation language, and a linearizer that
+translates combinator code into code for an abstract stored-program
+machine with linear memory for both data and code.  This factorization
+enabled different proof techniques to be used for the different phases
+of the compiler, and also allowed the generation of good
+code. Finally, the whole process was made possible by carefully
+defining the semantics of {\vlisp} PreScheme rather than just
+adopting Scheme's.  We believe that the architecture of the compiler
+and its correctness proof can easily be applied to compilers for
+languages other than PreScheme."
+}
+
+@Article{GuttmanRamsdellWand95,
+  author =      "Joshua Guttman and John Ramsdell and Mitchell Wand",
+  title =       "{VLISP}:  A Verified Implementation of Scheme",
+  journal =     "Lisp and Symbolic Computation",
+  year =        "1995",
+  volume =      "8",
+  number =      "1/2",
+  pages =       "5--32",
+  abstract = "The Vlisp project showed how to produce a
+                 comprehensively verified implementation for a
+                 programming language, namely Scheme.  This paper
+                 introduces two more detailed studies on Vlisp.  It
+                 summarizes the basic techniques that were used
+                 repeatedly throughout the effort.  It presents
+                 scientific conclusions about the applicability of the
+                 these techniques as well as engineering conclusions
+                 about the crucial choices that allowed the
+                 verification to succeed.", 
+ URL = {ftp://ftp.ccs.neu.edu/pub/people/wand/vlisp/lasc/overview.dvi},
+}
+
+@Inproceedings{cousot,
+    author = "Patrik Cousot",
+    year   = 1997,
+    title = "Constructive design of a hierarchy of semantics of a transition 
+             system by abstract interpretation",
+    booktitle = "Mathematical Foundations of Programming Semantics",
+}
+
+
+@Inproceedings{shao95,
+    author = "Zhong Shao and Andrew Appel",
+    title = "A Type-Based Compiler for {Standard ML}",
+    booktitle = "Conf. on Programming Language Design and Implementation",
+    pages = "116--129",
+    year = "1995"
+}
+
+@Inproceedings{league99,
+    author = "Christopher League and Zhong Shao and Valery Trifonov",
+    title = "Representing {Java} classes in a typed intermediate language",
+    booktitle = "International Conf. on Functional Programming",
+    year = "1999",
+    pages = "183--196",
+}
+
+@Article{sestoft,
+  title =        "Deriving a lazy abstract machine",
+  author =       "Peter Sestoft",
+  pages =        "231--264",
+  journal =      "Journal of Functional Programming",
+  year =         "1997",
+  volume =       "7",
+  number =       "3",
+  references =   "\cite{TCS::Josephs1989} \cite{POPL::Launchbury1993}
+                 \cite{JFP::Jones1992} \cite{POPL::SansomJ1995}
+                 \cite{POPL::Wand1982}",
+}
+
+@Misc{MetaMLOnline,
+  key = "MHP",
+  title = 	 "{The MetaML Home Page}",
+  year  =        2000,
+  note = 	 "Provides source code and documentation online at 
+                  \fr{http://www.cse.ogi.edu/PacSoft/projects/metaml/index.html}"
+}
+
+@PhdThesis{Sundaresh,
+  author =       "R. S. Sundaresh",
+  title =        "Incremental Computation via Partial Evaluation",
+  school =       "Yale University",
+  year =         "1992",
+  address =      "New Haven, Connecticut, USA",
+}
+
+@InProceedings{DyC,
+  author =       "Brian Grant and Matthai Philipose and Markus Mock and
+                 Craig Chambers and Susan J. Eggers",
+  title =        "An Evaluation of Staged Run-Time Optimizations in
+                 {DyC}",
+  booktitle =    "Proc. Conf. on
+                 Programming Language Design and Implementation",
+  year =         "1999",
+  pages =        "293--304",
+  url =          "http://www.acm.org/pubs/articles/proceedings/pldi/301618/p293-grant/p293-grant.pdf",
+  genterms =     "DESIGN, EXPERIMENTATION, LANGUAGES, MEASUREMENT,
+                 PERFORMANCE, THEORY",
+  categories =   "D.3.4 Software, PROGRAMMING LANGUAGES, Processors,
+                 Run-time environments. D.3.4 Software, PROGRAMMING
+                 LANGUAGES, Processors, Optimization.",
+  annote =       "incomplete",
+}
+
+@PhdThesis{Benaissa:thesis,
+  author = 	 "Zine El-Abidine Benaissa",
+  title = 	 "Explicit Substitution Calculi as a Foundation of
+    Functional Programming Languages Implementations",
+  school = 	 "INRIA",
+  year = 	 "1997",
+}
+
+@InProceedings{LevyMaranget:99,
+  author = 	 "Jean-Jacques Levy and Luc Maranget",
+  title = 	 "Explicit Substitutions and Programming Languages",
+  booktitle = 	 "19th Conf. on Foundations of Software Technology and
+  Theoretical Computer Science (FSTTCS)",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 "1999",
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  address = 	 "Chennai, India",
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Hofmann00,
+  author =       "Martin Hofmann",
+  title =        "A type system for bounded space and functional 
+                  in-place update",
+  booktitle =    "European Symposium on Programming (ESOP)",
+  pages =        "",
+  year =         2000,
+  series =       LNCS,
+  publisher =    "Springer-Verlag",
+}
+
+@InProceedings{Hofmann99,
+  author =       "Martin Hofmann",
+  title =        "Semantical Analysis of Higher-Order Abstract Syntax",
+  editor =       "G. Longo",
+  booktitle =    "Proc. 14th Annual Symposium on Logic in
+                 Computer Science (LICS'99)",
+  year =         "1999",
+  publisher =    "IEEE Computer Society Press",
+  address =      "Trento, Italy",
+  month =        jul,
+  keywords =     "misc",
+}
+
+@InProceedings{Fiore99lics,
+  author =       "Marcelo Fiore and Gordon D. Plotkin and Daniele Turi",
+  title =        "Abstract Syntax and Variable Binding",
+  editor =       "G. Longo",
+  pages =        "193--202",
+  booktitle =    "Proc. 14th Annual Symposium on Logic in
+                 Computer Science (LICS'99)",
+  year =         "1999",
+  publisher =    "IEEE Computer Society Press",
+  address =      "Trento, Italy",
+  month =        jul,
+  keywords =     "misc",
+}
+
+@Article{Chin99,
+  author =       "Wei-Ngan Chin and Siau-Cheng Khoo",
+  title =        "Calculating sized types",
+  journal =      "ACM SIG{\-}PLAN Notices",
+  volume =       "34",
+  number =       "11",
+  pages =        "62--72",
+  year =         "1999",
+  bibdate =      "Thu Apr 27 07:24:12 MDT 2000",
+  url =          "http://www.acm.org/pubs/citations/proceedings/pepm/328690/p62-chin/",
+  acknowledgement = ack-nhfb,
+}
+
+@InProceedings{sized96,
+  author =       "R.J.M. Hughes and Lars Pareto and Amr Sabry",
+  booktitle =    "Proc. ACM Symp. on Principles of
+                  Prog. Langs. {(POPL~'96)}",
+  title =        "Proving the Correctness of Reactive Systems using
+                 Sized Types",
+  year =         "1996",
+  abstract-url = "http://www.cs.chalmers.se/~rjmh/Papers/popl-96.html",
+  url =          "http://www.cs.chalmers.se/~rjmh/Papers/popl-96.ps",
+  keywords =     "sized types, reactive systems, embedded software,
+                 liveness and termination analysis, productivity",
+  publisher =    "ACM Press",
+  scope =        "static",
+}
+
+@InProceedings{CML,
+  author =       "J. H. Reppy",
+  title =        "{CML: A Higher-Order Concurrent Language}",
+  booktitle =    "Proc. Conf. on Programming Language Design
+                 and Implementation",
+  address =      "Toronto, Ontario, Canada, June 26--28",
+  year =         "1991",
+  series =       "SIGPLAN Notices",
+  volume =       "26(6)",
+  pages =        "294--305",
+  publisher =    "ACM Press, New York",
+  abstract =     "Concurrent ML (CML) is a high-level, high-performance
+                 language for concurrent programming. It is an extension
+                 of Standard ML (SML) and is implemented on top of
+                 Standard ML of New Jersey (SML/NJ). CML is a practical
+                 language and is being used to build real systems. It
+                 demonstrates that we need not sacrifice high-level
+                 notation in order to have a good performance.",
+  keywords =     "ML, Threads",
+}
+
+@inproceedings{split-c,
+        author  = {D. E. Culler and A. Dusseau and S. C.
+                  Goldstein and A. Krishnamurthy and S.
+                  Lumetta and T. von Eicken and K. Yelick},
+        title = "{Parallel Programming in {Split-C}}",
+        booktitle = "Supercomputing '93",
+        address = {Portland, Oregon},
+        year = {1993}}
+
+@inproceedings{KRI:ASPLOS,
+        author  = {A. Krishnamurthy and K. Schauser and C. Scheiman and
+                   R. Wang and D. Culler and K. Yelick},
+        title = {{Evaluation of Architectural Support for Global 
+        Address-Based Communication in Large-Scale Parallel Machines}},
+        booktitle = "Proceedings of Architecture Support for Programming
+Languages and Operating Systems",
+        year = {1996}}
+
+
+@inproceedings{KRI:SYNC,
+    author= {Arvind Krishnamurthy and Katherine Yelick},
+    title= {Optimizing Parallel Programs with Explicit
+Synchronization},
+    booktitle = {Programming Language Design and Implementation},
+    year = {1995}
+}
+
+@article{KRI:JPDC,
+        author  = {Arvind Krishnamurthy and Katherine Yelick},
+        title   = {{Analyses and Optimizations for Shared Address Space
+Programs}},
+        journal = "Journal of Parallel and Distributed Computation",
+        year    = 1996
+}
+
+@inproceedings{t3dperformstudy,
+   author = "R. Arpaci and D. Culler and A. Krishnamurthy
+            and S. Steinberg and K. Yelick",
+   title = {{Empirical Evaluation of the CRAY-T3D: A Compiler Perspective}},
+   booktitle = "International Symposium on Computer Architecture",
+   year = {1995},
+}
+
+@inproceedings{par-frp,
+   author= "John Peterson and Valery Trifonov and Andrei Serjantov",
+   title = {{Parallel Functional Reactive Programming}},
+   booktitle = "Proc. 2nd International Workshop on Practical Aspects of Declarative Languages",
+   year = {2000}
+}
+
+@Book{jones-97-ccbook,
+  author =       "Neil D. Jones",
+  title =        "Computability and Complexity From a Programming
+                 Perspective",
+  year =         "1997",
+  series =       "Foundations of Computing",
+  ISBN =         "0-262-10064-9",
+  publisher =    "The {MIT} Press",
+  address =      "Cambridge, MA, USA",
+}
+
+@InProceedings{inherit,
+  author =       "Torben Mogensen",
+  title =        "Inherited Limits",
+  booktitle =    "Partial Evaluation: Practice and Theory",
+  pages =        "189--202",
+  year =         1999,
+  volume =       1706,
+  series =       LNCS,
+  publisher =    "Springer-Verlag",
+}
+
+@InProceedings{HR95,
+  author =       "Fritz Henglein and Jakob Rehof",
+  year =         "1995",
+  title =        "Safe Polymorphic Type Inference for a Dynamically
+                 Typed Language: Translating {Scheme} to {ML}",
+  booktitle =    "Proc. International Conf. 
+                  on Functional Programming Languages
+                  and Computer Architecture (FPCA)",
+  address =      "La Jolla",
+  publisher =    "ACM Press",
+  summary =      "We describe a new method for polymorphic type
+                 inference for the dynamically typed language Scheme.
+                 The method infers both types and explicit {\em run-time
+                 type operations (coercions)} for a given program. It
+                 can be used to statically debug Scheme programs and to
+                 give a high-level translation to ML, in essence
+                 providing an ``embedding'' of Scheme into ML.",
+}
+@Misc{ghc,
+  key = 	 "GHC",
+  author = 	 "The {GHC Team}",
+  title = 	 "The Glasgow Haskell Compiler User's Guide, Version 4.08",
+  howpublished = "Available online from {\tt http://haskell.org/ghc/}",
+  OPTmonth = 	 {},
+  OPTyear = 	 {},
+  note = 	 "Viewed on 12/28/2000",
+  OPTannote = 	 {}
+}
+
+@Book{Gordon94,
+  author =       "Andrew D. Gordon",
+  title =        "Functional Programming and Input/Output.",
+  series =       "Distinguished Dissertations in Computer Science.",
+  publisher =    "Cambridge University Press",
+  month =        sep,
+  year =         "1994",
+  keywords =     "FP, input, output, monad, monads, PhD thesis, book,
+                 text, CSci, CS",
+  abstract =     "ISBN 0 521 47103 6 hardback Cambridge University
+                 Press, http://www.cl.cam.ac.uk/users/adg/fpio.html
+                 (Summary (11/'94)) 1. Introduction 2. A Calculus of
+                 Recursive Types 3. A Metalanguage for Semantics 4.
+                 Operational Precongruence 5. Theory of the Metalanguage
+                 6. An Operational Theory of FP 7. Four Mechanisms for
+                 Teletype I/O 8. Monadic I/O 9. Summary email:
+                 adg@cl.cam.ac.uk (11/'94)
+                 http://www.cl.cam.ac.uk/users/adg/ (home page
+                 (11/'94))",
+}
+
+@Article{Mason-Talcott91,
+  key =          "Mason \& Talcott",
+  author =       "Ian Mason and Carolyn L. Talcott",
+  title =        "Equivalence in Functional Languages with Effects",
+  journal =      "Journal of Functional Programming",
+  year =         "1991",
+  volume =       "1",
+  number =       "3",
+  month =        jul,
+  pages =        "287--328",
+  annote =       "Adds objects with memory to a call-by-value lambda
+                 calculus. 43 references.",
+}
+
+@Article{Talcott:1992:TPD,
+  author =       "Carolyn L. Talcott",
+  title =        "A theory for program and data type specification",
+  journal =      "Theoretical Computer Science",
+  volume =       "104",
+  number =       "1",
+  pages =        "129--159",
+  day =          "05",
+  month =        oct,
+  year =         "1992",
+  coden =        "TCSCDI",
+  ISSN =         "0304-3975",
+  bibdate =      "Mon Jul 19 22:16:43 MDT 1999",
+  url =          "http://www.elsevier.com/cgi-bin/cas/tree/store/tcs/cas_sub/browse/browse.cgi?year=1992&;volume=104&issue=1&aid=1163",
+  acknowledgement = ack-nhfb,
+  classification = "C4240 (Programming and algorithm theory); C6110B
+                 (Software engineering techniques); C6120 (File
+                 organisation)",
+  corpsource =   "Dept. of Comput. Sci., Stanford Univ., CA, USA",
+  keywords =     "abstraction; algebraic abstract data types; data
+                 structures; data type specification; data types;
+                 definedness; escape mechanisms; essentially
+                 first-order; formal specification; functional
+                 application; IOCC; program equivalence; programming
+                 theory; programs; reasoning; semantic models;
+                 two-layered theory",
+  pubcountry =   "Netherlands",
+  treatment =    "T Theoretical or Mathematical",
+}
+
+@InProceedings{PODC::VenkatasubramanianT1995,
+  title =        "Reasoning about Meta Level Activities in Open
+                 Distributed Systems",
+  author =       "Nalini Venkatasubramanian and Carolyn L. Talcott",
+  booktitle =    "Proc. Fourteenth Annual {ACM} Symposium
+                 on Principles of Distributed Computing",
+  address =      "Ottawa, Ontario, Canada",
+  month =        "2--23~" # aug,
+  year =         "1995",
+  pages =        "144--152",
+}
+
+@InCollection{PittsAM:operfl,
+  author =       "Andrew~M.~Pitts and Ian~D.~B.~Stark",
+  title =        "Operational Reasoning for Functions with Local State",
+  booktitle =    "Higher Order Operational Techniques in Semantics",
+  editor =       "Andrew~D.~Gordon and Andrew~M.~Pitts",
+  year =         "1996"
+}
+
+@Article{Felleisen:1992:RRS,
+  author =       "M. Felleisen and R. Hieb",
+  title =        "The revised report on the syntactic theories of
+                 sequential control and state",
+  journal =      "Theoretical Computer Science",
+  volume =       "103",
+  number =       "2",
+  pages =        "235--271",
+  day =          "14",
+  month =        sep,
+  year =         "1992",
+  coden =        "TCSCDI",
+  ISSN =         "0304-3975",
+  bibdate =      "Sat Nov 22 13:24:22 MST 1997",
+  acknowledgement = ack-nhfb,
+  classification = "C4210 (Formal logic); C4240 (Programming and
+                 algorithm theory); C6140 (Programming languages)",
+  corpsource =   "Dept. of Comput. Sci., Rice Univ., Houston, TX, USA",
+  keywords =     "Church-Rosser; equational reasoning; equivalence
+                 relations; formal languages; formal logic; fully
+                 compatible equational theories; functional programs;
+                 higher-order languages; imperative programming;
+                 programming languages; programming theory; sequential
+                 control; standardization theorems; state; syntactic
+                 theories",
+  pubcountry =   "Netherlands",
+  treatment =    "T Theoretical or Mathematical",
+}
+
+@InProceedings{GiuPT-FROCOS-96,
+  author =       "Fausto Giunchiglia and Paolo Pecchiari and Carolyn
+                 L. Talcott",
+  title =        "Reasoning Theories - Towards an Architecture for Open
+                 Mechanized Reasoning Systems",
+  editor =       "F.~Baader and K. U.~Schulz",
+  booktitle =    "Frontiers of Combining Systems: Proc. 1st
+                 International Workshop, Munich (Germany)",
+  publisher =    "Kluwer Academic Publishers",
+  series =       "Applied Logic",
+  month =        mar,
+  year =         "1996",
+  pages =        "157--174",
+}
+
+@inproceedings{icra99
+    ,author={John Peterson and Gregory Hager and Paul Hudak}
+    ,title={A Language for Declarative Robotic Programming}
+    ,booktitle={International Conf. on Robotics and Automation}
+    ,year=1999
+    ,pages={}
+    }
+ 
+@InProceedings{padl99,
+        author = "John Peterson and Paul Hudak and Conal Elliott",
+        title = "Lambda in Motion: Controlling Robots With Haskell",
+        booktitle = "First International Workshop on
+                     Practical Aspects of Declarative Languages",
+        organization = "SIGPLAN",
+        month = "Jan",
+        year = "1999" 
+}
+
+@inproceedings{RePeHaHu99,
+   title="Prototyping Real-Time Vision Systems: An Experiment 
+          in {DSL} Design",
+   author ="Alastair Reid and John Peterson and Greg Hager and Paul
+Hudak",
+   booktitle = "Proc. International Conf. on Software Engineering",
+   month = May,
+   year = 1999
+}
+
+@inproceedings{linearMADT
+    ,author={Chih-Ping Chen and Paul Hudak}
+    ,title={Rolling Your Own Mutable ADT---A Connection between Linear
+            Types and Monads}
+    ,booktitle = "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}"
+    ,year =        "1997"
+    ,publisher =   "ACM Press"
+    ,address =     "New York"
+    ,month =       "January"
+    ,pages={54--66}
+    }
+
+@InProceedings{sulzmann,
+  author =      "Martin Sulzmann and Martin Odersky and Martin Wehr",
+  title =       "Type Inference with Constrained Types",
+  booktitle =   "FOOL4: 4th. International Workshop on Foundations of
+Object-oriented programming Languages",
+  year =        "1997",
+  month =       "January"
+}
+
+
+@InProceedings{Pitts00,
+  author =       "Andrew M. Pitts and Murdoch J. Gabbay",
+  title =        "A Metalanguage for Programming with
+       Bound Names Modulo Renaming",
+  booktitle =    "Mathematics of Programme Construction",
+  pages =        "230-255",
+  year =         2000,
+  volume =       1837,
+  series =       LNCS,
+  publisher =    "Springer-Verlag",
+}
+
+@InProceedings{Twelf,
+  author =       "Frank Pfenning and Carsten Sch{\"u}rmann",
+  title =        "System Description: Twelf --- {A} Meta-Logical
+                 Framework for Deductive Systems",
+  editor =       "H. Ganzinger",
+  pages =        "202--206",
+  booktitle =    "the International Conf. on
+                 Automated Deduction (CADE-16)",
+  year =         "1999",
+  publisher =    "Springer-Verlag LNAI 1632",
+  address =      "Trento, Italy",
+  month =        jul,
+  keywords =     "LF, Elf",
+  urlps =        "http://www.cs.cmu.edu/~fp/papers/twelf98.ps.gz",
+}
+
+@Article{Isabelle,
+  author =       "L. C. Paulson",
+  title =        "{Isabelle}: {A} Generic Theorem Prover",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "828",
+  pages =        "xvii + 321",
+  year =         "1994",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Tue Apr 28 14:47:35 1998",
+  acknowledgement = ack-nhfb,
+}
+
+@InProceedings{Despeyroux97,
+  author =       "Jo{\"e}lle Despeyroux and Frank Pfenning and Carsten
+                  Sch{\"u}rmann",
+  title =        "Primitive Recursion for Higher-Order Abstract Syntax",
+  editor =       "J. Roger  Hindley",
+  pages =        "147--163",
+  booktitle =    "Proc. Third International Conf. on
+                  Typed Lambda Calculus and Applications (TLCA'97)",
+  year =         1997,
+  publisher =    "Springer-Verlag LNCS 1210",
+  address =      "Nancy, France",
+  month =        apr,
+  keywords =     "misc",
+  note =         "An extended version is available as Technical Report
+                  CMU-CS-96-172, Carnegie Mellon University",
+  urldvi =       "http://www.cs.cmu.edu/~fp/papers/tlca97.dvi.gz",
+  urlps =        "http://www.cs.cmu.edu/~fp/papers/tlca97.ps.gz"
+}
+
+@Manual{Pfenning98guide,
+  title =        "Twelf User's Guide",
+  author =       "Frank Pfenning and Carsten Sch{\"u}rmann",
+  edition =      "1.2",
+  year =         1998,
+  month =        sep,
+  keywords =     "LF, Elf",
+  note =         "Available as Technical Report CMU-CS-98-173, Carnegie
+                  Mellon University",
+  urlhtml =      "http://www.cs.cmu.edu/~twelf/guide"
+}
+
+@InProceedings{Pfenning98types,
+  author =       "Frank Pfenning and Carsten Sch{\"u}rmann",
+  title =        "Algorithms for Equality and Unification in the
+                  Presence of Notational Definitions",
+  editor =       "T. Altenkirch and W. Naraschewski and B. Reus",
+  booktitle =    "Types for Proofs and Programs",
+  month =        mar,
+  year =         1998,
+  pages =        "179--193",
+  address =      "Kloster Irsee, Germany",
+  publisher =    "Springer-Verlag LNCS 1657",
+  keywords =     "LF, Elf",
+  urlps =        "http://www.cs.cmu.edu/~fp/papers/types98.ps.gz"
+}
+
+@InProceedings{Pfenning99cade,
+  author =       "Frank Pfenning and Carsten Sch{\"u}rmann",
+  title =        "System Description: Twelf --- A Meta-Logical Framework for
+                  Deductive Systems",
+  editor =       "H. Ganzinger",
+  pages =        "202--206",
+  booktitle =    "Proc. 16th International Conf. on
+                  Automated Deduction (CADE-16)",
+  year =         1999,
+  publisher =    "Springer-Verlag LNAI 1632",
+  address =      "Trento, Italy",
+  month =        jul,
+  keywords =     "LF, Elf",
+  urlps =        "http://www.cs.cmu.edu/~fp/papers/cade99.ps.gz"
+}
+
+@MastersThesis{Schurmann95,
+  author =       "Carsten Sch{\"u}rmann",
+  title =        "A Computational Meta Logic for the {Horn} Fragment of {LF}",
+  school =       "Carnegie Mellon University",
+  year =         1995,
+  month =        dec,
+  note =         "Available as Technical Report CMU-CS-95-218",
+  keywords =     "LF"
+}
+
+@InProceedings{Schurmann98cade,
+  author =       "Carsten Sch{\"u}rmann and Frank Pfenning",
+  title =        "Automated Theorem Proving in a Simple Meta-Logic for {LF}",
+  editor =       "Claude Kirchner and H{\'e}l{\`e}ne Kirchner",
+  pages =        "286--300",
+  booktitle =    "Proc. 15th International Conf. on
+                  Automated Deduction (CADE-15)",
+  year =         1998,
+  publisher =    "Springer-Verlag LNCS 1421",
+  address =      "Lindau, Germany",
+  month =        jul,
+  keywords =     "LF, Elf",
+  urlps =        "http://www.cs.cmu.edu/~fp/papers/cade98m2.ps.gz"
+}
+
+@PhdThesis{Schurmann00phd,
+  author =       "Carsten Sch{\"u}rmann",
+  title =        "Automating the Meta Theory of Deductive Systems",
+  school =       "Department of Computer Science, Carnegie Mellon University",
+  year =         2000,
+  month =        aug,
+  note =         "Available as Technical Report CMU-CS-00-146",
+  keywords =     "LF, Elf",
+  urlps =        "http://cs-www.cs.yale.edu/homes/carsten/papers/S00b.ps.gz"
+}
+
+@InProceedings{Kreitz98,
+  author          = "Christoph Kreitz and Mark Hayden and Jason Hickey",
+  title           = "A Proof Environment for the Development of Group 
+                     Communication Systems",
+  booktitle       = "15$^{th}$ International Conf. on Automated
+Deduction", 
+  year            = "1998",
+  editor          = "C. Kirchner and H. Kirchner",
+  volume          = "1421",
+  series          = "Lecture Notes in Artificial Intelligence",
+  pages           = "317--332",
+  publisher       = "Springer Verlag"
+}
+
+@InProceedings{Kreitz99,
+  author          = "Christoph Kreitz",
+  title           = "Automated Fast-Track Reconfiguration of Group
+                     Communication Systems",
+  booktitle       = "5$^{th}$ International Conf. on Tools and Algorithms
+                     for the Construction and Analysis of Systems",
+  year            = "1999",
+  editor          = "R.~Cleaveland",
+  number          = "1579",
+  series          = "Lecture Notes in Computer Science",
+  pages           = "104--118",
+  publisher       = "Springer Verlag"
+}
+
+@TechReport{Luo92,
+  author =  "Zhaohui Luo and Robert Pollack",
+  title =  "The {LEGO} Proof Development System: A User's Manual",
+  institution =  "University of Edinburgh",
+  month = may,
+  year =  "1992",
+  number =  "ECS-LFCS-92-211",
+  keywords = "misc"
+}
+
+
+@InProceedings{Nordstrom93,
+  author = "Bengt Nordstr{\"o}m",
+  title = "The {ALF} proof editor",
+  booktitle = "Proc. Workshop on Types for Proofs and
+Programs",
+  address = "Nijmegen",
+  year = "1993",
+  pages = "253--266",
+  keywords =  "ALF"
+}
+
+@TechReport{Dowek93tr,
+  author = "Gilles Dowek and Amy Felty and Hugo Herbelin and
+    G{\'e}rard Huet and Chet Murthy and Catherine Parent and
+    Christine Paulin-Mohring and Benjamin Werner",
+  title = "The {Coq} Proof Assistant User's Guide",
+  institution = "INRIA",
+  address = "Rocquencourt, France",
+  type = "Rapport Techniques",
+  number = "154",
+  year = "1993",
+  note = "Version 5.8",
+  keywords =  "misc"
+}
+
+
+@InProceedings{Allen00,
+  author          = "Stuart Allen and Robert Constable and Richard Eaton and 
+                     Christoph Kreitz and Lori Lorigo",  
+  title           = "The {\sf Nuprl} Open Logical Environment",
+  booktitle       = "the International Conf. on Automated
+Deduction",
+  year            = "2000",
+  editor          = "D. McAllester",
+  volume          = "1831",
+  series          = "Lecture Notes in Artificial Intelligence",
+  pages           = "170--176",
+  publisher       = "Springer-Verlag"
+}
+
+@techreport{Goad80,
+author  =       "Christopher A. Goad" ,
+title   =       "Computational Uses of the Manipulation of Formal Proofs" ,
+institution=    "Stanford University" ,
+number  =       "Stan-CS-80-819" ,
+month   =       "August" ,
+year    =       "1980"
+}
+
+@inproceedings{Xi99@PADL,
+author = "Xi, Hongwei",
+title = {Dead Code Elimination through Dependent Types},
+booktitle = "First International Workshop on Practical Aspects of Declarative Languages",
+series =      "Lecture Notes in Computer Science",
+volume =       1551,
+year = 1999
+}
+
+@InCollection{HarperStone98,
+  author =       "Robert Harper and Chris Stone",
+  title =        "A Type-Theoretic Interpretation of {Standard ML}",
+  booktitle =    "Proof, Language and Interaction: Essays in Honour of
+                 Robin Milner",
+  publisher =    "MIT Press",
+  year =         "1998",
+  editor =       "Gordon D. Plotkin and Colin Stirling and Mads Tofte",
+  note =         "To appear",
+}
+
+@TechReport{HarperStone97,
+  author =       "Robert Harper and Chris Stone",
+  title =        "A Type-Theoretic Account of {S}tandard {ML} 1996
+                 (Version 2)",
+  institution =  "Carnegie Mellon University",
+  year =         "1997",
+  number =       "CMU--CS--97--147",
+  address =      "Pittsburgh, PA"
+}
+
+@InProceedings{miller90tr,
+  author =       "Dale Miller",
+  title =        "An Extension to {ML} to Handle Bound Variables in Data
+                 Structures: Preliminary Report",
+  month =        jun,
+  year =         "1990",
+  booktitle =    "Informal Proc. Logical Frameworks BRA
+                 Workshop",
+  where =        "Nice, France",
+  note =         "Available as UPenn CIS technical report MS-CIS-90-59",
+}
+
+@Article{Miller:1992:UUM,
+  author =       "Dale Miller",
+  title =        "Unification Under a Mixed Prefix",
+  journal =      "Journal of Symbolic Computation",
+  volume =       "14",
+  number =       "4",
+  pages =        "321--358",
+  month =        oct,
+  year =         "1992",
+  coden =        "JSYCEH",
+  ISSN =         "0747-7171",
+  mrclass =      "68T15 (03B35 03B40)",
+  mrnumber =     "93g:68121",
+  bibdate =      "Sat May 10 15:54:09 MDT 1997",
+  acknowledgement = ack-nhfb,
+  classcodes =   "C4240 (Programming and algorithm theory)",
+  corpsource =   "Dept. of Comput. Sci., Pennsylvania Univ.,
+                 Philadelphia, PA, USA",
+  keywords =     "decidability; mixed prefix; optimizations;
+                 pre-unifiers; search problems; symbol manipulation;
+                 unification problems; unification search problem",
+  treatment =    "T Theoretical or Mathematical",
+}
+
+@InProceedings{miller92rclp,
+  author =       "Dale Miller",
+  title =        "Abstract Syntax and Logic Programming",
+  booktitle =    "Logic Programming: Proc. First and Second
+                 Russian Conf.s on Logic Programming",
+  year =         "1992",
+  pages =        "322--337",
+  publisher =    "Springer-Verlag",
+  series =       "Lecture Notes in Artificial Intelligence",
+  number =       "592",
+  alsoavailable = "Also available as technical report MS-CIS-91-72,
+                 UPenn.",
+}
+
+@InProceedings{POPL00*133,
+  author =       "Alan Bawden",
+  title =        "First-Class Macros have Types.",
+  pages =        "133--141",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL)}",
+  month =        jan # " ~19--21",
+  publisher =    "ACM Press",
+  address =      "N.Y.",
+  year =         "2000",
+}
+
+@Article{Ingerman61,
+  author =       "P. Z. Ingerman",
+  title =        "Thunks: a way of compiling procedure statements with
+                 some comments on procedure declarations.",
+  journal =      "Comm. A.C.M.",   
+  volume =       "4",
+  number =       "1",
+  pages =        "55--58",
+  month =        jan,
+  year =         "1961",
+  keywords =     "Algol 60, call by name, call-by-name, by-name, FP,
+                 parameter, passing, thunk, think, pass, closure,
+                 algol-60, programming language",
+}
+
+
+
+@InProceedings{FM01A,
+  author = 	 "J. Ford and I. A. Mason",
+  title = 	 "Operational Techniques in PVS - A Preliminary Evaluation",
+  booktitle = 	 "The Australasian Theory Symposium, CATS '01",
+  year = 	 2001
+}
+
+@InProceedings{FM01B,
+  author = 	 "J. Ford and I. A. Mason",
+  title = 	 "Establishing a General Context Lemma in PVS",
+  booktitle = 	 "The 2nd Australasian Workshop on Computational Logic, 
+                  AWCL'01",
+  year = 	 2001
+}
+
+@manual{PVS,
+        TITLE = {PVS Tutorial},
+        AUTHOR = {N. Shankar and S. Owre and J. M. Rushby},
+        MONTH = feb,
+        YEAR = 1993,
+        ORGANIZATION = {Computer Science Laboratory, SRI International},
+        ADDRESS = {Menlo Park, CA},
+        NOTE = {Also appears in Tutorial Notes, {\em Formal Methods Europe
+                '93: Industrial-Strength Formal Methods}, pages 357--406,
+                Odense, Denmark, April 1993}}
+
+@InProceedings{CMA94,
+  key =          "CMA94",
+  author =       "L. Cardelli and F. Matthes and M. Abadi",
+  title =        "Extensible Grammars for Language Specialization",
+  booktitle =    "Database Programming Languages (DBPL-4)",
+  editor =       "C. Beeri and A. Ohori and D. E. Shasha",
+  series =       "Workshops in Computing",
+  publisher =    "Springer-Verlag",
+  month =        feb,
+  year =         "1994",
+  url =          "http://www.sts.tu-harburg.de/papers/1994/CMA94",
+  abstract =     "A basic dilemma in the design of a database
+                 programming language is the choice between a
+                 user-friendly language with a rich set of tailored
+                 notations for schema definitions, query expressions,
+                 etc., and a small, conceptually simple core language.
+                 We address this dilemma by proposing extensible
+                 grammars, a syntax-definition formalism for incremental
+                 language extensions and restrictions based on an
+                 initial core language.\\ The translation of programs
+                 written in tailored object languages into programs of a
+                 core language is defined via syntax-directed patterns.
+                 In contrast to traditional macro-expansion and
+                 program-rewriting tools, our extensible grammars
+                 respect scoping rules. Therefore, it is possible to
+                 introduce new binding constructs like quantifiers,
+                 iterators, and type declarations, while avoiding
+                 problems with variable captures and name clashes.\\ We
+                 develop extensible grammars and illustrate their use by
+                 extending the lambda calculus with let-bindings,
+                 conditionals, and SQL-style query expressions. We then
+                 give a formal description of the underlying parsing,
+                 transformation, and substitution rules. We also
+                 highlight some implementation details of a type-safe,
+                 extensible parser package based on the concept of
+                 extensible grammars developed for the Tycoon
+                 programming environment.",
+}
+
+@article{hashimoto97,
+    author = "M. Hashimoto and A. Ohori",
+    title = "A typed context calculus",
+    journal = "Theoretical Computer Science",
+    note = "To appear.  Preliminary version. Preprint          
+            RIMS-1098, Research Institute for Mathematical Sciences, Kyoto     
+            University, 1996",
+    url = "citeseer.nj.nec.com/hashimoto01typed.html"
+}
+
+@Article{Mason99,
+  author =       "Ian A. Mason",
+  title =        "Computing with Contexts",
+  journal =      "Higher-Order and Symbolic Computation",
+  volume =       "12",
+  number =       "2",
+  pages =        "171--201",
+  month =        sep,
+  year =         "1999",
+  coden =        "LSCOEX",
+  ISSN =         "1388-3690",
+  bibdate =      "Sat Jul 17 17:47:09 MDT 1999",
+  url =          "http://www.wkap.nl/oasis.htm/234970",
+  acknowledgement = ack-nhfb,
+}
+
+@InCollection{Sand98,
+  author =       "David Sands",
+  title =        "Computing with Contexts: {A} simple approach",
+  booktitle =    "Second Workshop on Higher-Order Operational Techniques
+                 in Semantics (HOOTS II)",
+  editor =       "Andrew D. Gordon and Andrew M. Pitts and Carolyn L. Talcott",
+  series =       "Electronic Notes in Theoretical Computer Science",
+  year =         "1998",
+  volume =       "10",
+  publisher =    "Elsevier Science Publishers B.V.",
+  keywords =     "pisem",
+}
+
+
+@TechReport{MS2000,
+  author = 	 "Stefan Monnier and Zhong Shao",
+  title = 	 "Inlining as Staged Computation",
+  institution =  "Department of Computer Science, 
+                  Yale University",
+  year = 	 2000,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "YALEU/DCS/TR-1193",
+  OPTaddress = 	 {},
+  month = 	 mar,
+  OPTnote = 	 {},
+  annote = 	 "{\sf http://flint.cs.yale.edu/flint/publications/isc.html}"
+}
+
+@InProceedings{Ong,
+  author = 	 "A. S. Murawski and C.-H. L. Ong",
+  title = 	 "Can safe recursion be interpreted in light logic?",
+  booktitle = 	 "Second International Workshop on 
+                  Implicit Computational Complexity",
+  year = 	 200,
+  address = 	 "Santa Barbara",
+  month = 	 jun
+}
+
+@Unpublished{Kieburtz2001,
+  author = 	 "Richard Kieburtz",
+  title = 	 "Real-time Reactive Programming for Embedded Controllers",
+  note = 	 "Available from author's home page",
+  OPTkey = 	 {},
+  month = 	 mar,
+  year = 	 2001,
+  OPTannote = 	 {}
+}
+
+@article{UpperBounds,
+author = {Hongwei Xi},            
+title = "{Upper bounds for standardizations and an application}",
+journal = {Journal of Symbolic Logic},
+volume = 64,
+number = 1,
+pages = "291-303",
+year = 1999,
+month = "March"
+}
+
+@InCollection{DepTypes,
+  author =       "Martin Hofmann",
+  title =        "Syntax and Semantics of Dependent Types",
+  editor =       "Andrew M. Pitts and Peter Dybjer",
+  booktitle =    "Semantics and Logics of Computation",
+  series =       "Publications of the Newton Institute",
+  volume =       "14",
+  pages =        "79--130",
+  publisher =    "Cambridge University Press",
+  address =      "Cambridge",
+  year =         "1997",
+}
+
+
+
+@InProceedings{Hofmann99b,
+  author =       "Martin Hofmann",
+  title =        "Linear Types and Non-Size-Increasing Polynomial Time
+                 Computation",
+  pages =        "464--473",
+  booktitle =    "the Symposium on Logic in Computer Science
+                 ({LICS} '99)",
+  ISBN =         "0-7695-0158-3",
+  month =        jul,
+  publisher =    "IEEE",
+  year =         "1999",
+}
+
+@InProceedings{Effects92,
+  author =       "Jean-Pierre Talpin and Pierre Jouvelot",
+  title =        "The Type and Effect Discipline",
+  editor =       "A. Scedrov",
+  booktitle =    "Proc. 1992 Logics in Computer Science
+                 Conf.",
+  pages =        "162--173",
+  year =         "1992",
+  publisher =    "IEEE",
+  abstract =     "The {\em type and effect discipline} is a new
+                 framework for reconstructing the principal type and the
+                 minimal effect of expressions in implicitly typed
+                 polymorphic functional languages that support
+                 imperative constructs. The type and effect discipline
+                 outperforms other polymorphic type systems. Just as
+                 types abstract collections of concrete values, {\em
+                 effects} denote imperative operations on regions. {\em
+                 Regions} abstract sets of possibly aliased memory
+                 locations. \par Effects are used to control type
+                 generalization in the presence of imperative constructs
+                 while regions delimit observable side-effects. The
+                 observable effects of an expression range over the
+                 regions that are free in its type environment and its
+                 type; effects related to local data structures can be
+                 discarded during type reconstruction. The type of an
+                 expression can be generalized with respect to the
+                 variables that are not free in the type environment or
+                 in the observable effect.",
+}
+
+@InProceedings{Wadler99,
+  key =          "Wadler",
+  author =       "Philip Wadler",
+  title =        "The marriage of effects and monads",
+  booktitle =    "the International
+                 Conf. on Functional Programming (ICFP '98)",
+  series =       "ACM SIGPLAN Notices",
+  volume =       "34(1)",
+  month =        jun,
+  year =         "1999",
+  organization = "ACM",
+  pages =        "63--74",
+  annote =       "Shows how effect systems can be adapted to monads. 33
+                 references.",
+}
+
+@Article{Regions97,
+  refkey =       "C1753",
+  title =        "Region-Based Memory Management",
+  author =       "Mads Tofte and Jean-Pierre Talpin",
+  pages =        "109--176",
+  journal =      "Information and Computation",
+  month =        "1~" # feb,
+  year =         "1997",
+  volume =       "132",
+  number =       "2",
+  abstract =     "This paper describes a memory management discipline
+                 for programs that perform dynamic memory allocation and
+                 de-allocation. At runtime, all values are put into
+                 \emph{regions}. The store consists of a stack of
+                 regions. All points of region allocation and
+                 de-allocation are inferred automatically, using a type
+                 and effect based program analysis. The scheme does not
+                 assume the presence of a garbage collector. The scheme
+                 was first presented in 1994 (M.~Tofte and J.-P. Talpin,
+                 \emph{in} ``Proc. 21st ACM SIGPLAN-SIGACT
+                 Symposium on Principles of Programming Languages,''
+                 pp.~188--201); subsequently, it has been tested in the
+                 ML Kit with Regions, a region-based, garbage-collection
+                 free implementation of the Standard ML Core Language,
+                 which includes recursive datatypes, higher-order
+                 functions and updatable references (L.~Birkedal,
+                 M.~Tofte, and M.~Vejlstrup, (1996), \emph{in}
+                 ``Proc. 23rd ACM SIGPLAN-SIGACT Symposium
+                 on Principles of Programming Languages,''
+                 pp.~171--183). This paper defines a region-based
+                 dynamic semantics for a skeletal programming language
+                 extracted from Standard ML\@. We present the inference
+                 system which specifies where regions can be allocated
+                 and de-allocated and a detailed proof that the system
+                 is sound with respect to a standard semantics. We
+                 conclude by giving some advice on how to write programs
+                 that run well on a stack of regions, based on practical
+                 experience with the ML Kit.",
+  references =   "pldi::AikenFL1995, book::Appel1992, CACM::Baker1978,
+                 clfp::Baker1990, popl::BirkedalTV1996,
+                 TR::GiffordJS1987, POPL::DamasM1982,
+                 MISC::Dijkstra1960, MISC::ElsmanH1995,
+                 toplas::Georgeff1984, clfp::Hudak1986,
+                 popl::JouvelotG1991, toplas::InoueSY1988:555,
+                 book::Knuth1972, cacm::LiebermanH1983,
+                 popl::LucassenG1988, thesis::Lucassen1987,
+                 jcss::Milner1978, book::MilnerTH1990,
+                 lncs::Mycroft1984, cacm::Backus+1963:1,
+                 popl::RuggieriM1988, thesis::Talpin1993,
+                 jfp::TalpinJ1992, TR::TofteT1993, popl::TofteT1994",
+  preliminary =  "POPL::TofteT1994",
+  references =   "\cite{PLDI::AikenFL1995} \cite{BOOK::Appel1992}
+                 \cite{CACM::Baker1978} \cite{CLFP::Baker1990}
+                 \cite{POPL::BirkedalTV1996} \cite{TR::GiffordJS1987}
+                 \cite{POPL::DamasM1982} \cite{MISC::Dijkstra1960}
+                 \cite{MISC::ElsmanH1995} \cite{TOPLAS::Georgeff1984}
+                 \cite{CLFP::Hudak1986} \cite{POPL::JouvelotG1991}
+                 \cite{TOPLAS::InoueSY1988} \cite{BOOK::Knuth1972}
+                 \cite{CACM::LiebermanH1983} \cite{POPL::LucassenG1988}
+                 \cite{THESIS::Lucassen1987} \cite{JCSS::Milner1978}
+                 \cite{BOOK::MilnerTH1990} \cite{LNCS::Mycroft1984}
+                 \cite{CACM::Backus+1963} \cite{POPL::RuggieriM1988}
+                 \cite{THESIS::Talpin1993} \cite{JFP::TalpinJ1992}
+                 \cite{TR::TofteT1993} \cite{POPL::TofteT1994}",
+}
+
+@InProceedings{Calcagno01,
+  author =       "Cristiano Calcagno",
+  title =        "Stratified Operational Semantics for Safety and
+                 Correctness of the Region Calculus",
+  booktitle =    "the Symposium on Principles of Programming Languages ({POPL}'01)",
+  year =         "2001",
+}
+
+
+
+
+
+@article{Caspi&Pouzet:1994a,
+        Author = {Paul Caspi and Marc Pouzet},
+        Title = {A functional extension to {Lustre}},
+        Year = 1994
+}
+
+@techreport{Caspi&Pouzet:1997,
+        Author = {Paul Caspi and Marc Pouzet},
+        Title = {A co-iterative characterization of synchronous stream functions},
+        Number = {{VERIMAG} Research Report 97-07},
+        Institution = {{VERIMAG}},
+        CITY = {Gieres, France},
+        Month = Oct,
+        Year = 1997
+}
+
+
+@InProceedings{Kieburtz,
+  title =        "Implementing Closed Domain-Specific Languages",
+  author =       "Richard B. Kieburtz",
+  booktitle =    "\cite{saig00}",
+  pages =        "1--2",
+  year = 2000,
+}
+
+
+@Article{arrow,
+  author =       {R.J.M. Hughes},
+  title =        {Generalising Monads to Arrows},
+  journal =      {Science of Computer Programming},
+  year =         {2000},
+  volume =       {37},
+  pages =        {67-111},
+  month =        {May}
+}
+
+@InProceedings{caspi96synchronous,
+  title =        "Synchronous {Kahn} networks",
+  author =       "Paul Caspi and Marc Pouzet",
+  pages =        "226--238",
+  booktitle =    "the International
+                 Conf. on Functional Programming (ICFP'96)",
+  month =        "24--26 " # may,
+  year =         "1996",
+  address =      "Philadelphia, Pennsylvania",
+}
+
+@article{ ,
+    author = "Paul Caspi and Marc Pouzet",
+    title = "Synchronous {Kahn} networks",
+    journal = "ACM SIG{\-}PLAN Notices",
+    volume = "31",
+    number = "6",
+    pages = "226--238",
+    year = "1996",
+    url = "citeseer.nj.nec.com/24360.html"
+}
+
+@InProceedings{rt-frp,
+  author =       {Zhanyong Wan and Walid Taha and Paul Hudak},
+  title =        {{R}eal-time {FRP}},
+  booktitle =    {Proc. Intl. Conf. on 
+                  Functional Programming ({ICFP} '01)},
+  year =         {2001},
+  address =      {Florence, Italy},
+  month =        {September},
+  organization = {ACM},
+}
+
+@InProceedings{efrp,
+  author =   {Zhanyong Wan and Walid Taha and Paul Hudak},
+  title =   {{E}vent-driven {FRP}},
+  booktitle =   {Proc. 4th. Intl. Sym. on Practical
+Aspects of Declarative Languages (PADL~'02)},
+  year =   {2002},
+  month =   {Jan},
+  organization = {ACM},
+}
+
+@InProceedings{typed-macros,
+  author =       {Steven Ganz and Amr Sabry and Walid Taha},
+  title =        {Macros as Multi-Stage Computations:
+                  Type-Safe, Generative, Binding Macros in {M}acro{ML}},
+  booktitle =    {the International Conf. on 
+                  Functional Programming (ICFP '01)},
+  year =         {2001},
+  address =      {Florence, Italy},
+  month =        {September},
+  organization = {ACM},
+}
+
+@inproceedings{mycroft00statically,
+    author = "Alan Mycroft and Richard Sharp",
+    title = "A Statically Allocated Parallel Functional Language",
+    booktitle = "Automata, Languages and Programming",
+    pages = "37-48",
+    year = "2000",
+    url = "citeseer.nj.nec.com/mycroft00statically.html"
+}
+
+@InProceedings{HP99,
+  author =       "R.J.M. Hughes and Lars Pareto",
+  title =        "Recursion and Dynamic Data-structures in Bounded
+                 Space: Towards Embedded {ML} Programming",
+  pages =        "70--81",
+  ISBN =         "1-58113-111-9",
+  booktitle =    "Proc. Fourth {ACM} {SIGPLAN}
+                 International Conf. on Functional Programming
+                 ({ICFP}-99)",
+  month =        sep # " ~27--29",
+  series =       "ACM Sigplan Notices",
+  volume =       "34.9",
+  publisher =    "ACM Press",
+  address =      "N.Y.",
+  year =         "1999",
+}
+
+@techreport{esterel-semantics
+    ,author={Gerard Berry}
+    ,title={The Constructive Semantics of Pure {E}sterel (Draft Version 3)}
+    ,institution={Ecole des Mines de Paris and INRIA}
+    ,type={Draft Version}
+    ,number={3}
+    ,month=Jul
+    ,year=1999
+    }
+@phdthesis{acd-phd,
+author = {Anthony C. Daniels},
+title = {A Semantics for Functions and Behaviours},
+month = {December},
+year = {1999},
+pages = {193},
+url = {http://www.cs.ukc.ac.uk/pubs/1999/1172},
+publication_type = {phdthesis},
+submission_id = {24157_981726971},
+school = {The University of Nottingham}
+} 
+
+
+@InProceedings{franTk,
+  author =       {Meurig Sage},
+  title =        {{F}ran{T}k -- A Declarative {GUI} Language for {H}askell},
+  booktitle =    {Proceedings of Fifth ACM SIGPLAN International Conf. on Functional Programming},
+
+  pages =        {106-118},
+  year =         {2000},
+  address =      {Montreal, Canada},
+  month =        {September},
+  organization = {ACM},
+}
+
+@InProceedings{frappe,
+  author =       {Antony Courtney},
+  title =        {{F}rapp\'e: Functional Reactive Programming in {J}ava},
+  booktitle =    {Proceedings of Symposium on Practical Aspects of Declarative Languages},
+  year =         {2001},
+  organization = {ACM},
+}
+
+@TechReport{henzinger-hybrid-automata,
+  author =       {Thomas A. Henzinger},
+  title =        {The theory of hybrid automata},
+  institution =  {University of California, Berkeley},
+  year =         {1996}
+}
+
+@phdthesis{sulzmann-phd
+    ,author={Sulzmann, Martin}
+    ,title={A General Framework for Hindley/Milner Type Systems
+            with Constraints}
+    ,school={Department of Computer Science, Yale University}
+    ,month=May
+    ,year=2000
+    }
+
+@phdthesis{chen-chih-ping-phd
+    ,author={Chen, Chih-Ping}
+    ,title={Mutable Abstract Datatypes--A Connection 
+            Between Linear Types and State Monads}
+    ,school={Department of Computer Science, Yale University}
+    ,month=Dec
+    ,year=1999
+    }
+
+@book{barnsley
+    ,author={Barnsley, Michael F.}
+    ,title={Fractals Everywhere (Second Edition)}
+    ,publisher={Morgan Kaufmann}
+    ,address={New York}
+    ,year=2000
+    }
+@book{logo
+    ,author={Michael Friendly}
+    ,title={Advanced Logo: A Language for Learning}
+    ,publisher={Lawrence Erlbaum Associates}
+    ,address={}
+    ,year=1988
+    }
+
+@book{karel
+    ,author={Richard E. Pattis}
+    ,title={Karel the Robot}
+    ,publisher={John Wiley and Sons}
+    ,address={New York}
+    ,year=1981
+    }
+
+@book{littleschemer
+    ,author={Daniel P. Friedman and Matthias Felleisen}
+    ,title={The Little Schemer}
+    ,publisher={MIT Press}
+    ,address={Cambridge}
+    ,year=1996
+    }
+
+@book{labanotation
+    ,author={Ann Hutchinson}
+    ,title={Labanotation}
+    ,publisher={Routledge Theatre Arts Books}
+    ,address={New York}
+    ,year=1991
+    }
+
+@book{hofstadter
+    ,author={Douglas R. Hofstadter}
+    ,title={G\"{o}del, Escher, Bach: an Eternal Golden Braid}
+    ,publisher={Basic Books}
+    ,address={New Yorl}
+    ,year=1979
+    }
+
+@book{emmer
+    ,editor={Michele Emmer}
+    ,title={The Visual Mind}
+    ,publisher={MIT Press}
+    ,address={Cambridge}
+    ,year=1993
+    }
+
+@book{rothstein
+    ,author={Edward Rothstein}
+    ,title={Emblems of Mind: The Inner Life of Music and Mathematics}
+    ,publisher={Times Books}
+    ,address={New York}
+    ,year=1995
+    }
+ 
+@inproceedings{frp-pldi
+    ,author={Zhanyong Wan and Paul Hudak}
+    ,title={Functional Reactive Programming From First Principles}
+    ,booktitle={the Symposium on Programming Language Design
+                and Implementation ({PLDI} '00)}
+    ,organization={ACM}
+    ,year=2000
+    ,pages={}
+    }
+
+@Book{inside-com,
+  author =      "Dale Rogerson",
+  title =       "Inside COM",
+  publisher =   "Microsoft Press",
+  year =        "1997",
+}
+
+@Book{javabeans-ref,
+
+  author =      "Dan Brookshier",
+  title =       "JavaBeans Developer's Reference",
+  publisher =   "Macmillan Computer Publishing",
+  year =        "1997",
+}
+
+@Book{corba-ref,
+  author =      "Thomas Mowbray and Ron Zahavi",
+  title =       "The Essential Corba",
+  publisher =   "John Wiley and Sons",
+  year =        "1995",
+}
+
+@book{nelson91,
+editor="Greg Nelson",
+title="Systems programming with {M}odula-3",
+publisher="Prentice Hall",
+address ="Englewood Cliffs, NJ",
+year="1991"
+}
+
+@misc{PITAC
+    ,author={President's Information Technology Advisory Committee}
+    ,title={Information Technology Research:
+            Investing in Our Future}
+    ,note={chaired by Bill Joy and Ken Kennedy}
+    ,month=Feb
+    ,year=1999
+    }
+
+@book{soe
+    ,author={Paul Hudak}
+    ,title={The Haskell School of Expression -- 
+            Learning Functional Programming through Multimedia}
+    ,publisher={Cambridge University Press}
+    ,address={New York}
+    ,year=2000
+    }
+
+@book{java
+    ,author={Gosling, J. and Joy, B. and Steele, G.}
+    ,title={The Java Language Specification}
+    ,publisher={Addison-Wesley}
+    ,address={Reading, MA}
+    ,year=1996
+    }
+
+@misc{ada
+    ,key={Ada}
+    ,title={Rationale for the Design of the Ada Programming Language}
+    ,organization={United States Department of Defense}
+    ,journal={ACM Sigplan Notices}
+    ,volume=14
+    ,number=6
+    ,year=1979
+    ,month=Jun
+    }
+
+@misc{cobol
+    ,key={Cobol}
+    ,title={American National Standard COBOL (ANS X3.23-1968)}
+    ,organization={American National Standards Institue, New York}
+    ,year=1968
+    }
+
+@article{algol
+    ,author={de Morgan, R.M. and Hill, I.D. and Wichmann, B.A.}
+    ,title={Modified Report on the Algorithmic Language {ALGOL} 60}
+    ,journal={Computer Journal}
+    ,volume=19
+    ,number=4
+    ,year=1976
+    ,pages={364-379}
+    }
+
+@inproceedings{lisp
+    ,author={McCarthy, J.}
+    ,title={Towards a Mathematical Theory of Computation}
+    ,booktitle={Porc. IFIP Congress 6.2}
+    ,publisher={North-Holland, Amsterdam}
+    ,year=1962
+    ,pages={21-28}
+    }
+
+@article{backus:fortran78
+    ,author={Backus, J.}
+    ,title={The history of {FORTRAN} {I}, {II}, and {III}}
+    ,journal={ACM Sigplan Notices}
+    ,volume=13
+    ,number=8
+    ,year=1978
+    ,month=Aug
+    ,pages={165-180}
+    }
+
+@inproceedings{metaml
+    ,author={Taha, Walid and Sheard, Tim}
+    ,title={Mult-Stage Programming with Explicit Annotations}
+    ,booktitle={Proceedings of Symposium on Partial Evaluation and 
+                Semantics Based Program manipulation}
+    ,organization={ACM SIGPLAN}
+    ,year=1997
+    ,pages={203-217}
+    }
+
+@book{pierce-ct
+    ,author={Pierce, Benjamin}
+    ,title={Basic Category Theory for Computer Scientists}
+    ,publisher={MIT Press}
+    ,address={Cambridge, MA}
+    ,year=1991
+    }
+
+@INPROCEEDINGS{Widen&98,
+        AUTHOR = {Tanya Widen and James Hook},
+        TITLE = {Software design automation:  language design in the context of
+domain engineering},
+        BOOKTITLE = {Proc. 10th International Conf. on Software
+Engineering and Knowledge Engineering},
+        YEAR = 1998,
+        PAGES = {308-317},
+        PUBLISHER = {Knowledge Systems Institute},
+        ADDRESS = {Skokie, Illinois}
+}
+
+@Article{R5RS,
+  author =       "Richard Kelsey and William Clinger and
+                  Jonathan {Rees, editors}",
+  title =        "Revised${}^5$ Report on the Algorithmic Language {S}cheme",
+  journal =      "Higher-Order and Symbolic Computation",
+  year =         1998,
+  volume =       11,
+  number =       1,
+  pages =        "7-105",
+  note =         "Also appears in ACM SIGPLAN Notices 33(9), September 1998"
+}
+
+@inproceedings{jcp-ms-ifip
+    ,author={John Peterson and Martin Sulzmann}
+    ,title={Analysis of Architectures using Constraint--Based Types
+            (position paper)}
+    ,booktitle={First Working IFIP Conf. on Software Architecture}
+    ,organization={IFIP}
+    ,month=Feb
+    ,year=1999
+    }
+
+@inproceedings{h-direct
+    ,author={Sigbjorn Finne and Daan Leijen and Erik Meijer and 
+             Simon L. {Peyton Jones}}
+    ,title={H/Direct: A Binary Foreign Language Interface for Haskell}
+    ,booktitle={Proceedings of International Conf. on Functional
+                Programming}
+    ,organization={ACM/IFIP}
+    ,year=1998
+    ,pages={}
+    }
+
+@article{Arya86
+    ,author={Kavi Arya}
+    ,title={A Functional Approach To Animation}
+    ,journal={Computer Graphics Forum}
+    ,volume=5
+    ,number=4
+    ,month=Dec
+    ,year=1986
+    ,pages={297--311}
+    }
+ 
+@techreport{Bartlett91
+    ,author={Joel F. Bartlett}
+    ,title={Don't Fidget With Widgets, Draw!}
+    ,institution={DEC Western Digital Laboratory}
+    ,type={Technical Report}
+    ,number=6
+    ,month=May
+    ,year=1991
+    }
+ 
+@inproceedings{Elliott94
+    ,author={Conal Elliott, Greg Schechter, Ricky Yeung, and Salim Abi-Ezzi}
+    ,title={TBAG: A High Level Framework For Interactive, 
+            Animated 3D Graphics Applications}
+    ,booktitle={Proceedings of SIGGRAPH '94}
+    ,organization={ACM SIGGRAPH}
+    ,month=Jul
+    ,year=1994
+    ,pages={421-434}
+    }
+ 
+@techreport{Elliott96a
+    ,author={Conal Elliott}
+    ,title={A Brief Introduction to ActiveVRML}
+    ,institution={Microsoft Research}
+    ,type={Technical Report}
+    ,number={MSR-TR-96-05}
+    ,year=1996
+    }
+ 
+@inproceedings{Escher88
+    ,author={S.N. Zilles, P. Lucas, T.M. Linden, J.B. Lotspiech, 
+             and A.R. Harbury}
+    ,title={The Escher Document Imaging Model}
+    ,booktitle={Proc. ACM Conf. on 
+                Document Processing Systems}
+    ,month=Dec
+    ,year=1988
+    ,pages={159-168}
+    }
+ 
+@inproceedings{HaggisGraphics95}
+    ,author={Sigbjorn Finne and Simon L. {Peyton Jones}}
+    ,title={Pictures: A Simple Structured Graphics Model}
+    ,booktitle={Proceedings of Glasgow Functional Programming Workshop}
+    ,month=Jul
+    ,year=1995
+    ,pages={}
+    }
+
+@techreport{LucasZilles87
+    ,author={Peter Lucas and Stephen N. Zilles}
+    ,title={Graphics in an Applicative Context}
+    ,institution={IBM Almaden Research Center}
+    ,type={Technical Report}
+    ,number={}
+    ,month=Jul
+    ,year=1987
+    }
+
+@inproceedings{PJGordonFinne96
+    ,author={Simon L. {Peyton Jones}, Andrew D. Gordon and Sigbjorn Finne}
+    ,title={Concurrent Haskell}
+    ,booktitle={Proceedings of ACM Symposium on Principles of 
+                Programming Languages}
+    ,organization={ACM SIGPLAN}
+    ,month=Jan
+    ,year=1996
+    ,pages={}
+    }
+ 
+@inproceedings{Schecht.er94
+    ,author={Greg Schechter, Conal Elliott, Ricky Yeung, and Salim Abi-Ezzi}
+    ,title={Functional 3D Graphics in C++ - 
+            With an Object-Oriented, Multiple Dispatching Implementation}
+    ,booktitle={Proc. 1994 Eurographics Object-Oriented 
+                Graphics Workshop}
+    ,organization={Eurographics, Springer Verlag}
+    ,year=1994
+    ,pages={}
+    }
+
+@article{Scheifler90
+    ,author={R.W. Scheifler and J. Gettys}
+    ,title={The X Window system}
+    ,journal={Software---Practice and Experience}
+    ,volume=20
+    ,number={S2}
+    ,month=Oct
+    ,year=1990
+    ,pages={5-34}
+    }
+@inproceedings{video-dsl
+    ,author={S. Thibault, R. Marlet, C. Consel}
+    ,title={A Domain-Specific Language for Video Device Drivers: 
+            From Design to Implementation}
+    ,booktitle={Proc. first Conf. on 
+                Domain-Specific Languages}
+    ,organization={USENIX}
+    ,year=1997
+    ,month=Oct
+    ,pages={11--26}
+    }
+
+@inproceedings{sw-eng-dsl
+    ,author={D. Spinellis, V. Guruprasad}
+    ,title={Lightweight Languages for Software Engineering Tools}
+    ,booktitle={Proc. first Conf. on 
+                Domain-Specific Languages}
+    ,organization={USENIX}
+    ,year=1997
+    ,month=Oct
+    ,pages={67--76}
+    }
+@article{strategies98
+    ,author={P.W. Trinder, K. Hammond, H.-W. Loidl, and Simon L. {Peyton Jones}}
+    ,title={Algorithm + strategy = parallelism}
+    ,journal={Journal of Functional Programming}
+    ,volume=8
+    ,number=1
+    ,year=98
+    ,pages={23--60}
+    }
+ 
+@inproceedings{hudak-shaumyan-LACL97
+    ,author={Sebastian Shaumyan and Paul Hudak}
+    ,title={Linguistic, Philosophical, and Pragamatic Aspects
+            of Type-Directed Natural Language Parsing}
+    ,booktitle={Proceedings of Logical Aspects of Computational Linguistics}
+    ,organization={Springer-Verlag}
+    ,year=1997
+    ,month=Sep
+    }
+
+@misc{modular-monadic-semantics-98
+    ,author={Sheng Liang and Paul Hudak}
+    ,title={Modular Monadic Semantics}
+    ,note={submitted to {\em Journal of ACM}}
+    ,month=Mar
+    ,year=1998
+    }
+
+@inproceedings{dsel-reuse-98
+    ,author={Paul Hudak}
+    ,title={Modular Domain Specific Languages and Tools}
+    ,booktitle={Proceedings of Fifth International Conf. 
+                on Software Reuse}
+    ,organization={IEEE Computer Society}
+    ,year=1998
+    ,month=Jun
+    ,pages={134-142}
+    }
+
+@TechReport{Tullsen:Hudak:1998,
+  author =       "Mark Tullsen and Paul Hudak",
+  email =        "mark.tullsen@yale.edu and paul.hudak@yale.edu",
+  title =        "An Intermediate Meta-Language for Program Transformation",
+  institution =  "Yale University",
+  month =        jun,
+  year =         "1998",
+  url =          "ftp://haskell.systemsz.cs.yale.edu/pub/tullsen/imlforpt.ps",
+  pages =        "15",
+  number =       "YALEU/DCS/RR-1154",
+  abstract =     "As part of an effort to bridge the gap between the
+                  theory and practice of program transformation, we
+                  have designed a meta-language for transforming
+                  functional programs.  The meta-language is sound in
+                  preserving both value and termination properties of
+                  programs (and is thus superior to the unfold/fold
+                  methodology).  Our key contribution is an equational
+                  specification of Scherlis's expression procedures, in
+                  which we express the essence of expression procedures
+                  as a single transformation rule.  Our approach has
+                  the following advantages over both unfold/fold and
+                  expression procedures: (1) all program derivations
+                  are reversible; (2) many transformations can be done
+                  which unfold/fold and expression procedures cannot
+                  do; and (3) the proof of correctness is far simpler."
+}
+
+@Proceedings{Maler:1997:HRT,
+  editor =       "O. (Oded) Maler",
+  booktitle =    "Hybrid and real-time systems: international workshop,
+                 {HART} '97, Grenoble, France, March 26--28, 1997:
+                 proceedings",
+  title =        "Hybrid and real-time systems: international workshop,
+                 {HART} '97, Grenoble, France, March 26--28, 1997:
+                 proceedings",
+  volume =       "1201",
+  publisher =    "Springer-Verlag",
+  address =      "New York, NY, USA",
+  pages =        "ix + 414",
+  year =         "1997",
+  coden =        "LNCSD9",
+  ISBN =         "3-540-62600-X (Berlin softcover)",
+  ISSN =         "0302-9743",
+  LCCN =         "QA76.38 .H37 1997",
+  bibdate =      "Mon Aug 25 10:50:15 MDT 1997",
+  series =       "Lecture Notes in Computer Science",
+  acknowledgement = ack-nhfb,
+  keywords =     "Hybrid computers -- Congresses.; Real-time data
+                 processing -- Congresses.",
+}
+
+@Proceedings{Alur:1996:HSI,
+  editor =       "Rajeev Alur and T. A. (Thomas A.) Henzinger and
+                 Eduardo D. Sontag",
+  booktitle =    "Hybrid systems {III}: verification and control",
+  title =        "Hybrid systems {III}: verification and control",
+  volume =       "1066",
+  publisher =    "Springer-Verlag",
+  address =      "New York, NY, USA",
+  pages =        "ix + 618",
+  year =         "1996",
+  coden =        "LNCSD9",
+  ISBN =         "3-540-61155-X",
+  ISSN =         "0302-9743",
+  LCCN =         "QA267.A1 L43 no.1066",
+  bibdate =      "Sat Dec 21 16:06:37 MST 1996",
+  note =         "Proc. DIMACS/SYCON Workshop on
+                 Verification and Control of Hybrid Systems, organized
+                 October 22--25, 1995 at Rutgers University, New
+                 Brunswick, New Jersey",
+  series =       "Lecture Notes in Computer Science",
+  acknowledgement = ack-nhfb,
+  alttitle =     "Hybrid systems 3 Hybrid systems three",
+  annote =       "``Proc. DIMACS/SYCON Workshop on
+                 Verification and Control of Hybrid Systems, organized
+                 October 22--25, 1995 at Rutgers University, New
+                 Brunswick, New Jersey''",
+  keywords =     "Hybrid computers -- Congresses; Digital control
+                 systems -- Congresses.",
+}
+@Proceedings{Best:1993:CIC,
+  editor =       "Eike Best",
+  booktitle =    "{CONCUR} '93: 4th International Conf. on
+                 Concurrency Theory, Hildesheim, Germany, August 993:
+                 proceedings",
+  title =        "{CONCUR} '93: 4th International Conf. on
+                 Concurrency Theory, Hildesheim, Germany, August 993:
+                 proceedings",
+  volume =       "715",
+  publisher =    "Springer-Verlag",
+  address =      "New York, NY, USA",
+  pages =        "ix + 540",
+  year =         "1993",
+  coden =        "LNCSD9",
+  ISBN =         "0-387-57208-2 (New York), 3-540-57208-2 (Berlin)",
+  ISSN =         "0302-9743",
+  LCCN =         "QA76.58 .I53 1993",
+  bibdate =      "Fri Apr 12 07:38:03 1996",
+  series =       "Lecture Notes in Computer Science",
+  acknowledgement = ack-nhfb,
+  keywords =     "parallel processing (electronic computers) ---
+                 congresses",
+  xxvolume =     "4004199954",
+}
+
+@Proceedings{Grossman:1993:HS,
+  editor =       "Robert L. Grossman",
+  booktitle =    "Hybrid systems",
+  title =        "Hybrid systems",
+  volume =       "736",
+  publisher =    "Springer-Verlag",
+  address =      "New York, NY, USA",
+  pages =        "viii + 474",
+  year =         "1993",
+  coden =        "LNCSD9",
+  ISBN =         "0-387-57318-6 (New York), 3-540-57318-6 (Berlin)",
+  ISSN =         "0302-9743",
+  LCCN =         "QA76.5 .H93 1993",
+  bibdate =      "Fri Apr 12 07:14:59 1996",
+  note =         "Papers presented at a workshop held Oct. 19--21, 1992
+                 at the Technical University, Lyngby, Denmark.",
+  price =        "DM86.00",
+  series =       "Lecture Notes in Computer Science",
+  acknowledgement = ack-nhfb,
+  keywords =     "hybrid computers --- congresses",
+  xxvolume =     "4004351807",
+}
+
+@article{devanbu
+    ,author={Devanbu, P. and Rosenblum, D. and Wolf, A.}
+    ,title={Generating Testing and Analysis tools}
+    ,journal={ACM Transactions on Software Engineering and Methodology}
+    ,year=1996
+    }
+
+@inproceedings{haskell-com
+    ,author={Simon L. {Peyton Jones} and Erik Meijer and Dan Leijen}
+    ,title={Scripting {COM} Components in Haskell}
+    ,booktitle={Proceedings of 5th International Conf. on Software Reuse}
+    ,organization={IEEE/ACM}
+    ,year=1998
+    ,pages={224--233}
+    }
+
+@inproceedings{jakarta
+    ,author={Don Batory and Bernie Lofaso and Yannis Smaragdakis}
+    ,title={{JTS}: A Tool Suite for Building {GenVoca} Generators}
+    ,booktitle={Proceedings of 5th International Conf. on Software Reuse}
+    ,organization={IEEE/ACM}
+    ,year=1998
+    ,pages={}
+    }
+ 
+@inproceedings{fran-dsl
+    ,author={Conal Elliott}
+    ,title={Modeling Interactive {3D} and Multimedia Animation 
+            with an Embedded Language}
+    ,booktitle={Proc. first Conf. on 
+                Domain-Specific Languages}
+    ,organization={USENIX}
+    ,year=1997
+    ,month=Oct
+    ,pages={285-296}
+    }
+
+@book{design-patterns
+    ,author={Gamma, E. and Helm, R. and Johnson, R. and Vlissides, J.}
+    ,title={Design Pattens: Elements of Reusable Object-Oriented Software}
+    ,publisher={Addison-Wesley}
+    ,year=1995
+    }
+
+@article{little-languages
+    ,author={Jon Bentley}
+    ,title={Little Languages}
+    ,journal={CACM}
+    ,volume=29
+    ,number=8
+    ,year=1986
+    ,pages={711-721}
+    }
+ 
+@misc{tullsen-hudak-97
+    ,author={Mark Tullsen and Paul Hudak}
+    ,title={An Intermediate Meta-Language for Program Transformation}
+    ,note={submitted to 1998 ACM Symposium on Programming Language
+           Design and Implementation}
+    ,month=Nov
+    ,year=1997
+    }
+ 
+@TechReport{dynamic-code
+  ,author={John Peterson and Paul Hudak and Gary Shu Ling}
+  ,title={Principled Dynamic Code Improvement}
+  ,institution={Yale University, Department of Computer Science}
+  ,month=Jul
+  ,year=1997
+  ,type={Research Report}
+  ,number={YALEU/DCS/RR-1135}
+}
+
+@TechReport{Hugs
+  ,author={Mark P. Jones and John C. Peterson}
+  ,title={Hugs 1.4 {U}ser {M}anual}
+  ,institution={Yale University, Department of Computer Science}
+  ,year=1997
+  ,type={Research Report}
+  ,number={YALEU/DCS/RR-1123}
+}
+
+@misc{appel-hot-sliding
+    ,author={Appel, Andrew W.}
+    ,title={Hot Sliding in Standard ML}
+    ,month=Dec
+    ,year=1994
+    ,note={unpublished manuscript}
+    }
+ 
+@TechReport{sulzmann-odersky-wehr:tr-type-inference,
+  author =       "Martin Sulzmann and Martin Odersky and Martin Wehr",
+  title =        "Type {I}nference with {C}onstrained {T}ypes",
+  institution =  "Yale University, Department of Computer Science",
+  year =         1997,
+  folder =       "13-23",
+  type =         "Research Report",
+  number =       "YALEU/DCS/RR-1129",
+  month =        "April"
+}
+
+@TechReport{sulzmann:tr-records,
+  author =       "Martin Sulzmann",
+  title =        "Designing {R}ecord {S}ystems",
+  institution =  "Yale University, Department of Computer Science",
+  year =         1997,
+  folder =       "13-23",
+  type =         "Research Report",
+  number =       "YALEU/DCS/RR-1128",
+  month =        "April",
+  abstract = "We explore the design space for type systems with
+  polymorphic records.  We design record systems for extension,
+  concatenation and removal of fields.  Furthermore, we design a record
+  system where field labels become first class values.  That means, we
+  can now quantify over field lables and pass them around as arguments.
+  All designed record systems enjoy type inference with principal
+  types. Especially, we can combine any features into a new record
+  system retaining type inference with principal types.
+
+  We also point out some problems which are present in previous record
+  systems.  Our designed record systems can be seen as the proper
+  logical formulation of previous approaches with even more expressive
+  power.
+
+   We base our design on the HM(X) framework. HM(X) is a general
+  framework for Hindley/Milner type systems that are parameterized in
+  the constraint domain X. HM(X) enables us to design record systems in
+  a systematic way retaining type inference with principal types.  That
+  means, designing record systems becomes construction of constraint
+  systems which model record systems."  }
+
+@TechReport{sulzmann:tr-type-inference,
+  author =       "Martin Sulzmann",
+  title =        "Proofs of {S}oundness and {C}ompleteness of {T}ype
+  {I}nference for {HM(X)}",
+  institution =  "Yale University, Department of Computer Science",
+  year =         1997,
+  folder =       "13-23",
+  type =         "Research Report",
+  number =       "YALEU/DCS/RR-1102",
+  month =        "February"
+}
+
+@InProceedings{type-inf-constrained-types,
+  author =      "Martin Sulzmann and Martin Odersky and Martin Wehr",
+  title =       "Type Inference with Constrained Types",
+  booktitle =   "FOOL4: 4th. International Workshop on Foundations of
+Object-oriented programming Languages",
+  year =        "1997",
+  month =       "January"
+}
+
+@article{dsls-on-line
+    ,author={Paul Hudak}
+    ,title={Building Domain Specific Embedded Languages}
+    ,journal={ACM Computing Surveys}
+    ,volume={28A}
+    ,month=Dec
+    ,year=1996
+    ,pages={(electronic)}
+    }
+
+@inproceedings{Fran
+    ,author={Conal Elliott and Paul Hudak}
+    ,title={Functional Reactive Animation}
+    ,booktitle={International Conf. on Functional Programming}
+    ,month=Jun
+    ,year=1997
+    ,pages={163--173}
+    }
+
+@inproceedings{elliott98
+    ,author={Conal Elliott}
+    ,title={Functional Implementations of Continuous Modeled Animation}
+    ,booktitle={Proceedings of PLILP/ALP '98}
+    ,organization={Springer-Verlag}
+    ,year=1998
+    ,pages={}
+    }
+
+@TechReport{Haskell1.4,
+  author =       {John Peterson et. al},
+  title =        {Haskell 1.4: A Non-strict, Purely Functional Language},
+  institution =  {Department of Computer Science, Yale University},
+  year =         {1997},
+  number =       {YALEU/DCS/RR-1106},
+  month =        {Mar},
+  note =         {World Wide Web version at
+                  \fr{http://haskell.cs.yale.edu/haskell-report}}
+}
+
+@TechReport{Haskell1.3,
+  author =       {John Peterson et. al},
+  title =        {Haskell 1.3: A Non-strict, Purely Functional Language},
+  institution =  {Department of Computer Science, Yale University},
+  year =         {1996},
+  key =          {Has96},
+  number =       {YALEU/DCS/RR-1106},
+  month =        {May},
+  note =         {World Wide Web version at
+                  {\tt http://haskell.cs.yale.edu/haskell-report}}
+}
+
+@inproceedings{haskore-tutorial
+    ,author={Paul Hudak}
+    ,title={Haskore Music Tutorial}
+    ,booktitle={Second International School on Advanced Functional Programming}
+    ,publisher={Springer Verlag, LNCS 1129}
+    ,year=1996
+    ,month=Aug
+    ,pages={38-68}
+    }
+ 
+@book{ML-definition
+    ,author={Milner, R. and Tofte, M. and Harper, R.}
+    ,title={The Definition of Standard ML}
+    ,publisher={The MIT Press}
+    ,address={Cambridge, MA}
+    ,year=1990
+    }
+ 
+@phdthesis{chenphd
+    ,author={Kung Chen}
+    ,title={A Parametric Extension of Haskell's Type Classes}
+    ,school={Yale University, Department of Computer Science}
+    ,month=May
+    ,year=1994
+    }
+
+@phdthesis{miraniphd
+    ,author={Rajiv Mirani}
+    ,title={High-Level Abstractions for Parallel Functional Programming}
+    ,school={Yale University, Department of Computer Science}
+    ,month=Jul
+    ,year=1996
+    }
+
+@phdthesis{rabinphd
+    ,author={Daniel Rabin}
+    ,title={Calculi for Functional Programming with Assignment}
+    ,school={Yale University, Department of Computer Science}
+    ,month=May
+    ,year=1996
+    }
+
+@inproceedings{jones-hudak-NLP
+    ,author={Jones, M.P. and Hudak, P. and Shaumyan, S.}
+    ,title={Using Types to Parse Natural Language}
+    ,booktitle={Proceedings of Glasgow Functional Programming Workshop}
+    ,organization={IFIP}
+    ,publisher={Springer Verlag}
+    ,year=1995
+    ,pages={}
+    }
+
+@InProceedings{liang-hudak-jones:monad-transformers,
+  author =      "Sheng Liang and Paul Hudak and Mark Jones",
+  title =       "Monad Transformers and Modular Interpreters",
+  booktitle =   "22nd {ACM} Symposium on Principles of
+                 Programming Languages ({POPL '95}), {San Francisco,
+                 California}",
+  year =        "1995",
+  publisher =   "ACM Press",
+  address =     "New York",
+  month =       "January",
+  pages={333-343}
+}
+
+@phdthesis{espinosa:thesis
+    ,author={David Espinosa}
+    ,title={Semantic Lego}
+    ,school={Columbia University}
+    ,year=1995
+    }
+
+@Unpublished{espinosa:modular,
+  author =      "David Espinosa",
+  title =       "Modular Denotational Semantics",
+  note =        "Unpublished manuscript",
+  year =        "1993",
+  month =       "December",
+}
+
+@InProceedings{liang-hudak:modular-semantics,
+  author =      "Sheng Liang and Paul Hudak",
+  title =       "Modular Denotational Semantics for Compiler
+                 Construction",
+  booktitle =   "European Symposium on Programming",
+  year =        "1996",
+  month =       "April"
+}
+
+@PhDThesis{liang:thesis,
+  author =      "Sheng Liang",
+  title =       "Modular Monadic Semantics and Compilation",
+  school =      "Yale University, Department of Computer Science",
+  year =        "1998",
+  month =       "May"
+}
+
+@InProceedings{steele:building,
+  author =      "Guy L. {Steele Jr.}",
+  title =       "Building Interpreters by Composing Monads",
+  pages =       "472--492",
+  booktitle =   "Conf. Record of {POPL '94}: 21st {ACM
+                 SIGPLAN-SIGACT} Symposium on Principles of
+                 Programming Languages, {Portland, Oregon}",
+  year =        "1994",
+  publisher =   "ACM Press",
+  address =     "New York",
+  month =       "January"
+}
+
+@article{ernoult-mycroft-95
+    ,author={Ernoult, C. and Mycroft, M.}
+    ,title={Untyped strictness analysis}
+    ,journal={Journal of Functional Programming}
+    ,volume=5
+    ,number=1
+    ,year=1995
+    ,pages={37-49}
+    }
+
+@inproceedings{Bur95,
+  author = {C. T. P. Burton},
+  title = {Conceptual structures for recursion},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {179-194}}
+
+@inproceedings{Cla95,
+  author = {C. Clack and C. Myers},
+  title = {The dys-functional student},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {289-309}}
+
+@inproceedings{Dav95,
+  author = {A. Davison},
+  title = {Teaching {C} after {Miranda}},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {35-50}}
+
+@inproceedings{Fok95,
+  author = {J. Fokker},
+  title = {Explaining algebraic theory with functional programs},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {139-158}}
+
+@inproceedings{Har95,
+  author = {P. H. Hartel and B. van Es and D. Tromp},
+  title = {Basic proof skills of computer science students},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {269-288}}
+
+@inproceedings{Hil95,
+  author = {E. Hilsdale and J. M. Ashley and R. K. Dybvig and D. P. Friedman},
+  title = {Compiler construction using Scheme},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {251-268}}
+
+@inproceedings{Jac95,
+  author = {J.-P. Jacquot and J. Guyard},
+  title = {Requirements for an ideal first language},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {51-64}}
+
+@inproceedings{Jar95,
+  author = {S. Jarvis and S. Poria and R. Morgan},
+  title = {Understanding {LOLITA}: Experiences in teaching large scale functional programming},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {103-120}}
+
+@inproceedings{Kar95,
+  author = {J. Karczmarczuk},
+  title = {Functional programming and mathematical objects},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {121-138}}
+
+@inproceedings{Ker95,
+  author = {E. T. Keravnou},
+  title = {Introducing computer science undergraduates to principles of programming through a functiona
+l language},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {15-34}}
+
+@inproceedings{Klu95,
+  author = {W. E. Kluge and C. Rathsack and S.-B. Scholz},
+  title = {Using $\pi$-{\sc red} as a teaching tool for functional programming and program execution},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {231-250}}
+
+@inproceedings{Koo95,
+  author = {P. Koopman and V. Zweije},
+  title = {Functional programming in a basic database course},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {215-230}}
+
+@inproceedings{Les95,
+  author = {D. Lester and S. Mintchev},
+  title = {Inducing students to induct},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {159-178}}
+
+@inproceedings{Nun95,
+  author = {M. N\'u\~nez and P. Palao and R. Pe\~na},
+  title = {A second year course on data structures based on functional programming},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {65-84}}
+
+@inproceedings{ODo95,
+  author = {J. O'Donnell},
+  title = {From transistors to computer architecture: Teaching functional circuit specification in Hydr
+a},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {195-214}}
+
+@inproceedings{Tho95,
+  author = {S. Thompson and S. Hill},
+  title = {Functional programming through the curriculum},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {85-102}}
+
+@inproceedings{Tur95,
+  author = {D. A. Turner},
+  title = {Elementary strong functional programming},
+  booktitle = {Functional programming languages in education ({FPLE}), {LNCS} 1022},
+  editor = {P. H. Hartel and M. J. Plasmeijer},
+  publisher = {Springer-Verlag, Heidelberg},
+  address = {Nijmegen, The Netherlands},
+  month = {Dec},
+  year = {1995},
+  pages = {1-13}}
+
+@book{revesz
+    ,author={Revesz, G.}
+    ,title={Lambda Calculus, Combinators, and Functional Programming}
+    ,publisher={Cambridge University Press}
+    ,address={Cambridge}
+    ,year=1988
+    }
+
+@inproceedings{hudakberger95
+    ,author={Hudak, P. and Berger, J.}
+    ,title={A Model of Performance, Interaction, and Improvisation}
+    ,booktitle={Proceedings of International Computer Music Conf.}
+    ,organization={International Computer Music Association}
+    ,year=1995
+    }
+ 
+@article{arya94
+    ,author={Arya, K.}
+    ,title={A Functional Animation Starter-Kit}
+    ,journal={Journal of Functional Programming}
+    ,volume=4
+    ,number=1
+    ,year=1994
+    ,pages={1-18}
+    }
+ 
+@incollection{musickit
+    ,author={Jaffe, D. and Boynton, L.}
+    ,title={An Overview of the Sound and Music Kits for the
+            {NeXT} Computer}
+    ,booktitle={The Well-Tempered Object}
+    ,publisher={MIT Press}
+    ,year=1991
+    ,editor={Pope, S.T.}
+    ,pages={107-118}
+    }
+ 
+@incollection{balaban92
+    ,author={Balaban, M.}
+    ,title={Music Structures: Interleaving the Temporal and Hierarchical
+            Aspects of Music}
+    ,booktitle={Understanding Music With AI}
+    ,publisher={AAAI Press}
+    ,year=1992
+    ,editor={Balaban, M. and Ebcioglu, K. and Laske, O.}
+    ,pages={110-139}
+    }
+ 
+@inproceedings{grame94
+    ,author={Orlarey, O. and Fober, D. and Letz, S. and Bilton, M.}
+    ,title={Lambda Calculus and Music Calculi}
+    ,booktitle={Proceedings of International Computer Music Conf.}
+    ,organization={International Computer Music Association}
+    ,year=1994
+    }
+ 
+@article{berger-91
+    ,author={Berger, J.}
+    ,title={A Theory of Musical Ambiguity}
+    ,journal={Journal of Computers in Music Research}
+    ,volume="II"
+    ,year=1991
+    }
+ 
+@techreport{huberman-hogg-94
+    ,author={Huberman, B. and Hogg, T.}
+    ,title={Communities in Practice: Performance and Evolution}
+    ,institution={Dynamics of Computation Group, Xerox PARC}
+    ,year=1994
+    }
+
+@book{rapoport
+    ,author={Rapoport, A.}
+    ,title={N-Person Game Theory}
+    ,publisher={University of Michigan Press}
+    ,address={Ann Arbor}
+    ,year=1970
+    }
+ 
+@book{luce-raiffa
+    ,author={Luce, D. and Raiffa, H.}
+    ,title={Games and Decisions}
+    ,publisher={John Wiley and Sons}
+    ,address={New York}
+    ,year=1957
+    }
+ 
+@incollection{ames-domino-92
+    ,author={Ames, C. and Domino, M.}
+    ,title={Cybernetic Composer: An Overview}
+    ,booktitle={Understanding Music with AI: Perspectives on Music Cognition}
+    ,publisher={AAAI Press/MIT Press}
+    ,year=1992
+    ,editor={Balaban, M. and Ebcioglu, K. and Laske, O.}
+    ,pages={186-205}
+    }
+ 
+@incollection{baggi-92
+    ,author={Baggi, D.L.}
+    ,title={NeurSwing: An Intelligent Workbench for the Investigation
+            of Swing in Jazz}
+    ,booktitle={Readings in Computer-Generated Music}
+    ,publisher={IEEE Computer Society Press}
+    ,year=1992
+    ,editor={Baggi, D.L.}
+    ,pages={79-94}
+    }
+ 
+@incollection{johnson-laird-91
+    ,author={Johnson-Laird, P.N.}
+    ,title={Jazz Improvisation: A Theory at the Computational Level}
+    ,booktitle={Representing Musical Structure}
+    ,publisher={Academic Press}
+    ,year=1991
+    ,editor={Howell, P. and West, R. and Cross, I.}
+    ,pages={291-325}
+    }
+ 
+@inproceedings{fpca95:parafun
+    ,author={Mirani, Rajiv and Hudak, Paul}
+    ,title={First Class Schedules and Virtual Maps}
+    ,booktitle = "Proceedings of Conf. on Functional Programming
+                  Languages and Computer Architecture"
+    ,organization={ACM/IFIP}
+    ,month=Jun
+    ,year=1995
+    ,pages={78--85}
+    }
+
+@InProceedings{popl95:monadint,
+  author =      "Sheng Liang and Paul Hudak and Mark Jones",
+  title =       "Monad Transformers and Modular Interpreters",
+  booktitle ={Proceedings of 22nd ACM Symposium on Principles of
+              Programming Languages},
+  year =        "1995",
+  publisher =   "ACM Press",
+  address =     "New York",
+  month =       "January",
+  pages={333-343}
+}
+
+@TechReport{Haskell-vs-ada,
+  author = 	"Hudak, P. and Jones, M.P.",
+  title = 	"Haskell vs. Ada vs. C++ vs. Awk vs. ...
+                 An Experiment in Software Prototyping Productivity",
+  institution = "Department of Computer Science, Yale University",
+  year = 	"1994",
+  type = 	"Research Report",
+  number = 	"YALEU/DCS/RR-1049",
+  address = 	"New Haven, CT",
+  month = 	"Oct",
+  note  =       "Available from
+                {\tt http://haskell.org/practice.html}"
+  }
+
+@article{hutton
+    ,author={Hutton, G.}
+    ,title={Combinator Parsing}
+    ,journal={Journal of Functional Programming}
+    ,year=1993
+    }
+
+@article{haskore
+    ,author={Hudak, P. and Makucevich, T. and 
+             Gadde, S. and Whong, B.}
+    ,title={Haskore Music Notation -- An Algebra of Music}
+    ,month=May
+    ,year=1996
+    ,volume=6
+    ,number=3
+    ,pages={465--483}
+    ,journal={Journal of Functional Programming}
+    }
+ 
+@misc{haskore-old
+    ,author={Hudak, P. and Makucevich, T. and 
+             Gadde, S. and Whong, B.}
+    ,title={Haskore Music Notation -- An Algebra of Music}
+    ,month=Sep
+    ,year=1994
+    ,note={To appear in the Journal of Functional Programming; 
+           preliminary version available via\\
+{\tt ftp://nebula.systemsz.cs.yale.edu/pub/yale-fp/papers/haskore/hmn-lhs.ps}}
+    }
+ 
+@article{milner-turing
+    ,author={Milner, R.}
+    ,title={Elements of Interaction}
+    ,journal={CACM}
+    ,volume=36
+    ,number=1
+    ,year=1993
+    ,month=Jan
+    ,pages={78--89}
+    }
+
+@incollection{salishan-book-chapter
+        ,author="Hudak, P. and Anderson, S."
+        ,title="{H}askell Solutions to the Language Session Problems
+                at the 1988 {S}alishan {H}igh-{S}peed {C}omputing {C}onference"
+        ,booktitle={A Comparative Study of Parallel Programming Languages:
+                    The Salishan Problems}
+        ,publisher={North-Holland, Amsterdam}
+        ,editor={Feo, J.T.}
+        ,year=1992
+        }
+
+@article{canon
+    ,author={Dannenberg, R.B.}
+    ,title={The {C}anon Score Language}
+    ,journal={Computer Music Journal}
+    ,volume=13
+    ,number=1
+    ,year=1989
+    ,pages={47-56}
+    }
+ 
+@techreport{csound
+    ,author={Vercoe, B.}
+    ,title={Csound: A Manual for the Audio Processing System
+            and Supporting Programs}
+    ,institution={MIT Media Lab}
+    ,year=1986
+    }
+ 
+@article{pla
+    ,author={Schottstaedt, B.}
+    ,title={PLA: A Composer's Idea of a Language}
+    ,journal={Computer Music Journal}
+    ,volume=7
+    ,number=1
+    ,year=1983
+    ,pages={11-20}
+    }
+ 
+@inproceedings{moxie
+    ,author={Collinge, D.}
+    ,title={Moxie: A Languge for Computer Music Performance}
+    ,booktitle={Proc. International Computer Music Conf.}
+    ,organization={Computer Music Association}
+    ,year=1984
+    ,pages={217-220}
+    }
+ 
+@incollection{formula
+    ,author={Anderson, D.P. and Kuivila, R.}
+    ,title={Formula: A Programming Language for Expressive Computer Music}
+    ,booktitle={Computer Generated Music}
+    ,publisher={IEEE Computer Society Press}
+    ,year=1992
+    ,editor={Denis Baggi}
+    }
+
+@incollection{fugue
+    ,author={Dannenberg, R.B. and Fraley, C.L. and Velikonja, P.}
+    ,title={A Functional Language for Sound Synthesis with
+            Behavioral Abstraction and Lazy Evaluation}
+    ,booktitle={Computer Generated Music}
+    ,publisher={IEEE Computer Society Press}
+    ,year=1992
+    ,editor={Denis Baggi}
+    }
+
+@incollection{scoresynth
+    ,author={Haus, G. and Sametti, A.}
+    ,title={ScoreSynth: A System for the Synthesis of Music Scores
+            Based on Petri Nets and a Music Algebra}
+    ,booktitle={Computer Generated Music}
+    ,publisher={IEEE Computer Society Press}
+    ,year=1992
+    ,editor={Denis Baggi}
+    }
+
+@misc{midi
+    ,key={IMA}
+    ,title={MIDI 1.0 Detailed Specification: Document Version 4.1.1}
+    ,publisher={International MIDI Association}
+    ,address={Los Angeles, CA}
+    ,month=Feb
+    ,year=1990
+    }
+
+@inproceedings{formes
+    ,author={Cointe, P. and Rodet, X.}
+    ,title={Formes: an Object and Time Oriented System
+            for Music Composition and Synthesis}
+    ,booktitle={Proc. 1984 ACM Symposium on Lisp and 
+                Functional Programmming}
+    ,organization={ACM}
+    ,year=1984
+    ,pages={85-95}
+    }
+
+@misc{common-music
+    ,key={CM}
+    ,title={Common Music}
+    ,note={Unpublished release notes.}
+    }
+ 
+@book{forte
+    ,author={Forte, A.}
+    ,title={The Structure of Atonal Music}
+    ,publisher={Yale University Press}
+    ,address={New Haven, CT}
+    ,year=1973
+    }
+
+@book{hindemith
+    ,author={Hindemith, P.}
+    ,title={Elementary Training for Musicians}
+    ,publisher={Associated Music Publishers}
+    ,address={New York}
+    ,edition=2
+    ,year=1949
+    }
+ 
+@inproceedings{rapide
+    ,author={Luckham, D. and Vera, J. and Bryan, D. and Augustin, L. and
+             Belz, F.}
+    ,title={Partial Orderings of Event Sets and Their Application to
+             Prototyping Concurrent Timed Systems}
+    ,booktitle={Proceedings of Software Technology Conf.}
+    ,organization={DARPA}
+    ,year=1992
+    ,pages={443-457}
+    }
+
+@inproceedings{griffin
+    ,author={Harrison, M.C. and Hsieh, C-H. and Laufer, C. and Henglein, F.}
+    ,title={Polymorphism and Type Abstraction in the {G}riffin Prototyping
+            Language}
+    ,booktitle={Proceedings of Software Technology Conf.}
+    ,organization={DARPA}
+    ,year=1992
+    ,pages={458-470}
+    }
+
+@inproceedings{proteus
+    ,author={Mills, P. and Reif, J.H. and Nyland, L.S. and Prins, J.F.}
+    ,title={Prototyping High-Performance Parallel Computing Applications
+            in {P}roteus}
+    ,booktitle={Proceedings of Software Technology Conf.}
+    ,organization={DARPA}
+    ,year=1992
+    ,pages={433-442}
+    }
+
+@techreport{NSWC-spec
+    ,author={Caruso, J.}
+    ,title={Prototyping Demonstration Problem for the Prototech
+            HiPer-D Joint Prototyping Demonstration Project}
+    ,institution={Naval Surface Warfare Center}
+    ,type={CCB Report}
+    ,number={0.2}
+    ,month=Aug
+    ,year=1993
+    ,annote={Last modified October 27, 1993; further changes specified by
+           J.~Caruso are described in "Addendum to Prototyping Demonstration
+           Problem for the Prototech HiPer-D Joint Prototyping Demonstration
+           Project," November 9, 1993.}
+    }
+
+@article{kishonhudak95
+    ,author =      "Kishon, A. and Hudak, P."
+    ,title =       "Semantics-Directed Program Execution Monitoring"
+    ,journal=      "Journal of Functional Programming"
+    ,volume=5
+    ,number=4
+    ,month=Oct
+    ,year=1995
+    }
+
+@book{salishan-book
+    ,author={Feo, J.T.}
+    ,title={A Comparative Study of Parallel Programming Languages:
+            The Salishan Problems}
+    ,publisher={North-Holland}
+    ,address={Amsterdam}
+    ,year=1992
+    }
+ 
+@techreport{runciman-rt
+    ,author={Wallace, M. and Runciman, C.}
+    ,title={Extending a Functional Programming System for
+            Embedded Real-Time Applications}
+    ,institution={Department of Computer Science, University of York}
+    ,type={Technical Report}
+    ,month=Apr
+    ,year=1994
+    }
+
+@TechReport{parmonads,
+  author = 	"Jones, M.P. and Hudak, P.",
+  title = 	"Implicit and Explicit Parallel Programming in Haskell",
+  institution = "Department of Computer Science, Yale University",
+  year = 	"1993",
+  type = 	"Research Report",
+  number = 	"YALEU/DCS/RR-982",
+  address = 	"New Haven, Connecticut",
+  month = 	"Nov"
+  }
+
+@misc{rt-erlang
+    ,author={Persson, M. and Odling, K. and Eriksson, D.}
+    ,title={A Switching Software Architecture Prototype 
+            Using Real Time Declarative Language}
+    ,institution={Ericsson Business Communication AB}
+    ,year=1993
+    }
+ 
+@misc{erlang
+    ,author={Armstrong, J.L and Virding, S.R.}
+    ,title={Erlang -- An Experimental Telephony Programming Language}
+    ,institution={Computer Science Laboratory, Ellemtel Etvecklings AB}
+    ,month=Jun
+    ,year=1990
+    }
+
+@book{ADA:83,
+  key = "Ada",
+  title = "Reference Manual for the ADA Programming Language",
+  publisher =  "U.S. Department of Defense",
+  year =  "1983"
+}
+
+@book{OCCAM:83,
+  key = "Occam",
+  title = "OCCAM Programming Manual",
+  publisher =  "INMOS Limited",
+  year =  "1983"
+}
+
+@Article{CSP:78,
+  author = "C.A.R. Hoare",
+  title = "Communicating Sequential Processes",
+  journal = "Comm. of the ACM",
+  volume = "21",
+  number =  "8", 
+  month = "August",  
+  year = "1978", 
+  pages = "666-677"
+}
+
+@InProceedings{esterel,
+  author = "Gerard  Berry and L. Cosserat",
+  title = "The ESTEREL Synchronous Programming Language
+           and its Mathematical Semantics", 
+  booktitle = "Seminar on Concurrency",
+  editor =  "S.D. Brookes, A.W. Roscoe and G. Winskel, editors",
+  volume = "197",
+  pages = "389-448",
+  series = "Lect. Notes in Computer Science",
+  publisher =  "Springer Verlag", 
+  year = "1985"
+}
+
+@InProceedings{signal,
+	author = "Thierry Gautier and Paul Le Guernic and Loic Besnard", 
+	title = "SIGNAL: A Declarative Language For Synchronous Programming
+                 of Real-Time Systems",
+	booktitle = "Functional Programming Languages and Computer 
+                     Architecture", 
+	editor = "Gilles Kahn",
+	volume = "274",
+	pages = "257-277",
+	series = "Lect Notes in Computer Science, 
+                  edited by G. Goos and J. Hartmanis",
+	publisher = "Springer-Verlag",
+	year = "1987"
+}
+
+@InProceedings{ada9x-rt,
+	author = "Mike Kamrad and Jim Hassett",
+	title = "Applying Ada9X to Two Real Time Applications:  A Case Study",
+	booktitle = "Ada - Europe '93",
+	editor = "Michel Gauthier",
+	volume = "688",
+	pages = "79-94",
+	series = "Lecture  Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "June",
+	year = "1993"
+}
+
+@InProceedings{ISL,
+	author = "Asis Goswami and Michael Bell and Mathai Joseph",
+	title = "ISL: An Interval Logic for the Specification
+                 of Real-time Programs",
+	booktitle ="Formal Techniques in Real-Time and Fault-Tolerant Systems",
+	editor = "J. Vytopil",
+	volume = "571",
+	pages = "1-21",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "January",
+	year = "1992"
+}
+
+@InProceedings{rlucid,
+	author = "John A. Plaice",
+	title = "RLucid, a general real-time dataflow language ",
+	booktitle ="Formal Techniques in Real-Time and Fault-Tolerant Systems",
+	editor = "J. Vytopil",
+	volume = "571",
+	pages = "363-374",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "January",
+	year = "1992"
+}
+
+@InProceedings{Z-RTL,
+	author = "C. J. Fidge",
+	title = "Specification and Verification of Real-Time Behaviour
+                 Using Z and RTL",
+	booktitle ="Formal Techniques in Real-Time and Fault-Tolerant Systems",
+	editor = "J. Vytopil",
+	volume = "571",
+	pages = "393-410",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "January",
+	year = "1992"
+}
+
+@InProceedings{TAM,
+	author = "D.J. Scholefield and H.S.M. Zedan",
+	title = "TAM: A Formal Framework for the Development of 
+                 Distributed Real-Time Systems",
+	booktitle ="Formal Techniques in Real-Time and Fault-Tolerant Systems",
+	volume = "571",
+	editor = "J. Vytopil",
+	pages = "411-428",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "January",
+	year = "1992"
+}
+
+
+@InProceedings{asynch-esterel,
+	author = "Martin Richard and Olivier Roux",
+	title = "An Attempt to Confront Asynchronous Reality to
+                 Synchronous Modelization in the ESTEREL Language",
+	booktitle ="Formal Techniques in Real-Time and Fault-Tolerant Systems",
+	volume = "571",
+	editor = "J. Vytopil",
+	pages = "429-450",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "January",
+	year = "1992"
+}
+
+@InProceedings{rt-csp,
+	author = "Frank de Boer and Jozef Hooman",
+	title = "The Real-Time Behaviour of Asynchronously
+                 Communicating Processes",
+	booktitle ="Formal Techniques in Real-Time and Fault-Tolerant Systems",
+	editor = "J. Vytopil",
+	volume = "571",
+	pages = "451-472",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "January",
+	year = "1992"
+}
+
+@InProceedings{baeten-bergstra,
+	author = "J.C.M. Baeten and J.A. Bergstra",
+	title = "Asynchronous Communication in Real Space Process Algebra",
+	booktitle ="Formal Techniques in Real-Time and Fault-Tolerant Systems",
+	editor = "J. Vytopil",
+	volume = "571",
+	pages = "473-492",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "January",
+	year = "1992"
+}
+
+@InProceedings{RAISE,
+	author = "Chris George",
+	title = "The RAISE Specification Language A Tutorial",
+	booktitle = "VDM '91 Formal Software Development Methods",
+	editor = "S. Prehn and W.J. Toetenel",
+	volume = "552",
+	pages = "238-319",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "October",
+	year = "1991"
+}
+
+@InProceedings{good-young,
+	author = "Donald I. Good and William D. Young",
+	title = "Mathematical Methods for Digital Systems Development",
+	booktitle = "VDM '91 Formal Software Development Methods",
+	editor = "S. Prehn and W.J. Toetenel",
+	volume = "552",
+	pages = "406-430",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "October",
+	year = "1991"
+}
+
+@InProceedings{timed-proc-alg,
+	author = "Xavier Nicollin and Joseph Sifakis",
+	title = "An Overview and Synthesis on Timed Process Algebras",
+	Booktitle = "Computer Aided Verification",
+	editor = "K.G. Larsen and A. Skou",
+	volume = "575",
+	pages = "376-398",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "July",
+	year = "1991"
+}
+
+
+@InProceedings{action-tranducers,
+	author = "Frits Vaandrager and Nancy Lynch",
+	title = "Action Transducers and Timed Automata",
+	Booktitle = "CONCUR '92",
+	editor = "W.R. Cleaveland",
+	volume = "630",
+	pages = "436-455",
+	series = "Lecture Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "August",
+	year = "1991"
+}
+
+@InProceedings{hard-rt-ada,
+	author = "Nasser Kettani and Vincent Celier",
+	title = "Toward a Secondary Standard for Hard Real-Time Ada:
+                 The Real-Time Rapporteur Group",
+	booktitle = "Ada - Europe '93",
+	editor = "Michel Gauthier",
+	volume = "688",
+	pages = "330-352",
+	series = "Lecture  Notes in Computer Science",
+	publisher = "Springer-Verlag",
+	month = "June",
+	year = "1993"
+}
+
+@Article{rt-lisp,
+	author = "James R. Allard and Lowell B. Hawkinson",
+	title = "Real-Time Programming in Common Lisp",
+	journal ="Communications  of the ACM",
+	volume = "34",
+	number = "9",
+	pages = "65-69",
+	publisher = "ACM",
+	month = "September",
+	year = "1991"
+
+}
+@Article{fpos:jones-sinclair,
+	author = "S.B. Jones and A.F. Sinclair",
+	title = "Functional Programming and Operating Systems",
+	journal = "The Computer Journal 
+                  (Special Issue of Lazy Functional Programming)",
+	volume = "32",
+	number = "2",
+	pages = "162-172",
+	publisher = "Cambridge University Press",
+	month = "April",
+	year = "1989"
+}
+
+@Article{ieee-oores:92,	
+	author = "Thomas E. Bihari and Prabha Gopinath",
+	title = "Object-Oriented Real-Time Systems:  Concepts and Examples",
+	journal = "Computer",
+	volume = "25",
+	number = "12",
+	pages = "25-32",
+	publisher = "IEEE",
+	month = "December",
+	year = "1992"
+}
+
+@InProceedings{lustre,
+	author = "Paul Caspi and Halbwachs Halbwachs and Nicolas Pilaud and John A. Plaice",
+	title = "LUSTRE: A declarative language for programming 
+                 synchronous systems",
+        booktitle = "the Symposium on Principles of Programming
+                    Languages ({POPL} '87)", 
+        month = "January",
+        year =  "1987"
+}
+
+@Book{wadge-ashcroft:85,
+	author = "W.W. Wadge and E.A. Ashcroft",
+	title = "Lucid, the Dataflow Programming Language",
+	publisher = "Academic Press U.K.",
+	year =  "1985"
+}
+
+@Book{burns-wellings:89,
+	author = "A. Burns and A.J. Wellings",
+	title = "Real-time systems and their programming languages",
+	publisher = "Addison Wesley",
+	year = "1989"
+}  
+
+@Article{spj:89,
+	author = "Simon L. {Peyton Jones}",
+	title = "Parallel Implementations of functional programming languages",
+	journal = "The Computer Journal",
+	volume = "32",
+	number = "2",
+	pages =  "175-186",
+	publisher =  "Cambridge University Press",
+	month = "April",
+	year = "1989"
+}  
+
+@Article{wirth:77,
+	author =  "Niklaus Wirth",
+	title = "Design and Implementation of Modula",
+	journal = "Software Practice and Experience",
+	volume = "7",
+	number = "1",
+	pages = "67-84",
+	month = "January",
+	year = "1977"
+}
+
+@Article{burns-review:91,
+	author = "Alan Burns",
+	title = "Scheduling hard real-time systems: a review",
+	journal = "Software Engineering Journal", 
+	volume = "6",
+	number = "3",
+	pages = "116-128",
+	month = "May",
+	year =  "1991"
+}
+
+@InProceedings{reppy-cml:91,
+	author = "John H. Reppy",
+	title = "CML:  A higher-order concurrent language",
+	booktitle = "Conf. on Programming Language Design 
+                     and Implementation", 
+	organization = "SIGPLAN",
+	pages = "293-305",
+	month = "June",
+	year = "1991" 
+}
+  
+@InProceedings{SETSS:92,
+	author = "J.L. Armstrong and B. O. Dacker
+                  and S.R. Virding and M.C. Williams",
+	title = "Implementing a functional language for highly parallel 
+                 real time applications", 
+	booktitle =  "Proceedings of SETSS 92, Florence",
+	month = "April",
+	year =  "1992"
+}
+
+@InProceedings{wallace-runciman:R73,
+	author = "Malcolm Wallace and Colin Runciman",
+	title = "An incremental garbage collector
+                for embedded real-time systems",
+	booktitle ="in Proc. Winter Meeting, PMG-R73",
+	organization = "Chalmers University of Technology, Gothenburg, Sweden",
+	month  = "June",
+	year = "1993"  
+}
+
+@techreport{NSWC-haskell
+    ,author={Carlson, W.E. and Hudak, P. and Jones, M.P.}
+    ,title={An Experiment Using {H}askell To Prototype
+            "Geometric Region Servers" for Navy Command And Control}
+    ,institution={Department of Computer Science, Yale University}
+    ,type={Research Report}
+    ,number={1031}
+    ,month=Nov
+    ,year=1993
+    }
+
+@misc{NSWC-report
+    ,author={Lee, J.A.N. and Blum, B. and Kanellakis, P. and Crisp, H.
+             and Caruso, J.A.}
+    ,title={{ProtoTech HiPer-D Joint Prototyping Demonstration Project}}
+    ,note={Unpublished; 400 pages}
+    ,month=Feb
+    ,year=1994
+    }
+
+@inproceedings{lo-ml92,
+	author = {L\"aufer, Konstantin and Odersky, Martin},
+	title = {An Extension of {ML} with First-Class Abstract Types},
+	month = {June},
+	year = {1992},
+	booktitle = {Proc. Workshop on ML and its Applications}
+}
+
+@InProceedings{orh:assignment,
+  author = 	"Martin Odersky and Dan Rabin and Paul Hudak",
+  title = 	"Call-by-name, Assignment, and the Lambda Calculus",
+  booktitle =	{Proc. Twentieth Annual {ACM} Symposium
+                 on Principles of Programming Languages, Charleston,
+                 South Carolina},
+  pages =	"43-57",
+  year = 	"1993",
+  month = 	"January"
+}
+
+@TechReport{or:assignment-tr-revised,
+  author = 	"Martin Odersky and Dan Rabin",
+  title = 	"The Unexpurgated Call-by-name, Assignment, and the
+                 Lambda-Calculus, Revised Report",
+  institution = 	"Department of Computer Science, Yale
+                 University",
+  year = 	"1993",
+  type = 	"Research Report",
+  number = 	"YALEU/DCS/RR-930",
+  address = 	"New Haven, Connecticut",
+  month = 	"May",
+}
+
+@TechReport{od:lamnu-report,
+  author = 	"Martin Odersky",
+  title = 	"A Syntactic Theory of Local Names",
+  institution = "Yale University",
+  year = 	"1993",
+  number = 	"YALEU/DCS/RR-965",
+  month = 	"May"
+}
+
+@TechReport{odersky:critical-pairs,
+  author = 	"Martin Odersky",
+  title = 	"A Syntactic Method for Proving Operational
+		 Equivalences",
+  institution =	{Department of Computer Science, Yale University},
+  type =	{Research Report},
+  number =	{YALEU/DCS/RR-964},
+  year = 	"1993",
+  month = 	"May"
+}
+
+@TechReport{tyinf:ptc,
+  author = 	"Kung Chen and Martin Odersky and Paul Hudak",
+  title = 	"Type Inference for Parametric Type Classes",
+  institution = 	"Yale University",
+  year = 	"1992",
+  OPTtype = 	"",
+  number = 	"YALEU/DCS/RR-900",
+  OPTaddress = 	"",
+  month = 	"June",
+  OPTnote = 	""
+}
+
+@TechReport{chen-odersky:tlvar,
+  author = 	"Kung Chen and Martin Odersky",
+  title = 	"A Type System for a Lambda Calculus with Assignments",
+  institution = 	"Yale University",
+  year = 	"1993",
+  OPTtype = 	"",
+  number = 	"YALEU/DCS/RR-963",
+  OPTaddress = 	"",
+  month = 	"May",
+  OPTnote = 	""
+}
+
+% Added Thu Oct 22 14:11:21 1992
+% Modified Mon Oct 26 14:10:20 1992
+@TechReport{odersky-rabin-hudak:assignment-conf-tr,
+  author = 	"Martin Odersky and Dan Rabin and Paul Hudak",
+  title = 	"Call-by-name, Assignment, and the Lambda-calculus",
+  institution = 	"Department of Computer Science, Yale
+                 University",
+  year = 	"1992",
+  type = 	"Research Report",
+  number = 	"YALEU/DCS/RR-929",
+  address = 	"New Haven, Connecticut",
+  month = 	"October",
+  status =	{binder-14}
+}
+
+% Added Thu Oct 22 14:13:04 1992
+@TechReport{odersky-rabin:assignment-tr,
+  author = 	"Martin Odersky and Dan Rabin",
+  title = 	"The Unexpurgated Call-by-name, Assignment, and the
+                 Lambda-Calculus",
+  institution = 	"Department of Computer Science, Yale
+                 University",
+  year = 	"1993",
+  type = 	"Research Report",
+  number = 	"YALEU/DCS/RR-930",
+  address = 	"New Haven, Connecticut",
+  month = 	"May",
+}
+@misc{ansicl,
+	title = "X3.226, 199x, Programming Language Common Lisp",
+	note = "Draft proposed American National Standard",
+	editor = "Kent Pitman and Kathy Chapman and Richard P. Gabriel
+		and Sandra Loosemore",
+	publisher = "Global Engineering Documents",
+	year = 1992
+	}
+
+@TechReport{mpj:partial-explosion,
+  author =      "Mark P. Jones",
+  title =       "Partial Evaluation for Dictionary-free Overloading",
+  institution =  "Department of Computer Science, Yale University",
+  year =        "1993",
+  type =        "Research Report",
+  number =      "YALEU/DCS/RR-959",
+  address =     "New Haven, Connecticut",
+  month =       "April",
+  note =        "Elaboration on \cite{orh:assignment}."
+}
+
+@InProceedings{mpj:prog-with-con-classes,
+  author =      "Mark P. Jones",
+  title =       "Programming with constructor classes (preliminary
+                 summary)",
+  booktitle =   {Proc. Fifth Annual Glasgow Functional
+                 Programming Workshop, Ayr, Scotland},
+  year =        "1992",
+  month =       "July"
+}
+
+@InProceedings{mpj:con-classes,
+  author =      "Mark P. Jones",
+  title =       "A system of constructor classes: overloading and
+                 implicit higher-order polymorphism",
+  booktitle =   {Proc. Conf. on Functional Programming
+                 Languages and Computer Architecture, Copenhagen, Denmark},
+  year =        "1993",
+  month =       "June"
+}
+
+@InJournal{mpj:compute-lattices,
+  author = 	"Mark P. Jones",
+  title = 	"Computing with lattices: An application of type classes",
+  journal = 	"Journal of Functional Programming, Volume 2, Part 4",
+  month = 	"October",
+  year =	"1992",
+}
+
+@Thesis{mpj:qualified-types,
+  author =	"Mark P. Jones",
+  title = 	"Qualified types: Theory and Practice",
+  degree =	"D.Phil. Thesis",
+  institution = "Programming Research Group, University of Oxford",
+  month = 	"July",
+  year =	"1992",
+  toAppear =	"To appear as PRG Technical Monograph"
+}
+
+@inproceedings{petersonjones93
+    ,author={John Peterson and Mark P. Jones}
+    ,title={Implementing Type Classes}
+    ,booktitle={Proceedings of ACM SIGPLAN Symposium on Programming
+                Language Design and Implementation}
+    ,organization={ACM SIGPLAN}
+    ,month=Jun
+    ,year=1993
+    }
+
+@InProceedings{pitts&stark,
+  author = 	"Pitts, A. and Stark, I.",
+  title = 	"On the Observable Properties of Higher Order
+		 Functions that Dynamically Create Local Names",
+  booktitle = 	"Proc. ACM SIGPLAN Workshop on State in Programming
+		 Languages, Copenhagen, Denmark",
+  year = 	"1993",
+  publisher = 	"Yale University, Department of Computer Science,
+                 Research Report YALEU/DCS/RR-968",
+  month = 	"June"
+}
+
+@phdthesis{mohrphd
+    ,author={Mohr, E.}
+    ,title={Dynamic Partitioning of Parallel Lisp Programs}
+    ,school={Yale University, Department of Computer Science}
+    ,month=Oct
+    ,year=1991
+    }
+ 
+@phdthesis{khoophd,
+   author = "Khoo, S.C.",
+   title = "Parameterized Partial Evaluation",
+   school = "Yale University, Department of Computer Science",
+   year = "1992"
+}
+
+@phdthesis{berry:thesis,
+    author = "Gerard  Berry",
+    title = "Generating Program Animators from Programming Language Semantics",
+    school = "University of Edinburgh",
+    year = 1991,
+    month = "June"
+}
+ 	
+@book{sterling:art,
+        author = "L. Sterling and E. Shapiro",
+        title = "The Art of Prolog, Advanced Programming Techniques",
+        publisher = "The MIT PRess",
+        address = "Cambridge, MA",
+        year = 1986
+}
+
+@inproceedings{toyn:snapshots,
+	author = "I. Toyn and C. Runichman",
+	title = "Adapting Combinator and SECD Machines to Display
+                 Snapshots of Functional Computations",
+	booktitle = "New Generation Computing(4)",
+	pages = "339-363",
+	year = 1986
+	}
+
+@inproceedings{bertot:occurrences,
+	author = "Y. Bertot",
+	title = "Occurrences in Debugger Specifications",
+	booktitle = "Proc. 1991 ACM Conf.
+                     on Programming Languages Design and Implementation",      
+        publisher = "ACM",
+        month = "June",
+	year = 1988
+	}
+
+@TechReport{yale-haskell,
+  author = 	"John Peterson",
+  title = 	"The {Y}ale {H}askell {U}sers {M}anual",
+  institution = "Department of Computer Science, Yale
+                 University",
+  year = 	"1992",
+  type = 	"Research Report",
+  number = 	"Version Y2.0",
+  address = 	"New Haven, Connecticut",
+  month = 	"October",
+}
+
+@phdthesis{aasaphd92
+    ,author={Aasa, A.}
+    ,title={User Defined Syntax}
+    ,school={Chalmers University of Technology}
+    ,address={Goteborg, Sweden}
+    ,year=1992
+    }
+
+@misc{karrhudak91
+    ,author={Karr, M. and Hudak, P.}
+    ,title={A Kernel Family and the Common Prototyping System}
+    ,institution={Software Options, Cambridge, MA}
+    ,type={Technical Report}
+    ,month=Jan
+    ,year=1991
+    }
+ 
+@techreport{karrsyntax90
+    ,author={Karr, M.}
+    ,title={CPL Working Notes on Grammars and Related Technology}
+    ,institution={Software Options, Cambridge, MA}
+    ,type={Technical Report}
+    ,month=Mar
+    ,year=1990
+    }
+
+@inproceedings{mauny89
+    ,author={Mauny, M.}
+    ,title={Parsers and Printers as Stream Destructors Embedded in
+            Functional Languages}
+    ,booktitle={Proc. Conf. on Functional Programming
+                Languages and Computer Architecture}
+    ,organization={ACM/IFIP}
+    ,year=1989
+    ,pages={360-370}
+    }
+
+@techreport{yacc
+    ,author={Johnson, S.C.}
+    ,title={Yacc -- Yet Another Compiler Compiler}
+    ,institution={Bell Labs}
+    ,type={Technical Report}
+    ,number={32}
+    ,year=1975
+    }
+
+@techreport{lex
+    ,author={Lesk, M.E.}
+    ,title={LEX -- A Lexical Analyzer Generator}
+    ,institution={Bell Labs}
+    ,type={Technical Report}
+    ,number={39}
+    ,year=1975
+    }
+
+@phdthesis{kishonphd,
+author = "Kishon, A.",
+title = "Theory and Art of Semantics-Directed Program Execution Monitoring",
+school = "Yale University, Department of Computer Science",
+year = "1992"
+}
+
+@inproceedings{wadler-popl92
+    ,author={Wadler, Philip}
+    ,title={The Essence of Functional Programming}
+    ,booktitle={the Symposium on Principles of Programming
+           Languages ({POPL} '92)}
+    ,organization={ACM}
+    ,month=Jan
+    ,year=1992
+    ,pages={1-14}
+    }
+
+@inproceedings{moggi89
+    ,author={Moggi, E.}
+    ,title={Computational Lambda-Calculus and Monads}
+    ,booktitle={Proceedings of Symposium on Logic in Computer Science}
+    ,organization={IEEE}
+    ,year=1989
+    ,month=Jun
+    ,pages={14--23}
+    }
+
+@inproceedings{peytonjoneswadler-popl93
+    ,author={Peyton Jones, Simon and Wadler, Philip}
+    ,title={Imperative Functional Programming}
+    ,booktitle={the Symposium on Principles of Programming
+           Languages ({POPL} '93)}
+    ,organization={ACM}
+    ,month=Jan
+    ,year=1993
+    ,note={71--84}
+    }
+
+@phdthesis{guzmanphd
+    ,author={Guzm\'an, J.}
+    ,title={On Expressing the Mutation of State in a 
+            Functional Programming Language}
+    ,school="Yale University, Department of Computer Science"
+    ,year="1993"
+    }
+
+@book{appelbook
+    ,author={Appel, A.}
+    ,title={Compiling with Continuations}
+    ,publisher={Cambridge University Press}
+    ,address={Cambridge}
+    ,year=1992
+    }
+ 
+@techreport{hudakcmadttr
+    ,author={Hudak, P.}
+    ,title={Mutable Abstract Datatypes -- or --
+            How to Have Your State and Munge It Too}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-914}
+    ,month=Dec
+    ,year=1992
+    }
+ 
+@InCollection(Filinski-continuations,
+	Author = "Filinski, A.",
+	Title = "Declarative Continuations: {A}n Investigation of
+		 Duality in Programming Language Semantics",
+	BookTitle = "Category Theory and Computer Science",
+	Pages = "224-249",
+	Editor = "Pitt, D. H.",
+	Publisher = "Springer-Verlag",
+	Address = "Berlin",
+	Note = "(Lect. Notes in Comp. Science Vol. 389)",
+	Year = "1989"
+	)
+
+@inproceedings{lfp92,
+	author = {Chen, K. and Hudak, P. and Odersky, M.},
+	title = {Parametric Type Classes},
+	month = {June},
+	year = {1992},
+        pages ={170--181},
+        publisher =   "ACM",
+	booktitle = {Proceedings of ACM Conf. on Lisp and 
+                     Functional Programming}
+}
+
+@article{haskell-tutorial
+    ,author={Hudak, Paul and Fasel, Joe}
+    ,title={A Gentle Introduction to {H}askell}
+    ,journal={ACM SIGPLAN Notices}
+    ,volume=27
+    ,number=5
+    ,month=May
+    ,year=1992
+    }
+
+@Article{fradet-le-metayer:compilation,
+  author = 	"Pascal Fradet and Daniel Le M\'{e}tayer",
+  title = 	"Compilation of Functional Languages by Program
+		 Transformation",
+  journal = 	"{ACM} Transactions on Programming Languages and
+		 Systems",
+  year = 	"1991",
+  volume = 	"13",
+  number = 	"1",
+  pages = 	"21--51",
+  month = 	"January",
+  status =	{own-journal}
+}
+
+@misc{hudak91FPCAtut
+    ,author={Hudak, P.}
+    ,title={Manipulating State in Functional Languages}
+    ,note={Tutorial given at ACM/IFIP-sponsored FPCA Conf.}
+    ,month=Aug
+    ,year=1991
+    }
+ 
+@misc{odersky91b
+    ,author={Odersky, M.}
+    ,title={Observers for Linear Types}
+    ,note={(draft)}
+    ,month=Jul
+    ,year=1991
+    }
+ 
+@techreport{abramsky90
+    ,author={Abramsky, S.}
+    ,title={Computational Interpretations of Linear Logic}
+    ,institution={Imperial College}
+    ,type={Research Report}
+    ,number={{DOC} 90/20}
+    ,month=Oct
+    ,year=1990
+    }
+
+@inproceedings{holmstrom88
+    ,author={Holmstrom, S.}
+    ,title={A Linear Functional Language}
+    ,booktitle={Proc. Workshop on the Implementation of
+                Lazy Functional Languages, PMG Report 53}
+    ,institution={Chalmers University of Technology}
+    ,year=1988
+    ,pages={13-32}
+    }
+
+@article{lafont88
+    ,author={Lafont, Y.}
+    ,title={The Linear Abstract Machine}
+    ,journal={Theoretical Computer Science}
+    ,volume=59
+    ,year=1988
+    ,pages={157-180}
+    }
+
+@techreport{rabinhudak91
+    ,author={Rabin, D. and Hudak, P.}
+    ,title={Mutable Heaps with Structure Sharing in a Pure Functional Language}
+    ,institution="Yale University, Department of Computer Science"
+    ,month=Aug
+    ,type="Research Report"
+    ,number="YALEU/DCS/RR"
+    ,year=1991
+    }
+
+@inproceedings{odonnell85
+    ,author={O'Donnell, J.}
+    ,title={Dialogues: A basis for constructing programming
+            environments}
+    ,booktitle={Proc. ACM Symposium on Language Issues in
+                Programming Environments}
+    ,organization={ACM}
+    ,year=1985
+    ,pages={19-27}
+    }
+
+@inbook{thompson89
+    ,author={Thompson, S.J.}
+    ,title={Interactive functional programs: a method and formal
+            semantics}
+    ,booktitle={Declarative Programming}
+    ,chapter=10
+    ,pages={249-285}
+    ,editors={Turner, D.A.}
+    ,year=1989
+    ,publisher={Addison Wesley}
+    }
+
+@inproceedings{dwelly89
+    ,author={Dwelly, A.}
+    ,title={Dialogue Combinators and Dynamic User Interfaces}
+    ,booktitle={Proc. Conf. on Functional Programming
+                Languages and Computer Architecture}
+    ,organization={ACM/IFIP}
+    ,year=1989
+    ,pages={371-381}
+    }
+ 
+@inproceedings{masontalcott89
+    ,author={Mason, I.A. and Talcott, Carolyn L.}
+    ,title={Axiomatizing Operational Equivalence in the Presence of
+            Side Effects}
+    ,booktitle={Proceedings of Symposium on Logic in Computer Science}
+    ,organization={IEEE}
+    ,year=1989
+    ,pages={284-293}
+    }
+
+@inproceedings{swarupetal91
+    ,author={Swarup, V. and Reddy, U. and Ireland, E.}
+    ,title={Assignments for Applicative Languages}
+    ,booktitle={Proc. Conf. on Functional Programming
+                Languages and Computer Architecture}
+    ,organization={ACM/IFIP}
+    ,year=1991
+    }
+
+@inproceedings{wakelingrunciman91
+    ,author={Wakeling, D. and Runciman, C.}
+    ,title={Linearity and Laziness}
+    ,booktitle={Proc. Conf. on Functional Programming
+                Languages and Computer Architecture}
+    ,organization={ACM/IFIP}
+    ,year=1991
+    }
+
+@inproceedings{barthetal91
+    ,author={Barth, P.S. and Nikhil, R.S. and Arvind}
+    ,title={M-Structures: Extending a Parallel, Non-Strict, Functional
+            Language with State}
+    ,booktitle={Proc. Conf. on Functional Programming
+                Languages and Computer Architecture}
+    ,organization={ACM/IFIP}
+    ,year=1991
+    }
+
+@inproceedings{wadler91a
+    ,author={Wadler, Philip}
+    ,title={Is There a Use for Linear Logic?}
+    ,booktitle={the Symposium on Partial Evaluation and Semantics Based
+                Program Manipulation}
+    ,organization={ACM/IFIP}
+    ,year=1991
+    ,pages={255-273}
+    }
+
+@inproceedings{odersky91
+    ,author={Odersky, M.}
+    ,title={How To Make Destructive Updates Less Destructive}
+    ,booktitle={Proceedings 18th Symposium on Principles of Programming
+           Languages}
+    ,organization={ACM}
+    ,month=Jan
+    ,year=1991
+    ,pages={25-36}
+    }
+
+@inproceedings{guzmanhudak91
+    ,author={Guzm\'an, J. and Hudak, P.}
+    ,title={First-order liveness analysis via type inference}
+    ,booktitle={XVII Latin American Informatics Conf.}
+    ,year=1991
+    ,month=Jul
+    }
+
+@inproceedings{henderson82
+    ,author={Henderson, P.}
+    ,title={Functional Geometry}
+    ,booktitle={Proc. 1982 ACM Symposium on Lisp and 
+                Functional Programmming}
+    ,organization={ACM}
+    ,year=1982
+    ,pages={179--187}
+    }
+
+@inproceedings{arya89
+    ,author={Arya, K.}
+    ,title={Processes in a Functional Animation System}
+    ,booktitle={Proc. Conf. on Functional Programming
+                Languages and Computer Architecture}
+    ,organization={ACM/IFIP}
+    ,year=1989
+    ,pages={382-395}
+    }
+
+@InProceedings{consel-khoo:91,
+  author =      "C. Consel and Khoo, S. C.",
+  title =       "Parameterized Partial Evaluation",
+  booktitle =   "ACM SIGPLAN Conf. on Programming Language Design and Implementation",
+  year =        "1991",
+  pages = "92-106"
+}
+
+@InProceedings{kishonhudakconsel91,
+  author =      "A. Kishon and C. Consel and P. Hudak",
+  title =       "Monitoring Semantics: a Formal Framework for Specifying,
+                 Implementing and Reasoning about Execution Monitors",
+  booktitle =   "ACM SIGPLAN Conf. on Programming Language Design 
+                 and Implementation",
+  month =	Jun,
+  year =        "1991",
+  pages = "338-352"
+}
+
+@inproceedings{baker90
+    ,key={baker}
+    ,author={Baker, Henry G.}
+    ,title={Unify and Conquer (Garbage, Updating, Aliasing, ...) in 
+            Functional Languages}
+    ,booktitle={Proc. 1990 ACM Conf. on Lisp and 
+                Functional Programmming}
+    ,year=1990
+    ,publisher={ACM}
+    }
+
+@book{K&R,
+author = "Brian W. Kernighan and Dennis M. Ritchie",
+title = "The C Programming Language",
+publisher = {Prentice-Hall},
+year = 1978
+}
+@book{DRAGON2,
+author = "A. V. Aho and R. Sethi and J. D. Ullman",
+title = "Compilers Principles, Techniques and Tools",
+publisher = "Addison-Wesley",
+year = 1987
+}
+@book{REPS,
+author = "T. W. Reps",
+title = "Generating Language-Based Environments",
+publisher = "The MIT Press",
+year = 1984
+}
+@book{SPJ,
+author = "Simon L. {Peyton Jones}",
+title = "The Implementation of Functional Programming Languages",
+publisher = {Prentice-Hall},
+year = 1987
+}
+@techreport{PFL,
+author = {S\"{o}ren Holmstr\"{o}m},
+title = "PFL: A Functional Language for Parallel Programming, and
+its Implementation",
+institution = {Programming Methodology Group, University of
+G\"{o}teborg and Chalmers University of Technology},
+year = 1983,
+month = "September",
+number = "7"
+}
+@techreport{INCTECH,
+author = "R. S. Sundaresh and P. Hudak",
+title = "A theory of incremental computation and its application",
+institution =  "Yale University, Department of Computer Science",
+year = 1990,
+month = "March",
+number = "YALEU/DCS/RR770"
+}
+@techreport{INC,
+author = "D. Yellin and R. Strom",
+title = "{INC}: A Language for Incremental Computation",
+institution = "IBM",
+year = 1989,
+month = "RC 14375(\#64375)"
+}
+@book{CCS,
+author = "Robin Milner",
+title = "A Calculus of Communicating Systems",
+publisher = {Springer-Verlag},
+year = 1981,
+volume = 81,
+series = LNCS
+}
+@incollection{HMERGE,
+author = "P. Henderson",
+title = "Purely Functional Operating Systems",
+pages = "177-189",
+editor = "J. Darlington and P. Henderson and D.A. Turner",
+booktitle = "Functional Programming and its Applications",
+publisher = {Cambridge University Press},
+year = 1982
+}
+@inproceedings{NDCLINGER,
+author = "W. Clinger",
+title = "Nondeterministic call by need is neither lazy nor by name",
+booktitle = "Proc. 1982 ACM Symp. LISP and Functional Programming",
+year = 1982
+}
+@techreport{AUSNDFL,
+author = "Harald Sondergaard and Peter Sestoft",
+title = "Nondeterminism in Functional Languages",
+institution = {Department of Computer Science, University of Melbourne},
+year = 1988,
+number = " 88/18"
+}
+@techreport{STOYE,
+author = "W. Stoye",
+title = "A New Scheme for Writing Functional Operating Systems",
+institution = {Cambridge University Computer Laboratory},
+year = 1984,
+number = "56"
+}
+@inbook{KAOS,
+author = "David Turner",
+title = "Functional Programming and Communicating Processes",
+booktitle = "PARLE Parallel Architectures and Languages Europe",
+year = 1987,
+publisher = {Springer Verlag},
+pages = "54-74",
+volume = 259,
+series = LNCS
+}
+@article{BURTON,
+author = "F. W. Burton",
+title = "Nondeterminism with Referential Transparency in Functional Programming
+Languages",
+journal = "The Computer Journal",
+year = 1988,
+volume = 31,
+number = 3,
+pages = {243-247}
+}
+@book{DIJKSTRA,
+author = "Edsger W. Dijkstra",
+title = "A Discipline of Programming",
+publisher = {Prentice-Hall},
+year = 1976
+}
+@book{AGHA1,
+author = "Gul Agha",
+title = "Actors A Model of Concurrent Computation in Distributed Systems",
+publisher = {The MIT Press},
+year = 1986
+}
+@inbook{AGHA2,
+author = "Gul Agha",
+title = "Semantic Considerations in the Actor Paradigm of Concurrent Computation",
+pages = "151-179",
+volume = 197,
+series = LNCS,
+publisher = {Springer Verlag},
+year = 1984
+}
+@book{UNITY,
+author = "K. Mani Chandy and Jayadev Misra",
+title = "Parallel Program Design",
+publisher = {Addison-Wesley},
+year = 1988
+}
+@article{LINDA,
+author = "David Gelernter",
+title = "Generative Communication in Linda",
+journal = "ACM Trans. Program. Lang. Syst.",
+year = 1985,
+month = "January",
+pages = "80-112",
+volume = 7,
+number = 1 
+}
+@article{CSP1,
+author = "C. A. R. Hoare",
+title = "Communicating Sequential Processes",
+journal = "Comm. ACM",
+year = 1978,
+pages = "666-677",
+volume = 21,
+number = 8
+}
+@book{CSP2,
+author = "C. A. R. Hoare",
+title = "Communicating Sequential Processes",
+publisher = {Prentice-Hall},
+year = 1985
+}
+@inbook{KAHN,
+author = "G. Kahn",
+chapter = "The Semantics of a simple language for Parallel Programming",
+title = "Information Processing",
+pages = "471-475",
+publisher = {North Holland},
+year = 1974,
+volume = 74
+}
+@techreport{HASKELL0,
+author = "Paul Hudak and Philip Wadler et al.",
+title = "Report on the Functional Programming Language Haskell",
+institution = "Department of Computer Science, Yale University",
+year = 1988,
+month = "December",
+number = "YALEU/DCS/RR-666"
+}
+@techreport{NEBULA,
+author = "K. Karlsson",
+title = "Nebula, a Functional Operating System",
+institution = "Chalmers University",
+year = 1981
+}
+@misc{HOPEIO,
+author = "Lee M. McLoughlin and Sean Hayes",
+title = "Interlanguage Working from a Pure Functional Language",
+howpublished = "Functional Programming mailing list",
+month = "November",
+year = 1988
+}
+@techreport{FL,
+author = "John Backus and John H. Williams and Edward L. Wimmers",
+title = "FL Language Manual (Preliminary Version)",
+institution = "IBM Almaden Research Center",
+year = 1986,
+month = "November",
+number = "RJ 5339 (54809)"
+}
+@techreport{SML-v2,
+author = "Robert Harper and Robin Milner and Mads Tofte",
+title = "The Definition of Standard ML Version 2",
+institution = "Laboratory for Foundations of Computer Science, Department of Computer Science - University of Edinburgh",
+year = 1988,
+month = "August",
+number = "ECS-LFCS-88-62"
+}
+@techreport{PONDER,
+author = "Jon Fairbairn",
+title = "Design and Implementation of a Simple Typed Language Based on the Lambda-Calculus",
+institution = "University of Cambridge Computer Laboratory",
+year = 1985,
+month = "May",
+number = 75
+}
+@inproceedings{HOPE,
+author = "Burstall and McQueen and Sanella",
+title = "HOPE: An experimental applicative language",
+booktitle = "Proceedings 1st International LISP Conf., Stanford",
+year = 1980
+}
+@techreport{ALFL,
+author = "Paul Hudak",
+title = "ALFL Reference Manual and Programmer's Guide",
+institution = "Yale University Department of Computer Science",
+year = 1984,
+month = "August",
+number = "YALEU/DCS/TR-322"
+}
+@techreport{IO,
+author = "Paul Hudak and Raman S. Sundaresh",
+title = "On the Expressiveness of Purely Functional I/O Systems",
+institution = "Yale University Department of Computer Science",
+year = 1988,
+month = "December",
+number = "YALEU/DCS/RR-665"
+}
+@inproceedings{MIRANDA,
+author = "David Turner",
+title = "Miranda: A non-strict functional language with polymorphic types",
+booktitle = "Proceedings IFIP International Conf. on Functional Programming Languages and Computer Architecture, 
+Nancy France (Springer Lecture Notes in Computer Science, vol 201)",
+year = 1985,
+month = "September"
+}
+@article{LANDIN1,
+author = "P. J. Landin",
+title = "A Correspondence between ALGOL 60 and Church's Lambda Notation",
+journal = "Comm. ACM",
+year = 1965,
+volume = 21,
+number = 11,
+pages = {931-933}
+}
+@inproceedings{FIO,
+author = "John H. Williams and Edward L. Wimmers",
+title = "Sacrificing simplicity for convenience: Where do you draw the line?",
+booktitle = "Proc. Fifteenth Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages
+, San Diego, California",
+year = 1988,
+month = "January"
+}
+@techreport{SALISHAN,
+author = "Paul Hudak and Steve Anderson",
+title = "Haskell Solutions to the Language Session Problems at the 1988 Salishan High-Speed Computing Conf.",
+institution = "Yale University, Department of Computer Science",
+year = "1988",
+month = "January",
+number = "YALEU/DCS/RR-627"
+}
+@article{PF,
+author = "Paul Hudak",
+title = "Denotational Semantics of a Para-functional Programming Language",
+journal = "International Journal of Parallel Programming",
+year = 1986,
+volume = 15,
+number = 2,
+pages = {103-125}
+}
+@inproceedings{CHOCS,
+author = "Bent Thomsen",
+title = "A Calculus of Higher Order Communicating Systems",
+booktitle = "POPL",
+year = 1989
+}
+@inproceedings{MARRYD,
+author = "T. J. Marlowe and B. G. Ryder",
+title = "An Efficient Hybrid Algorithm for Incremental Data Flow
+Analysis",
+booktitle = "Conf. Record of the Seventeenth Annual ACM
+Symposium on Principles of Programming Languages",
+year = 1990
+}
+@inproceedings{CONSDAN,
+author = "C. Consel and O. Danvy",
+title = "From Interpreting to Compiling Binding times",
+booktitle = "Proc. 3rd European Symposium on Programming,
+Lecture Notes in Computer Science, Vol. 432",
+publisher = "Springer-Verlag",
+month = "May",
+year = 1990
+}
+@article{REPSTD,
+author = "T. Reps and T. Teitelbaum and A. Demers",
+title = "Incremental Context Dependent Analysis for Language-Based
+Editors",
+journal = "ACM Transactions on Programming Languages and Systems",
+year = 1983,
+volume = 5,
+number = 3,
+month = "July",
+pages = {449-477}
+}
+@phdthesis{sundareshphd,
+author = "Sundaresh, R.S.",
+title = "Incremental Computation via Partial Evaluation",
+school = "Yale University, Department of Computer Science",
+year = "1992"
+}
+@phdthesis{PUGH,
+author = "Pugh, Jr., W. W.",
+title = "Incremental Computation and the Incremental Evaluation of Functional Programs",
+school = "Cornell University",
+year = 1988,
+month = "August"
+}
+@phdthesis{LAUNCHTH,
+author = "Launchbury, J.",
+title = "Projection Factorisations in Partial Evaluation",
+school = "University of Glasgow",
+year = 1990,
+month = "January"
+}
+@phdthesis{MARLOWE,
+author = "T. J. Marlowe",
+title = "Data Flow Analysis and Incremental Iteration",
+school = "Rutgers, The State University of New Jersey",
+year = 1989,
+month = "October"
+}
+@phdthesis{ZANDEN,
+author = "B. T. Vander\ Zanden",
+title = "Incremental constraint satisfaction and its application to
+graphical interfaces",
+school = "Cornell University",
+year = 1989,
+month = "January"
+}
+@inproceedings{LAUNCH,
+author = "J. Launchbury",
+title = "Projections for Specialisation",
+booktitle = "Partial Evaluation and Mixed Computation",
+year = 1988,
+editor = "D.Bj{\o}rner, A.P.Ershov and N.D.Jones",
+publisher = "North-Holland"
+}
+@inproceedings{RYDEHEARD,
+author = "D. Rydeheard",
+title = "Tutorial on Natural Transformations",
+booktitle = "Category Theory and Computer Programming",
+year = 1985,
+publisher = "Springer LNCS 240",
+}
+@article{BROUWER,
+author = "J. C. C. McKinsey and A. Tarski",
+title = "On Closed Elements in Closure Algebras",
+journal = "Annals of Mathematics",
+year = 1946,
+volume = 47,
+number = 1,
+month = "January"
+}
+@article{FUT,
+author = "Y. Futamura",
+title = "Partial Evaluation of Computation Process-An approach to a Compiler-Compiler",
+journal = "Systems, Computers, Controls",
+year = 1971,
+volume = 2,
+number = 5
+}
+@article{MIX,
+author = "N. D. Jones and P. Sestoft and H. S{\o}ndergaard",
+title = "Mix: A Self-Applicable Partial Evaluator for Experiments in Compiler Generation",
+journal = "Lisp and Symbolic Computation",
+year = 1989,
+volume = 2,
+number = 1
+}
+@inproceedings{FIELD,
+author = "J. Field and T. Teitelbaum",
+title = "Incremental Reduction in the Lambda Calculus",
+booktitle = "Proc. 1990 ACM Conf. on Lisp and
+Functional Programming",
+month = "June",
+year = 1990
+}
+@inproceedings{LOM,
+author = "L. A. Lombardi and B. Raphael",
+title = "LISP as the Language for an Incremental Computer",
+booktitle = "The Programming Language LISP: Its Operation and
+Applications",
+year = 1964,
+publisher = "Information International Inc., The MIT Press",
+pages = "204-219"
+}
+@inproceedings{REPSB,
+author = "T. Reps",
+title = "Algebraic properties of program integration",
+booktitle = "Proc. 3rd European Symposium on Programming,
+Lecture Notes in Computer Science, Vol. 432",
+publisher = "Springer-Verlag",
+month = "May",
+year = 1990
+}
+@inproceedings{HUDYOUNG,
+author = "P. Hudak and J. Young",
+title = "Higher-order strictness analysis for the untyped lambda
+calculus",
+booktitle = "Proc. 12th ACM symposium on principles of
+programming languages",
+month = "January",
+year = 1986
+}
+
+@Book{aho-al:86,
+  author =      "Aho, A. D. and R. Sethi and Ullman, J. D.",
+  title =       "Compilers: Principles, Techniques and Tools",
+  publisher =   aw,
+  year =        "1986"
+}
+
+@InProceedings{backus:85,
+  author =      "J. Backus",
+  title =       "From Function Level Semantics to Program Transformation 
+                 and Optimization",
+  booktitle =   "International Conf. on Theory and Practice of Software 
+                 Development",
+  pages =       "60-91",
+  year =        "1985",
+  editor =      "H. Ehrig and C. Floyd and M. Nivat and J. Thatcher",
+  volume =      "186",
+  series =      lncs,
+  publisher =   sv
+}
+
+@Article{bauer-al:89,
+  author =      "Bauer, F. L. and B. Moller and H. Partsch and P. Pepper",
+  title =       "Formal Program Construction by trasformations -- Computer-Aided, 
+                 Intuition-Guided Programming",
+  journal =     "IEEE Transactions on Software Engineering",
+  year =        "1989",
+  volume =      "15",
+  number =      "2",
+  pages =       "165-180"
+}
+
+
+@Article{beckman-al:76,
+  author =      "L. Beckman and A. Haraldsson and {O}. Oskarsson
+                 and E. Sandewall",
+  title =       "A Partial Evaluator, and Its Use as a Programming Tool",
+  journal =     "Artificial Intelligence",
+  year =        "1976",
+  volume =      "7",
+  number =      "4",
+  pages =       "319-357"
+}
+
+@InProceedings{berlin:90,
+  author =      "A. Berlin",
+  title =       "Partial Evaluation Applied to Numerical Computation",
+  booktitle =   "ACM Conf. on Lisp and Functional Programming",
+  pages =       "139-150",
+  year =        "1990"
+}
+
+@Book{book:abs-int,
+  title =       "Abstract Interpretation of Declarative Languages",
+  publisher =   "Ellis Horwood",
+  year =        "1987",
+  editor =      "Abramsky, S. and Hankin, C."
+}
+
+@Article{boyer-moore:75,
+  author =      "Boyer, R. S. and Moore, J. S.",
+  title =       "Proving theorems about {LISP} functions",
+  journal =     "Journal of ACM",
+  year =        "1975",
+  pages =       "129-144",
+  volume =      "22",
+  number =      "1"
+}
+
+@InProceedings{bondorf1:88,
+  author =      "A. Bondorf",
+  title =       "Towards a Self-Applicable Partial Evaluator for Term
+                  Rewriting Systems",
+  booktitle =   "Partial Evaluation and Mixed Computation",
+  year =        "1988",
+  editor =      "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D.",
+  publisher =   nh
+}
+
+@TechReport{bondorf2:88,
+  author =      "A. Bondorf",
+  title =       "Pattern Matching in a Self-Applicable Partial Evaluator",
+  institution =         "University of Copenhagen",
+  year =        "1988",
+  type =        "Diku Report",
+  address =     "Copenhagen, Denmark"
+}
+
+@TechReport{bondorf-al:88,
+  author =      "A. Bondorf and Jones, N. D. and T. Mogensen and P. Sestoft",
+  title =       "Binding Time Analysis and the Taming of Self-Application",
+  institution =         "University of Copenhagen",
+  year =        "1988",
+  type =        "Diku Report",
+  address =     "Copenhagen, Denmark"
+}
+
+@TechReport{bondorf-danvy:89,
+  author =      "A. Bondorf and O. Danvy",
+  title =       "Automatic Autoprojection of Recursive Equations with 
+                 Global Variables and Abstract Data Types",
+  institution =         "University of Copenhagen",
+  number =      "90/04",
+  year =        "1990",
+  type =        "Diku Research Report",
+  note =        "To appear in Science of Computer Programming",
+  address =    "Copenhagen, Denmark"
+ }
+
+@InProceedings{bondorf:90,
+  author =      "A. Bondorf",
+  title =       "Automatic Autoprojection of Higher Order Recursive Equations",
+  booktitle =   "ESOP'90, 3$^{rd}$ European Symposium on Programming",
+  pages =       "70-87",
+  year =        "1990",
+  editor =      "Jones, N. D.",
+  volume =      "432",
+  series =      lncs,
+  publisher =   sv
+}
+
+@Article{burstall-darlington:77,
+  author =      "Burstall, R. M. and J. Darlington",
+  title =       "A Transformational System for Developing Recursive Programs",
+  journal =     "Journal of ACM",
+  year =        "1977",
+  pages =       "44-67",
+  volume =      "24",
+  number =      "1"
+}
+
+@TechReport{burge:76,
+  author =      "W. Burge",
+  title =       "An Optimizing Technique for High Level Programming Languages",
+  institution = "IBM Thomas J. Watson Research Center",
+  number =      "RC 5834 (\# 25271)",
+  year =        "1976",
+  type =        "Research Report",
+  address =     "Yorktown Heights, New York, New York"
+}
+
+@Book{common-lisp,
+  author =      "Steele, G. L.",
+  title =       "Common Lisp: The Language",
+  publisher =   "Digital Press",
+  year =        "1984"
+}
+
+@TechReport{consel:86,
+  author =      "C. Consel",
+  title =       "{P}ils: un interpr\`ete {L}isp, un syst\`eme multiprocessus
+                 et un compilateur",
+  institution =         "Universit\'e de Paris VIII",
+  year =        "1986",
+  type =        "M\'emoire de ma\^itrise",
+  address =     "Saint Denis, France"
+}
+
+
+
+@Manual{consel-al:86,
+  title =       "Cskim Reference Manual",
+  author =      "C. Consel and A. Deutsch and R. Dumeur
+                 and J.-D. Fekete ",
+  organization =        "Universit\'e de Paris VIII",
+  address =     "Saint Denis, France",
+  year =        "1986",
+  note =        "Informal report"
+}
+
+
+@TechReport{consel:87,
+  author =      "C. Consel",
+  title =       "Skipe: un \'evaluateur partiel",
+  institution =         "Universit\'e de Paris VIII",
+  year =        "1987",
+  type =        "M\'emoire de DEA",
+  address =     "Saint Denis, France"
+}
+
+@InProceedings{consel1:88,
+  author =      "C. Consel",
+  title =       "New Insights into Partial Evaluation: the {S}chism
+                 Experiment",
+  booktitle =   "ESOP'88, 2$^{nd}$ European Symposium on Programming",
+  pages =       "236-246",
+  year =        "1988",
+  editor =      "H. Ganzinger",
+  volume =      "300",
+  series =      lncs,
+  publisher =   sv
+}
+
+@TechReport{consel2:88,
+  author =      "C. Consel",
+  title =       "Realistic Compiler Generation using Partial Evaluation",
+  institution =         "LIX, Ecole Polytechnique",
+  year =        "1989",
+  type =        "Research Report",
+  number =      "89-02",
+  address =     "Palaiseau, France"
+}
+
+@Article{consel-danvy:89,
+  author =      "C. Consel and O. Danvy",
+  title =       "Partial Evaluation of Pattern Matching in Strings",
+  journal =     "Information Processing Letters",
+  year =        "1989",
+  pages =       "79-86",
+  volume =      "30",
+  number =      "2"
+}
+
+@TechReport{consel-al:88,
+  author =      "C. Consel and O. Danvy and K. Malmkj{\ae}r",
+  title =       "Generating Compacted Weiner Trees Automatically:
+                an Exercise in Partial Evaluation",
+  institution =         "LITP--DIKU",
+  year =        "1988",
+  type =        "Working Report"
+}
+
+@Article{consel-al:89,
+  author =      "C. Consel and A. Deutsch and R. Dumeur and J-D. Fekete",
+  title =       "Cskim: an Extended Dialect of {S}cheme",
+  journal =     "Bigre Journal",
+  year =        "1989",
+}
+
+@PhdThesis{consel1:89,
+  author =      "C. Consel",
+  title =       "Analyse de Programmes, Evaluation Partielle et
+                 Generation de Compilateurs", 
+  school =      "Universit\'e de Paris VI",
+  year =        "1989",
+  address =     "Paris, France"
+}
+
+@InProceedings{consel-danvy2:89,
+  author =      "C. Consel and O. Danvy",
+  title =       "Static and Dynamic Semantics Processing",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  note =        "Also Yale Research Report 761",
+  year =        "1991"
+}
+
+@InProceedings{consel-danvy1:90,
+  author =      "C. Consel and O. Danvy",
+  title =       "From Interpreting to Compiling Binding Times",
+  booktitle =   "ESOP'90, 3$^{rd}$ European Symposium on Programming",
+  year =        "1990",
+  editor =      "Jones, N. D.",
+  volume =      "432",
+  pages =       "88-105",
+  series =      lncs,
+  publisher =   sv
+}
+
+@InProceedings{consel2:89,
+  author =      "C. Consel",
+  title = "Binding time analysis for higher order untyped functional
+          languages",
+  booktitle =   "ACM Conf. on Lisp and Functional Programming",
+  pages =       "264-272",
+  year =        "1990"
+}
+
+@TechReport{consel-khoo1:90,
+  author =      "C. Consel and Khoo, S. C.",
+  title =       "Semantics-Directed Generation of a {P}rolog Compiler",
+  number =      "781",
+  institution = "Yale University",
+  year =        "1990",
+  address =     "New Haven, Connecticut, USA",
+  type =        "Research Report"
+}
+
+@Misc{consel-khoo2:90,
+  author =      "C. Consel and Khoo, S. C.",
+  title =       "Higher Order Polyvariant Analysis",
+  year =        "1990",
+  note =        "Paper in preparation"
+}
+
+@Manual{consel1:90,
+  author =      "C. Consel",
+  title =       "The {S}chism {M}anual",
+  Organization = "Yale University",
+  address =      "New Haven, Connecticut, USA",
+  year =        "1990",
+  note =        "Version 1.0"
+}
+
+@Misc{consel2:90,
+  author =      "C. Consel",
+  title =       "Higher Order Partial Evaluation with Data Structures",
+  year =        "1990",
+  note =        "Paper in preparation"
+}
+
+@Misc{consel3:90,
+  author =      "C. Consel",
+  title =       "Partial Evaluation for Scientific Computing",
+  year =        "1990",
+  note =         "Presented at the 1990 Workshop on Advanced Programming
+                  Environment for Scientific Computing"
+}
+
+@TechReport{consel-danvy:90,
+  author =      "C. Consel and O. Danvy",
+  title =       "Partial Evaluation in Parallel",
+  number =      "820",
+  institution = "Yale University",
+  year =        "1990",
+  address =     "New Haven, Connecticut, USA",
+  type =        "Research Report"
+}
+
+@InProceedings{cousot:81,
+  author =      "P. Cousot",
+  title =       "Semantic foundations of program analysis: Theory and
+                 Applications",
+  publisher =   "Prentice-Hall",
+  year =        "1981",
+  booktitle =   "Program Flow Analysis: Theory and Applications",
+  editor =      "Muchnick, S. S. and Jones, N. D."
+}
+
+@Book{clocksin-mellish:81,
+  author =      "Clocksin, W. F. and Mellish, C. S.",
+  title =       "Programming in {P}rolog",
+  publisher =   sv,
+  year =        "1981"
+}
+
+@TechReport{danvy1:90,
+  author =      "O. Danvy",
+  title =       "Semantics-Directed Compilation of Non-Linear Patterns",
+  number =      "303",
+  institution = "Indiana University",
+  year =        "1990",
+  address =     "Bloomington, Indiana, USA",
+  type =        "Technical Report"
+}
+
+
+@InProceedings{dijkstra:68,
+  author =      "Dijkstra,E. W.",
+  title =       "Co-operating Sequential Processes",
+  pages =        "43-112",
+  publisher =   "Academic Press",
+  year =        "1968",
+  booktitle =   "Programming Languages",
+  editor =      "F. Genuys"
+}
+
+@InProceedings{emanuelson-al:80,
+  author =      "P. Emanuelson and A. Haraldsson",
+  title =       "On Compiling Embedded Languages in Lisp",
+  booktitle =   "ACM Conf. on Lisp and Functional Programming,
+                 Stanford, California",
+  year =        "1980",
+  pages =       "208--215"
+}
+
+@InProceedings{ershov:78,
+  author =      "Ershov, A. P.",
+  title =       "On the Essence of Compilation",
+  booktitle =   "Formal Description of Programming Concepts",
+  year =        "1978",
+  editor =      "Neuhold, E. J.",
+  pages =       "391-420",
+  publisher =   nh
+}
+
+@TechReport{felleisen:85,
+  author =      "M. Felleisen",
+  title =       "Transliterating {P}rolog into {S}cheme",
+  institution =     "Indiana University",
+  year =        "1985",
+  type =        "Technical Report",
+  number =      "182",
+  address =     "Bloomington, Indiana"
+}
+
+@InProceedings{fujita-al:88,
+  author =      "H. Fujita and K. Furukawa",
+  title =       "A Self-Applicable Partial Evaluator and Its Use in
+                 Incremental Compiler",
+  booktitle =   "New Generation Computing",
+  year =        "1988",
+  editor =      "Y. Futamura",
+  publisher =   "OHMSHA. LTD. and Springer-Verlag",
+  volume =      "6",
+  series =      "2,3"
+}
+
+@Article{futamura:71,
+  author =      "Y. Futamura",
+  title =       "Partial Evaluation of Computation Process -- An
+                 Approach to a Compiler-Compiler",
+  journal =     "Systems, Computers, Controls 2, 5",
+  year =        "1971",
+  pages =       "45--50"
+}
+
+@InProceedings{futamura:83,
+  author =      "Y. Futamura",
+  title =       "Partial Evaluation of Programs",
+  booktitle =   "RIMS Symposia on Software Science and Engineering,
+                 Kyoto, Japan",
+  year =        "1983",
+  editor =      "E. Goto et al.",
+  pages =       "1--35",
+  publisher =   sv,
+  series =      lncs,
+  volume =      "147"
+}
+
+@InProceedings{fuller-abramsky:88,
+  author =      "Fuller, D. A. and S. Abramsky",
+  title =       "Mixed Computation of {P}rolog",
+  booktitle =   "Partial Evaluation and Mixed Computation",
+  year =        "1988",
+  editor =      "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D.",
+  publisher =   nh
+}
+
+@Book{ganzinger-jones:85,
+  title =   "Programs as Data Objects",
+  year =        "1985",
+  editor =      "H. Ganzinger and Jones, N. D.",
+  volume =      "217",
+  series =      lncs,
+  publisher =   sv
+}
+
+@InProceedings{gomard:90,
+  author =      "Gomard, Carsten  K.",
+  title = "Partial Type Inference for Untyped Functional Programs",
+  booktitle =   "ACM Conf. on Lisp and Functional Programming",
+  year =        "1990"
+}
+
+@TechReport{gomard-jones:90,
+  author =      "Jones, Neil D and Gomard, Carsten  K.",
+  title =       "A Partial Evaluator for the Untyped Lambda Calculus",
+  institution =         "University of Copenhagen",
+  year =        "1990",
+  type =        "{DIKU} Report",
+  address =     "Copenhagen, Denmark",
+  note =        "Extended version of \cite{jones-al:90}"
+}
+
+@Book{gordon:79,
+  author =      "Gordon, M. J. C.",
+  title =       "The Denotational Decription of Programming Languages",
+  publisher =   sv,
+  year =        "1979"
+}
+
+@Book{graph,
+  author =      "Michel Sakarovitch",
+  title =       "Optimisation combinatoire (m\'{e}thodes math\'{e}matiques et
+                 algorithmiques)",
+  publisher =   "Hermann",
+  year =        "1984"
+}
+
+@Article{halstead:85,
+  author =      "Halstead, R. Jr.",
+  title =       "Multilisp: A Language for Concurrent Symbolic Computation",
+  journal =     "ACM Transaction on Programming Languages and Systems",
+  pages =       "501-538",
+  year =        "1985",
+  volume =      "7",
+  number =      "4"
+}
+
+@PhdThesis{haraldsson:77,
+  author =      "A. Haraldsson",
+  title =       "A Program Manipulation System Based on Partial Evaluation",
+  school =      "Link{o}ping University, Sweden",
+  year =        "1977",
+  note =        "Link{o}ping Studies in Science and Technology
+                 Dissertations N$^o$ 14"
+}
+
+@Article{heering:86,
+  author =      "J. Heering",
+  title =       "Partial Evaluation and $\omega$-Completeness of
+                 Algebraic Specifications",
+  journal =     "Theoretical Computer Science",
+  year =        "1986",
+  volume =      "43",
+  pages =       "149-167"
+}
+
+@Book{henson:87,
+  author =      "Henson, M. C.",
+  title =       "Elements of Functional Languages",
+  publisher =   "Blackwell",
+  year =        "1987"
+}
+
+@InProceedings{hudak-young:86,
+  author =      "P. Hudak and J. Young",
+  title =       "Higher-Order Strictness Analysis in Untyped Lambda Calculus",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  pages     =   "97-109",
+  year =        "1986"
+}
+
+@InProceedings{hudak-young:88,
+  author =      "P. Hudak and J. Young",
+  title =       "A Collecting Interpretation of Expressions (Without
+                 Powerdomains)",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  pages =       "107-118",
+  year =        "1988",
+  note={Superseded by \cite{hudak-young:88}.}
+
+}
+
+@Manual{interlisp,
+  title =       "Interlisp",
+  author =      "W. Teitelman",
+  organization =        "Xerox Palo Alto Research Center",
+  year =        "1978"
+}
+
+
+@InProceedings{johnsson:85,
+  author =      "T. Johnsson",
+  title =       "Lambda Lifting: Transforming Programs to Recursive
+                 Equations",
+  booktitle =   "Conf. on Functional Programming Languages and
+                 Computer Architecture",
+  year =        "1985",
+  editor =      "J.-P. Jouannaud",
+  volume =      "201",
+  series =      lncs,
+  publisher =   sv
+
+}
+
+@Book{jones:80,
+  editor =      "Jones, N. D.",
+  title =   "Semantics-Directed Compiler Generation",
+  publisher =   sv,
+  series =      lncs,
+  volume =      "94",
+  year =        "1980"
+}
+
+@InProceedings{jones-muchnick:76,
+  author =      "Jones, N. D. and Muchnick, S. S.",
+  title =       "Some Thoughts towards the Design of an Ideal Language",
+  booktitle =   "ACM Conf. on Principles of Programming Languages",
+  year =        "1976",
+  pages =       "77-94"
+}
+
+@InProceedings{jones-muchnick:81,
+  author =      "Jones, N. D. and Muchnick, S. S.",
+  title =       "Flow Analysis and Optimization of LISP-like Structures",
+  publisher =   "Prentice-Hall",
+  year =        "1981",
+  booktitle =   "Program Flow Analysis: Theory and Applications",
+  editor =      "Muchnick, S. S. and Jones, N. D."
+}
+
+@InProceedings{jones-muchnick:82,
+  author =      "Jones, N. D. and Muchnick, S. S.",
+  title =       "A flexible Approach to Interprocedural Data Flow
+                 Analysis and Programs with Recursive Data Structures",
+  booktitle =   "ACM Conf. on Principles of Programming Languages",
+  year =        "1982",
+  pages =       "66-74"
+}
+
+@InProceedings{jones-al:85,
+  author =      "Jones, N. D. and P. Sestoft and H. S{\o}ndergaard",
+  title =       "An Experiment in Partial Evaluation: the Generation 
+                 of a Compiler Generator",
+  booktitle =   "Rewriting Techniques and Applications, Dijon, France",
+  year =        "1985",
+  editor =      "J.-P. Jouannaud",
+  pages =       "124--140",
+  publisher =   sv,
+  volume =      "202",
+  series =      lncs
+}
+
+@InProceedings{jones-mycroft:86,
+  author =      "Jones, N. D. and A. Mycroft",
+  title =       "Data flow analysis of applicative programs using
+                 minimal function graphs",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  year =        "1986"
+}
+
+@Book{jones:87,
+  author =      "Jones, N. D.",
+  title =       "Flow analysis of lazy higher-order functional programs",
+  publisher =   "Ellis Horwood Limited",
+  year =        "1987"
+}
+
+@Article{jones-al:87,
+  author =      "Jones, N. D. and P. Sestoft and H. S{\o}ndergaard",
+  title =       "Mix: a Self-Applicable Partial Evaluator for
+                 Experiments in Compiler Generation",
+  journal =     "Lisp and Symbolic Computation",
+  year =        "1989",
+  volume =      "2",
+  number =      "1",
+  pages =       "9-50"
+}
+
+@Article{jones-al:88,
+  author =      "Jones, N. D. and P. Sestoft and H. S{\o}ndergaard",
+  title =       "Mix: a Self-Applicable Partial Evaluator for
+                 Experiments in Compiler Generation",
+  journal =     "LISP and Symbolic Computation",
+  year =        "1989",
+  volume =      "2",
+  number =      "1",
+  pages =       "9-50"
+}
+
+@InProceedings{jones:88,
+  author =      "Jones, N. D.",
+  title =       "Challenging Problems in Partial Evaluation and Mixed Computation",
+  booktitle =   "{\rm \cite{ngc:88}}",
+  pages     =   "1-14"
+}
+
+@TechReport{jones2:88,
+  author =      "Jones, N. D",
+  title =       "Binding Time Analysis and Static Semantics (extended abstract)",
+  institution =         "University of Copenhagen",
+  year =        "1988",
+  type =        "Diku Report",
+  address =     "Copenhagen, Denmark"
+}
+
+@InProceedings{jones-al:90,
+  author =      "Jones, Neil D. and Gomard, Carsten  K. and A. Bondorf and O. Danvy and 
+                 T. Mogensen",
+  title =       "A Self-applicable Partial Evaluator for the Lambda Calculus",
+  booktitle =   "IEEE International Conf. on Computer Languages",
+  pages =       "49-58",
+  year =        "1990"
+}
+
+@InProceedings{jorring-scherlis:86,
+  author =      "U. J{\o}rring and Scherlis, W. L.",
+  title =       "Compilers and Staging Transformations",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  pages =       "86-96",
+  year =        "1986"
+}
+
+@Article{kmp:77,
+  author =      "Knuth, D. E. and Morris, J. H. and Pratt, V. R.",
+  title =       "Fast Pattern Matching in Strings",
+  journal =     "SIAM",
+  year =        "1977",
+  volume =      "6",
+  number =      "2",
+  pages =       "323-350"
+}
+
+@InProceedings{kesley-hudak:89,
+  author =      "R. Kesley and P. Hudak",
+  title =       "Realistic compilation by program transformation",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  pages =       "281-292",
+  year =        "1989"
+}
+
+@InProceedings{kahn-carlsson:84,
+  author =      "Kahn, K. M. and Carlsson, M.",
+  title =       "The Compilation of {P}rolog Programs Without the Use of
+                 {P}rolog Compiler",
+  booktitle =   "International Conf. on Fifth Generation Computer
+                 Systems",
+  year =        "1984",
+  pages =       "348-355"
+}
+
+@Book{kleene:52,
+  author =      "Kleene, S. C.",
+  title =       "Introduction to Metamathematics",
+  publisher =   "Van Nostrand",
+  year =        "1952"
+}
+
+@TechReport{komorowski:81,
+  author =      "Komorowski, H. J.",
+  title =       "A Specification of an Abstract
+                 {P}rolog Machine and Its Application to Partial Evaluation",
+  institution =      "Link{o}ping University",
+  year =        "1981",
+  type =        "Link{o}ping Studies in Science and Technology
+                 Dissertations N$^o$ 69",
+  address =     "Link{o}ping, Sweden"
+}
+
+@InProceedings{komorowski:82,
+  author =      "H. J. Komorowski",
+  title =       "Partial Evaluation as a Means for Inferencing Data
+                 Structures in an Applicative Language: A Theory and
+                 Implementation in the Case of {P}rolog",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  year =        "1982"
+}
+
+@Article{kranz-al:86,
+  author =      "Kranz, D. A. and R. Kesley and Rees, J. A. and P. Hudak and J. Philbin
+                 and Adams, N. I.",
+  title =       "{O}rbit: an optimizing compiler for {S}cheme",
+  journal   =   "SIGPLAN Notices, ACM Symposium on Compiler Construction",
+  volume =      "21",
+  number =      "7",
+  pages =       "219-233",
+  year =        "1986"
+}
+
+@Book{lcf,
+  author =      "Gordon, M. J. and Wadsworth, C. P.",
+  title =       "LCF",
+  publisher =   sv,
+  year =        "1979",
+  volume =      "78",
+  series =      lncs
+}
+
+@Book{lee:87,
+  author =      "P. Lee",
+  title =       "Realistic Compiler Generation",
+  publisher =   "MIT Press",
+  year =        "1989"
+}
+
+@InProceedings{lee-pleban:86,
+  author =      "P. Lee and Pleban, U. F.",
+  title =       "On the Use of {L}isp in Implementing Denotational Semantics",
+  booktitle =   "ACM Conf. on Lisp and Functional Programming",
+  year =        "1986",
+  pages =       "233-248"
+}
+
+@InProceedings{lombardi-al:64,
+  author =      "Lombardi, L. A. and B. Raphael",
+  title =       "Lisp as the Language for an Incremental Computer",
+  booktitle =   "The Programming Language Lisp: Its Operation and
+                 Applications",
+  year =        "1964",
+  editor =      "Berkeley, E. C. and Bobrow, D. G.",
+  pages =       "204-219",
+  publisher =   "MIT Press, Cambridge, Massachusetts"
+}
+
+@InProceedings{lombardi:67,
+  author =      "Lombardi, L. A.",
+  title =       "Incremental Computation",
+  booktitle =   "Advances in Computers",
+  year =        "1967",
+  editor =      "alt, F. L. and M. Rubinoff",
+  pages =       "247--333",
+  volume =      "8",
+  publisher =   "Academic Press"
+}
+
+@InProceedings{loveman:76,
+  author =      "Loveman, D. B.",
+  title =       "Program Improvement by Source to Source Transformation",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  year =        "1976"
+}
+
+@Article{manna-waldinger:80,
+  author =      "Z. Manna and R. Waldinger",
+  title =       "A deductive approach to program synthesis",
+  journal =     "ACM Transaction on Programming Languages and Systems",
+  pages =       "90-121",
+  year =        "1980",
+  volume =      "2",
+  number =      "1"
+}
+
+@Manual{mosses:79,
+  author =      "P. Mosses",
+  title =       "{SIS} -- Semantics Implementation System, reference manual
+                 and user guide",
+  Organization = "University of Aarhus",
+  address =      "Aarhus, Denmark",
+  year =        "1979",
+  type =        "{DAIMI} report {MD}-30",
+  note =        "Version 1.0"
+}
+
+@InProceedings{mosses:84,
+  author =      "Mosses, P. A.",
+  title =       "A Basic Abstract Semantic Algebra",
+  booktitle =   "Semantics of Data Types",
+  year =        "1984",
+  pages =       "87-108",
+  volume =      "173",
+  series =      lncs,
+  publisher =   sv
+}
+
+@InProceedings{mogensen:88,
+  author =      "T. Mogensen",
+  title =       "Partially Static Structures in a Self-applicable
+                 Partial Evaluator",
+  booktitle =   "Partial Evaluation and Mixed Computation",
+  pages     =   "325-348",
+  year =        "1988",
+  editor =      "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D.",
+  publisher =   nh
+}
+
+@InProceedings{mogensen:89,
+  author =      "T. Mogensen",
+  title =       "Binding Time Analysis for Polymorphically Typed
+                 Higher Order Languages",
+  booktitle =   "International Joint Conf. on Theory and Practice 
+                 of Software Development",
+  pages =       "298-312",
+  year =        "1989",
+  editor =      "J. Diaz and F. Orejas",
+  volume =      "352",
+  series =      lncs,
+  publisher =   sv
+}
+
+@InProceedings{mogensen2:89,
+  author =      "T. Mogensen",
+  title =       "Separating binding times in language specifications",
+  booktitle =   "FPCA'89, 4$^{th}$ International Conf. on Functional Programming 
+                 Languages and Computer Architecture",
+  year =        "1989"
+}
+
+@TechReport{morris:70,
+  author =      "Morris, F. L.",
+  title =       "The Next 700  Formal Language Descriptions",
+  year =        "1970",
+  type =        "Unpublished paper"
+}
+
+@InProceedings{montenyohl-wand:88,
+  author =      "M. Montenyohl and M. Wand",
+  title =       "Correct Flow Analysis in Continuation Semantics",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  pages   =     "204-218",
+  year =        "1988"
+}
+
+@Manual{mix:87,
+  author =      "The Mix Group",
+  title =       "The Mix System User's Guide 3.0",
+  organization =        "University of Copenhagen",
+  address =     "Copenhagen, Denmark",
+  year =        "1987"
+}
+
+@Article{nicholson-foo:89,
+  author =      "T. Nicholson and N. Foo",
+  title =       "A Denotational Semantics for {P}rolog",
+  journal =     "ACM Transaction on Programming Languages and Systems",
+  year =        "1989",
+  volume =      "11",
+  number =      "4"
+}
+
+@Book{ngc:88,
+  title =       "Selected Papers from the Workshop on Partial
+                 Evaluation and Mixed Computation",
+  journal =     "New Generation Computing",
+  volume =      "6",
+  series =      "2,3",
+  editor =      "Ershov, A. P.  and D. Bj{\o}rner and Y. Futamura and K. Furukawa 
+                 and A. Haraldsson and Scherlis, W. L.",
+  publisher =   "OHMSHA. LTD. and Springer-Verlag",
+  year =        "1988"
+}
+
+@Manual{psi:87,
+  author =      "Nielson, Hanne Riis",
+  title =       "The core of the {PSI}-system",
+  organization =        "Institut for Elektroniske Systemer",
+  address =     "Aalborg, Denmark",
+  note =        "{IR} 87-02",
+  year =        "1987"
+}
+
+@InProceedings{nielson:88,
+  author =      "Nielson, Hanne Riis and Flemming Nielson",
+  title =       "Automatic binding time analysis for a typed
+                 $\lambda$-calculus",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  pages  =      "98-106",
+  year =        "1988"
+}
+
+@TechReport{nielson2:88,
+  author =      "Nielson, Hanne Riis and Flemming Nielson",
+  title =       "The {TML}-Approach to Compiler-Compilers",
+  type =        "Technical Report",
+  number =      "88-47",
+  institution =      "Technical University of Denmark",
+  address =     "Lyngby, Denmark",
+  year =        "1988"
+}
+
+@InProceedings{nielson:89,
+  author =      "Nielson, Hanne Riis and Flemming Nielson",
+  title =       "Tranformations on Higher-Order Functions",
+  booktitle =   "FPCA'89, 4$^{th}$ International Conf. on Functional Programming
+                 Languages and Computer Architecture",
+  pages   =     "129-143",
+  year =        "1989"
+}
+
+@InProceedings{nielson:90,
+  author =      "Nielson, Hanne Riis and Flemming Nielson",
+  title =       "Eureka Definitions for Free! or
+                 Disagreement Points for fold/unfold transformations",
+  booktitle =   "ESOP'90, 3$^{rd}$ European Symposium on Programming",
+  year =        "1990",
+  editor =      "Jones, N. D.",
+  volume =      "432",
+  pages =       "291-305",
+  series =      lncs,
+  publisher =   sv
+}
+
+@Article{partsch-steinbruggen:83,
+  author =      "H. Partsch and R. Steinbr{\"{u}}ggen",
+  title =       "Program Transformation Systems",
+  journal =     "ACM Computing Surveys",
+  year =        "1983",
+  volume =      "15",
+  number =      "3",
+  pages =       "199-236"
+}
+
+@PhdThesis{paulson:81,
+  author =      "L. Paulson",
+  title =       "A Compiler Generator for Semantic Grammars",
+  school =      "Stanford University",
+  year =        "1981",
+  address =     "Stanford, California",
+  note =        "Report No. STAN-CS-81-893"
+}
+
+@InProceedings{paulson:82,
+  author =      "L. Paulson",
+  title =       "A Semantics-Directed Compiler Generator",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  pages =       "224-233",
+  year =        "1982",
+}
+
+@InProceedings{pepper:84,
+  author =      "P. Pepper",
+  title =       "Inferential techniques for program development",
+  booktitle =   "Program Transformation and Programming Environments",
+  year =        "1984",
+  editor =      "P. Pepper",
+  pages =       "275-290",
+  volume =      "F8",
+  publisher =   sv
+}
+
+@Book{pemc:88,
+  title =       "Partial Evaluation and Mixed Computation",
+  publisher =   nh,
+  year =        "1988",
+  editor =      "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D."
+}
+
+@InProceedings{pebib,
+  author =      "P. Sestoft and Zamulin, A. V.",
+  title =       "Annotated Bibliography on Partial Evaluation and Mixed
+                 Computation",
+  booktitle =   "Partial Evaluation and Mixed Computation",
+  year =        "1988",
+  editor =      "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D.",
+  publisher =   nh
+}
+
+@TechReport{pebib:90,
+  author =      "P. Sestoft",
+  title =       "Annotated Bibliography on Partial Evaluation and Mixed
+                 Computation",
+  institution = "University of Copenhagen",
+  year =        "1990",
+  type =        "Diku Report",
+  address =     "Copenhagen, Denmark"
+}
+
+@Book{peyton-jones:87,
+  author =      "Peyton Jones, Simon L.",
+  title =       "The Implementation of Functional Programming Languages",
+  publisher =   ph,
+  year =        "1987",
+  editor =      "Hoare, C. A. R.",
+  series =      "Computer Science"
+}
+
+@TechReport{peyton-jones2:87,
+  author =      "Peyton Jones, Simon L.",
+  title =       "{FLIC} -- a Functional Language Intermediate Code",
+  institution = "University College London",
+  year =        "1990",
+  type =        "Internal Note 2048",
+  address =     "London, UK"
+}
+
+@InProceedings{pleban:87,
+  author =      "U. Pleban",
+  title =       "Semantics-Directed Compiler Generation",
+  booktitle =   "ACM Symposium on Principles of Programming Languages",
+  year =        "1987",
+  note =        "Tutorial"
+}
+
+@InProceedings{reynolds:69,
+  author =      "J. Reynolds",
+  title =       "Automatic computation of data set definitions",
+  booktitle =   "Information Processing",
+  year =        "1969",
+  editor =      nh,
+  pages =       "456-61"
+}
+
+@InProceedings{reynolds:72,
+  author =      "J. Reynolds",
+  title =       "Definitional interpreters for higher order
+                 programming languages",
+  booktitle =   "ACM National Conf.",
+  pages =       "717-740",
+  year =        "1971"
+}
+
+@InProceedings{reynolds:81,
+  author =      "J. Reynolds",
+  title =       "The essence of {A}lgol",
+  booktitle =   "International Symposium on Algorithmic Languages",
+  pages =       "345-372",
+  year =        "1981",
+  editor =      "Van Vliet",
+  publisher =   nh
+}
+
+@InProceedings{romanenko:88,
+  author =      "Romanenko, S. A.",
+  title =       "A Compiler Generator Produced by a Self-applicable
+                 Specializer Can Have a Surprisingly Natural and
+                 Understandable Structure",
+  booktitle =   "Partial Evaluation and Mixed Computation",
+  year =        "1988",
+  editor =      "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D.",
+  publisher =   nh
+}
+
+@Article{r3rs,
+  author =      "J. Rees and W. Clinger",
+  title =       "Revised$^3$ Report on the Algorithmic Language {S}cheme",
+  journal =     "SIGPLAN Notices",
+  year =        "1986",
+  volume =      "21",
+  number =      "12",
+  pages =       "37--79"
+}
+
+@MastersThesis{safra:90,
+  author =      "S. Safra",
+  title =       "Partial Evaluation of Concurrent Prolog and Its Implications",
+  school =      "Weizmann Institute of Science",
+  year =        "1990",
+  address =     "Israel"
+}
+
+@Article{schmidt:85,
+  author =      "Schmidt, D. A.",
+  title =       "Detecting Global Variables in Denotational Specification",
+  journal =     "ACM Transactions on Programming Languages and Systems",
+  year =        "1985",
+  pages =       "299-310",
+  volume =      "7",
+  number =      "2"
+}
+
+@Book{schmidt:86,
+  author =      "Schmidt, D. A.",
+  title =       "Denotational Semantics: a Methodology for Language
+                 Development",
+  publisher =   ab,
+  year =        "1986"
+}
+
+@TechReport{sestoft2:85,
+  author =      "P. Sestoft",
+  title =       "The Structure of a Self-Applicable Partial Evaluator",
+  institution =         "University of Copenhagen",
+  year =        "1985",
+  type =        "Diku Report (extended version of \cite{sestoft:85})",
+  number =      "85/11",
+  address =     "Copenhagen, Denmark"
+}
+
+@InProceedings{sestoft:85,
+  author =      "P. Sestoft",
+  title =       "The Structure of a Self-Applicable Partial Evaluator",
+  booktitle  =  "{\rm \cite{ganzinger-jones:85}}",
+  pages =       "236-256"
+}
+
+@InProceedings{sestoft:88,
+  author =      "P. Sestoft",
+  title =       "Automatic Call Unfolding in a Partial Evaluator",
+  booktitle =   "Partial Evaluation and Mixed Computation",
+  year =        "1988",
+  editor =      "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D.",
+  publisher =   nh
+}
+
+@MastersThesis{sestoft-m:88,
+  author =      "P. Sestoft",
+  title =       "Replacing function parameters by global variables",
+  school =      "Diku, University of Copenhagen",
+  year =        "1989",
+  address =     "Copenhagen, Denmark"
+}
+
+@InProceedings{sestoft:89,
+  author =      "P. Sestoft",
+  title =       "Replacing function parameters by global variables",
+  booktitle =   "FPCA'89, 4$^{th}$ International Conf. on Functional Programming
+                 Languages and Computer Architecture",
+  pages =       "39-53",
+  year =        "1989"
+}
+
+@Book{stoy:77,
+  author =      "J. Stoy",
+  title =       "Denotational Semantics: the {S}cott-{S}trachey approach to
+                 programming languages theory",
+  publisher =   "{MIT} Press",
+  year =        "1977"
+}
+
+@Misc{stransky:88,
+  author =      "Jan Stransky",
+  title =       "Analyse s\'emantique de structures de donn\'ees
+                 dynamiques avec application au cas particulier de
+                 langages LISPiens.",
+  howpublished =        "Universit\'e de Paris-Sud Centre d'Orsay",
+  year =        "1988",
+  note =        "Th\`ese de doctorat de troisi\`eme cycle"
+}
+
+@MastersThesis{steele:78,
+  author =      "Steele, G. L.",
+  title =       "Rabbit: A Compiler for Scheme",
+  school =      "M.I.T (A.I. LAB.)",
+  year =        "1978",
+  address =     "Massachusetts, U.S.A"
+}
+
+@Manual{T,
+  author =      "Rees, J. A. and Adams, N. I. and Meehan, J. R.",
+  title =       "The {T} {M}anual",
+  Organization = "Yale University",
+  address =      "New Haven, Connecticut, USA",
+  year =        "1984",
+  note =        "Fourth edition"
+}
+
+@InProceedings{tennent:77,
+  author =      "Tennent, R. D.",
+  title =       "Language Design Methods  Based on Semantic Principles",
+  booktitle =   "Acta Informatica",
+  year =        "1977",
+  pages =       "97-112",
+  volume =      "8"
+}
+
+@Article{turchin:86,
+  author =      "Turchin, V. F.",
+  title =       "The Concept of a Supercompiler",
+  journal =     "ACM Transaction on Programming Languages and Systems",
+  year =        "1986",
+  volume =      "8",
+  number =      "3",
+  pages =       "292-325"
+}
+
+@InProceedings{venken:84,
+  author =      "R. Venken",
+  title =       "A {P}rolog Meta-Interpreter for Partial Evaluation
+                 and Its Application to Source to Source Transformation and
+                 Query-Optimisation",
+  booktitle =   "ECAI'84",
+  year =        "1988",
+  editor =      "T. O'Shea",
+  publisher =   nh
+}
+
+@Article{wand:82,
+  author =      "M. Wand",
+  title =       "Deriving target code as a representation of continuation
+                 semantics",
+  journal   =   "ACM Transactions on Programming Languages and Systems",
+  volume =      "4",
+  number =      "3",
+  pages =       "496-517",
+  year =        "1982"
+}
+
+@TechReport{wand:83,
+  author =      "M. Wand",
+  title =       "A Semantic Algebra for Logic Programming",
+  institution =     "Indiana University",
+  year =        "1983",
+  type =        "Technical Report",
+  number =      "148",
+  address =     "Bloomington, Indiana"
+}
+
+@Article{wand:84,
+  author =      "M. Wand",
+  title =       "A Semantic Prototyping System",
+  journal   =   "SIGPLAN Notices, ACM Symposium on Compiler Construction",
+  volume =      "19",
+  number =      "6",
+  pages =       "213-221",
+  year =        "1984"
+}
+
+@InProceedings{wand-wang:90,
+  author =      "M. Wand and Z. Wang",
+  title =       "Conditional Lambda-Theories and the Verification of Static
+                Properties of Programs",
+  booktitle =   "IEEE Symposium on Logic in Computer Science",
+  pages   =     "321-332",
+  year =        "1990"
+}
+
+@TechReport{warren:77,
+  author =      "D. Warren",
+  title =       "Implementing {P}rolog -- Compiling Predicate
+                 Logic Programs",
+  institution =     "University of Edinburgh",
+  year =        "1977",
+  type =        "D.A.I Research Report",
+  number =      "39 and 40",
+  address =     "Edinburgh, Scotland"
+}
+
+@InProceedings{wadler:88,
+  author =      "Philip Wadler",
+  title =       "Deforestation: Transforming programs to eliminate trees",
+  booktitle =   "ESOP'88, 2$^{nd}$ European Symposium on Programming",
+  year =        "1988",
+  editor =      "H. Ganzinger",
+  volume =      "300",
+  series =      lncs,
+  publisher =   sv
+}
+
+@PhdThesis{weis:87,
+  author =      "P. Weis",
+  title =       "Le Syst\`eme Sam: M\'etacompilation Tr\`es efficace
+                 \`a l'Aide d'Op\'erateurs S\'emantiques",
+  school =      "Universit\'e de Paris VII",
+  year =        "1987",
+  address =     "Paris, France"
+}
+
+@manual{schism,
+	author = "C. Consel",
+	title  = "The Schism Manual",
+	organization = "Yale University",
+	address = "New-Haven, USA",
+	year = 1989,
+	remarks = "a masterpiece, a colossal wark",
+	}
+
+@article {consel:insights,
+	author = "C. Consel",
+	title = "New Insights into Partial Evaluation: 
+		the {SCHISM} Experiment",
+	journal = "ESOP'88, 2nd European Symposium on Programming",
+        note = "in LNCS 300, pages 236-246",
+	year = "88"
+	}
+
+@article {cook,
+	author = "W. Cook and J. Palsberg",
+	title = "A Denotational Semantics of Inheritance and its Correctness",
+	journal = "OOPSLA 1989, SIGPLAN Notices 24:10",
+	year = "89"
+	}
+
+@incollection{friedman:expansion,
+	author = "R. Kent Dybvig and D. P. Friedman and C. T. Haynes",
+	title = "Expansion-Passing Style: A General Macro Mechanism",
+	booktitle = "Lisp and Symbolic Computation, 1",
+	pages  = "53--75",
+	publisher = "Kluwer Academic Publishers",
+	address = "Netherlands",
+	year = 1988,
+	remarks = 
+		"nice debugging and transformation ideas. 
+		hard-code the transformation using macros to the function
+		instead of dealing with a MCE.",
+	}
+
+
+@inproceedings{hudak:collecting,
+	author = "P. Hudak and J. Young",
+	title = "A Collecting Interpretation of Expressions 
+				(Without Powerdomains)",
+	booktitle = "Proc. 1988 ACM Symposium of
+			Principles of Programming Languages",
+	publisher = "ACM",
+	year = 1988,
+	remarks = "a good reference for collecting interpretation style.
+		   discusses abstracting out the standard evaluator from the
+		   instrumented semantics. a good reference for how to
+ 		   present a semantics based paper."
+	}
+
+@incollection{maio:execution,
+	author = "A. Di Maio and S. Ceri and S. Crespi Reghizzi",
+	title = " Execution Monitoring and Debugging Tool for ADA Using 
+			Relational Algebra",
+	editor = "J. G. P. Barnes and G. A. {Fisher Jr}",
+	booktitle = "Ada in use, Proceeding of the Ada International
+ 			Conf.. Paris 14-16 May 1985",
+	publisher = "Cambridge University Press",
+	year = 1985,
+	remarks = "This is an implementation report. Has a good classifications
+		of predicates (many not related to our model). Mentions that
+		predicates are often referred to as 'breakpoints'. Classify
+		actions as neutral and non-neutral. Has a nice idea to include
+		toolbox of debugging aids.  Has some nice bibliography"
+	}
+	
+
+@incollection{odonnell:debugging,
+	author = "J. T. O'Donnell and C. V. Hall",
+	title = "Debugging In Applicative Languages",
+	booktitle = "Lisp and Symbolic Computation, 1",
+	publisher = "Kluwer Academic Publishers",
+	address = "Netherlands",
+	year = 1988,
+	remarks = 
+		"contains some good examples of applicative debugging 
+		 implementations. Theme = using MCE buys you the same
+		 computational paradigm of the underlying language"
+	}
+
+@article{survey,
+	author = "B. Plattner and J. Nievergelt",
+	title = "Monitoring Program Execution: A Survey",
+	journal = "IEEE Computer",
+	year = 1981,
+	month = "November",
+	pages = "76--93",
+	remarks = "A very good reference for terminology. A good conceptual
+		discussion about Monitoring activities as a whole. No model is
+		presented although design issues are extensively discussed.
+		presents the notion of predicate-action which is different from
+		our label actions. Argues that labels do not suffice for
+		monitoring purposes (I do not think so -amir). Includes some
+		good references."
+	}
+
+@incollection{safra:meta,
+	author = "S. Safra and E. Shapiro",
+	title = "Meta Interpreters for Real",
+	booktitle = "Concurrent Prolog, collected papers",
+	publisher = "MIT Press",
+	year = 1989,
+        volume = "2",
+	remarks = "Same general idea. Lacking the obviousity of MCE because
+		uses prolog. PE the program with the interpreter while 
+		we partial the MCE with 
+   		debugging specification (our higher level)."
+	}
+
+@book{shapiro:algorithmic,
+        author = "E. Shapiro",
+        title = "Algorithmic Program Debugging",
+        publisher = "MIT Press",
+        year = "1982"
+}
+
+@book{pemc,
+        author = "D. Bj{\o}rner and Ershov, A. P. and Jones, N. D.",
+        title = "Partial Evaluation and Mixed Computation",
+        publisher = "North-Holland",
+        year = "1988"
+}
+
+@book{schmidt:denotational,
+	author = "David A. Schmidt", 
+	title = "Denotational Semantics",
+	publisher = "Wm. C. Brown Publishers",
+	address = "Dubuque, Iowa",
+	year = 1986
+	}
+
+@book{stoy:denotational,
+	author = "J. E. Stoy",
+	title = "Denotational Semantics: The Scott-Strachey Approach
+                 to Programming Language Theory",
+	publisher = "MIT Press",
+	address = "Cambridge, Massachusetts",
+	year = 1977
+	}
+
+@book{gordon:denotational,
+	author = "M. J. C. Gordon",
+	title = "The Denotational Description of Programming Languages",
+	publisher = "Springer",
+	address = "Berlin",
+	year = 1979
+	}
+
+@article{balzer:exdams,
+	author = "R. M. Balzer",
+	title = "EXDAMS - EXtendable Debugging and Monitoring System",
+	journal = "Proc. of AFIPS Spring Joint Computer Conf.",
+	year = 1969,
+	volume = 34,
+	pages = "567--580",
+	remarks = "an important paper about the implementation of running 
+		  backwarks a computation by keeping efficiently relevent
+		  computation history"
+	}
+
+
+@inproceedings{odonnell:dialogues,
+	author = "J. T. O'Donnell",
+	title = "Dialogues: A Basis for Constructing Programming Environments",
+	booktitle = "ACM Symposium on Languages Issues in Programming
+		Environment",
+	year = 1985,
+	month = "June",
+	remarks = "a nice programming exercise..."
+	}
+
+@misc{sterling:composing,
+	author = "???Sterling and Lakhotia",
+	title  = "Composing Prolog Meta-Interpreters",
+	remarks = "I read it now - amir"
+	}
+
+
+@techreport{jones:mix,
+	author = "Jones, N. D. and P. Sestoft and H. Sondergaard",
+	title = "Mix: a Self-Applicable Partial Evaluator for
+		Experiments in Compiler Generation",
+	institution = "University of Copenhagen",
+	year = "1987",
+	number = "DIKU Report 87/08",
+	address = "Denmark",
+	remarks = "a good intro paper for partial evaluation and self 
+ 			applicability"
+	}
+	
+	
+@inproceedings{delisle:viewing,
+	author = "N. M. Delisle and D. E. Menicosy and M. D.
+		Schwarts",
+	title = "Viewing a Programming Environment as a Single Tool",
+	booktitle = "Proc. of the ACM SIGSOFT/SIGPLAN Software
+			Engineering Symposium on Practical Software 
+			Development Environments",
+	year = "1984",
+	month = "April",
+	note = "ACM SIGPLAN Notices, Vol 19, No. 5, May 1984",
+	remarks = "in the right direction but not formulized and
+	limited since only attach demons to identifiers and does not include
+	post and pre actions, especially overlooking the generality of
+	the method."
+	}
+
+@inproceedings{snodgrass:monitoring,
+	author = "R. Snodgrass",
+	title = "Monitoring in a Software Development Environment: A
+			Relational Approach",
+	booktitle = "Proc. ACM SIGSOFT/SIGPLAN Software
+			Engineering Symoposium on Practical Software 
+			Development Environments",
+	year = "1984",
+	month = "April",
+	day = "23--25",
+	editor = "Peter Handerson",
+	address = "Pittsburgh, Pennsylvania",
+	publisher = "ACM",
+	note = "SIGPLAN Notices, Volume 19, Number 5",
+	remarks = "good terminalogy and definitions. The main
+			theme is the use of relational database to
+			accumulate the information. Does not discuss
+			the generality of the monitor mechanism for
+			expression any monitoring activities."
+	}
+			
+@inproceedings{hall:debugging,
+	author = "Hall, C. V. and O'Donnell, J. T.",
+	title = "Debugging in a side effect free programming
+			environment",
+	booktitle = "Proc. 1985 SIGPLAN Symposium on Programming
+			Languages and Programming environments",
+	year = "1985",
+	month = "June",
+	remarks = "Discusses more the transformatin of functions
+                  to a debugged form. Uses streams and shadow
+		  variables. Uses syntactic transformations."
+   
+}
+
+@inproceedings{tolman:debugging,
+	author = "Tolmach, A. P. and Appel, A. W.",
+	title = "Debugging {Standard} {ML} Without Reverse Engineering",
+	booktitle = "Proc. 1990 ACM Conf. on Lisp and functional programming",
+	year = "1990",
+	month = "June",
+	remarks = "..."
+}
+		
+		
+@article {winder:jdb,
+	author = "R. Winder and J. Nicolson",
+	title = " JDB: An Adaptable Interface for Debugging",
+	journal = "Software-Practice and Experience",
+	year = "1988",
+	month = "March",
+	pages = "221--238",
+	volume = "18(3)",
+	remarks = "Talk about design issues, like a nice user
+			interface. Provide some good terminology. Also
+			provide a high-level frontend to existing
+			debuggers. Important: provide a good list of
+			debugger activities"
+}
+    
+@inproceedings{evans:on-line,
+	author = "Evans G. T. and Darley D. L.",
+	title = "On-line Debugging Techniques: A Survey",
+	booktitle = "Fall Joint Computer Conf.",
+	year = "1966",
+	month = "Fall",
+	remarks = "very old. believe static chekcing will replace debugging"
+}
+     
+@InProceedings{cardelli:multiple,
+  author = 	"Luca Cardelli",
+  title = 	"A semantics of multiple inheritance",
+  booktitle = 	"Proceedings Semantics of Data Types, {France}",
+  year = 	"1984",
+  editor = 	"G. Kahn and D. MacQueen and G. Plotkin",
+  pages = 	"51--68",
+  publisher = 	"Springer-Verlag",
+  note = 	"LNCS 173. Also in Information and Computation 76, 138-164(1988)"
+}
+
+@Article{cardelli-wegner:fun,
+  author = 	"Luca Cardelli and Peter Wegner",
+  title = 	"On understanding types, data abstraction and polymorphism",
+  journal = 	"Computing Survey",
+  year = 	"1985",
+  OPTvolume = 	"17",
+  OPTnumber = 	"4",
+  OPTpages = 	"471-522",
+  OPTmonth = 	"December",
+  OPTnote = 	""
+}
+
+@InProceedings{cook-mitchell:f-bound,
+  author = "P. Canning and W. Cook and W. Hill and W. Olthof and J. Mitchell",
+  title = 	"F-Bounded polyphorism for object-oriented programming",
+  booktitle = 	"Proc. of Conf. on Functional Programming Languages and
+		 Computer Architecture",
+  year = 	"1989",
+  OPTeditor = 	"",
+  OPTpages = 	"273--280",
+  OPTorganization = 	"",
+  OPTpublisher = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"",
+  OPTnote = 	""
+}
+
+@PhdThesis{cook:inheritance,
+  author = 	"William Cook",
+  title = 	"A Denotational Semantics of Inheritance",
+  school = 	"Brown University",
+  year = 	"1989",
+  OPTaddress = 	"",
+  OPTmonth = 	"",
+  OPTnote = 	""
+}
+
+@InProceedings{cook:subtype,
+author = 	"William R. Cook and Walter L. Hill and Peter S. Canning",
+  title = 	"Inheritance Is Not Subtyping",
+  booktitle = 	"Conf. Record of {ACM} Seventeenth Symposium on
+		 Principles of Programming Languages",
+  year = 	"1990",
+  OPTeditor = 	"",
+  OPTpages = 	"125--135",
+  OPTorganization = 	"",
+  OPTpublisher = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"Jan",
+  OPTnote = 	""
+}
+
+@InProceedings{wand:simple,
+  author = 	"Mitchell Wand",
+  title = 	"Complete type inference for simple objects",
+  booktitle = 	"Second Annual IEEE Symp. on Logic in Computer Science",
+  year = 	"1987",
+  OPTeditor = 	"",
+  OPTpages = 	"37--44",
+  OPTorganization = 	"",
+  OPTpublisher = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"June",
+  OPTnote = 	""
+}
+
+@TechReport{wand:single,
+  author = 	"Mitchell Wand",
+  title = 	"Type inference for objects with instance variables and inheritance",
+  institution = "Computer Science, Northeastern University",
+  year = 	"1988",
+  OPTtype = 	"",
+  OPTnumber = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"November",
+  OPTnote = 	"NU-CCS-89-2"
+}
+
+@InProceedings{wand:multiple,
+  author = 	"Mitchell Wand",
+  title = 	"Type inference for record concatenation and multiple inheritance",
+  booktitle = 	"Fourth Annual IEEE Symp. on Logic in Computer Science",
+  year = 	"1989",
+  OPTeditor = 	"",
+  OPTpages = 	"92--97",
+  OPTorganization = 	"",
+  OPTpublisher = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"June",
+  OPTnote = 	""
+}
+
+@InProceedings{jategaonkar:ml,
+  author = 	" Lalita A. Jategaonkar and John C. Mitchell",
+  title = 	"ML with extended pattern matching and subtypes",
+  booktitle = 	"Proc. of the ACM Conf. on Lisp and Functional Programming",
+  year = 	"1988",
+  OPTeditor = 	"",
+  OPTpages = 	"198--211",
+  OPTorganization = 	"",
+  OPTpublisher = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"July",
+  OPTnote = 	""
+}
+
+@InProceedings{ohori-buneman:db,
+  author = 	"Atsushi Ohori and Peter Buneman",
+  title = 	"Type inference in a database programming language",
+  booktitle = 	"Proc. of the ACM Conf. on Lisp and Functional Programming",
+  year = 	"1988",
+  OPTeditor = 	"",
+  OPTpages = 	"174--183",
+  OPTorganization = 	"",
+  OPTpublisher = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"July",
+  OPTnote = 	""
+}
+
+@InProceedings{remy:popl89,
+  author = 	"Didier R\'emy",
+  title = 	"Typechecking records and variants in a natural extension of ML",
+  booktitle = 	"Sixteenth Annual ACM Symp. on Principles of Programming Languages",
+  year = 	"1989",
+  OPTeditor = 	"",
+  OPTpages = 	"242--249",
+  OPTorganization = 	"",
+  OPTpublisher = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"January",
+  OPTnote = 	""
+}
+
+@TechReport{remy:upenn,
+  author = 	"Didier R\'emy",
+  title = 	"Type inference for records in a natural extension of ML",
+  institution = "Dept. of Computer and Information Science, Univ. of Pennsylvania",
+  year = 	"1989",
+  OPTtype = 	"",
+  OPTnumber = 	"",
+  OPTaddress = 	"",
+  OPTmonth = 	"",
+  OPTnote = 	"Technical Report MS-CIS-90-73"
+}
+
+@misc{cs421
+    ,author={Hudak, P.}
+    ,title={{C}ourse {N}otes {CS}421: {C}ompilers and {I}nterpreters}
+    ,note={Unpublished}
+    ,month=Sep
+    ,year=1990
+    }
+
+@misc{blenkohudak90pre
+    ,author={Blenko, T. and Hudak, P.}
+    ,title={A Framework for Reasoning about Abstract Interpretations}
+    ,note={Submitted to Conf. on Mathematical Foundations
+           of Programming Language Semantics}
+    ,month=Oct
+    ,year=1990
+    }
+
+@techreport{sundarhudak90TR
+    ,author={Sundaresh, R.S. and Hudak, P.}
+    ,title={A Theory of Incremental Computation and its Application}
+    ,institution="Yale University, Department of Computer Science"
+    ,month=Mar
+    ,type="Research Report"
+    ,number="YALEU/DCS/RR770"
+    ,year=1990
+    }
+
+@inproceedings{sundarhudak91
+    ,author={Sundaresh, R.S. and Hudak, P.}
+    ,title={Incremental Computation via Partial Evaluation}
+    ,booktitle={Proceedings 18th Symposium on Principles of Programming
+           Languages}
+    ,organization={ACM}
+    ,month=Jan
+    ,year=1991
+    ,pages={1-13}
+    }
+ 
+@inproceedings{wadler90b
+    ,author={Wadler, Philip}
+    ,title={Comprehending Monads}
+    ,booktitle={Proceedings of Symposium on Lisp and Functional Programming}
+    ,organization={ACM}
+    ,month=Jun
+    ,year=1990
+    ,pages={61-78}
+    ,address={Nice, France}
+    }
+
+@inproceedings{jonessondergaard87
+    ,author="Jones, N. and Sondergaard, H."
+    ,title="A semantics-based framework for the abstract interpretation
+            of {Prolog}"
+    ,booktitle="Abstract Interpretation of Declarative Languages"
+    ,editors="Abramsky, S. and Hankin, C."
+    ,pages="123-142"
+    ,year=1987
+    ,publisher="Ellis Horwood"
+    }
+
+@inproceedings{mellish87
+    ,author="Mellish, C."
+    ,title="Abstract interpretation of {PROLOG} programs"
+    ,booktitle="Abstract Interpretation of Declarative Languages"
+    ,editors="Abramsky, S. and Hankin, C."
+    ,pages="181-198"
+    ,year=1987
+    ,publisher="Ellis Horwood"
+    }
+
+@inproceedings{bloss89
+    ,author={Bloss, A.}
+    ,title={Update Analysis and the Efficient Implementation of
+            Functional Aggregates}
+    ,booktitle={Proceedings of 4th International Conf. on Functional
+                Programming Languages and Computer Architecture}
+    ,organization={ACM, IFIP}
+    ,year=1989
+    ,pages={26-38}
+    }
+
+@phdthesis{mouphd
+    ,author={Mou, Z.G.}
+    ,title={A Formal Model for Divide-and-Conquer and Its Parallel
+            Realization}
+    ,school="Yale University, Department of Computer Science"
+    ,year=1990
+    ,month=May
+    }
+
+@inproceedings{andersonhudak90
+    ,author={Anderson, S. and Hudak, P.}
+    ,title={Compilation of {H}askell Array Comprehensions
+        for Scientific Computing}
+    ,booktitle={ACM SIGPLAN Conf. on Programming Language Design
+        and Implementation}
+    ,year=1990
+    ,month=Jun
+    ,pages={137-149}
+    }
+
+@techreport{varmahudak89,
+	author = "Varma, P. and Hudak, P.",
+	title = "Memo-Functions in {ALFL}",
+	institution = "Yale University Department of Computer Science",
+	year = 1989,
+	month = "December",
+	number = "YALEU/DCS/RR-759"
+}
+
+@InProceedings{consel4:90,
+  author =      "Consel, C.",
+  title = "Binding time analysis for higher order untyped functional
+          languages",
+  booktitle =   "Proc. 1990 {ACM} {S}ymposium on 
+                 {L}isp and {F}unctional {P}rogramming",
+  year =        "1990",
+  note = "To appear"
+}
+
+@inproceedings{guzmanhudak90
+    ,author={Guzm\'an, J. and Hudak, P.}
+    ,title={Single-Threaded Polymorphic Lambda Calculus}
+    ,booktitle={Proceedings of Symposium on Logic in Computer Science}
+    ,organization={IEEE}
+    ,month=Jun
+    ,year=1990
+    ,pages={333-343}
+    }
+
+@misc{hudakguzman90
+    ,author={Hudak, P. and Guzm\'an, J.}
+    ,title={Taming Side Effects with a Single-Threaded Type System}
+    ,note={in preparation}
+    ,address={Yale University, Department of Computer Science}
+    ,year=1990
+    }
+
+@inproceedings{mohretal90
+    ,author={Mohr, E. and Kranz, D. and Halstead, R.}
+    ,title={Lazy Task Creation: A Technique for
+            Increasing the Granularity of Parallel Programs}
+    ,booktitle={Proceedings of Symposium on Lisp and Functional Programming}
+    ,organization={ACM}
+    ,month=Jun
+    ,year=1990
+    ,pages={185-197}
+    ,address={Nice, France}
+    }
+
+@inproceedings{felleisen87
+    ,key={felleisen}
+    ,author={Felleisen, M.}
+    ,title={{$\lambda$-v-CS}: An Extended $\lambda$-Calculus for {S}cheme}
+    ,booktitle={Proc. 1988 ACM Conf. on
+                Lisp and Functional Programming}
+    ,organization={ACM}
+    ,year=1988
+    ,pages={72-85}
+    }
+ 
+@inproceedings{mitchell84
+    ,author={Mitchell, J.C.}
+    ,title={Coercion and Type Inference}
+    ,booktitle={Proceedings of 11th ACM Symposium 
+                on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,pages={175-185}
+    }
+
+@article{fuhmishra89a
+    ,key={fuh}
+    ,author={Fuh, Y-C. and Mishra, P.}
+    ,title={Type Inference with Subtypes}
+    ,journal={Theoretical Computer Science}
+    ,volume={}
+    ,year=1987
+    ,pages=""
+    }
+
+@techreport{kuomishra89
+    ,key={kuo}
+    ,author={Kuo, T-M. and Mishra, P.}
+    ,title={Strictness Analysis: A New Perspective Based on Type Inference}
+    ,institution="The State University of New York at Stony Brook"
+    ,number="89/13"
+    ,year=1989
+    }
+
+@inproceedings{fuhmishra89b
+    ,key={fuh}
+    ,author={Fuh, Y-C. and Mishra, P.}
+    ,title={Polymorphic Subtype Inference: Closing the Theory-Practice Gap}
+    ,booktitle={Proceedings of TAPSOFT 89}
+    ,year=1989
+    ,publisher={Springer-Verlag LNCS (to appear)}
+    }
+
+@misc{wadler89a
+    ,author={Wadler, Philip}
+    ,title={Linear Types Can Change the World!}
+    ,note={Draft, presented at WG2.8 Workshop on Functional Programming}
+    ,address={Mystic, CT}
+    ,year=1989
+    ,month=May
+    }
+
+@misc{wadler90a
+    ,author={Wadler, Philip}
+    ,title={Linear Types Can Change the World!}
+    ,note={Presented at IFIP TC 2 Working Conf. on
+           Programming Concepts and Methods}
+    ,address={Sea of Galilee, Israel}
+    ,year=1990
+    ,month=Apr
+    }
+
+@techreport{gifford87
+    ,key={gifford}
+    ,author={Gifford, D.K.}
+    ,title={FX-87 Reference Manual}
+    ,institution="MIT"
+    ,number="LCS TR-409"
+    ,year=1987
+    ,month=Sept
+    }
+
+@phdthesis{eekelen88
+    ,key={eekelen}
+    ,author={Eekelen, M.C.J.D. van}
+    ,title={Parallel Graph Rewriting --- Some Contribution to its Theory,
+            its Implementation and its Applications}
+    ,school="University of Nijmegen"
+    ,year=1988
+    ,month=Dec
+    }
+
+@techreport{haskell1
+    ,author="Hudak, P. and Wadler (editors), P."
+    ,title="Report on the {P}rogramming {L}anguage {H}askell, 
+           {A} {N}on-strict {P}urely {F}unctional {L}anguage ({V}ersion 1.0)"
+    ,institution="Yale University, Department of Computer Science"
+    ,month=Apr
+    ,year=1990
+    ,number="YALEU/DCS/RR777"
+    }
+
+@techreport{haskell2
+    ,author="Hudak, P. and Peyton Jones, Simon L. and Wadler (editors), P."
+    ,title="Report on the {P}rogramming {L}anguage {H}askell, 
+           {A} {N}on-strict {P}urely {F}unctional {L}anguage ({V}ersion 1.1)"
+    ,institution="Yale University, Department of Computer Science"
+    ,month=Aug
+    ,year=1991
+    ,number="YALEU/DCS/RR777"
+    }
+
+@article{haskell-sigplan
+    ,author="Hudak, Paul and Peyton Jones, Simon L. and Wadler (editors), Philip"
+    ,title="Report on the {P}rogramming {L}anguage {H}askell, 
+           {A} {N}on-strict {P}urely {F}unctional {L}anguage ({V}ersion 1.2)"
+    ,journal="ACM SIGPLAN Notices"
+    ,volume=27
+    ,number=5
+    ,month=May
+    ,year=1992
+    }
+
+@article{haskell
+    ,author="Hudak, Paul and Peyton Jones, Simon L. and Wadler (editors), Paul"
+    ,title="Report on the {P}rogramming {L}anguage {H}askell, 
+           {A} {N}on-strict {P}urely {F}unctional {L}anguage ({V}ersion 1.2)"
+    ,journal="ACM SIGPLAN Notices"
+    ,volume=27
+    ,number=5
+    ,month=May
+    ,year=1992
+    }
+
+@article{blos88b
+    ,author={Bloss, A. and Hudak, P. and Young, J.}
+    ,title={An Optimizing Compiler for a Modern Functional Language}
+    ,journal={The Computer Journal}
+    ,volume=31
+    ,number=6
+    ,year=1988
+    ,pages={152-161}
+    }
+ 
+@inproceedings{mul-t
+    ,author={Kranz, D.A. and Halstead, R.H. and Mohr, E.}
+    ,title={Mul-{T}: A High-Performance Parallel {L}isp}
+    ,booktitle={Proceedings of 1989 SIGPLAN Conf. on 
+                Programming Language Design and Implementation}
+    ,organization={ACM/SIGPLAN}
+    ,year=1989
+    ,month=Jun
+    ,pages={81-90}
+    }
+ 
+@inproceedings{hudakchapter91
+    ,author={Hudak, P.}
+    ,title={Para-functional Programming in {H}askell}
+    ,booktitle={Parallel Functional Languages and Compilers}
+    ,editors={Szymanski, B.K.}
+    ,year=1991
+    ,publisher={ACM Press (New York) and Addison-Wesley (Reading)}
+    ,chapter={5}
+    ,pages={159-196}
+    }
+
+@misc{huda89c
+    ,author={Hudak, P. and Guzm\'an, J.}
+    ,title={On Expressing the Mutation of State in a Functional
+            Programming Language}
+    ,note={presented at WG2.8 Workshop on Functional Programming}
+    ,address={Mystic, CT}
+    ,year=1989
+    ,month=May
+    }
+
+@inproceedings{wadl85b
+    ,key={wadler}
+    ,author={Wadler, P.}
+    ,title={Listlessness is Better Than Laziness II:
+        Composing listless functions}
+    ,booktitle={LNCS 217: Programs as Data Objects}
+    ,pages={282-305}
+    ,publisher={Springer-Verlag}
+    ,year=1985
+    } 
+
+@InProceedings{darlingtonwhile87
+    ,author={Darlington, J. and While, L.}
+    ,title={Controlling the Behavior of Functional Language Systems}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer-Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={278-300}
+    }
+
+@techreport{hughes85
+    ,author={Hughes, R.J.M.}
+    ,title={An Efficient Implementation of Purely Functional Arrays}
+    ,institution={Programming Methodology Group, 
+                  Chalmers University of Technology}
+    ,year=1985
+    }
+ 
+@inproceedings{holmstrom83
+    ,author={Holmstrom, S.}
+    ,title={How to Handle Large Data Structures in Functional Languages}
+    ,booktitle={Proc.~of SERC/Chalmers Workshop on 
+                Declarative Programming Languages}
+    ,year=1983
+    }
+ 
+@techreport{aasaetal87
+    ,author={Aasa, A. and Holmstrom, S. and Nilsson, C.}
+    ,title={An Efficiency Comparison of Some Representations of
+            Purely Functional Arrays}
+    ,institution={Programming Methodology Group, 
+                  Chalmers University of Technology}
+    ,number=33
+    ,month=May
+    ,year=1987
+    }
+ 
+@phdthesis{mullin88
+    ,author={Mullin, L.R.}
+    ,title={A Mathematics of Arrays}
+    ,school={Computer and Information Science and CASE Center, 
+             Syracuse University}
+    ,year=1988
+    ,month=Dec
+    }
+ 
+@techreport{ande89
+    ,author="Anderson, S. and Hudak, P."
+    ,title="Efficient Compilation of {H}askell Array Comprehensions"
+    ,institution="Yale University, Department of Computer Science"
+    ,month=Mar
+    ,type="Research Report"
+    ,number="YALEU/DCS/RR693"
+    ,year=1989
+    }
+
+@InProceedings{lucassengifford88
+    ,key={lucassen}
+    ,author={Lucassen, J.M. and Gifford, D.K.}
+    ,title={Polymorphic Effect Systems}
+    ,booktitle={Proceedings of 15th ACM Symposium 
+                on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1988
+    ,pages={47-57}
+    }
+
+@InProceedings{giffordlucassen86
+    ,Key={gifford}
+    ,Author={Gifford, D.K. and Lucassen, J.M.}
+    ,Title={Integrating Functional and Imperative Programming}
+    ,Booktitle={Proceedings~1986 ACM Conf. on
+                Lisp and Functional Programming}
+    ,Organization={ACM SIGPLAN/SIGACT/SIGART}
+    ,Year=1986
+    ,Month=Aug
+    ,Pages={28-38}
+    }
+
+@misc{hancock87inpeyt87
+    ,author={Hancock, P.}
+    ,title={Polymorphic Type-Checking}
+    ,note={Chapters 8 and 9 in \cite{peyt87}}
+    }
+
+@misc{wadler87inpeyt87
+    ,author={Wadler, P.}
+    ,title={Efficient Compilation of Pattern-Matching}
+    ,note={Chapter 5 in \cite{peyt87}}
+    }
+
+@article{burton88
+    ,author={Burton, F.W.}
+    ,title={Nondeterminism with Referential Transparency in Functional 
+            Programming Languages}
+    ,journal={The Computer Journal}
+    ,year=1988
+    ,volume=31
+    ,number=3
+    ,pages={243-247}
+    }
+
+@phdthesis{tofte88
+    ,key={tofte}
+    ,author={Tofte, M}
+    ,title={Operational Semantics and Polymorphic Type Inference}
+    ,school={University of Edinburgh, 
+             Department of Computer Science (CST-52-88)}
+    ,year=1988
+    ,month=May
+    }
+ 
+@InProceedings{berry78
+    ,key={berry}
+    ,author={Berry, Gerard}
+    ,title={S\'{e}quentialit\'{e} de l'\'{e}valuation formelle des 
+            $\lambda$-expressions}
+    ,booktitle={Proceedings 3-e Colloque International sur la Programmation}
+    ,year=1978
+    ,month=Mar
+    }
+
+@phdthesis{girard72
+    ,key={girard}
+    ,author={Girard, J.-Y.}
+    ,title={Interpr\'{e}tation Fonctionelle et Elimination des Coupures
+            dans l'Arithm\'{e}tique d'Ordre Sup\'{e}rieur}
+    ,school={Univ. of Paris}
+    ,year=1972
+    }
+ 
+@book{wegner68
+    ,key={wegner}
+    ,author={Wegner, P.}
+    ,title={Programming Languages, Information Structures, and Machine Organization}
+    ,publisher={McGraw-Hill}
+    ,year=1968
+    }
+
+@InProceedings{reynolds85
+    ,key={reynolds}
+    ,author={Reynolds, J.C.}
+    ,title={Three Approaches to Type Structure}
+    ,booktitle={Mathematical Foundations of Software Development}
+    ,publisher={Springer-Verlag LNCS 185}
+    ,year=1985
+    ,month=Mar
+    ,pages={97-138}
+    }
+
+@book{wikstrom88
+    ,key={wikstrom}
+    ,author={Wikstr$\ddot{o}$m, A.}
+    ,title={Functional Programming Using Standard ML}
+    ,publisher={Prentice-Hall}
+    ,year=1987
+    }
+
+@techreport{tui
+        ,key="boutel"
+        ,author="Boutel, B.E."
+        ,title="Tui Language Manual"
+        ,institution="Victoria University of Wellington, 
+                      Department of Computer Science"
+        ,number="CSD-8-021"
+        ,year=1988
+        }
+
+@techreport{orwell
+        ,key="Wadler"
+        ,author="Wadler, P. and Miller, Q."
+        ,title="An Introduction to Orwell"
+        ,institution="Programming Research Group, Oxford University"
+        ,year=1988
+        ,note="(First version, 1985.)"
+        }
+
+@InProceedings{grip87
+    ,key={peytonjones}
+    ,author={Peyton Jones, Simon L. and Clack, C. and Salkild, J. and Hardie, M.}
+    ,title={{GRIP}---A High-performance Architecture for Parallel Graph Reduction} 
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer-Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={98-112}
+    }
+
+@InProceedings{watsonwatson87
+    ,key={watson}
+    ,author={Watson, P. and Watson, I.}
+    ,title={Evaluating Functional Programs on the {FLAGSHIP} machine}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer-Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={80-97}
+    }
+
+@InProceedings{burnetal88
+    ,Key={burn}
+    ,Author={Burn, G.L. and Peyton Jones, Simon L. and Robson, J.D.}
+    ,Title={The Spineless {G}-Machine}
+    ,Booktitle={Proceedings~1988 ACM Conf. on Lisp and Functional Programming}
+    ,Organization={ACM SIGPLAN/SIGACT/SIGART}
+    ,Year=1988
+    ,Month=Aug
+    ,Address={Salt Lake City, Utah}
+    ,Pages={244-258}
+    }
+
+@techreport{huda89b
+        ,key="Hudak"
+        ,author="Hudak, P. and Sundaresh, R."
+        ,title="On the Expressiveness of Purely Functional {I/O} Systems"
+        ,institution="Yale University, Department of Computer Science"
+        ,month=Feb
+        ,number="YALEU/DCS/RR-665"
+        ,year=1989
+        }
+
+@InProceedings{kaes88
+    ,key={kaes}
+    ,author={Kaes, S.}
+    ,title={Parametric Polymorphsim}
+    ,booktitle={Proc. 2nd Eupropean Symposium on Programming}
+    ,month=Mar
+    ,year=1988
+    ,publisher={Springer-Verlag LNCS 300}
+    }
+
+@InProceedings{wadlerblott89
+    ,key={wadler}
+    ,author={Wadler, P. and Blott, S.}
+    ,title={How to Make {\em ad hoc} Polymorphism Less {\em ad hoc}}
+    ,booktitle={Proceedings of 16th ACM Symposium 
+                on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1989
+    ,pages={60-76}
+    }
+
+@article{tuperlis86
+    ,key={tuperlis}
+    ,author={Tu, H-C. and Perlis, A.J.}
+    ,title={{FAC}: A Functional {APL} Language}
+    ,journal={IEEE Software}
+    ,volume=3
+    ,number=1
+    ,year=1986
+    ,month=Jan
+    ,pages={36-45}
+    }
+
+@article{fortuneetal85
+    ,key={fortune}
+    ,author={Fortune, S. and Leivant, D. and O'Donnell, M.}
+    ,title={The Expressiveness of Simple and Second-Order Type Structures}
+    ,journal={JACM}
+    ,volume=30
+    ,number=1
+    ,year=1985
+    ,month=Jan
+    ,pages={151-185}
+    }
+
+@techreport{daisy
+    ,key={johnson}
+    ,author={Johnson, S.D.}
+    ,title={Daisy Programming Manual}
+    ,institution={Indiana University Computer Science Department}
+    ,year=1988
+    ,note={(in progress, draft available on request)}
+    }
+ 
+@book{fieldharrison88
+    ,key={field}
+    ,author={Field, A.J. and Harrison, P.G.}
+    ,title={Functional Programming}
+    ,publisher={Adison-Wesley}
+    ,address={Workingham, England}
+    ,year=1988
+    }
+
+@inproceedings{henderson82a
+    ,author={Henderson, P.}
+    ,title={Purely Functional Operating Systems}
+    ,booktitle={Functional Programming and Its Applications:
+                An Advanced Course}
+    ,editors={Darlington, J. and Henderson, P. and Turner, D.A.}
+    ,pages={177-192}
+    ,year=1982
+    ,publisher={Cambridge University Press}
+    }
+
+@InProceedings{appelmacqueen87
+    ,author={Appel, A.W. and MacQueen, D.B.}
+    ,title={A Standard {ML} Compiler}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer-Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={301-324}
+    }
+
+@book{degrootlindstrom85
+    ,title={Functional and Logic Programming}
+    ,author={Degroot, D. and Lindstrom, G.}
+    ,year=1985
+    ,publisher={Prentice-Hall}
+    }
+ 
+@book{milnestrachey76
+    ,key={milne}
+    ,author={Milne, R.E. and Strachey, C.}
+    ,title={A Theory of Programming Language Semantics}
+    ,publisher={Chapman and Hall, London, and John Wiley, New York}
+    ,year=1976
+    }
+ 
+@article{hindley69
+    ,key={hindley}
+    ,author={Hindley, J. Roger}
+    ,title={The Principal Type Scheme of an Object in Combinatory Logic}
+    ,journal={Transactions of the American Mathematical Society}
+    ,volume=146
+    ,year=1969
+    ,month=Dec
+    ,pages={29-60}
+    }
+ 
+@article{blos88
+    ,key={blosshudak}
+    ,author={Bloss, A. and Hudak, P. and Young, J.}    
+    ,title={Code Optimizations for Lazy Evaluation}
+    ,journal={Lisp and Symbolic Computation: An International Journal}
+    ,year=1988
+    ,volume=1
+    ,number=2
+    ,month=Sep
+    ,pages={147-164}
+    }
+
+@phdthesis{wadsworth71
+    ,key={wadsworth}
+    ,author={Wadsworth, C.P.}
+    ,title={Semantics and Pragmatics of the Lambda Calculus}
+    ,school={Oxford University}
+    ,year=1971
+    }
+ 
+@techreport{hughes84
+    ,key={hughes}
+    ,author={Hughes, R.J.M.}
+    ,title={Why Functional Programming Matters}
+    ,institution={Programming Methodology Group, 
+                  Chalmers University of Technology}
+    ,number={16}
+    ,month=Nov
+    ,year=1984
+    }
+ 
+@techreport{wadler87
+    ,key={wadler}
+    ,author={Wadler, P.}
+    ,title={Views: A Way for Pattern-Matching to Cohabit with Data Abstraction}
+    ,institution={Programming Methodology Group, 
+                  Chalmers University of Technology}
+    ,number={34}
+    ,month=Mar
+    ,year=1987
+    ,note={Preliminary version appeared in the Proc. 14th ACM
+          Symposium on Principles of Programming Languages, January 1987}
+    }
+ 
+@article{cardelliwegner85
+    ,key={cardelli}
+    ,author={Cardelli, L. and Wegner, P.}
+    ,title={On Understanding Types, Data Abstraction, and Polymorphism}
+    ,journal={Computing Surveys}
+    ,volume=17
+    ,number=4
+    ,year=1985
+    ,month=Dec
+    ,pages={471-522}
+    }
+ 
+@book{wadgeashcroft85
+    ,key={wadge}
+    ,author={Wadge, W.W. and Ashcroft, E.A.}
+    ,title={Lucid, the Dataflow Programming Language}
+    ,publisher={Academic Press}
+    ,address={London}
+    ,year=1985
+    }
+ 
+@article{ashcroftwadge77
+    ,key={ashcroft}
+    ,author={Ashcroft, E.A. and Wadge, W.W.}
+    ,title={Lucid, a Nonprocedural Language with Iteration}
+    ,journal=CACM
+    ,volume=20
+    ,year=1976
+    ,pages={519-526}
+    }
+
+@techreport{backusetal86
+    ,key={backus}
+    ,author={Backus, J. and Williams, J.H. and Wimmers, E.L.}
+    ,title={{FL} Language Manual (Preliminary Version)}
+    ,institution={IBM Almaden Research Center}
+    ,number={RJ 5339 (54809) Computer Science}
+    ,month=Nov
+    ,year=1986
+    }
+ 
+@phdthesis{tu86
+    ,key={tu}
+    ,author={Tu, H-C.}
+    ,title={{FAC}: Functional Array Calculator and its Application to {APL}
+            and Functional Programming}
+    ,school={Yale University, Department of Computer Science}
+    ,month=Apr
+    ,year=1986
+    ,note={Available as Research Report YALEU/DCS/RR-468}
+    }
+ 
+@techreport{twentel
+    ,key={kroeze}
+    ,author={Kroeze, H.J.}
+    ,title={The {TWENTEL} System (Version 1)}
+    ,institution={Department of Computer Science, University of Twente,
+                  The Netherlands}
+    ,year="1986/87"
+    }
+ 
+@book{thakkar87
+    ,key={thakkar}
+    ,editor={Thakkar, S.S.}
+    ,title={Selected Reprints on Dataflow and Reduction Architectures}
+    ,publisher={The Computer Society Press}
+    ,address={Washington, DC}
+    ,year=1987
+    }
+ 
+@article{vegdahl84
+    ,key={vegdahl}
+    ,author={Vegdahl, S.R.}
+    ,title={A Survey of Proposed Architectures for the Execution
+            of Functional Languages}
+    ,journal={IEEE Transactions on Computers}
+    ,volume="C-23"
+    ,number=12
+    ,month=Dec
+    ,year=1984
+    ,pages={1050-1071}
+    }
+ 
+@inproceedings{gordonetal78
+    ,key={gordon}
+    ,author={Gordon, M. and Milner, R. and Morris, L. and Newey, M. and
+             Wadswirth, C.}
+    ,title={A Metalanguage for Interactive Proof in {LCF}}
+    ,booktitle={Conf. Record of the Fifth Annual ACM Symposium
+                on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1978
+    ,pages={119-130}
+    }
+ 
+@phdthesis{fairbairn85
+    ,key={fairbairn}
+    ,author={Fairbairn, J.}
+    ,title={Design and Implementation of a Simple Typed Language
+            Based on the Lambda Calculus}
+    ,school={University of Cambridge}
+    ,month=May
+    ,year=1985
+    ,note={Available as Computer Laboratory TR No.\ 75}
+    }
+ 
+@techreport{mcgrawetal83
+    ,key={mcgraw}
+    ,author={McGraw, J. and Allan, S. and Glauart, J. and Dobes, I.}
+    ,title={{SISAL}: Streams and Iteration in a Single-Assignment Language,
+            Language Reference Manual}
+    ,institution={Lawrence Livermore National Laboratory, M-146}
+    ,month=Jul
+    ,year=1983
+    }
+ 
+@inproceedings{guttagetal81
+    ,key={guttaghorning}
+    ,author={Guttag, J. and Horning, J. and Williams, J.}
+    ,title={{FP} with Data Abstraction and Strong Typing}
+    ,booktitle={Proc. 1981 Conf. on Functional Programming 
+                Languages and Computer Architecture}
+    ,organization={ACM}
+    ,year=1981
+    ,pages={11-24}
+    }
+ 
+@inproceedings{turner82
+    ,key={turner}
+    ,author={Turner, D.A.}
+    ,title={Recursion Equations as a Programming Language}
+    ,booktitle={Functional Programming and Its Applications:
+                An Advanced Course}
+    ,editors={Darlington, J. and Henderson, P. and Turner, D.A.}
+    ,pages={1-28}
+    ,year=1982
+    ,publisher={Cambridge University Press}
+    }
+ 
+@inproceedings{turner81
+    ,key={turner}
+    ,author={Turner, D.A.}
+    ,title={The Semantic Elegance of Applicative Languages}
+    ,booktitle={Proc. 1981 Conf. on Functional Programming 
+                Languages and Computer Architecture}
+    ,organization={ACM}
+    ,year=1981
+    ,pages={85-92}
+    }
+
+@book{iverson62
+    ,key={iverson}
+    ,author={Iverson, K.}
+    ,title={A Programming Language}
+    ,publisher={Wiley}
+    ,address={New York}
+    ,year=1962
+    }
+ 
+@article{milner78
+    ,key={milner}
+    ,author={Milner, R.A.}
+    ,title={A Theory of Type Polymorphism in Programming}
+    ,journal={Journal of Computer and System Sciences}
+    ,volume=17
+    ,number=3
+    ,year=1978
+    ,month=Dec
+    ,pages={348-375}
+    }
+ 
+@book{birdwadler88
+    ,key={bird}
+    ,author={Bird, R. and Wadler, P.}
+    ,title={Introduction to Functional Programming}
+    ,publisher={Prentice Hall}
+    ,address={New York}
+    ,year=1988
+    }
+ 
+@article{post43
+    ,key={post}
+    ,author={Post, E.L.}
+    ,title={Formal Reductions of the General Combinatorial Decision Problem}
+    ,journal={American Journal of Mathematics}
+    ,volume=65
+    ,year=1943
+    ,pages={197-215}
+    }
+ 
+@article{markov51
+    ,key={markov}
+    ,author={Markov, A.A.}
+    ,title={Teoriya Algorifmov ({T}heory of Algorithms)}
+    ,journal={Trudy Mat. Inst. Steklov}
+    ,volume=38
+    ,year=1951
+    ,pages={176-189}
+    }
+ 
+@techreport{cartwright76
+    ,key={cartwright}
+    ,author={Cartwright, R.}
+    ,title={A Practical Formal Semantic Definition and Verification System
+            for Typed Lisp}
+    ,institution={Stanford Artifical Intelligence Laboratory AIM-296}
+    ,year=1976
+    }
+ 
+@article{gelernteretal60
+    ,key={gelernter}
+    ,author={Gelernter, H. and Hansen, J.R. and Gerberich, C.L.}
+    ,title={A {FORTRAN}-Compiled List Processing Language}
+    ,journal={JACM}
+    ,volume=7
+    ,number=2
+    ,year=1960
+    ,pages={87-101}
+    }
+ 
+@InProceedings{McCarthy62d,
+  author =       "John McCarthy",
+  title =        "Computer Programs for Checking Mathematical Proofs",
+  booktitle =    "Proceedings of Symposia in Pure Mathematics",
+  organization = "Symposia in Pure Mathematics",
+  address =      "Providencce",
+  volume =       "5",
+  note =         "AMS",
+  year =         "1962",
+}
+@inproceedings{mccarthy78
+    ,key={mccarthy}
+    ,author={McCarthy, J.}
+    ,title={History of {L}isp}
+    ,booktitle={Preprints of Proceedings of {ACM} {SIGPLAN} History of 
+                Programming Languages Conf.}
+    ,year=1978
+    ,pages={217-223}
+    ,note={Published as SIGPLAN Notices 13(8), August 1978}
+    }
+ 
+@phdthesis{petznick70
+    ,key={petznick}
+    ,author={Petznick, G.W.}
+    ,title={Combinatory Programming}
+    ,school={University of Wisconsin, Madison}
+    ,year=1970
+    ,note={Available as publication 70-24812 from University
+           Microfilms Int.}
+    }
+ 
+@article{turing36
+    ,key={turing}
+    ,author={Turing, A.M.}
+    ,title={On Computable Numbers with an Application to the 
+            Entscheidungsproblem}
+    ,journal={Proc. London Mathematical Society}
+    ,volume=42
+    ,year=1936
+    ,pages={230-265}
+    }
+ 
+@article{turing37
+    ,key={turing}
+    ,author={Turing, A.M.}
+    ,title={Computability and $\lam$-definability}
+    ,journal={Journal of Symbolic Logic}
+    ,volume=2
+    ,year=1937
+    ,pages={153-163}
+    }
+ 
+@book{curryfeys58
+    ,key={curryfeys}
+    ,author={Curry, H.B. and Feys, R.}
+    ,title={Combinatory Logic, Vol. 1}
+    ,publisher={North-Holland}
+    ,address={Amsterdam}
+    ,year=1958
+    }
+ 
+@article{curry30
+    ,key={curry}
+    ,author={Curry, H.B.}
+    ,title={Grundlagen der Kombinatorischen Logik}
+    ,journal={American Journal of Mathematics}
+    ,volume=52
+    ,year=1930
+    ,pages={509-536,789-834}
+    }
+ 
+@book{church56
+    ,key={church}
+    ,author={Church, A.}
+    ,title={Introduction to Mathematical Logic}
+    ,publisher={Princeton University Press}
+    ,address={Princeton, NJ}
+    ,year=1956
+    }
+ 
+@article{church32
+    ,key={church}
+    ,author={Church, A.}
+    ,title={A Set of Postulates for the Foundation of Logic}
+    ,journal={Annals of Mathematics}
+    ,volume=2
+    ,number={33-34}
+    ,year={1932-1933}
+    ,pages={346-366,839-864}
+    }
+ 
+@article{churchrosser36
+    ,key={church}
+    ,author={Church, A. and Rosser, J.B.}
+    ,title={Some Properties of Conversion}
+    ,journal={Transactions of the American Mathematical Society}
+    ,volume=39
+    ,year=1936
+    ,pages={472-482}
+    }
+ 
+@article{kleenerosser35
+    ,key={kleene}
+    ,author={Kleene, S.C. and Rosser, J.B.}
+    ,title={The Inconsistency of Certain Forms of Logic}
+    ,journal={Annals of Mathematics}
+    ,volume=2
+    ,number=36
+    ,year=1935
+    ,pages={630-636}
+    }
+
+@article{kleene36
+    ,key={kleene}
+    ,author={Kleene, S.C.}
+    ,title={$\lam$-definability and Recursiveness}
+    ,journal={Duke Mathematical Journal}
+    ,volume=2
+    ,year=1936
+    ,pages={340-353}
+    }
+ 
+@article{landin64
+    ,key={landin}
+    ,author={Landin, P.J.}
+    ,title={The Mechanical Evaluation of Expressions}
+    ,journal={Computer Journal}
+    ,volume=6
+    ,number=4
+    ,year=1964
+    ,month=Jan
+    ,pages={308-320}
+    }
+  
+@article{landin65
+    ,key={landin}
+    ,author={Landin, P.J.}
+    ,title={A Correspondance between {ALGOL} 60 and {C}hurch's Lambda Notation}
+    ,journal=CACM
+    ,volume=8
+    ,year=1965
+    ,pages={89-101,158-165}
+    }
+  
+@article{landin66
+    ,key={landin}
+    ,author={Landin, P.J.}
+    ,title={The Next 700 Programming Languages}
+    ,journal=CACM
+    ,volume=9
+    ,number=3
+    ,year=1966
+    ,pages={157-166}
+    }
+  
+@book{vanheijenoort67
+    ,key={vanheijenoort}
+    ,author={van Heijenoort, J.}
+    ,title={From {F}rege to {G}\"{o}del}
+    ,publisher={Harvard University Press}
+    ,address={Cambridge, MA}
+    ,year=1967
+    }
+ 
+@article{reynolds70
+    ,key={reynolds}
+    ,author={Reynolds, J.C.}
+    ,title={{GEDANKEN} -- a simple typless language based on
+            the principle of completeness and reference concept}
+    ,journal=CACM
+    ,volume=13
+    ,number=5
+    ,year=1970
+    ,pages={308-319}
+    }
+ 
+@article{tennent76
+    ,key={tennent}
+    ,author={Tennent, R.D.}
+    ,title={The Denotational Semantics of Programming Languages}
+    ,journal=CACM
+    ,volume=19
+    ,number=8
+    ,year=1976
+    ,pages={}
+    }
+ 
+@book{gordonetal79
+    ,key={gordon}
+    ,author={Gordon, M.J. and Milner, R. and Wadsworth, C.P.}
+    ,title={Edinburgh {LCF}}
+    ,publisher={Springer-Verlag LNCS 78}
+    ,address={Berlin}
+    ,year=1979
+    }
+ 
+@techreport{stoye85
+    ,key={stoye}
+    ,author={Stoye, W.}
+    ,title={A New Scheme for Writing Functional Operating Systems}
+    ,institution={University of Cambridge, Computer Laboratory}
+    ,number=56
+    ,year=1985
+    }
+
+@inproceedings{boehm85
+    ,key={boehm}
+    ,author={Boehm, H-J.}
+    ,title={Partial Polymorphic Type Inference is Undecidable}
+    ,booktitle={Proceedings of 26th Symposium on Foundations of
+                Computer Science}
+    ,pages={339-345}
+    ,month=Oct
+    ,year=1985
+    }
+
+@inproceedings{pfenning88
+    ,key={pfenning}
+    ,author={Pfenning, F.}
+    ,title={Partial Polymorphic Type Inference and Higher-Order Unification}
+    ,Booktitle={Proceedings~1988 ACM Conf. on Lisp and Functional Programming}
+    ,Organization={ACM SIGPLAN/SIGACT/SIGART}
+    ,Year=1988
+    ,Month=Aug
+    ,Address={Salt Lake City, Utah}
+    ,Pages={153-163}
+    }
+
+@article{huda89a
+    ,author={Hudak, P.}
+    ,title={Conception, Evolution, and Application of Functional
+            Programming Languages}
+    ,journal={ACM Computing Surveys}
+    ,volume=21
+    ,number=3
+    ,year=1989
+    ,pages={359-411}
+    }
+ 
+@article{mou88
+    ,author={Mou, Z.G. and Hudak, P.}
+    ,title={An Algebraic Model for Divide-and-Conquer and its Parallelism}
+    ,journal={Journal of Supercomputing}
+    ,volume=2
+    ,number=3
+    ,year=1988
+    }
+ 
+@article{girard87
+    ,author={Girard, J.-Y.}
+    ,title={Linear Logic}
+    ,journal={Theoretical Computer Science}
+    ,volume=50
+    ,year=1987
+    ,pages={1-102}
+    }
+
+@InProceedings{abadietal89
+    ,author={Abadi, Mart{\'\i}n and 
+             Cardeli, Luca and Pierce, Benjamin and Plotkin, Gordon D.}
+    ,title={Dynamic Typing in a Statically Typed Language}
+    ,booktitle={ACM Symposium on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1989
+    ,pages={213-227}
+    }
+
+@InProceedings{appel89
+    ,author={Appel, A.W. and Jim, T.}
+    ,title={Continuation-passing, Closure-passing Style}
+    ,booktitle={ACM Symposium on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1989
+    ,pages={193-302}
+    }
+
+@article{odon88
+    ,key={odonnell}
+    ,author={O'Donnell, J.T. and Hall, C.V.}
+    ,title={Debugging in Applicative Languages}
+    ,journal={Lisp and Symbolic Computation: In International Journal}
+    ,volume=1
+    ,number=2
+    ,year=1988
+    ,month=Sep
+    ,pages={113-146}
+    }
+
+@techreport{mou89
+    ,key={mou}
+    ,author={Mou, Z.G. and Anderson, S. and Hudak, P.}
+    ,title={Parallelism in Sequential Divide-and Conquer (Extended Abstract)}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-683}
+    ,month=Feb
+    ,year=1989
+    }
+
+@article{flic
+    ,key={peytonjones}
+    ,author={Peyton Jones, Simon L.}
+    ,title={{FLIC} --- a functional language intermediate code}
+    ,journal={SIGPLAN Notices}
+    ,volume=23
+    ,number=8
+    ,year=1988
+    ,pages={30-48}
+    }
+
+@techreport{darl85
+    ,key={darlington}
+    ,author={Darlington, J. and Field, A.J. and Pull, H.}
+    ,title={The unification of functional and logic languages}
+    ,institution={Department of Computing,
+                  Imperial College of Science and Technology}
+    ,month=Feb
+    ,year=1985
+    }
+
+@article{slag74
+    ,key={slagle}
+    ,author={Slagle, J.R.}
+    ,title={Automated theorem-proving for theories with simplifiers}
+    ,journal={JACM}
+    ,volume=21
+    ,number=4
+    ,year=1974
+    ,pages={622-642}
+    }
+
+@techreport{lank75
+    ,key={lankford}
+    ,author={Lankford, D.S.}
+    ,title={Canonical inference}
+    ,institution={University of Texas at Austin}
+    ,number={ATP-32}
+    ,year=1975
+    }
+
+@inproceedings{hull80
+    ,key={hullot}
+    ,author={Hullot, J-M.}
+    ,title={Canonical forms and unification}
+    ,booktitle={Conf. on Automated Deduction}
+    ,year=1980
+    ,pages={318-334}
+    }
+
+@article{warr77
+    ,key={warren}
+    ,author={Warren, D. and Pereira, L.M. and Pereira, F.}
+    ,title={Prolog --- the language and its implementation compared with Lisp}
+    ,journal={SIGPLAN Notices}
+    ,volume=12
+    ,number=8
+    ,year=1977
+    ,pages={}
+    }
+
+@inproceedings{subr84b
+    ,key={subrahmanyam}
+    ,author={Subrahmanyam, P.A. and You, J-H.}
+    ,title={FUNLOG = functions + logic: a computational model
+            integrating functional and logic programming}
+    ,booktitle={International Symposium Logic Programming}
+    ,organization={IEEE}
+    ,year=1984
+    ,pages={144-153}
+    }
+
+@inproceedings{sato83
+    ,key={sato}
+    ,author={Sato, M. and Sakurai, T.}
+    ,title={Qute: a Prolog/Lisp type language for logic programming}
+    ,booktitle={Eigth International Joint Conf. Artificial Intelligence}
+    ,year=1983
+    }
+
+@inproceedings{robi82a
+    ,key={robinson}
+    ,author={Robinson, J.A. and Sibert, E.E.}
+    ,title={LOGLISP: motivation, design and implementation}
+    ,booktitle={Logic Programming}
+    ,editors={Clark, K.L. and Tarnlund, S-A.}
+    ,pages={299-314}
+    ,year=1982
+    ,publisher={Academic Press}
+    }
+
+@inproceedings{mell84
+    ,key={mellish}
+    ,author={Mellish, C. and Hardy, S.}
+    ,title={Integrating PROLOG in the POPLOG environment}
+    ,booktitle={Implementations of PROLOG}
+    ,editors={Campbell, J.A.}
+    ,pages={147-162}
+    ,year=1984
+    ,publisher={Ellis Horwood}
+    }
+
+@inproceedings{mala84
+    ,key={malachi}
+    ,author={Malachi, Y. and Manna, Z. and Waldinger, R.}
+    ,title={TABLOG: The deductive-tableau programming language}
+    ,booktitle={Proceedings 1984 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Aug
+    ,pages={323-330}
+    }
+
+@inproceedings{lind85
+    ,key={lindstrom}
+    ,author={Lindstrom, G.}
+    ,title={Functional programming and the logical variable}
+    ,booktitle={Proceedings 11th Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1985
+    ,month=Jan
+    ,pages={266-280}
+    }
+
+@inproceedings{komo82
+    ,key={komorowski}
+    ,author={Komorowski, H.J.}
+    ,title={QLOG --- The programming environment PROLOG in LISP}
+    ,booktitle={Logic Programming}
+    ,editors={Clark, K.L. and Tarnlund, S-A.}
+    ,pages={315-323}
+    ,year=1982
+    ,publisher={Academic Press}
+    }
+
+@inproceedings{hans82
+    ,key={hansson}
+    ,author={Hansson, A. and Haridi, S. and Tarnlund, S-A.}
+    ,title={Properties of a logic programming language}
+    ,booktitle={Logic Programming}
+    ,editors={Clark, K.L. and Tarnlund, S-A.}
+    ,pages={267-280}
+    ,year=1982
+    ,publisher={Academic Press}
+    }
+
+@inproceedings{gogu84
+    ,key={goguen}
+    ,author={Goguen, J.A. and Meseguer, J.}
+    ,title={Equality, types, modules and generics for logic programming}
+    ,booktitle={Proceedings 2nd International Logic Programming Conf.}
+    ,year=1984
+    ,pages={115-125}
+    }
+
+@inproceedings{fay79
+    ,key={fay}
+    ,author={Fay, M.}
+    ,title={First-order unification in an equational theory}
+    ,booktitle={Fourth Workshop on Automated Deduction}
+    ,year=1979
+    ,pages={161-167}
+    }
+
+@inproceedings{barb85
+    ,key={barbutti}
+    ,author={Barbutti, R. and Bellia, M. and Levi, G. and Martelli, M.}
+    ,title={LEAF: A language which integrates logic, equations, and functions}
+    ,booktitle={Functional and Logic Programming}
+    ,editors={Degroot, D. and Lindstrom, G.}
+    ,pages={}
+    ,year=1985
+    ,publisher={Prentice-Hall}
+    }
+
+@inproceedings{bell82
+    ,key={bellia}
+    ,author={Bellia, M. and Degano, P. and Levi, G.}
+    ,title={Call by name semantics of a clause language with functions}
+    ,booktitle={Logic Programming}
+    ,editors={Clark, K.L. and Tarlund, S-A.}
+    ,pages={189-198}
+    ,year=1982
+    ,publisher={Academic Press}
+    }
+
+@inproceedings{redd85a
+    ,key={reddya}
+    ,author={Reddy, U.S.}
+    ,title={Narrowing as the operational semantics of functional languages}
+    ,booktitle={Submitted to International Symposium on Logic Programming}
+    ,organization={IEEE}
+    ,year=1985
+    }
+
+@inproceedings{redd85b
+    ,key={reddyb}
+    ,author={Reddy, U.S.}
+    ,title={On the relationship between logic and functional languages}
+    ,booktitle={Functional and Logic Programming}
+    ,editors={Degroot, D. and Lindstrom, G.}
+    ,pages={}
+    ,year=1985
+    ,publisher={Prentice-Hall}
+    }
+
+@inproceedings{carl84
+    ,key={carlsson}
+    ,author={Carlsson, M.}
+    ,title={On implementing Prolog in functional programming}
+    ,booktitle={International Symposium on Logic Programming}
+    ,organization={IEEE}
+    ,year=1984
+    ,month=Feb
+    ,pages={154-159}
+    }
+
+@article{huet80
+    ,key={huet}
+    ,author={Huet, G.}
+    ,title={Confluent reductions: abstract properties and applications
+            to term rewriting systems}
+    ,journal={JACM}
+    ,volume=27
+    ,number=4
+    ,year=1980
+    ,pages={797-821}
+    }
+
+@techreport{ders85
+    ,key={dershowitz}
+    ,author={Dershowitz, N.}
+    ,title={Termination of rewriting}
+    ,institution={University of Illinois, Department of Computer Science}
+    ,number={UIUCDCS-R-85-1220, UILU-ENG-85-1728}
+    ,month=Aug
+    ,year=1985
+    }
+
+@inproceedings{huet80a
+    ,key={huet}
+    ,author={Huet, G. and Oppen, D.C.}
+    ,title={Equations and rewrite rules: a survey}
+    ,booktitle={Formal Languages: Perspectives and Open Problems}
+    ,editors={Book, R.}
+    ,pages={349-405}
+    ,year=1980
+    ,publisher={Academic Press}
+    }
+
+@unpublished{aitk85
+    ,key={Ait-Kali}
+    ,author={Ait-Kali, H.}
+    ,title={R-unification}
+    ,note={(Unpublished summary)}
+    ,year=1985
+    }
+
+@techreport{rety85
+    ,key={rety}
+    ,author={Rety, P. and Kirchner, C. and Kirchner, H. and Lescanne, P.}
+    ,title={NARROWER: a new algorithm for unification and its application
+            to logic programming}
+    ,institution={Center de Recherche en Informatique de Nancy}
+    ,year=1985
+    }
+
+@techreport{pull85
+    ,key={pull}
+    ,author={Pull, H.}
+    ,title={Unification in Hope -- some theory and practice}
+    ,institution={Department of Computing,
+                  Imperial College of Science and Technology}
+    ,month=Jul
+    ,year=1985
+    }
+
+@techreport{smol85
+    ,key={smolka}
+    ,author={Smolka, G. and Panangaden, P.}
+    ,title={Fresh: a higher-order language with unification and
+            multiple results}
+    ,institution={Department of Computer Science, Cornell University}
+    ,number={85-685}
+    ,month=May
+    ,year=1985
+    }
+
+@inproceedings{sriv85
+    ,key={srivastava}
+    ,author={Srivastava, A. and Oxley, D. and Srivastava, A.}
+    ,title={An(other) integration of logic and functional programming}
+    ,booktitle={International Symposium on Logic Programming (CHECK THIS)}
+    ,organization={IEEE}
+    ,year=1985
+    ,month=Feb
+    ,pages={254-260}
+    }
+
+@techreport{huda85h
+    ,key={hudak}
+    ,author={Hudak, P. and Guzm\'an, J.}
+    ,title={A proof-stream semantics for lazy narrowing}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-446}
+    ,month=Dec
+    ,year=1985
+    }
+
+@inproceedings{jone86
+    ,key={jones}
+    ,author={Jones, Neil D. and Mycroft, A.}
+    ,title={Data flow analysis of applicative programs using
+            minimal function graphs}
+    ,booktitle={Proceedings 13th Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1986
+    ,month=Jan
+    ,pages={296-306}
+    }
+
+@book{gabr85a
+    ,key={gabriel}
+    ,author={Gabriel, R.P.}
+    ,title={Performance and Evaluation of Lisp Systems}
+    ,publisher={MIT Press}
+    ,address={Cambridge, Mass.}
+    ,year=1985
+    }
+
+@article{huda86c
+    ,key={li}
+    ,author={Li, K. and Hudak, P.}
+    ,title={A new list compaction method}
+    ,journal={Software -- Practice and Experience}
+    ,volume=16
+    ,number=2
+    ,month=Feb
+    ,year=1986
+    ,pages={145-163}
+    }
+
+@inproceedings{augu84
+    ,key={augustsson}
+    ,author={Augustsson, L.}
+    ,title={A compiler for {L}azy {ML}}
+    ,booktitle={Proceedings 1984 ACM Conf. on LISP and Functional Programming}
+    ,month=Aug
+    ,year=1984
+    ,pages={218-227}
+    }
+
+@techreport{huda86h
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Exploring para-functional programming}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-467}
+    ,month=Apr
+    ,year=1986
+    ,note={(Obsolete)}
+    }
+
+@techreport{srid85
+    ,key={sridharan}
+    ,author={Sridharan, N.S.}
+    ,title={Semi-Applicative Programming: An Example}
+    ,institution={BBN Laboratories}
+    ,month=Nov
+    ,year=1985
+    }
+
+@techreport{huda86i
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Collecting Interpretations of Expressions}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-497}
+    ,year=1986
+    }
+
+@article{hoar62
+    ,key={hoare}
+    ,author={Hoare, C.A.R.}
+    ,title={Quicksort}
+    ,journal={Computing J.}
+    ,volume=5
+    ,number=4
+    ,month=Apr
+    ,year=1962
+    ,pages={10-15}
+    }
+
+@inproceedings{kran86
+    ,key={kranz}
+    ,author={Kranz, D. and Kelsey, R. and Rees, J. and Hudak, P. 
+             and Philbin, J. and Adams, N.}
+    ,title={ORBIT: an optimizing compiler for {Scheme}}
+    ,booktitle={SIGPLAN '86 Symposium on Compiler Construction}
+    ,organization={ACM}
+    ,month=Jun
+    ,year=1986
+    ,pages={219-233}
+    ,note={Published as SIGPLAN Notices Vol. 21, No. 7, July 1986}
+    }
+
+@inproceedings{huda86d
+    ,key={kranz}
+    ,author={Kranz, D. and Kelsey, R. and Rees, J. and Hudak, P. 
+             and Philbin, J. and Adams, N.}
+    ,title={ORBIT: an optimizing compiler for {Scheme}}
+    ,booktitle={SIGPLAN '86 Symposium on Compiler Construction}
+    ,organization={ACM}
+    ,month=Jun
+    ,year=1986
+    ,pages={219-233}
+    ,note={Published as SIGPLAN Notices Vol. 21, No. 7, July 1986}
+    }
+
+@article{huda86j
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Para-functional programming}
+    ,journal={Computer}
+    ,volume=19
+    ,number=8
+    ,month=Aug
+    ,year=1986
+    ,pages={60-71}
+    }
+
+@article{niel82
+    ,key={nielson}
+    ,author={Nielson, Flemming}
+    ,title={A denotational framework for data flow analysis}
+    ,journal={Acta Informatica}
+    ,volume=18
+    ,year=1982
+    ,pages={265-287}
+    }
+
+@article{niel85
+    ,key={nielson}
+    ,author={Nielson, Flemming}
+    ,title={Program transformations in a denotational setting}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,volume=7
+    ,number=3
+    ,month=Jul
+    ,year=1985
+    ,pages={359-379}
+    }
+
+@phdthesis{niel84
+    ,key={nielson}
+    ,author={Nielson, Flemming}
+    ,title={Abstract Interpretation Using Domain Theory}
+    ,school={University of Edinburgh}
+    ,month=Oct
+    ,year=1984
+    }
+
+@inproceedings{cous81
+    ,key={cousot}
+    ,author={Cousot, P.}
+    ,title={Semantic foundations of program analysis}
+    ,booktitle={Program Flow Analysis: Theory and Applications}
+    ,editors={Muchnick, S.S. and Jones, Neil D.}
+    ,pages={303-342}
+    ,year=1981
+    ,publisher={Prentice-Hall}
+    }
+
+@inproceedings{donz81
+    ,key={Donzeau-Gouge}
+    ,author={Donzeau-Gouge, V.}
+    ,title={Denotational definition of properties of program computations}
+    ,booktitle={Program Flow Analysis: Theory and Applications}
+    ,editors={Muchnick, S.S. and Jones, Neil D.}
+    ,pages={343-379}
+    ,year=1981
+    ,publisher={Prentice-Hall}
+    }
+
+@inproceedings{burn86
+    ,key={Burn}
+    ,author={Burn, G.L. and Hankin, C.L. and Abramsky, S.}
+    ,title={The theory of strictness analysis for higher order functions}
+    ,booktitle={LNCS 217: Programs as Data Objects}
+    ,editors={Ganzinger, H. and Jones, Neil D.}
+    ,pages={42-62}
+    ,year=1985
+    ,publisher={Springer-Verlag}
+    }
+
+@inproceedings{mycr86
+    ,key={mycroft}
+    ,author={Mycroft, A and Jones, Neil D.}
+    ,title={A Relational Framework for Abstract Interpretation}
+    ,booktitle={LNCS 217: Programs as Data Objects}
+    ,editors={Ganzinger, H. and Jones, Neil D.}
+    ,pages={156-171}
+    ,year=1985
+    ,publisher={Springer-Verlag}
+    }
+
+@inproceedings{hugh86
+    ,key={hughes}
+    ,author={Hughes, R.J.M.}
+    ,title={Strictness detection in non-flat domains}
+    ,booktitle={LNCS 217: Programs as Data Objects}
+    ,editors={Ganzinger, H. and Jones, Neil D.}
+    ,pages={42-62}
+    ,year=1986
+    ,publisher={Springer-Verlag}
+    }
+
+@inproceedings{huda86e
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={A semantic model of reference counting and its abstraction
+            (detailed summary)}
+    ,booktitle={Proceedings 1986 ACM Conf. on
+                LISP and Functional Programming}
+    ,organization={ACM}
+    ,month=Aug
+    ,year=1986
+    ,pages={351-363}
+    }
+
+@inproceedings{blos86a
+    ,key={bloss}
+    ,author={Bloss, A. and Hudak, P.}
+    ,title={Variations on Strictness Analysis}
+    ,booktitle={Proc. 1986 ACM Conf. 
+                on LISP and Functional Programming}
+    ,organization={ACM}
+    ,month=Aug
+    ,year=1986
+    ,pages={132-142}
+    }
+                   
+@book{abra87
+    ,key={abramsky}
+    ,author={Abramsky, S. and Hankin, C.}
+    ,title={Abstract Interpretation of Declarative Languages}
+    ,publisher={Ellis Horwood}
+    ,year=1987
+    }
+
+@inproceedings{jone81
+    ,key={jones}
+    ,author={Jones, Neil D. and Muchnick, S.S.}
+    ,title={Complexity of flow analysis, inductive assertion synthesis,
+            and a language due to {D}ijkstra}
+    ,booktitle={Program Flow Analysis: Theory and Applications}
+    ,editors={Muchnick, S.S. and Jones, Neil D.}
+    ,pages={380-393}
+    ,year=1981
+    ,publisher={Prentice-Hall}
+    }
+
+@techreport{huda86l
+    ,key={goldberg}
+    ,author={Goldberg, B. and Hudak, P.}
+    ,title={Detecting Sharing of Partial Applications in Functional Languages}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-526}
+    ,month=Mar
+    ,year=1987
+    }
+
+@InProceedings{farrow86
+    ,key={Farrow}
+    ,author={Farrow, R.}
+    ,title={Automatic Generation of Fixed-Point-Finding Evaluators
+            for Circular, but Well-Defined, Attribute Grammars}
+    ,booktitle={Proceedings SIGPLAN '86 Symposium on Compiler Construction}
+    ,organization={ACM}
+    ,year=1986
+    ,pages={85-98}
+    }
+
+@inproceedings{PJ86
+    ,key="Peyton Jones"
+    ,author="Peyton Jones, Simon L. and Clack, C."
+    ,title="Finding fixpoints in abstract interpretation"
+    ,booktitle="Abstract Interpretation of Declarative Languages"
+    ,editors="Abramsky, S. and Hankin, C."
+    ,pages="to appear"
+    ,year=1987
+    ,publisher="Ellis Horwood"}
+
+@InProceedings{thom86
+    ,Key = "Thompson"
+    ,Author = "Simon Thompson"
+    ,Title = "Laws in {M}iranda"
+    ,Pages = "1-12"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts"}
+
+@InProceedings(clem86
+    ,Key = "Clement"
+    ,Author = "Dominique Cl\'ement and {Jo\"elle} Despeyroux
+               and Thierry Despeyroux and Gilles Kahn"
+    ,Title = "A Simple Applicative Language: {M}ini-{ML}"
+    ,Pages = "13-27"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(giff86
+    ,Key = "Gifford"
+    ,Author = "David K. Gifford and John M. Lucassen"
+    ,Title = "Integrating Functional and Imperative Programming"
+    ,Pages = "28-38"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(albe86
+    ,Key = "Alberga"
+    ,Author = "Cyril N. Alberga and Chris Bosman-Clark and Martin Mikelsons
+               and Mary S. Van Deusen and Julian Padget"
+    ,Title = "Experience with an Uncommon {L}isp"
+    ,Pages = "39-53"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(padg86
+    ,Key = "Padget"
+    ,Author = "Julian Padget and others"
+    ,Title = "Desiderata for the Standardisation of {L}isp"
+    ,Pages = "54-66"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(broo86
+    ,Key = "Brooks"
+    ,Author = "Rodney A. Brooks and David B. Posner and James L. McDonald
+               and Jon L. White and Eric Benson and Richard P. Gabriel"
+    ,Title = "Design of an Optimizing, Dynamically Retargetable Compiler
+              for {C}ommon {L}isp"
+    ,Pages = "67-85"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(bart86
+    ,Key = "Bartley"
+    ,Author = "David H. Bartley and John C. Jensen"
+    ,Title = "The Implementation of {PC} {S}cheme"
+    ,Pages = "86-93"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(fair86
+    ,Key = "Fairbairn"
+    ,Author = "Jon Fairbairn and Stuart C. Wray"
+    ,Title = "Code Generation Techniques for Functional Languages"
+    ,Pages = "94-104"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(knig86
+    ,Key = "Knight"
+    ,Author = "Tom Knight"
+    ,Title = "An Architecture for Mostly Functional Languages"
+    ,Pages = "105-112"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(lema86
+    ,Key = "Lemaitre"
+    ,Author = "M. Lema\^\itre and M. Castan and M.-H. Durand
+               and G. Durrieu and B. Lecussan"
+    ,Title = "Mechanisms for Efficient Multiprocessor Combinator Reduction"
+    ,Pages = "113-121"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(rams86
+    ,Key = "Ramsdell"
+    ,Author = "John D. Ramsdell"
+    ,Title = "The {CURRY} Chip"
+    ,Pages = "122-131"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(blos86
+    ,Key = "Bloss"
+    ,Author = "Adrienne Bloss and Paul Hudak"
+    ,Title = "Variations on Strictness Analysis"
+    ,Pages = "132-142"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(dybv86
+    ,Key = "Dybvig"
+    ,Author = "R. Kent Dybvig and Daniel P. Friedman and Christopher T. Haynes"
+    ,Title = "Expansion-Passing Style:  Beyond Conventional Macros"
+    ,Pages = "143-150"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(kohl86
+    ,Key = "Kohlbecker"
+    ,Author = "Eugene Kohlbecker and Daniel P. Friedman
+               and Matthias Felleisen and Bruce Duba"
+    ,Title = "Hygienic Macro Expansion"
+    ,Pages = "151-161"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(boeh86
+    ,Key = "Boehm"
+    ,Author = "Hans-J. Boehm and Robert Cartwright and Mark Riggle
+               and Michael J. O'Donnell"
+    ,Title = "Exact Real Arithmetic:  A Case Study in Higher Order Programming"
+    ,Pages = "162-173"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(whit86
+    ,Key = "White"
+    ,Author = "Jon L. White"
+    ,Title = "Reconfigurable, Retargetable Bignums:
+              A Case Study in Efficient, Portable {L}isp System Building"
+    ,Pages = "174-191"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(steen86
+    ,Key = "Steenkiste"
+    ,Author = "Peter Steenkiste and John Hennessy"
+    ,Title = "{L}isp on a Reduced-Instruction-Set-Processor"
+    ,Pages = "192-201"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(sark86
+    ,Key = "Sarkar"
+    ,Author = "Vivek Sarkar and John Hennessy"
+    ,Title = "Partitioning Parallel Programs for Macro-Dataflow"
+    ,Pages = "202-211"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(sche86
+    ,Key = "Scheevel"
+    ,Author = "Mark Scheevel"
+    ,Title = "{NORMA}:  A Graph Reduction Processor"
+    ,Pages = "212-219"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(clac86
+    ,Key = "Clack"
+    ,Author = "Chris Clack and Simon L. {Peyton Jones}"
+    ,Title = "The Four-Stroke Reduction Engine"
+    ,Pages = "220-232"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(lee86
+    ,Key = "Lee"
+    ,Author = "Peter Lee and Uwe Pleban"
+    ,Title = "On the Use of {L}isp in Implementing Denotational Semantics"
+    ,Pages = "233-248"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(niel86
+    ,Key = "Nielson"
+    ,Author = "Hanne Riis Nielson and Flemming Nielson"
+    ,Title = "Semantics Directed Compiling for Functional Languages"
+    ,Pages = "249-257"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(bawd86
+    ,Key = "Bawden"
+    ,Author = "Alan Bawden"
+    ,Title = "Connection Graphs"
+    ,Pages = "258-265"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(maun86
+    ,Key = "Mauny"
+    ,Author = "Michel Mauny and Asc\'ander Su\'arez"
+    ,Title = "Implementing Functional Languages
+              in the Categorical Abstract Machine"
+    ,Pages = "266-278"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(stee86
+    ,Key = "Steele"
+    ,Author = "Steele, Guy L., Jr. and W. Daniel Hillis"
+    ,Title = "Connection Machine LISP:
+              Fine-Grained Parallel Symbolic Processing"
+    ,Pages = "279-297"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(wand86
+    ,Key = "Wand"
+    ,Author = "Mitchell Wand and Daniel P. Friedman"
+    ,Title = "The Mystery of the Tower Revealed:
+              A Non-Reflective Description of the Reflective Tower"
+    ,Pages = "298-307"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(mitc86
+    ,Key = "Mitchell"
+    ,Author = "John C. Mitchell"
+    ,Title = "A Type-Inference Approach to Reduction Properties
+              and Semantics of Polymorphic Expressions (summary)"
+    ,Pages = "308-319"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(jaya86
+    ,Key = "Jayaraman"
+    ,Author = "Bharat Jayaraman and Frank S. K. Silbermann"
+    ,Title = "Equations, Sets, and Reduction Semantics for
+              Functional and Logic Programming"
+    ,Pages = "320-331"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(that86
+    ,Key = "Thatte"
+    ,Author = "Satish R. Thatte"
+    ,Title = "Towards a Semantic Theory for Equational Programming Languages"
+    ,Pages = "332-342"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(lerm86
+    ,Key = "Lermen"
+    ,Author = "Claus-Werner Lermen and Dieter Maurer"
+    ,Title = "A Protocol for Distributed Reference Counting"
+    ,Pages = "343-350"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(huda86eFP
+    ,Key = "Hudak"
+    ,Author = "Paul Hudak"
+    ,Title = "A Semantic Model of Reference Counting and its Abstraction
+              (detailed summary)"
+    ,Pages = "351-363"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@InProceedings(ruda86
+    ,Key = "Rudalics"
+    ,Author = "Martin Rudalics"
+    ,Title = "Distributed Copying Garbage Collection"
+    ,Pages = "364-372"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+
+@techreport{youn86
+    ,key={Young}
+    ,author={Young, J. and Hudak, P.}
+    ,title={Finding fixpoints on function spaces}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-505}
+    ,month=Nov
+    ,year=1986
+    }
+
+@article{schm85
+    ,key={schmidt}
+    ,author={Schmidt, D.A.}
+    ,title={Detecting global variables in denotational specifications}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,volume=7
+    ,number=2
+    ,year=1985
+    ,pages={299-310}
+    }
+
+@article{bart77
+    ,key={barth}
+    ,author={Barth, J.M.}
+    ,title={Shifting garbage collection overhead to compile time}
+    ,journal={CACM}
+    ,volume=20
+    ,number=7
+    ,year=1977
+    ,pages={513-518}
+    }
+
+@article{schw82
+    ,key={Schwarz}
+    ,author={Schwarz, J.}
+    ,title={Using annotations to make recursion equations behave}
+    ,journal={IEEE Transactions on Software Engineering}
+    ,volume={SE-8}
+    ,number=1
+    ,year=1982
+    ,month=Jan
+    ,pages={21-33}
+    }
+
+@article{burs77
+    ,key={burstall}
+    ,author={Burstall, R.M. and Darlington, J.}
+    ,title={A transformation system for developing recursive programs}
+    ,journal={JACM}
+    ,volume=24
+    ,number=1
+    ,year=1977
+    ,pages={44-67}
+    }
+
+@phdthesis{gold88
+    ,key={goldberg}
+    ,author={Goldberg, B.}
+    ,title={Multiprocessor Execution of Functional Programs}
+    ,school={Yale University, Department of Computer Science}
+    ,year=1988
+    ,note={Available as technical report {YALEU/DCS/RR-618}}
+    }
+
+@InProceedings{hugh85
+    ,key={hughes}
+    ,author={Hughes, R.J.M.}
+    ,title={Lazy memo-functions}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={129-146}
+    }
+
+@InProceedings{burt85
+    ,key={burton}
+    ,author={Burton, F.W.}
+    ,title={Controlling speculative computation in a 
+            parallel functional language}
+    ,booktitle={International Conf. on Distributed Computing Systems}
+    ,pages={453-458}
+    ,month=May
+    ,year=1985
+    }
+
+@techreport{habe75
+    ,key={haberman}
+    ,author={Haberman, A.N.}
+    ,title={Path Expressions}
+    ,institution={Carnegie-Mellon University}
+    ,month=Jun
+    ,year=1975
+    }
+
+@article{shap86
+    ,key={shapiro}
+    ,author={Shapiro, E.}
+    ,title={Concurrent Prolog: a progress report}
+    ,journal={Computer}
+    ,volume=19
+    ,number=8
+    ,month=Aug
+    ,year=1986
+    ,pages={44-59}
+    }
+
+@InProceedings{delo85
+    ,key={delosme}
+    ,author={Delosme, J.-M. and Ipsen, I.C.F.}
+    ,title={An illustration of a methodology for the construction of
+            efficient systolic architectures in {VLSI}}
+    ,booktitle={Proceedings 2nd International Symposium on VLSI Technology, Systems,
+                and Applications}
+    ,pages={268-273}
+    ,year=1985
+    }
+
+@article{huda86k
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Denotational Semantics of a Para-functional Programming Language}
+    ,journal={International Journal of Parallel Programming}
+    ,volume=15
+    ,number=2
+    ,year=1986
+    ,month=Apr
+    ,pages={103-125}
+    }
+
+@InProceedings{myni83
+    ,key={mycroft}
+    ,author={Mycroft, Alan and Nielson, Flemming}
+    ,title={Strong abstract interpretation using powerdomains}
+    ,booktitle={Proceedings ICALP, Springer Verlag LNCS No. 154}
+    ,pages={536-547}
+    ,year=1983
+    }
+
+@techreport{pana84
+    ,key={panangaden}
+    ,author={Panangaden, P. and Mishra, P.}
+    ,title={A Category Theoretic Formalism for Abstract Interpretation}
+    ,institution={University of Utah}
+    ,number={UUCS-84-005}
+    ,year=1984
+    }
+
+@inproceedings{blos87a
+    ,key={bloss}
+    ,author={Bloss, A. and Hudak, P.}
+    ,title={Path Semantics}
+    ,booktitle={Proceedings of Third Workshop on the
+                Mathematical Foundations of Programming Language Semantics}
+    ,year=1987
+    ,organization={Tulane University}
+    ,publisher={Springer-Verlag LNCS Volume 298}
+    ,pages={476-489}
+    }
+
+@inproceedings{lind86
+    ,key={lindstrom}
+    ,author={Lindstrom, G.}
+    ,title={Static evaluation of functional programs}
+    ,booktitle={SIGPLAN '86 Symposium on Compiler Construction}
+    ,organization={ACM}
+    ,month=Jun
+    ,year=1986
+    ,pages={196-206}
+    ,note={Published as SIGPLAN Notices Vol. 21, No. 7, July 1986}
+    }
+
+@inproceedings{wadl84
+    ,key={wadler}
+    ,author={Wadler, P.}
+    ,title={Listlessness is better than laziness: lazy evaluation and 
+            garbage collection at compile time}
+    ,booktitle={Proceedings 1984 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Aug
+    ,pages={45-52}
+    }
+
+@InProceedings{odon85
+    ,key={O'Donnell}
+    ,author={O'Donnell, J.T.}
+    ,title={An architecture that efficiently updates associative aggregates
+            in applicative programming language}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={164-189}
+    }
+
+@techreport{huda85j
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Functional programming on multiprocessor architectures}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-447}
+    ,month=Dec
+    ,year=1985
+    }
+
+@article{huda88b
+    ,key={LiKai}
+    ,author={Li, K. and Hudak, P.}
+    ,title={Memory Coherence in Shared Virtual Memory Systems}
+    ,journal={ACM Transactions on Computer Systems}
+    ,volume=7
+    ,number=4
+    ,month=Nov
+    ,year=1989
+    ,pages={321-359}
+    }
+
+@InProceedings{huda86g
+    ,key={LiKai}
+    ,author={Li, K. and Hudak, P.}
+    ,title={Memory Coherence in a Shared Virtual Memory System}
+    ,booktitle={5th ACM Symposium on Principles of Distributed Computing}
+    ,month=Aug
+    ,year=1986
+    ,organization={ACM SIGACT-SIGOPS}
+    ,pages={229-239}
+    }
+
+@InProceedings{wise85
+    ,key={Wise}      
+    ,author={Wise, D.S.}     
+    ,title={Design for a multiprocessing heap with on-board
+            reference counting}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={289-304}
+    }
+
+@InProceedings{wadl87
+    ,key={wadler}
+    ,author={Wadler, P.}
+    ,title={A New Array Operation}
+    ,booktitle={Workshop on Graph Reduction Techniques}
+    ,month=Oct
+    ,year=1986
+    ,publisher={Springer-Verlag LNCS 279}
+    }
+
+@techreport{nikh86
+    ,key={nikhil}
+    ,author={Nikhil, R.S. and Pingali, K. and Arvind}
+    ,title={Id Nouveau}
+    ,institution={Massachusetts Institute of Technology,
+                  Laboratory for Computer Science}
+    ,type={Computation Structures Group Memo}
+    ,number={265}
+    ,month=Jul
+    ,year=1986
+    }
+
+@misc{arvi86
+    ,key={Arvind}
+    ,author={Arvind}
+    ,title={Data structures for parallel computing}
+    ,note={Talk given at Graph Reduction Workshop, co-sponsored
+                by Los Alamos National Lab and MCC, held in Santa Fe, NM}
+    ,month=Oct
+    ,year=1986
+    }
+
+@article{prat86
+    ,key={Pratt}
+    ,author={Pratt, V.}
+    ,title={Modeling Concurrency with Partial Orders}
+    ,journal={International Journal of Parallel Programming}
+    ,volume=15
+    ,number=1
+    ,month=Feb
+    ,year=1986
+    ,pages={33-72}
+    }
+
+@article{hend86
+    ,key={Henderson}    
+    ,author={Henderson, P.}
+    ,title={Functional Programming, Formal Specification, 
+            and Rapid Prototyping}
+    ,journal={IEEE Transactions on SW Engineering}
+    ,volume="SE-12"
+    ,number=2
+    ,year=1986
+    ,pages={241-250}
+    }
+
+@InProceedings{gold84
+    ,key={goldberg}
+    ,author={Goldberg, A. and Paige, R.}
+    ,title={Stream Processing}
+    ,booktitle={Proceedings 1984 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Aug
+    ,pages={53-62}
+    }
+
+@InProceedings{huda87b
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Arrays, Non-Determinism, Side-Effects, and Parallelism:
+            A Functional Perspective}
+    ,booktitle={Proc. Santa Fe Graph Reduction Workshop}
+    ,organization={Los Alamos/MCC}
+    ,year=1986
+    ,month=Oct
+    ,publisher={Springer-Verlag LNCS 279}
+    ,pages={312-327}
+    }
+
+@InProceedings{gold86
+    ,key={Goldberg}
+    ,author={Goldberg, B. and Hudak, P.}
+    ,title={Alfalfa: Distributed Graph Reduction on a Hypercube Multiprocessor}
+    ,booktitle={Proc. Santa Fe Graph Reduction Workshop}
+    ,organization={Los Alamos/MCC}
+    ,year=1986
+    ,month=Oct
+    ,publisher={Springer-Verlag LNCS 279}
+    ,pages={94-113}
+    }
+
+@misc{mich86
+    ,key={michelsen}
+    ,author={Michelsen, R. and Yantis, B. and Williams, E. and Smith, L. }
+    ,title={Reducing on the Cray X/MP}
+    ,booktitle={talk given at Graph Reduction Workshop, co-sponsored
+                by Los Alamos National Lab and MCC, held in Santa Fe, NM}
+    ,month=Oct
+    ,year=1986
+    }
+
+@InProceedings{huda87a
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Para-functional languages for parallel and distributed computing}
+    ,booktitle={Proceedings of Spring COMPCON '87}
+    ,organization={IEEE}
+    ,year=1987
+    ,month=Feb
+    ,pages={334-337}
+    }
+
+@article{huda72
+    ,key={Hudak}
+    ,author={Bourne, J.R. and Hudak, P. and Duke, J.L.}
+    ,title={Computer Automated Electro-oculography}
+    ,journal={Computers and Biomedical Research}
+    ,volume=5
+    ,year=1972                                  
+    ,month=Jun
+    ,pages={654-658}
+    }
+
+@phdthesis{gisc84
+    ,key={gischer}
+    ,author={Gischer, J.}
+    ,title={Partial Orders and the Axiomatic Theory of Shuffle}
+    ,school={Stanford University, Department of Computer Science}
+    ,year=1984
+    }
+
+@article{kell86
+    ,key={Keller}
+    ,author={Keller, R.M. and Sleep, R.}
+    ,title={Applicative Caching}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,volume=8
+    ,number=1
+    ,month=Jan
+    ,year=1986
+    ,pages={88-108}
+    }
+
+@techreport{guzm87a
+    ,key={guzman}
+    ,author={Guzm\'an, J. and Hudak, P.}
+    ,title={Provably Complete Operational Semantics
+            for First-Order Lazy Narrowing}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-525}
+    ,month=Mar
+    ,year=1987
+    }
+
+@techreport{huda87c
+    ,key={hudak}
+    ,author={Hudak, P. and Delosme, J-M. and Ipsen, I.}
+    ,title={ParLance: A Para-Functional Programming Environment
+            for Parallel and Distributed Computing}
+    ,institution={Yale University, Department of Computer Science}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-524}
+    ,month=Apr
+    ,year=1987
+    }
+
+@InProceedings{gold87b
+    ,key={goldberg}
+    ,author={Goldberg, B.}
+    ,title={Detecting Sharing of Partial Applications in Functional Programs}
+    ,booktitle={Proc. 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={408-425}
+    }
+
+@InProceedings{huda87d
+    ,key={hudak}
+    ,author={Hudak, P. and Anderson, S.}
+    ,title={Pomset Interpretations of Parallel Functional Programs}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={234-256}
+    }
+
+@book{abel85
+    ,key={abelson}
+    ,author={Abelson, H. and Sussman, G.J. and Sussman, J.}
+    ,title={Structure and Interpretation of Computer Programs}
+    ,publisher={The MIT Press (Cambridge, MA) and McGraw-Hill Book Company
+                (New York, NY)}
+    ,year=1985
+    }
+
+@article{mich68
+    ,key={michie}
+    ,author={Michie, D.}
+    ,title={``{M}emo'' Functions and Machine Learning}
+    ,journal={Nature}
+    ,volume=218      
+    ,month=Apr
+    ,year=1968
+    ,pages={19-22}
+    }
+
+@book{schm86
+    ,key={schmidt}
+    ,author={Schmidt, D.A.}
+    ,title={Denotational Semantics -- A Methodology for Language
+            Development}
+    ,publisher={Allyn and Bacon}
+    ,address={Boston, Mass.}
+    ,year=1986
+    }
+
+@misc{jone87
+    ,key={jones}
+    ,author={Jones, Neil D.}
+    ,title={Private communication}
+    ,month=Jun
+    ,year=1987
+    }
+
+@inproceedings{mcca63
+    ,key={mccarthy}
+    ,author={McCarthy, J.}
+    ,title={A Basis for a Mathematical Theory of Computation}
+    ,booktitle={Computer Programming and Formal Systems}
+    ,editors={Braffort, P. and Hirschberg, D.}
+    ,pages={33-70}
+    ,year=1963
+    ,publisher={North Holland}
+    ,address={Amsterdam}
+    }
+
+@article{RRRRS
+    ,key={rees}
+    ,author={Rees, J. and Clinger (eds.), W.}
+    ,title={The Revised$^3$ Report on the Algorithmic Language {S}cheme}
+    ,journal={SIGPLAN Notices}
+    ,volume=21
+    ,number=12
+    ,year=1986
+    ,month=Dec
+    ,pages={37-79}
+    }
+
+@InProceedings{wise87
+    ,key={wise}
+    ,author={Wise, D.}
+    ,title={Matrix Algebra and Applicative Programming}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={134-153}
+    }
+
+@book{peyt87
+    ,key={peyton jones}
+    ,author={Peyton Jones, Simon L.}
+    ,title={The Implementation of Functional Programming Languages}
+    ,publisher={Prentice-Hall International}
+    ,address={Englewood Cliffs, NJ}
+    ,year=1987
+    }
+
+@InProceedings{augu85
+    ,key={augustsson}
+    ,author={Augustsson, L.}
+    ,title={Compiling Pattern-Matching}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={368-381}
+    }
+
+@InProceedings{huda88a
+    ,key={hudak}
+    ,author={Hudak, P. and Young, J.}
+    ,title={A Collecting Interpretation of Expressions (Without Powerdomains)}
+    ,booktitle={Proceedings of ACM Symposium on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1988
+    ,pages={107-118}
+    }
+
+@InProceedings{wadl87b
+    ,key={wadlerhughes}
+    ,author={Wadler, P. and Hughes, R.J.M.}
+    ,title={Projections for Strictness Analysis}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={385-407}
+    }
+
+@InProceedings{mart87
+    ,key={martin}
+    ,author={Martin, C. and Hankin, C.}
+    ,title={Finding Fixed Points in Finite Lattices}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={426-445}
+    }
+
+@InProceedings{john85b
+    ,key={johnsson}
+    ,author={Johnsson, T.}
+    ,title={Lambda Lifting: Transforming Programs to Recursive Equations}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={190-203}
+    }
+
+@InProceedings{chen86
+    ,key={chenmarina}
+    ,author={Chen, M.C.}
+    ,title={Transformations of Parallel Programs in Crystal}
+    ,booktitle={Information Processing '86}
+    ,editors={Kugler, H.-J.}
+    ,year=1986
+    ,publisher={Elsevier Science Publishers B.V. (North-Holland)}
+    ,organization={IFIP}
+    ,pages={455-462}
+    }
+
+@InProceedings{fair87
+    ,key={fairbairn}
+    ,author={Fairbairn, J. and Wray, S.}
+    ,title={TIM: A Simple, Lazy Abstract Machine to Execute Supercombinators}
+    ,booktitle={Proceedings of 1987 Functional Programming Languages and
+                Computer Architecture Conf.}
+    ,publisher={Springer Verlag LNCS 274}
+    ,year=1987
+    ,month=Sep
+    ,pages={34-45}
+    }
+
+@article{hals85
+    ,key={halstead}
+    ,title={Multilisp: A Language for Concurrent Symbolic Computation}
+    ,author={Halstead Jr., R.H.}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,volume=7
+    ,number=4
+    ,month=Oct
+    ,year=1985
+    ,pages={501-538}
+    }
+
+@misc{lisk87
+    ,key={liskov}
+    ,author={Liskov, B.}
+    ,title={Private communication}
+    ,month=Oct
+    ,year=1987
+    }
+
+@article{huda87g
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Arrays, Non-Determinism, Side-Effects, and Parallelism:
+            A (Pseudo-) Functional Perspective}
+    ,journal={Submitted to CACM}
+    ,year=1987
+    }
+
+@article{huda88c
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Exploring Para-Functional Programming:
+            {S}eparating the {\em What} from the {\em How}}
+    ,journal={IEEE Software}
+    ,month=Jan
+    ,year=1988
+    ,volume=5
+    ,number=1
+    ,pages={54-61}
+    }
+
+@inproceedings{huda86f
+    ,key="hudak"
+    ,author="Hudak, P."
+    ,title="A semantic model of reference counting and its abstraction"
+    ,booktitle="Abstract Interpretation of Declarative Languages"
+    ,editors="Abramsky, S. and Hankin, C."
+    ,pages="45-62"
+    ,year=1987
+    ,publisher="Ellis Horwood"
+    ,note="(Preliminary version appeared in Proceedings 1986 ACM Conf. on
+           LISP and Functional Programming, August 1986, pp. 351-363)"
+    }
+
+@book{miln80
+    ,key={milner}
+    ,author={Milner, R.}
+    ,title={A Calculus of Communicating Systems}
+    ,publisher={Springer-Verlag, LNCS 92}
+    ,address={Englewood Cliffs, NJ}
+    ,year=1980
+    }
+
+@book{hoar85
+    ,key={hoare}
+    ,author={Hoare, C.A.R.}
+    ,title={Communicating Sequential Processes}
+    ,publisher={Prentice-Hall International, Series in Computer Science}
+    ,address={Englewood Cliffs, NJ}
+    ,year=1985
+    }
+
+@article{huda88aj
+    ,key={hudak}
+    ,author={Hudak, P. and Young, J.}
+    ,title={Collecting Interpretations of Expressions}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,year=1991
+    ,volume=13
+    ,number=2
+    ,pages={269-290}
+    ,note={Preliminary version appeared in the Proc.
+           1988 ACM Symposium on Principles of Programming Languages.}
+    }
+
+@article{cook85
+   ,key={cook}
+   ,author={Cook, S.A.}
+   ,title={A Taxonomy of Problems with Fast Parallel Algorithms}
+   ,journal={Information and Control}
+   ,volume=64
+   ,number={2-22}
+   ,year=1985
+   } 
+      
+@article{ston71
+   ,key={stone}
+   ,author={Stone, H.S.}    
+   ,title={Parallel Processing with the Perfect Shuffle}
+   ,journal={IEEE Transactions on Computers}
+   ,volume={C-20}
+   ,number=2
+   ,year=1971
+   }
+
+@article{prep81
+   ,key={preparata}
+   ,author={Preparata, F.P. and Vuillemin, Jean}
+   ,title={The Cube-connected Cycles: A Versatile Network for Parallel Computation}
+   ,journal={Communications of ACM}
+   ,volume={?}
+   ,number=5
+   ,year=1981
+   }   
+
+@article{hill86
+   ,key={hill}
+   ,author={Hillis, W.D. and Steel, Jr. G.L.}
+   ,title={Data Parallel Algorithms}
+   ,journal={Communications of ACM}
+   ,number=12
+   ,volume=29
+   ,year=1986
+   }
+
+@article{berg87
+   ,key={berger}
+   ,author={Berger, M.J. and Bokhari, S.H.}
+   ,title={A Partitioning Strategy for Nonuniform Problems on
+           Multiprocessors}
+   ,journal={IEEE Transactions on Computers}
+   ,volume={C-36}
+   ,number=5
+   ,year=1987
+   }
+
+@article{smit87
+   ,key={smith}
+   ,author={Smith, D.R.}
+   ,title={Applications of a Strategy for Designing Divide-and-conquer
+           Algorithms}
+   ,journal={Science of Computer Programming}
+   ,number=8
+   ,year=1987
+   }
+
+@article{hartxx
+   ,key={Hartel}
+   ,author={Hartel, P.H.}
+   ,title={Parallel Graph Reduction for Divide-and-conquer}
+   ,journal={}
+   ,year=1987
+   }
+
+@book{ahu74
+   ,key={ahu}
+   ,author={Aho and Hopcroft and Ullman}
+   ,title={The Design and Analysis of Computer Algorithms}
+   ,publisher={Addison-wesley Publishing Company}
+   ,year=1974
+   }         
+
+@book{ullm84
+   ,key={ullman}
+   ,author={Ullman, J.D.}
+   ,title={Computational Aspect of VLSI}
+   ,publisher={Computer Science Press}
+   ,year=1984
+   }
+
+@book{mead80
+   ,key={mead}
+   ,author={Mead, C. and Conway, L.}
+   ,title={Introduction to VLSI systems}
+   ,pblisher={Addison-wesley Publishing Company}
+   ,year=1980
+   }
+
+@article{ladn80
+   ,key={ladner}
+   ,author={Ladner, R.E. and Fischer, M.J.}
+   ,title= {Parallel Prefix Computation}
+   ,journal={Journal of the ACM}
+   ,volume=27
+   ,number=4
+   ,year=1980
+   }
+   
+@article{vali82
+  ,key={valiant}
+  ,author={Valiant, L.G.}
+  ,title={A Scheme for Fast Parallel Communications}
+  ,journal={SIAM J. Computing}
+  ,volume={?}
+  ,number=2
+  ,year=1982
+  }
+
+@phdthesis{blossphd
+  ,key={bloss}
+  ,author={Bloss, A.}
+  ,title={Path Analysis: Using Order-of-Evaluation Information to
+          Optimize Lazy Functional Languages}
+  ,school={Yale University, Department of Computer Science}
+  ,year=1988
+  }
+
+@phdthesis{youngphd
+  ,key={young}
+  ,author={Young, J.}
+  ,title={The Semantic Analysis of Functional Programs: Theory and Practice}
+  ,school={Yale University, Department of Computer Science}
+  ,year=1988
+  }
+
+@article{huda88d
+    ,author={Mou, Z.G. and Hudak, P.}
+    ,title={An Algebraic Model for Divide-and-Conquer and its Parallelism}
+    ,journal={Journal of Supercomputing}
+    ,volume=2
+    ,number=3
+    ,year=1988
+    }
+ 
+@InProceedings{gold88a
+    ,key={Goldberg}
+    ,author={Goldberg, B. and Hudak, P.}
+    ,title={Implementing Functional Programs on a Hypercube 
+            Multiprocessor}
+    ,booktitle={Proceedings of Third Conf. on Hypercube Concurrent
+                Computers and Applications}
+    ,organization={ACM}
+    ,year=1988
+    ,month=Jan
+    }
+
+@book{hill85
+        ,key="Hillis"
+        ,author="Hillis, W. D."
+        ,title="The Connection Machine"
+        ,publisher="MIT Press"
+        ,address="Cambridge, Massachusetts"
+        ,year=1985
+        }
+
+@mastersthesis{kusz86
+        ,key="kuszmaul"
+        ,author="Kuszmaul, B. C."
+        ,title="Simulating Applicative Architectures on the Connection Machine"
+        ,school="M.I.T."
+        ,month=May
+        ,year=1986
+        }
+
+@InProceedings{gron87
+    ,key={grondalski}
+    ,author={Grondalski, R.}
+    ,title={A VLSI Chip Set for a Massively Parallel Architecture}
+    ,booktitle={IEEE International Solid-State Circuits Conf.}
+    ,organization={IEEE}
+    ,year=1987
+    ,pages={198-199,399-400}
+    }
+
+@InProceedings{hank86
+    ,key={hankin}
+    ,author={Hankin, C. L. and Burn, G. L. and Peyton Jones, Simon L.}
+    ,title={A Safe Approach to Parallel Combinator Reduction}
+    ,booktitle={European Symposium on Programming (LNCS 213)}
+    ,pages={99-110}
+    ,year=1986
+    ,publisher={Springer-Verlag}
+    }
+
+@Inproceedings{maur85
+    ,key={maurer}
+    ,author={Maurer, D.}
+    ,title={Strictness Computation Using Generalised $\lambda$-expressions}
+    ,booktitle={Workshop on Programs as Data Objects (LNCS)}
+    ,year=1985
+    ,publisher={Springer-Verlag}
+    }
+
+@techreport{rana88
+        ,key="Ranade"
+        ,author="Ranade, A. G. and Bhatt, S. N. and Johnsson, S. L."
+        ,title="The Fluent Abstract Machine"
+        ,institution="Yale University, Department of Computer Science"
+        ,month=Jan
+        ,number="YALEU/DCS/RR-573"
+        ,year=1988
+        }
+
+@InProceedings(lem86
+    ,Key = "Lemaitre"
+    ,Author = "M. Lema\^\i tre and M. Castan and M.-H. Durand
+               and G. Durrieu and B. Lecussan"
+    ,Title = "Mechanisms for Efficient Multiprocessor Combinator Reduction"
+    ,Pages = "113-121"
+    ,Booktitle = "Proceedings~1986 ACM Conf. on Lisp and Functional Programming"
+    ,Organization = "ACM SIGPLAN/SIGACT/SIGART"
+    ,Year = "1986"
+    ,Month = Aug
+    ,Address = "Cambridge, Massachusetts")
+    }
+
+@InProceedings(lein87
+    ,Key = "Leinwand"
+    ,Author = "S. Leinwand and J. Goguen"
+    ,Title = "Architectural Options for the Rewrite Rule Machine"
+    ,Booktitle = "Proceedings~Second International Conf. on Supercomputing"
+    ,Year = "1987"
+    ,Month = May
+    ,Address = "Santa Clara, California")
+    }
+
+@article{chee87
+    ,key={Cheese}
+    ,author={Cheese, A.}
+    ,title={Combinatory Code and a Parallel Packet Based Computational Model}
+    ,journal={SIGPLAN Notices}
+    ,volume=22
+    ,number=4
+    ,month=Apr
+    ,year=1987
+    }
+
+@unpublished{lass88
+    ,key={lasser}
+    ,author={Lasser, C.}
+    ,month=Jan
+    ,year=1988
+    ,title={Personal communication}
+    }
+
+@techreport{huda88f
+        ,key="Hudak"
+        ,author="Hudak, P. and Anderson, S."
+        ,title="{H}askell Solutions to the Language Session Problems
+                at the 1988 {S}alishan {H}igh-{S}peed {C}omputing {C}onference"
+        ,institution="Yale University, Department of Computer Science"
+        ,month=Jan
+        ,number="YALEU/DCS/RR-627"
+        ,year=1988
+        }
+
+@phdthesis{kelseyphd
+  ,key={kelsey}
+  ,author={Kelsey, R.}
+  ,title={Compilation by Program Transformation}
+  ,school={Yale University, Department of Computer Science}
+  ,year=1988
+  }
+
+@phdthesis{kranzphd
+  ,key={kranz}
+  ,author={Kranz, D.}
+  ,title={ORBIT: An Optimizing Compiler For Scheme}
+  ,school={Yale University, Department of Computer Science}
+  ,year=1988
+  ,note={Available as technical report {YALEU/DCS/RR-632}}
+  }
+
+@phdthesis{liphd
+  ,key={li}
+  ,author={Li, K.}
+  ,title={Shared Virtual Memory on Loosely Coupled Multiprocessors}
+  ,school={Yale University, Department of Computer Science}
+  ,year=1986
+  }
+
+@InProceedings{kels89
+    ,key={kelsey}
+    ,author={Kelsey, R. and Hudak, P.}
+    ,title={Realistic Compilation by Program Transformation}
+    ,booktitle={ACM Symposium on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1989
+    ,pages={181-192}
+    }
+
+@techreport{haskell0
+    ,key="Hudak"
+    ,author="Hudak, P. and Wadler (editors), P."
+    ,title="Report on the Functional Programming Language {H}askell"
+    ,institution="Yale University, Department of Computer Science"
+    ,month=Nov
+    ,number="YALEU/DCS/RR666"
+    ,year=1988
+    }
+
+@InProceedings{huda88g
+    ,Key={hudak}
+    ,Author={Hudak, P. and Mohr, E.}
+    ,Title={Graphinators and the Duality of {SIMD} and {MIMD}}
+    ,Booktitle={Proceedings~1988 ACM Conf. on Lisp and Functional Programming}
+    ,Organization={ACM SIGPLAN/SIGACT/SIGART}
+    ,Year=1988
+    ,Month=Aug
+    ,Address={Salt Lake City, Utah}
+    ,Pages={224-234}
+    }
+
+@InProceedings{gold88b
+    ,Key={goldberg}
+    ,Author={Goldberg, B.}
+    ,Title={Buckwheat: Graph Reduction on a Shared Memory Multiprocessor}
+    ,Booktitle={Proceedings~1988 ACM Conf. on
+                Lisp and Functional Programming}
+    ,Organization={ACM SIGPLAN/SIGACT/SIGART}
+    ,Year=1988
+    ,Month=Aug
+    ,Address={Salt Lake City, Utah}
+    ,Pages={40-51}
+    }
+
+@inproceedings{youn87
+    ,key={young}
+    ,author={Young, J. and O'Keefe, P.}
+    ,title={Experience with a Type Evaluator}
+    ,booktitle={Proceedings 2nd Workshop on Partial Evaluation}
+    ,month={October}
+    ,year=1987
+    }
+
+@techreport{trak88
+    ,key="Trakhtenbrot"
+    ,author="Trakhtenbrot, B.A."
+    ,title="Comparing the Church and Turing Approaches: Two Prophetic Messages"
+    ,institution="Eskenasy Institute of Computer Science, Tel-Aviv University"
+    ,month=Apr
+    ,number="98/88"
+    ,year=1988
+    }
+
+@article{vuil74
+    ,key={vuillemin}
+    ,author={Vuillemin, Jean}
+    ,title= {Correct and Optimal Implementations of Recursion in a Simple
+             Programming Language}
+    ,journal={Journal of Computer and Systems Science}
+    ,volume=9
+    ,number=3
+    ,year=1974
+    }
+   
+@techreport{wadl85
+    ,key="Wadler"
+    ,author="Wadler, P. and Miller, Q."
+    ,title="An Introduction to Orwell"
+    ,institution="Programming Research Group, Oxford University"
+    ,year=1985
+    }
+
+@InProceedings{abra86
+    ,Key={abramsky}
+    ,Author={Abramsky, A.}
+    ,Title={Strictness Analysis and Polymorphic Invariance}
+    ,Booktitle={Proceedings {DIKU} Workshop on Programs as Data Objects}
+    ,Organization={Springer-Verlag {LNCS} 217}
+    ,Year=1986
+    ,Pages={1-24}
+    }
+
+@article{stee75
+        ,key="Steele"
+        ,author="Steele, G.L. Jr."
+        ,title="Multiprocessing compactifying garbage collection"
+        ,journal="CACM"
+        ,volume=18
+        ,number=9
+        ,pages="491-500"
+        ,month=Sep
+        ,year=1975
+        }
+@article{wadl76
+        ,key="Wadler"
+        ,author="Wadler, P.L."
+        ,title="Analysis of an algorithm for real time garbage collection"
+        ,journal="CACM"
+        ,volume=19
+        ,number=9
+        ,pages="495-508"
+        ,month=Sep
+        ,year=1976
+        }
+@techreport{kell80a
+        ,key="Keller"
+        ,author="Keller, R.M."
+        ,title="Semantics and applications of function graphs"
+        ,institution="Department of Computer Science, University of Utah"
+        ,month=Oct
+        ,number="UUCS-80-112"
+        ,year=1980
+        }
+@book{knut73
+        ,key="Knuth"
+        ,author="Knuth, D.E."
+        ,title="The Art of Computer Programming"
+        ,volume=1
+        ,publisher="Addison-Wesley Publishing Company"
+        ,address="Reading, Mass."
+        ,year=1973
+        ,pages="406-451"
+        }
+@article{hibi80
+        ,key="Hibino"
+        ,author="Hibino, Y."
+        ,title="A practical parallel garbage collection algorithm
+                and its implementation"
+        ,journal="Sigarch Newsletter"
+        ,volume=8
+        ,number=3
+        ,pages="113-120"
+        ,month=May
+        ,year=1980
+        }
+@article{bake78
+        ,key="Baker"
+        ,author="Baker, H.G. Jr."
+        ,title="List processing in real time on a serial computer"
+        ,journal="CACM"
+        ,volume=21
+        ,number=4
+        ,pages="280-294"
+        ,month=Apr
+        ,year=1978
+        }
+@techreport{mins63
+        ,key="Minsky"
+        ,author="Minsky, M.L."
+        ,title="A LISP garbage collection algorithm using secondary storage"
+        ,institution="Mass. Institute of Technology, Cambridge, Mass."
+        ,type="AI Memo"
+        ,number=58
+        ,month=Oct
+        ,year=1963
+        }
+@techreport{lieb80
+        ,key="Lieberman"
+        ,author="Lieberman, H. and Hewitt, C."
+        ,title="A real time garbage collector that can recover
+                temporary storage quickly"
+        ,institution="Mass. Institute of Technology, Cambridge, Mass."
+        ,type="AI Memo"
+        ,number=569
+        ,month=Apr
+        ,year=1980
+        }
+@techreport{denn74
+        ,key="Dennis"
+        ,author="Dennis, J.B."
+        ,title="On storage management for advanced programming languages"
+        ,institution="Mass. Institute of Technology"
+        ,type="Computation Structures Group Memo"
+        ,number=109
+        ,month=Oct
+        ,year=1974
+        }
+@mastersthesis{nori79
+        ,key="Nori"
+        ,author="Nori, A.K."
+        ,title="A storage reclamation scheme for applicative multiprocessor system"
+        ,school="Department of Computer Science, University of Utah"
+        ,month=Dec
+        ,year=1979
+        }
+@phdthesis{bish77
+        ,key="Bishop"
+        ,author="Bishop, P."
+        ,title="Computer Systems with a Very Large Address Space
+                and Garbage Collection"
+        ,school="Laboratory for Computer Science, Mass. Institute of Technology"
+        ,month=May
+        ,year=1977
+        }
+@article{bobr80
+        ,key="Bobrow"
+        ,author="Bobrow, D.G."
+        ,title="Managing reentrant structures using reference counts"
+        ,journal="ACM Transactions on Programming Languages and Systems"
+        ,volume=2
+        ,number=3
+        ,pages="269-273"
+        ,month=Jul
+        ,year=1980
+        }
+@article{deut76
+        ,key="Deutsch"
+        ,author="Deutsch, L.P. and Bobrow, D.G."
+        ,title="An efficient incremental automatic garbage collector"
+        ,journal="CACM"
+        ,volume=19
+        ,number=9
+        ,pages="522-526"
+        ,month=Sep
+        ,year=1976
+        }
+@article{morr78
+        ,key="Morris"
+        ,author="Morris, F.L."
+        ,title="A time- and space-efficient garbage compaction algorithm"
+        ,journal="CACM"
+        ,volume=21
+        ,number=8
+        ,pages="662-665"
+        ,month=Aug
+        ,year=1978
+        }
+@article{wise79
+        ,key="Wise"
+        ,author="Wise, D.S."
+        ,title="Morris's garbage compaction algorithm restores reference counts"
+        ,journal="ACM Transactions on Programming Languages and Systems"
+        ,volume=1
+        ,number=1
+        ,pages="115-120"
+        ,month=jul
+        ,year=1979
+        }
+@article{back78
+        ,key="Backus"
+        ,author="Backus, J."
+        ,title="Can programming be liberated from the von {N}eumann style?
+                {A} functional style and its algebra of programs"
+        ,journal="CACM"
+        ,volume=21
+        ,number=8
+        ,pages="613-641"
+        ,month=Aug
+        ,year=1978
+        }
+@book{baas78
+        ,key="Baase"
+        ,author="Baase, S."
+        ,title="Computer Algorithms: Introduction to Design and Analysis"
+        ,publisher="Addison-Wesley Publishing Company"
+        ,address="Reading, Mass."
+        ,year=1978
+        }
+@article{jaya80
+        ,key="Jayaraman"
+        ,author="Jayaraman, B. and Keller, R.M."
+        ,title="Resource control in a demand-driven data-flow model"
+        ,journal="1980 International Conf. on Parallel Processing"
+        ,pages="118-127"
+        ,month=Aug
+        ,year=1980
+        }
+@article{grie77b
+        ,key="Gries"
+        ,author="David Gries"
+        ,title="An exercise in proving parallel programs correct"
+        ,journal="CACM"
+        ,volume=20
+        ,number=12
+        ,pages="921-930"
+        ,month=Dec
+        ,year=1977
+        }
+@techreport{kung77
+        ,key="Kung"
+        ,author="Kung, H.T. and Song, W."
+        ,title="An efficient parallel garbage collection system
+                and its correctness proof"
+        ,institution=" Department of Computer Science, Carnegie-Mellon University"
+        ,month=Sep
+        ,year=1977
+        }
+@techreport{bake77
+        ,key="Baker"
+        ,author="Baker, H.G. and Hewitt, C."
+        ,title="The incremental garbage collection of processes"
+        ,institution="Mass. Institute of Technology"
+        ,type="AI Working Paper"
+        ,number=149
+        ,month=Jul
+        ,year=1977
+        }
+@article{cohe81
+        ,key="Cohen"
+        ,author="Cohen, J."
+        ,title="Garbage collection of linked data structures"
+        ,journal="Computing Surveys"
+        ,volume=13
+        ,number=3
+        ,pages="341-367"
+        ,month=Sep
+        ,year=1981
+        }
+@phdthesis{alme80
+        ,key="Almes"
+        ,author="Almes, G.T."
+        ,title="Garbage Collection in an Object-Oriented System"
+        ,school="Carnegie-Mellon University"
+        ,month=Jun
+        ,year=1980
+        }
+@article{whit80
+        ,key="White"
+        ,author="White, J.L."
+        ,title="Address/memory management for a gigantic LISP environment or,
+                GC considered harmful"
+        ,journal="Proc. 1980 LISP Conf."
+        ,pages="119-127"
+        ,month=Jul
+        ,year=1980
+        }
+@article{lind74
+        ,key="Lindstrom"
+        ,author="Lindstrom, G."
+        ,title="Copying list structures using bounded work space"
+        ,journal="CACM"
+        ,volume=17
+        ,number=4
+        ,pages="198-202"
+        ,month=April
+        ,year=1974
+        }
+@article{grit81
+        ,key="Grit"
+        ,author="Grit, D.H. and Page, R.L."
+        ,title="Deleting irrelevant tasks in an expression oriented
+                multiprocessor system"
+        ,journal="ACM Transactions on Programming Languages and Systems"
+        ,volume=3
+        ,number=1
+        ,pages="49-59"
+        ,month=jan
+        ,year=1981
+        }
+@article{clar77
+        ,key="Clark"
+        ,author="Clark, D.W."
+        ,title="An empirical study of list structure in LISP"
+        ,journal="CACM"
+        ,volume=20
+        ,number=2
+        ,pages="78-87"
+        ,month=Feb
+        ,year=1977
+        }
+@phdthesis{owic75
+        ,key="Owicki"
+        ,author="Owicki, S."
+        ,title="Axiomatic Proof Techniques For Parallel Programs"
+        ,school="Cornell University, Department of Computer Science TR 75-251"
+        ,month=Jul
+        ,year=1975
+        }
+@techreport{owic80
+        ,key="Owicki"
+        ,author="Owicki, S. and Lamport, Leslie"
+        ,title="Proving liveness properties of concurrent programs"
+        ,institution="Stanford University/SRI International"
+        ,number="57 (S\&L 1)"
+        ,month=Oct
+        ,year=1980
+        }
+@techreport{lamp75
+        ,key="Lamport"
+        ,author="Lamport, Leslie"
+        ,title="On-the-fly garbage collection: once more with rigor"
+        ,institution=" CA-7508-1611, Massachusetts Computer Associates"
+        ,month=Aug
+        ,year=1975
+        }
+@techreport{lamp76
+        ,key="Lamport"
+        ,author="Lamport, Leslie"
+        ,title="Garbage collection with multiple processors:
+                an exercise in parallelism"
+        ,institution=" CA-7602-2511, Massachusetts Computer Associates"
+        ,month=Feb
+        ,year=1976
+        }
+@TechReport{
+        Halstead78,
+        key="Halstead",
+        author={Halstead, R.H. Jr},
+        title={Multiple-processor implementations of message-passing systems},
+        institution={MIT Laboratory for Computer Science},
+        number={MIT/LCS/TR-198},
+        month=Jan,
+        year=1978}
+
+@TechReport{
+        Halstead79,
+        Key={Halstead},
+        Author={Halstead, R.H. Jr.},
+        Institution={ MIT Laboratory for Computer Science},
+        Title={Reference tree networks: virtual machine and implementation},
+        Year={1979},
+        Number={MIT/LCS/TR-22}}
+
+@TechReport{
+        FriedmanWise78c,
+        key="Friedman",
+        author={Friedman, D.P. and Wise, D.S.},
+        title={Applicative multiprogramming},
+        number= 72,
+        institution={Computer Science Department, Indiana University},
+        month=Dec,
+        year=1978}
+
+@inproceedings{mcca67
+        ,key="McCarthy"
+        ,author="McCarthy,J."
+        ,title="A basis of the mathematical theory of computation"
+        ,booktitle="Programming Systems and Languages"
+        ,editors="Braffort, P. and Hirschberg, D."
+        ,pages="455-480"
+        ,year=1967
+        ,publisher="McGraw-Hill, New York"}
+
+@article{grie77a
+        ,key="Gries"
+        ,author="Gries, D."
+        ,title="On believing programs to be correct"
+        ,journal="CACM"
+        ,volume=20
+        ,number=1
+        ,pages="49-50"
+        ,month=Jan
+        ,year=1977
+        }
+@phdthesis{mull76
+        ,key="Muller"
+        ,author="Muller, K.G."
+        ,title="On The Feasibility Of Concurrent Garbage Collection"
+        ,school="Technical Hogeschool Delft"
+        ,month=Mar
+        ,year=1976
+        }
+@article{fran78
+        ,key="Francez"
+        ,author="Francez, N."
+        ,title="An application of a method for the analysis of cyclic programs"
+        ,journal="IEEE Transactions on Software Engineering"
+        ,volume=4
+        ,number=5
+        ,pages="371-377"
+        ,month=Sep
+        ,year=1978
+        }
+@techreport{huda80
+        ,key="Hudak"
+        ,author="Hudak, P."
+        ,title="Memory management in applicative language architectures"
+        ,institution="University of Utah"
+        ,type="Department of Computer Science PhD Research Proposal"
+        ,month=Oct
+        ,year=1980
+        }
+@techreport{jhon82
+        ,key="jhon"
+        ,author="Jhon, C.S. and Keller, R."
+        ,title="Analysis of unbounded token-flow graphs and realization of
+                unbounded token-flow graph by bounded token-flow graphs"
+        ,institution="University of Utah"
+        ,type="AMPS Technical Memorandum"
+        ,number=8
+        ,month=April
+        ,year=1982
+        }
+@inproceedings{wadg79
+        ,key="wadge"
+        ,author="Wadge, W.W."
+        ,title="An extensional treatment of dataflow deadlock"
+        ,editor="Kahn, G."
+        ,booktitle="Semantics of Concurrent Computation"
+        ,pages="285-299"
+        ,year=1979
+        ,publisher="Springer-Verlag"
+        }
+@phdthesis{hunt82
+        ,key="hunt"
+        ,author="Hunt, F."
+        ,title="Applicative updating and provisional computation in
+                functional programmming"
+        ,school="University of Utah"
+        ,month=Aug
+        ,year=1982
+        }
+@article{coll60
+        ,key="Collins"
+        ,author="Collins, G.E."
+        ,title="A method for overlapping and erasure of lists"
+        ,journal="CACM"
+        ,volume=3
+        ,number=12
+        ,pages="655-657"
+        ,month=Dec
+        ,year="1960"
+        }
+@article{coll66
+        ,key="Collins"
+        ,author="Collins, G.E."
+        ,title="PM, a system for polynomial manipulation"
+        ,journal="CACM"
+        ,volume=9
+        ,number=8
+        ,pages="578-589"
+        ,month=Aug
+        ,year=1966
+        }
+@article{mcca60
+        ,key="McCarthy"
+        ,author="McCarthy, J."
+        ,title="Recursive functions of symbolic expressions and their
+                computation by machine, {P}art {I}"
+        ,journal="CACM"
+        ,volume=3
+        ,number=4
+        ,pages="184-195"
+        ,month=Apr
+        ,year=1960
+        }
+@article{weiz63
+        ,key="Weizenbaum"
+        ,author="Weizenbaum, J."
+        ,title="Symmetric list processor"
+        ,journal="CACM"
+        ,volume=6
+        ,number=9
+        ,pages="524-544"
+        ,month=Sep
+        ,year=1963
+        }
+@techreport{huda81a
+        ,key="Hudak"
+        ,author="Hudak, P."
+        ,title="Call-graph reclamation: an alternative storage
+                reclamation scheme"
+        ,institution="Department of Computer Science, University of Utah"
+        ,type="AMPS Technical Memorandum"
+        ,number=4
+        ,month=Aug
+        ,year=1981
+        }
+@InProceedings{davis78a,
+        key={Davis},
+        author={Davis, A.L.},
+        title={The architecture and system method of {DDM}-1: a
+                recursively-structured data driven machine},
+        booktitle={Proceedings Fifth Annual Symposium on Computer Architecture},
+        year=1978}
+@InProceedings{Denn74a,
+        key={Dennis},
+        Author={Dennis, J.B. and Misunas, D.P.},
+        Title={A preliminary architecture for a basic data-flow processor},
+        BookTitle={Proc. 2nd Annual Symposium on Computer Architecture},
+        year={1974},
+        Organization={ACM, IEEE},
+        pages={126-132},
+        date={December 1974}}
+@Article{Mago79,
+        key={Mago},
+        author={Mago, G.A.},
+        volume={8},
+        number={5},
+        title={A network of microprocessors to execute reduction languages, Part I},
+        journal={International Journal of Computer and Information Sciences},
+        publisher={Plenum Publishing Corp},
+        Month=Mar,
+        year={1979 revised},
+        pages={349-385}}
+@article{rem81
+        ,key="Rem"
+        ,author="Rem, M."
+        ,title="Associons: a program notation with tuples instead of variables"
+        ,journal="ACM Transactions on Programming Languages and Systems"
+        ,volume=3
+        ,number=3
+        ,pages="251-262"
+        ,month=Jul
+        ,year=1981
+        }
+@phdthesis{huda82a
+        ,key="Hudak"
+        ,author="Hudak, P."
+        ,title="Object and Task Reclamation in Distributed Applicative
+                Processing Systems"
+        ,school="University of Utah"
+        ,month=Jul
+        ,year=1982
+        }
+@techreport{ward74
+        ,key="Ward"
+        ,author="Ward, S.A."
+        ,title="Functional domains of applicative languages"
+        ,institution="Mass. Institute of Technology"
+        ,type="Project MAC"
+        ,number="TR-136"
+        ,month=Sep
+        ,year=1974
+        }
+@TechReport{Hearn74,
+        key={Hearn},
+        author={Hearn, A.C.},
+        title={Reduce 2 symbolic mode primer},
+        type={Utah Symbolic Computation Group, Operating Note},
+        number={5.1},
+        institution={University of Utah},
+        month=October,
+        year={1974}}
+@article{frie78
+        ,key="Friedman"
+        ,author="Friedman, D.P. and Wise, D.S."
+        ,title="Aspects of applicative programming for parallel processing"
+        ,journal="IEEE Transactions Computers"
+        ,volume=27
+        ,number=4
+        ,pages="289-296"
+        ,month=April
+        ,year=1978
+        }
+@article{scho67
+        ,key="Schorr"
+        ,author="Schorr, H. and Waite, W."
+        ,title="An efficient machine-independent procedure for garbage
+                collection in various list structures"
+        ,journal="CACM"
+        ,volume=10
+        ,number=8
+        ,pages="501-506"
+        ,month=Aug
+        ,year=1967
+        }
+@article{john80
+        ,key="Johnson"
+        ,author="Johnson, D. et al."
+        ,title="Automatic partitioning of programs in multiprocessor systems"
+        ,journal="Proceedings Compcon Spring 80"
+        ,pages="175-178"
+        ,month=Feb
+        ,year=1980
+        }
+@article{wats82
+        ,key="Watson"
+        ,author="Watson, I. and Gurd, J.R."
+        ,title="A practical data flow computer"
+        ,journal="Computer"
+        ,volume=15
+        ,number=2
+        ,pages="51-57"
+        ,month=Feb
+        ,year=1982
+        }
+@InProceedings{
+        Berk81,
+        Key={Berkling},
+        Author={K. Berkling},
+        BookTitle={the Symposium on functional languages and computer
+                architecture},
+        Organization={Chalmers University of Technology and
+                Goteborg University},
+        Title={Transformations in a reduction system.},
+        Year={1981},
+        Editors={Homstrom, et al.},
+        Month=Jun,
+        Pages={64-71}}
+@InProceedings{
+        Berk75,
+        key={Berkling},
+        author={K. J. Berkling},
+        title={Reduction languages for reduction machines},
+        booktitle={Proceedings 2nd Annual Symposium on Computer Architecture},
+        organization={IEEE},
+        pages={133-140},
+        year={1975}}
+@article{rumb77
+        ,key="Rumbaugh"
+        ,author="Rumbaugh J."
+        ,title="A data flow multiprocessor."
+        ,journal="IEEE Transactions on Computers"
+        ,volume="C-26"
+        ,number=2
+        ,pages="138-146"
+        ,month=Feb
+        ,year=1977
+        }
+@techreport{gris82
+        ,key="Griss"
+        ,author="Griss, M.L. and Morrison, B."
+        ,title="The portable standard LISP users manual"
+        ,institution="University of Utah"
+        ,type="Utah Symbolic Computation Group"
+        ,number="V3"
+        ,month=May
+        ,year=1982
+        }
+@article{turn79
+    ,key="Turner"
+    ,author="Turner, D.A."
+    ,title="A new implementation technique for applicative languages"
+    ,journal="Software --- Practice and Experience"
+    ,volume=9
+    ,pages="31-49"
+    ,year=1979
+    }
+@article{turn79b
+    ,key={Turner}
+    ,author={Turner, D.A.}
+    ,title={Another algorithm for bracket abstraction}
+    ,journal={The Journal of Symbolic Logic}
+    ,volume=44
+    ,number=2
+    ,month=Jun
+    ,year=1979
+    ,pages={267-270}
+    }
+@article{abda76
+    ,key={abdali}
+    ,author={Abdali, S.K.}
+    ,title={An abstraction algorithm for combinatory logic}
+    ,journal={The Journal of Symbolic Logic}
+    ,volume=41
+    ,number=1
+    ,month=Mar
+    ,year=1976
+    ,pages={222-224}
+    }
+@phdthesis{abda74
+    ,key={abdali}
+    ,author={Abdali, S.K.}
+    ,title={A Combinatory Logic Model of Programming Languages}
+    ,school={University of Wisconsin}
+    ,year=1974
+    }
+@InProceedings{klug80
+    ,key={kluge}
+    ,author={Kluge, W. and Schlutter, H.}
+    ,booktitle={Proc. International Workshop on High-Level Language
+                Computer Architecture}
+    ,title={An architecture for direct execution of reduction languages}
+    ,year=1980
+    ,editors={Chu, et al.}
+    ,month=May
+    ,pages={174-180}
+    }
+@InProceedings{huda82b
+    ,key={Hudak}
+    ,author={Hudak, P. and Keller, R.M.}
+    ,title={Garbage collection and task deletion in distributed applicative
+            processing systems}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,editors={Park, et al.}
+    ,month=Aug
+    ,pages={168-178}
+    }
+@article{huda83b
+    ,key={Hudak}
+    ,author={Hudak, P.}
+    ,title={Decentralized marking of an evolving graph}
+    ,year=1983
+    ,journal={submitted to TOPLAS}
+    }
+@techreport{huda83a
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Distributed Graph Marking}
+    ,institution={Yale University}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-268}
+    ,month=Jan
+    ,year=1983
+    }
+@InProceedings{huda83c
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Distributed Task and Memory Management}
+    ,booktitle={Proceedings of Symposium on Principles of Distributed Computing}
+    ,organization={ACM}
+    ,year=1983
+    ,editors={Lynch, N.A., et al.}
+    ,month=Aug
+    ,pages={277-289}
+    }
+@InProceedings{hugh82
+    ,key={hughes}
+    ,author={Hughes, R.J.M.}
+    ,title={Super-combinators: a new implementation method for
+            applicative languages}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,editors={Park, et al.}
+    ,month=Aug
+    ,pages={1-10}
+    }
+@InProceedings{much82
+    ,key={muchnick}
+    ,author={Muchnick, S.S. and Jones, Neil D.}
+    ,title={A fixed-program machine for combinator expression evaluation}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,editors={Park, et al.}
+    ,month=Aug
+    ,pages={11-20}
+    }
+@InProceedings{peyt82
+    ,key={peyton}
+    ,author={Peyton Jones, Simon L.}
+    ,title={An investigation of the relative efficiencies of combinators
+            and lambda expressions}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,editors={Park, et al.}
+    ,month=Aug
+    ,pages={150-158}
+    }
+@InProceedings{ross82
+    ,key={rosser}
+    ,author={Rosser, J.B.}
+    ,title={Highlights of the history of the lambda-calculus}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,editors={Park, et al.}
+    ,month=Aug
+    ,pages={216-225}
+    }
+@InProceedings{hewi80
+    ,key={hewitt}
+    ,author={Hewitt, C.}
+    ,title={Design of the APIARY for actor systems}
+    ,booktitle={The 1980 LISP Conf.}
+    ,organization={Stanford University}
+    ,year=1980
+    ,editors={Davis, R.E. and Allen, J.R.}
+    ,month=Aug
+    ,pages={107-118}
+    }
+@InProceedings{trel80b
+    ,key={treleaven}
+    ,author={Treleaven, P.C. and Mole, L.F.}
+    ,title={A multi-processor reduction machine for user-defined
+            reduction languages}
+    ,booktitle={Proc. 7'th International Symposium on Computer Architecture}
+    ,organization={IEEE}
+    ,year=1980
+    ,month=May
+    ,pages={121-130}
+    }
+@book{curr58
+    ,key={curry}
+    ,author={Curry, H.K. and Feys, R.}
+    ,title={Combinatory Logic}
+    ,publisher={Noth-Holland Pub. Co.}
+    ,address={Amsterdam}
+    ,year=1958
+    }
+@article{scho24
+    ,key={schonfinkel}
+    ,author={Sch\"{o}nfinkel, M.}
+    ,title={Uber die bausteine der mathematischen logik}
+    ,journal={Mathematische Annalen}
+    ,volume=92
+    ,year=1924
+    ,pages={305}
+    }
+@article{lmi82
+    ,key={lmi}
+    ,author={LISP Machine, Inc.}
+    ,title={LMI introduces lambda: the next generation LISP machine}
+    ,journal={LMI Newsletter}
+    ,volume=2
+    ,number=1
+    ,month=Jul
+    ,year=1982
+    }
+@inproceedings{rees82
+    ,key={rees}
+    ,author={Rees, J.A. and Adams, N.I.}
+    ,title={T: a dialect of LISP or, Lambda: the ultimate software tool}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,editors={Park, et al.}
+    ,month=Aug
+    ,pages={114-122}
+    }
+@techreport{xero82
+    ,key={xerox}
+    ,author={Xerox}
+    ,title={The Xerox 1100 Smalltalk-80 system}
+    ,institution={Xerox Corp.}
+    ,type={Advertising Literature}
+    ,number={2M 8/82R 3221}
+    ,month=Aug
+    ,year=1982
+    }
+@techreport{kell82
+    ,key={keller}
+    ,author={Keller, R.M.}
+    ,title={FEL programmer's guide}
+    ,institution={University of Utah}
+    ,type={AMPS TR}
+    ,number=7
+    ,month=Mar
+    ,year=1982
+    }
+@techreport{turn76
+    ,key={turner}
+    ,author={Turner, D.A.}
+    ,title={SASL language manual}
+    ,institution={University of St. Andrews}
+    ,year=1976
+    }
+@article{demi82
+    ,key={deminet}
+    ,author={Deminet, J.}
+    ,title={Experience with multiprocessor algorithms}
+    ,journal={IEEE Transactions on Computers}
+    ,volume={C-41}
+    ,number=4
+    ,month=Apr
+    ,year=1982
+    ,pages={278-287}
+    }
+@article{misr82a
+    ,key={misra}
+    ,author={Misra, J. and Chandy, K.M.}
+    ,title={A distributed graph algorithm: knot detection}
+    ,journal={ACM Transactions Programming Languages Syst.}
+    ,volume=4
+    ,number=4
+    ,month=Oct
+    ,year=1982
+    ,pages={678-686}
+    }
+@article{chand82a
+    ,key={chandy}
+    ,author={Chandy, K.M. and Misra, J.}
+    ,title={Distributed computation on graphs: shortest path algorithms}
+    ,journal={CACM}
+    ,volume=25
+    ,number=11
+    ,month=Nov
+    ,year=1982
+    ,pages={833-837}
+    }
+@article{dijk80
+    ,key={dijkstra}
+    ,author={Dijkstra, E.W. and Scholten, C.S.}
+    ,title={Termination detection for diffusing computations}
+    ,journal={Information Processing Letters}
+    ,volume=11
+    ,number=1
+    ,month=Aug
+    ,year=1980
+    ,pages={1-4}
+    }
+@phdthesis{chanxx
+    ,key={chang}
+    ,author={Chang, E.}
+    ,title={}
+    ,school={University of Waterloo}
+    ,month={}
+    ,year={}
+    }
+@techreport{chanyy
+    ,key={chang}
+    ,author={Chang, E.}
+    ,title={Decentralized deadlock detection in distributed systems}
+    ,institution={University of Victoria, Victoria, B.C., Canada}
+    ,year=1978
+    }
+
+@InProceedings{kenna82
+    ,key={kennaway}
+    ,author={Kennaway, J.R. and Sleep, M.R.}
+    ,title={Expressions as Processes}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    ,pages={21-28}
+    }
+
+@InProceedings{lisk82
+    ,key={liskov}
+    ,author={Liskov, B. and Scheifler, R.}
+    ,title={Guardians and Actions: Linguistic Support for Robust,
+            Distributed Programs}
+    ,booktitle={9th ACM Symposium on Principles of Programming Lan.}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Jan
+    ,pages={7-19}
+    }
+
+@InProceedings{broy81
+    ,key={broy}
+
+    ,author={Broy, Manfred}
+    ,title={A fixed point approach to applicative multi-programming}
+    ,booktitle={Lecture Notes}
+    ,organization={International Summer School on Theoretical Foundations
+                   of Programming Methodology}
+    ,year=1981
+    ,annote={Considers both fixed point and operational semantics for a form
+    of parallelism in a simple nondeterministic applicative programming
+    language.  The operational semantics are given by a system of term
+    rewriting rules based on a dataflow semantics.  The fixed point
+    semantics is based on multi-domains.}
+    }
+
+@article{cons79
+    ,key={constable}
+    ,author={Constable, R.L. and Donohue, J.E.}
+    ,title={A hierarchical approach to formal semantics with application
+            to the definition of PL/CS}
+    ,journal={TOPLAS}
+    ,volume=1
+    ,number=1
+    ,month=Jul
+    ,year=1979
+    ,pages={98-114}
+    }
+
+@inproceedings{kell78
+    ,key={keller}
+    ,author={Keller, R.M.}
+    ,title={Denotational models for parallel programs with indeterminate operators}
+    ,booktitle={Formal Descriptions of Programming Concepts}
+    ,editors={Neuhold, E.J.}
+    ,pages={337-336}
+    ,year=1978
+    ,publisher={North-Holland}
+    ,annote={Discusses various models for indeterminate operators in FGL.}
+    }
+
+@InProceedings{kosi78
+    ,key={kosinski}
+    ,author={Kosinski, P.R.}
+    ,title={A straightfprward denotational semantics for non-determinate
+            data flow programs}
+    ,booktitle={Fifth Annual Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1978
+    ,month=Jan
+    ,pages={214-221}
+    }
+
+@techreport{moss79
+    ,key={mosses}
+    ,author={Mosses, P.D.}
+    ,title={SIS -- Semantics implementation system: 
+            Reference manual and user guide}
+    ,institution={University of Aarhus}
+    ,type={Department of Computer Science}
+    ,number={DAIMI MD-30}
+    ,year=1979
+    ,annote={Guide to best known implementation system driven by den. sem.}
+    }
+
+@techreport{mycr81
+    ,key={mycroft}
+    ,author={Mycroft, A.}
+    ,title={Call-by-need = call-by-value + conditional}
+    ,institution={University of Edinburugh}
+    ,type={Draft, Department of Computer Science}
+    ,year=1981
+    }
+
+@InProceedings{pola81
+    ,key={polak}
+    ,author={Polak, W.}
+    ,title={Program verification based on denotational semantics}
+    ,booktitle={8th Annual Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1981
+    ,month=Jan
+    ,pages={149-158}
+    }
+
+@techreport{sche78
+    ,key={scheifler}
+    ,author={Scheifler, R.W.}
+    ,title={A denotational semantics for CLU}
+    ,institution={MIT}
+    ,type={LCS}
+    ,number={TR-201}
+    ,month=May
+    ,year=1978
+    }
+
+@inproceedings{schw79
+    ,key={schwarz}
+    ,author={Schwarz, J.S.}
+    ,title={Denotational semantics of parallelism}
+    ,booktitle={Semantics of Concurrent Computation -- LNCS 70}
+    ,editors={Kahn, G.}
+    ,pages={191-202}
+    ,year=1979
+    ,publisher={Springer-Verlag}
+    }
+
+@article{scot76
+    ,key={Scott}
+    ,author={Scott, D.S.}
+    ,title={Data Types as Lattices}
+    ,journal={SIAM Journal of Computing}
+    ,volume=5
+    ,number=3
+    ,month=Sep
+    ,year=1976
+    ,pages={522-587}
+    ,annote={Gospel from the prophet.}
+    }
+
+@techreport{scot81
+    ,key={scott}
+    ,author={Scott, D.S.}
+    ,title={Lecture Notes on a Mathematical Theory of Computation}
+    ,institution={Oxford University}
+    ,type={Programming Research Group}
+    ,number={PRG-19}
+    ,month=May
+    ,year=1981
+    ,annote={From 1980 lectures.  A treatment of the foundations for
+    denotational semantics, based on neighborhood systems.}
+    }
+
+@techreport{scot70
+    ,key={scott}
+    ,author={Scott, D.S.}
+    ,title={Outline of a Mathematical Theory of Computation}
+    ,institution={Oxford University}
+    ,type={Programming Research Group}
+    ,number={PRG-2}
+    ,month=Nov
+    ,year=1970
+    ,annote={Early domain theory.  I have one other article by Scott written
+    when he was at Princeton, called "Lattice Theory, Data Types and
+    Semantics".  I don't know where I got it from.}
+    }
+
+@techreport{seth81
+    ,key={sethi}
+    ,author={Sethi, R.}
+    ,title={Control flow aspects of semantics directed compiling}
+    ,institution={Bell Labs}
+    ,type={CS Technical Report}
+    ,number=98
+    ,month=Sep
+    ,year=1981
+    }
+
+@article{wads76
+    ,key={wadsworth}
+    ,author={Wadsworth, C.P.}
+    ,title={The relation between computational and denotational
+    properties for Scott's models of the lambda-calculus}
+    ,journal={SIAM Journal of Computing}
+    ,volume=5
+    ,number=3
+    ,month=Sep
+    ,year=1976
+    ,pages={488-521}
+    }
+
+@article{ashc76
+    ,key={ashcroft}
+    ,author={Ashcroft, E.A. and Wadge, W.W.}
+    ,title={Lucid -- A formal system for writing and proving programs}
+    ,journal={SIAM Journal of Computing}
+    ,volume=5
+    ,number=3
+    ,month=Sep
+    ,year=1976
+    ,pages={336-354}
+    }
+
+@article{plot76
+    ,key={plotkin}
+    ,author={Gordon D. Plotkin}
+    ,title={A powerdomain construction}
+    ,journal={SIAM Journal of Computing}
+    ,volume=5
+    ,number=3
+    ,month=Sep
+    ,year=1976
+    ,pages={452-487}
+    ,annote={Hard to read.}
+    }
+
+@article{mann76
+    ,key={manna}
+    ,author={Manna, Z. and Shamir, A.}
+    ,title={The theoretical aspects of the optimal fixpoint}
+    ,journal={SIAM Journal of Computing}
+    ,volume=5
+    ,number=3
+    ,month=Sep
+    ,year=1976
+    ,pages={414-426}
+    }
+
+@article{down78
+    ,key={downey}
+    ,author={Downey, P.J. and Sethi, R.}
+    ,title={Correct computation rules for recursive languages}
+    ,journal={SIAM Journal of Computing}
+    ,volume=5
+    ,number=3
+    ,month=Sep
+    ,year=1976
+    ,pages={378-401}
+    }
+
+@article{milner79
+    ,key={milner}
+    ,author={Milner, R.}
+    ,title={Flowgraphs and flow algebras}
+    ,journal={JACM}
+    ,volume=26
+    ,number=4
+    ,month=oct
+    ,year=1979
+    ,pages={794-818}
+    ,annote={Companion paper to "Concurrent processes and their syntax".
+    Uses category theory and free algebras to give semantics to process nets.}
+    }
+
+@article{milne79
+    ,key={milne}
+    ,author={Milne, G. and Milner, R.}
+    ,title={Concurrent processes and their syntax}
+    ,journal={JACM}
+    ,volume=26
+    ,number=2
+    ,month=Apr
+    ,year=1979
+    ,pages={302-321}
+    }
+
+@techreport{mane79
+    ,key={manes}
+    ,author={Manes, E.G.}
+    ,title={Partially-additive semantics: a progress report}
+    ,institution={University of Mass.}
+    ,type={COINS Technical Report}
+    ,number={79-8}
+    ,month=May
+    ,year=1979
+    }
+
+@techreport{stee81
+    ,key={steenstrup}
+    ,author={Steenstrup, M. and Arbib, M.A.}
+    ,title={Port automata and the algebra of concurrent processes}
+    ,institution={University of Mass.}
+    ,type={COINS Technical Report}
+    ,number={81-25}
+    ,month=oct
+    ,year=1981
+    }
+@inproceedings{smyt76
+    ,key={smyth}
+    ,author={Smyth, Michael B.}
+    ,title={Powerdomains}
+    ,booktitle={the Mathematical Foundations of
+                Computer Science Symposium}
+    ,pages={537-543},
+  series =       LNCS,
+  volume =       45
+    ,year=1976
+    ,publisher={Springer-Verlag}
+    ,annote={Good discussion of powerdomains -- more readable than Plotkin.}
+    }
+
+
+@Article{SmythMB:pow,
+  author =       "Michael B. Smyth",
+  title =        "Powerdomains",
+  journal =      "Journal of Computer and Systems Sciences",
+  year =         "1978",
+  pages =        "23--36",
+  month =        feb,
+  volume =       "16",
+  number =       "1",
+}
+
+@inproceedings{pnue79
+    ,key={pnueli}
+    ,author={Pnueli, A.}
+    ,title={The temporal semantics of concurrent programs}
+    ,booktitle={Semantics of Concurrent Computation -- LNCS 70}
+    ,editors={Kahn, G.}
+    ,pages={1-20}
+    ,year=1979
+    ,publisher={Springer-Verlag}
+    }
+@inproceedings{frie79
+    ,key={friedman}
+    ,author={Friedman, D.P. and Wise, D.S.}
+    ,title={An approach to fair applicative multiprogramming}
+    ,booktitle={Semantics of Concurrent Computation -- LNCS 70}
+    ,editors={Kahn, G.}
+    ,pages={203-225}
+    ,year=1979
+    ,publisher={Springer-Verlag}
+    }
+@InProceedings{back82
+    ,key={back}
+    ,author={Back, R.J.R. and Mannila, H.}
+    ,title={A refinement of Kahn's semantics to handle non-determinism
+    and communication}
+    ,booktitle={Proceedings of Symposium on Principles of Distributed Computing}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    ,pages={111-120}
+    }
+
+@InProceedings{milner82
+    ,key={milner}
+    ,author={Milner, R.}
+    ,title={Four Combinators for Concurrency}
+    ,booktitle={Proceedings of Symposium on Principles of Distributed Computing}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    ,pages={104-110}
+    }
+
+@InProceedings{clin82
+    ,key={clinger}
+    ,author={Clinger, W.}
+    ,title={Nondeterministic call by need is neither lazy nor by name}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    ,pages={226-234}
+    }
+
+@InProceedings{macq82
+    ,key={macqueen}
+    ,author={MacQueen, D.B. and Sethi, R.}
+    ,title={A semantic model of types for applicative languages}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    ,pages={243-252}
+    }
+
+@InProceedings{cart82
+    ,key={cartwright}
+    ,author={Cartwright, R. and Donahue, J.}
+    ,title={The semantics of lazy (and industrious) evaluation}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    ,pages={253-264}
+    }
+
+@techreport{backus72
+    ,key={backus}
+    ,author={Backus, J.}
+    ,title={Reduction languages and variable-free programming}
+    ,institution={IBM Research}
+    ,number={RJ 1010}
+    ,month=Apr
+    ,year=1972
+    }
+
+@InProceedings{backus82
+    ,key={backus}
+    ,author={Backus, J.}
+    ,title={Function level programs as mathematical objects}
+    ,booktitle={Proceedings 1982 ACM Conf. on LISP and 
+                Functional Programming}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    ,pages={1-10}
+    }
+
+@InProceedings{wand82
+    ,key={wand}
+    ,author={Wand, M.}
+    ,title={Semantics-directed machine architecture}
+    ,booktitle={9th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Jan
+    ,pages={234-241}
+    }
+@InProceedings{wand83
+    ,key={wand}
+    ,author={Wand, M.}
+    ,title={Loops in combinator-based compilers}
+    ,booktitle={10th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1983
+    ,month=Jan
+    ,pages={190-196}
+    }
+
+@InProceedings{hens82
+    ,key={henson}
+    ,author={Henson, M.C. and Turner, R.}
+    ,title={Completion semantics and interpreter generation}
+    ,booktitle={9th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Jan
+    ,pages={242-254}
+    }
+
+@phdthesis{clin81
+    ,key={clinger}
+    ,author={Clinger, W.D.}
+    ,title={Foundations of Actor Semantics}
+    ,school={MIT}
+    ,month=May
+    ,year=1981
+    }
+
+@phdthesis{smit82
+    ,key={smith}
+    ,author={Smith, B.C.}
+    ,title={Reflection and Semantics in a Procedural Language}
+    ,school={MIT}
+    ,month=Jan
+    ,year=1982
+    }
+
+@inproceedings{mann81
+    ,key={manna}
+    ,author={Manna, Z. and Wolper, P.}
+    ,title={Synthesis of communicating processes from temporal logic
+    specifications}
+    ,booktitle={Workshop on Logics of Programs -- LNCS}
+    ,pages={1-28?}
+    ,year=1981
+    ,publisher={Springer-Verlag}
+    }
+
+@techreport{puru82
+    ,key={purushothaman}
+    ,author={Purushothaman, S. and Subrahmanyam, P.A.}
+    ,title={Modelling of call-by-need and stream primitives using CCS}
+    ,institution={University of Utah}
+    ,type={unpublished manuscript}
+    ,month=Jun
+    ,year=1982
+    }
+
+@article{raou80
+    ,key={raoult}
+    ,author={Raoult, Jean-Claude and Vuillemin, Jean}
+    ,title={Operational and semantic equivalence between recursive programs}
+    ,journal={JACM}
+    ,volume=27
+    ,number=4
+    ,month=Oct
+    ,year=1980
+    ,pages={772-796}
+    }
+
+@article{arbi82
+    ,key={arbib}
+    ,author={Arbib, M.A. and Manes, E.G.}
+    ,title={The pattern-of-calls expansion is the canonical fixpoint
+    for recursive definitions}
+    ,journal={JACM}
+    ,volume=29
+    ,number=2
+    ,month=Apr
+    ,year=1982
+    ,pages={577-602}
+    }
+
+@article{meye82
+    ,key={meyer}
+    ,author={Meyer, A.R. and Halpern, J.Y.}
+    ,title={Axiomatic definitions of programming languages: a theoretical
+            assessment}
+    ,journal={JACM}
+    ,volume=29
+    ,number=2
+    ,month=Apr
+    ,year=1982
+    ,pages={555-576}
+    }
+
+@article{ashc82
+    ,key={ashcroft}
+    ,author={Ashcroft, E.A. and Wadge, W.W.}
+    ,title={Rx for semantics}
+    ,journal={TOPLAS}
+    ,volume=4
+    ,number=2
+    ,month=Apr
+    ,year=1982
+    ,pages={283-294}
+    }
+
+@article{hoar69
+    ,key={hoare}
+    ,author={Hoare, C.A.R.}
+    ,title={An axiomatic basis for computer programming}
+    ,journal={CACM}
+    ,volume=12
+    ,month=Dec
+    ,year=1969
+    ,pages={576-580}
+    ,annote={Established the standard for the axiomatic verification method}
+    }
+
+@article{smyt82
+    ,key={smyth}
+    ,author={Smyth, M.B. and Plotkin, G.D.}
+    ,title={The category-theoretic solution of recursive domain equations}
+    ,journal={SIAM Journal of Computing}
+    ,volume=11
+    ,number=4
+    ,month=Nov
+    ,year=1982
+    ,pages={761-783}
+    ,annote={Anyone who can adequately explain to me the contents of this
+    paper gets an automatic honors...}
+    }
+
+@book{stoy77
+    ,key={stoy}
+    ,author={Stoy, J.E.}
+    ,title={Denotational Semantics: The Scott-Strachey Approach to Programming
+    Language Theory}
+    ,publisher={The MIT Press}
+    ,address={Cambridge, Mass.}
+    ,year=1977
+    }
+
+@book{gord79
+    ,key={gordon}
+    ,author={Gordon, J.C.}
+    ,title={The Denotational Description of Programming Languages}
+    ,publisher={Springer-Verlag}
+    ,address={New York}
+    ,year=1979
+    }
+
+@techreport{davi78
+    ,key={davis}
+    ,author={Davis, A.L.}
+    ,title={Data driven nets: a maximally concurrent, procedural, parallel
+            pocess representation for distributed control systems}
+    ,institution={University of Utah}
+    ,number={UUCS-78-108}
+    ,month=Jul
+    ,year=1978
+    }
+
+@techreport{davi77
+    ,key={davis}
+    ,author={Davis, A.L.}
+    ,title={The architecture of DDM1: a recursively structured data driven
+            machine}
+    ,institution={University of Utah}
+    ,number={UUCS-77-113}
+    ,month=Oct
+    ,year=1977
+    }
+
+@techreport{acke79
+    ,key={ackerman}
+    ,author={Ackerman, W.B. and Dennis, J.B}
+    ,title={VAL -- a value-oriented algorithmic language preliminary
+    reference manual}
+    ,institution={MIT}
+    ,type={Laboratory for Computer Science}
+    ,number={MIT/LCS/TR-218}
+    ,month=Jun
+    ,year=1979
+    }
+
+@techreport{arvi80
+    ,key={arvind}
+    ,author={Arvind}
+    ,title={I-structures: an efficient data type for functional languages}
+    ,institution={MIT}
+    ,type={Technical Memo}
+    ,number={MIT/LCS/TM-210}
+    ,month=Sep
+    ,year=1980
+    }
+
+@article{mcgr82
+    ,key={mcgraw}
+    ,author={Mcgraw, J.R.}
+    ,title={The {VAL} language: description and analysis}
+    ,journal={TOPLAS}
+    ,volume=4
+    ,number=1
+    ,month=Jan
+    ,year=1982
+    ,pages={44-82}
+    }
+
+@techreport{lind82
+    ,key={lindstrom}
+    ,author={Lindstrom, G. and Hunt, F.E.}
+    ,title={Consistency and concurrency in functional databases}
+    ,institution={University of Utah}
+    ,type={Draft}
+    ,month=Feb
+    ,year=1982
+    }
+
+@techreport{lind81
+    ,key={lindstrom}
+    ,author={Lindstrom, G. and Wagner, R.}
+    ,title={Incremental recomputation on data-flow graphs}
+    ,institution={University of Utah}
+    ,type={Draft}
+    ,month=Apr
+    ,year=1981
+    }
+
+@InProceedings{bic81
+    ,key={bic}
+    ,author={Bic, L. and Herendeen, M.}
+    ,title={An architecture for a relational dataflow database}
+    ,booktitle={some acm proceedings...}
+    ,organization={ACM}
+    ,year=1981
+    ,month={}
+    ,pages={136-145}
+    }
+
+@InProceedings{
+        Arvi77,
+        key={Arvind},
+        author={Arvind and Gostelow, K.P.},
+        title={A computer capable of exchanging processors for time},
+        booktitle={Proceedings IFIP Congress},
+        Pages={849-853},
+        month=Jun,
+        year= 1977}
+
+@article{gost80
+    ,key={gostelow}
+    ,author={Gostelow, K.P and Thomas, R.L.}
+    ,title={Performance of a simulated dataflow computer}
+    ,journal={IEEE Transactions on Computers}
+    ,volume={C-29}
+    ,number=10
+    ,month=Oct
+    ,year=1980
+    ,pages={905-919}
+    }
+
+@techreport{arvi81
+    ,key={arvind}
+    ,author={Arvind and Pingali, K.}
+    ,title={Safe data driven evaluation}
+    ,institution={MIT}
+    ,type={Draft}
+    ,month=May
+    ,year=1981
+    ,annote={This was published somewhere...}
+    }
+
+@InProceedings{darl81
+    ,key={darlington}
+    ,author={Darlington, J. and Reeve, M.}
+    ,title={ALICE: a multi-processor reduction machine for the parallel
+            evaluation of applicative languages}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,organization={ACM}
+    ,year=1981
+    ,month=Oct
+    ,pages={65-76}
+    }
+
+@InProceedings{catt81
+    ,key={catto}
+    ,author={Catto, A.J. and Gurd, J.R}
+    ,title={Resource management in dataflow}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,organization={ACM}
+    ,year=1981
+    ,month=Oct
+    ,pages={65-76}
+    }
+
+@article{acke82
+    ,key={ackerman}
+    ,author={Ackerman, W.B.}
+    ,title={Data flow languages}
+    ,journal={Computer}
+    ,volume=15
+    ,number=2
+    ,month=Feb
+    ,year=1982
+    ,pages={15-25}
+    }
+
+@article{davi82
+    ,key={davis}
+    ,author={Davis, A.L. and Keller, R.M.}
+    ,title={Data flow program graphs}
+    ,journal={Computer}
+    ,volume=15
+    ,number=2
+    ,month=Feb
+    ,year=1982
+    ,pages={26-41}
+    }
+
+@article{arvi82
+    ,key={Arvind}
+    ,author={Arvind and Gostelow, K.P.}
+    ,title={The {U}-interpreter}
+    ,journal={Computer}
+    ,volume=15
+    ,number=2
+    ,month=Feb
+    ,year=1982
+    ,pages={42-50}
+    }
+
+@InProceedings{burk82
+    ,key={burkowski}
+    ,author={Burkowski, F.J.}
+    ,title={Instruction set design issues relating to a static dataflow computer}
+    ,booktitle={Proceedings 9th Symposium Computer Architecture}
+    ,organization={ACM -- SIGARCH}
+    ,year=1982
+    ,month=Apr
+    ,pages={101-111}
+    }
+
+@InProceedings{homm82
+    ,key={hommes}
+    ,author={Hommes, F.}
+    ,title={The heap-substitution concept -- an implementation of functional
+    operations on data structures for a reduction machine}
+    ,booktitle={Proceedings 9th Symposium Computer Architecture}
+    ,organization={ACM -- SIGARCH}
+    ,year=1982
+    ,month=Apr
+    ,pages={248-258}
+    }
+
+@InProceedings{arvi81b
+    ,key={arvind}
+    ,author={Arvind and Kathail, V.}
+    ,title={A multiple processor data flow machine that supports generalized
+    procedures}
+    ,booktitle={Proceedings 8th Annual Symposium Computer Architecture}
+    ,organization={ACM SIGARCH 9(3)}
+    ,year=1981
+    ,month=May
+    ,pages={291-302}
+    }
+
+@InProceedings{srin81
+    ,key={srini}
+    ,author={Srini, V.P.}
+    ,title={An architecture for extended abstract data flow}
+    ,booktitle={Proceedings 8th Annual Symposium Computer Architecture}
+    ,organization={ACM -- SIGARCH 9(3)}
+    ,year=1981
+    ,month=May
+    ,pages={303-326}
+    }
+
+@InProceedings{burk81
+    ,key={burkowski}
+    ,author={Burkowski, F.J.}
+    ,title={A mult-user data flow architecture}
+    ,booktitle={Proceedings 8th Annual Symposium Computer Architecture}
+    ,organization={ACM -- SIGARCH 9(3)}
+    ,year=1981
+    ,month=May
+    ,pages={327-340}
+    }
+
+@book{feig83
+    ,key={Feigenbaum}
+    ,author={Feigenbaum, E.A. and McCorduck, P.}
+    ,title={The Fifth Generation}
+    ,publisher={Addison-Wesley Publishing Company}
+    ,address={Reading, MA}
+    ,year=1983
+    }
+
+@techreport{fish82
+    ,key={fisher}
+    ,author={Fisher, J.A.}
+    ,title={Very Long Word Architectures}
+    ,institution={Yale University}
+    ,number={YALEU/DCS/RR-253}
+    ,month=Dec
+    ,year=1982
+    }
+
+@article{budn71
+    ,key={budnick}
+    ,author={Budnick, P and Kuck, D.J.}
+    ,title={The organization and use of parallel memories}
+    ,journal={IEEE Transactions on Computers}
+    ,volume={C-20}
+    ,number={}
+    ,month={}
+    ,year=1971
+    ,pages={}
+    }
+@article{linc83
+    ,key={lincoln}
+    ,author={Lincoln, N.R.}
+    ,title={Supercomputers = colossal computations + enormous expectations +
+            renowned risk}
+    ,journal={IEEE Computer}
+    ,volume=16
+    ,number=5
+    ,month=May
+    ,year=1983
+    ,pages={38-47}
+    }
+@book{hend80
+    ,key={Henderson}
+    ,author={Henderson, P.}
+    ,title={Functional Programming: Application and Implementation}
+    ,publisher={Prentice-Hall}
+    ,address={Englewood Cliffs, NJ}
+    ,year=1980
+    }
+@inproceedings{robi82
+    ,key={robinson}
+    ,author={Robinson, J.A.}
+    ,title={Fundamentals of machine-oriented deductive logic}
+    ,booktitle={Introductory Readings in Expert Systems}
+    ,editors={Michie, D.}
+    ,pages={81-92}
+    ,year=1982
+    ,publisher={Gordon and Breach}
+    }
+@inproceedings{bram82
+    ,key={bramer}
+    ,author={Bramer, M.A.}
+    ,title={A survey and critical review of expert systems research}
+    ,booktitle={Introductory Readings in Expert Systems}
+    ,editors={Michie, D.}
+    ,pages={3-30}
+    ,year= 1982
+    ,publisher={Gordon and Breach}
+    }
+@inproceedings{quin82
+    ,key={quinlan}
+    ,author={Quinlan, J.R.}
+    ,title={Fundamentals of the knowledge engineering problem}
+    ,booktitle={Introductory Readings in Expert Systems}
+    ,editors={Michie, D.}
+    ,pages={33-46}
+    ,year= 1982
+    ,publisher={Gordon and Breach}
+    }
+@inproceedings{clar82
+    ,key={clark}
+    ,author={Clark, K.L.}
+    ,title={An introduction to logic programming}
+    ,booktitle={Introductory Readings in Expert Systems}
+    ,editors={Michie, D.}
+    ,pages={93-112}
+    ,year= 1982
+    ,publisher={Gordon and Breach}
+    }
+@book{wins79
+    ,key={winston}
+    ,author={Winston, P.H.}
+    ,title={Artificial Intelligence}
+    ,publisher={Addison-Wesley Publishing Co.}
+    ,address={Don Mills, Ontario, Canada}
+    ,year= 1979
+    }
+@article{wood83
+    ,key={woods}
+    ,author={Woods, W.A.}
+    ,title={What's important about knowledge representation?}
+    ,journal={Computer}
+    ,volume=16
+    ,number=10
+    ,month= Oct
+    ,year=1983
+    ,pages={22-29}
+    }
+@article{scha80
+    ,key={schank}
+    ,author={Schank, R.C.}
+    ,title={Language and memory}
+    ,journal={Cognitive Science}
+    ,volume= 4
+    ,number= 3
+    ,month={Jul-Sep}
+    ,year= 1980
+    ,pages={243-284}
+    }
+@article{brac83
+    ,key={brachman}
+    ,author={Brachman, R.J.}
+    ,title={What is-a is and isn't: an analysis of taxonomic links
+            in semantic networks}
+    ,journal={Computer}
+    ,volume=16
+    ,number=10
+    ,month= Oct
+    ,year= 1983
+    ,pages={30-36}
+    }
+@article{isra83
+    ,key={israel}
+    ,author={Israel, D.J.}
+    ,title={The role of logic in knowledge representation}
+    ,journal={Computer}
+    ,volume=16
+    ,number=10
+    ,month= Oct
+    ,year= 1983
+    ,pages={37-41}
+    }
+@article{dahl83
+        ,key={dahl}
+        ,author={Dahl,V.}
+        ,title={Logic programming as a representation of knowledge}
+        ,journal={Computer}
+        ,volume=16
+        ,number=10
+        ,month= Oct
+        ,year=1983
+        ,pages={106-111}
+        }
+@article{robi65
+    ,key={robinson}
+    ,author={Robinson, A.}
+    ,title={A machine-oriented logic based on the resolution principle}
+    ,journal={JACM}
+    ,volume= 12
+    ,year= 1965
+    ,pages={23-41}
+    }
+@techreport{mins74
+    ,key={minsky}
+    ,author={Minsky, M.}
+    ,title={A framework for representing knowledge}
+    ,institution={MIT}
+    ,type={AI Memo}
+    ,number=306
+    ,month=Jun
+    ,year=1974
+    }
+@InProceedings{scha75
+    ,key={schank,abelson}
+    ,author={Schank, R. and Abelson, R.}
+    ,title={Scripts, plans and knowledge}
+    ,booktitle={Proceedings International Joint Conf. AI}
+    ,organization={AI}
+    ,year= 1975
+    ,pages={151-157}
+    }
+@article{nau83
+    ,key={nau}
+    ,author={Nau, D.}
+    ,title={Expert computer systems}
+    ,journal={Computer}
+    ,volume=16
+    ,number=2
+    ,month=Feb
+    ,year=1983
+    ,pages={63-68}
+    }
+@book{fahl79
+    ,key={fahlman}
+    ,author={Fahlman, S.}
+    ,title={NETL: A System for Representing and Using Real-World Knowlege}
+    ,publisher={MIT Press}
+    ,address={Cambridge, MA}
+    ,year=1979
+    }
+@InProceedings{schm81
+    ,key={schmolze,brachman}
+    ,author={Schmolze, J. and Brachman, R.}
+    ,title={Summary of the KL-one language}
+    ,booktitle={Proceedings 1981 KL-ONE Workshop,FLAIR tech-report 4}
+    ,organization={Fairchild Laboratory for AI Research}
+    ,year=1982
+    ,pages={231-257}
+    }
+@InProceedings{moor82
+    ,key={moore}
+    ,author={Moore, R.C.}
+    ,title={The role of logic in knowledge representation and
+    commonsense reasoning}
+    ,booktitle={Proceedings Nat'l Conf. Artificial Intelligence}
+    ,organization={American Association for Artificial Intelligence}
+    ,year=1982
+    ,month= Aug
+    ,pages={428-433}
+    }
+@InProceedings{rich82
+    ,key={rich}
+    ,author={Rich, C.}
+    ,title={Knowledge representation languages and predicate calculus:
+    How to have your cake and eat it too}
+    ,booktitle={Proceedings AAAI}
+    ,organization={AAAI}
+    ,year=1982
+    ,pages={192-196}
+    }
+@article{trel82b
+    ,key={treleaven,lima}
+    ,author={Treleaven, P. and Lima, I.}
+    ,title={Japan's fifth-generation computer systems}
+    ,journal={Computer}
+    ,volume=15
+    ,number=8
+    ,month=Aug
+    ,year=1982
+    ,pages={79-88}
+    }
+@book{FGCS81
+    ,key={Moto-oka}
+    ,title={Proceedings International Conf. 5th Generation Computer Systems}
+    ,publisher={Japan Information Processing Development Center}
+    ,author={Moto-oka, T., et al.}
+    ,month=Oct
+    ,year=1981
+    }
+@techreport{hill81
+    ,key={Hillis}
+    ,author={Hillis, W.D.}
+    ,title={The Connection Machine}
+    ,institution={MIT}
+    ,number={AI-Memo 646}
+    ,month=Sep
+    ,year=1981
+    }
+@techreport{shap83
+    ,key={Shapiro}
+    ,author={Shapiro, E.Y.}
+    ,title={A Subset of Concurrent Prolog and its Interpreter}
+    ,institution={Weizmann Institute of Science}
+    ,month=Jan
+    ,year=1983
+    }
+@book{barr81
+    ,key={barr}
+    ,title={The Handbook of Artificial Intelligence}
+    ,publisher={HeurisTech Press}
+    ,author={Barr, A. and Feigenbaum, E.A.}
+    ,volume=1
+    ,year=1981
+    }
+@InProceedings{fahl83
+    ,key={fahlman}
+    ,author={Fahlman, S.E. and Hinton, G.E.}
+    ,title={Massively Parallel Architectures for AI: NETL, Thistle,
+            and Boltzmann Machines}
+    ,booktitle={Proceedings AAAI}
+    ,organization={AAAI}
+    ,year=1983
+    ,pages={109-113}
+    }
+@techreport{rabbit
+    ,key={Steele}
+    ,author={Steele, G.L. Jr.}
+    ,title={RABBIT: a compiler for SCHEME}
+    ,institution={MIT}
+    ,month=May
+    ,number=474
+    ,type={AI Memo}
+    ,year=1978
+    }
+@techreport{stee78
+    ,key={Steele}
+    ,author={Steele, G.L. Jr. and Sussman, G.J.}
+    ,title={The Revised Report on Scheme}
+    ,institution={MIT}
+    ,month=Jan
+    ,number=452
+    ,type={AI Memo}
+    ,year=1978
+    }
+@book{dragon
+    ,key={Aho}
+    ,title={Principles of Compiler Design}
+    ,publisher={Addison-Wesley}
+    ,author={Aho, A.V. and Ullman, J.D.}
+    ,year=1977
+    }
+@InProceedings{stee77
+    ,key={steele}
+    ,author={Steele, G.L. Jr.}
+    ,title={Debunking the expensive procedure call myth}
+    ,booktitle={Proceedings ACM National Conf.}
+    ,organization={ACM}
+    ,year=1977
+    ,pages={153-162}
+    }
+@InProceedings{mcde80
+    ,key={mcdermott}
+    ,author={McDermott, D.}
+    ,title={An efficient environment allocation scheme in an
+            interpreter for a lexically-scoped LISP}
+    ,booktitle={The 1980 LISP Conf.}
+    ,organization={Stanford University}
+    ,year=1980
+    ,editors={Davis, R.E. and Allen, J.R.}
+    ,month=Aug
+    ,pages={154-162}
+    }
+@article{bobr73
+    ,key={bobrow}
+    ,author={Bobrow, D.G. and Wegbreit, B.}
+    ,title={A model and stack implementation of multiple environments}
+    ,journal={CACM}
+    ,volume=16
+    ,number=10
+    ,month=Oct
+    ,year=1973
+    ,pages={591-603}
+    }
+@article{hoff82a
+    ,key={hoffman}
+    ,author={Hoffman, C.M. and O'Donnell, M.J.}
+    ,title={Programming with equations}
+    ,journal={ACM Transactions Programming Languages Systems}
+    ,volume=4
+    ,number=1
+    ,month=Jan
+    ,year=1982
+    ,pages={83-112}
+    }
+@InProceedings{huda84a
+    ,key={hudak}
+    ,author={Hudak, P. and Kranz, D.}
+    ,title={A combinator-based compiler for a functional language}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={121-132}
+    }
+@InProceedings{Joua84
+    ,key={Jouannaud}
+    ,author={Jouannaud, J-P. and Kirchner, H.}
+    ,title={Completion of a set of rules modulo a set of equations}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={83-92}
+    }
+@InProceedings{shap84
+    ,key={shapiro}
+    ,author={Shapiro, E.}
+    ,title={Systems programming in concurrent prolog}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={93-105}
+    }
+@InProceedings{band84
+    ,key={bandes}
+    ,author={Bandes, R.G.}
+    ,title={Constraining-unification and the programming language Unicorn}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={106-110}
+    }
+@InProceedings{hoff84
+    ,key={hoffman}
+    ,author={Hoffman, C.M. and O'Donnell, M.J.}
+    ,title={Implementation of an interpreter for abstract equations}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={111-120}
+    }
+@InProceedings{subr84a
+    ,key={subrahmanyam}
+    ,author={Subrahmanyam, P.A. and You, J-H.}
+    ,title={Pattern-driven lazy reduction: a unifying evaluation
+            mechanism for functional and logic programs}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={228-234}
+    }
+@InProceedings{wand84
+    ,key={wand}
+    ,author={Wand, M.}
+    ,title={A types-as-sets semantics for Milner-style polymorphism}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={158-164}
+    }
+@InProceedings{mish84
+    ,key={mishra}
+    ,author={Mishra, P. and Keller, R.M.}
+    ,title={Static inference of properties of functional programs}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={235-244}
+    }
+@InProceedings{schw84
+    ,key={schwarz}
+    ,author={Schwarz, J.S. and Rubine, D.}
+    ,title={Treat -- an applicative code generator}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={133-139}
+    }
+@InProceedings{mitc84
+    ,key={mitchell}
+    ,author={Mitchell, J.C.}
+    ,title={Coercion and type inference}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={175-185}
+    }
+@InProceedings{hend76
+    ,key={henderson}
+    ,author={Henderson and Morris}
+    ,title={A lazy evaluator}
+    ,booktitle={3rd ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1976
+    ,month=Jan
+    ,pages={95-103}
+    }
+@inproceedings{frie76
+    ,key={friedman}
+    ,author={Friedman, D.P. and Wise, D.S.}
+    ,title={CONS should not evaluate its arguments}
+    ,booktitle={Automata, Languages and Programming}
+    ,editors=xx
+    ,pages={257-284}
+    ,year=1976
+    ,publisher={Edinburgh University Press}
+    }
+@article{friexx
+    ,key={friedman}
+    ,author={Friedman, D.P. and Wise, D.S.}
+    ,title={Unbounded computational structures}
+    ,journal={Software -- Practice and Experience}
+    ,volume=8
+    ,number=0
+    ,month="foobar"
+    ,year="198n"
+    ,pages={407-416}
+    }
+@article{shal82
+    ,key={shallit}
+    ,author={Shallit}
+    ,title={Unbounded arrays in APL}
+    ,journal={APL}
+    ,volume=xx
+    ,number=xx
+    ,month=xx
+    ,year=1982
+    }
+@article{knut68
+    ,key={knuth}
+    ,author={Knuth, D.}
+    ,title={Semantics of context-free languages}
+    ,journal={Math Systems Theory}
+    ,volume=2
+    ,number=2
+    ,month=Feb
+    ,year=1968
+    ,pages={127-145}
+    }
+@article{jali83
+    ,key={Jalili}
+    ,author={Jalili, F.}
+    ,title={A general linear-time evaluator for attribute grammars}
+    ,journal={SIGPLAN Notices}
+    ,volume=18
+    ,number=9
+    ,month=Sep
+    ,year=1983
+    ,pages={35-44}
+    }
+@article{raih80
+    ,key={raiha}
+    ,author={Raiha}
+    ,title={Bibliography on attribute grammars}
+    ,journal={SIGPLAN Notices}
+    ,volume=15
+    ,number=3
+    ,month=Mar
+    ,year=1980
+    }
+@techreport{hewi76
+    ,key={hewitt}
+    ,author={Hewitt, C.}
+    ,title={Viewing control structures as patterns of passing messages}
+    ,institution={MIT}
+    ,type={Working Paper}
+    ,number=92
+    ,month=Apr
+    ,year=1976
+    }
+@article{ward80
+    ,key={ward}
+    ,author={Ward, S.A. and Halstead, R.H.}
+    ,title={A syntactic theory of message passing}
+    ,journal={JACM}
+    ,volume=27
+    ,number=2
+    ,month=Apr
+    ,year=1980
+    ,pages={365-383}
+    }
+@InProceedings{gele84
+    ,key={gelernter}
+    ,author={Gelernter, D.}
+    ,title={A note on systems programming in concurrent Prolog}
+    ,booktitle={International Symposium on Logic Programming}
+    ,organization={IEEE}
+    ,year=1984
+    ,month=Feb
+    ,pages={xx}
+    }
+@article{kowa79
+    ,key={kowalski}
+    ,author={Kowalski, R.}
+    ,title={Algorithm = logic + control}
+    ,journal={CACM}
+    ,volume=22
+    ,number=7
+    ,month=Jul
+    ,year=1979
+    ,pages={424-436}
+    }
+@article{clar77b
+    ,key={clark}
+    ,author={Clark and Tarnlund}
+    ,title={A 1st-order theory of data and programs}
+    ,journal={IFIP}
+    ,volume=xx
+    ,number=xx
+    ,year=1977
+    }
+@book{cloc81
+    ,key={clocksin}
+    ,title={Programming in Prolog}
+    ,publisher={Springer-Verlag}
+    ,author={Clocksin, W.F. and Mellish, C.S.}
+    ,year=1981
+    }
+@article{paig82
+    ,key={paige}
+    ,author={Paige, R. and Koenig, S.}
+    ,title={Finite differencing of computable expressions}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,volume=4
+    ,number=3
+    ,year=1982
+    ,pages={402-454}
+    }
+@inproceedings{Arsac
+    ,key={arsac}
+    ,author={Arsac}
+    ,title={Transformation of recursive procedures into iterative ones}
+    ,booktitle={Tools and Notions for Program Construction}
+    ,editors=xx
+    ,pages=xx
+    ,year=xx
+    ,publisher=xx
+    }
+@article{part81
+    ,key={partsch}
+    ,author={Partsch}
+    ,title={A Comprehensive Survey on Program Transformation Schemes}
+    ,journal={TUM}
+    ,volume=I81
+    ,number=08
+    ,year=1981
+    ,pages=xx
+    }
+@techreport{huda84b
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={{ALFL} {R}eference {M}anual and {P}rogrammer's {G}uide}
+    ,institution={Yale University}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-322, Second Edition}
+    ,month=Oct
+    ,year=1984
+    }
+@book{gold83
+    ,key={goldberg}
+    ,title={Smalltalk-80:  The Language and its Implementation}
+    ,publisher={Addison-Wesley}
+    ,author={Goldberg, A. and Robson, D.}
+    ,address={Reading, MA}
+    ,year=1983
+    }
+@article{wand82b
+    ,key={wand}
+    ,author={Wand, M.}
+    ,title={Deriving target code as a representation of continuation semantics}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,volume=4
+    ,number=3
+    ,month=Jul
+    ,year=1982
+    ,pages={496-517}
+    }
+@article{hoff82b
+    ,key={hoffman}
+    ,author={Hoffman, C.M. and O'Donnell, M.J.}
+    ,title={Pattern matching in trees}
+    ,journal={JACM}
+    ,volume=29
+    ,number=1
+    ,month=Jan
+    ,year=1982
+    ,pages={68-95}
+    }
+@article{down80
+    ,key={downey}
+    ,author={Downey, P.J. and Sethi, R.}
+    ,title={Variations on the common subexpression problem}
+    ,journal={JACM}
+    ,volume=27
+    ,number=4
+    ,month=Oct
+    ,year=1980
+    ,pages={758-771}
+    }
+@book{burg75
+    ,key={burge}
+    ,author={Burge, W.H.}
+    ,title={Recursive Programming Techniques}
+    ,publisher={Addison-Wesley}
+    ,address={Reading, MA}
+    ,year=1975
+    }
+@phdthesis{gesc72
+    ,key={geschke}
+    ,author={Geschke, C.M.}
+    ,title={Global Program Optimizations}
+    ,school={CMU}
+    ,month=Oct
+    ,year=1972
+    }
+@InProceedings{huda84c
+    ,key={hudak}
+    ,author={Hudak, P. and Goldberg, B.}
+    ,title={Experiments in diffused combinator reduction}
+    ,booktitle={Proceedings 1984 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Aug
+    ,pages={167-176}
+    }
+@InProceedings{jone84
+    ,key={jones}
+    ,author={Jones, Neil D. and Muchnick, S.S.}
+    ,title={A flexible approach to interprocedural data flow analysis and
+            programs with recursive data structures}
+    ,booktitle={9th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Jan
+    ,pages={66-74}
+    }
+@article{seth82
+    ,key={sethi}
+    ,author={Sethi, R.}
+    ,title={Pebble games for studying storage sharing}
+    ,journal={Theoretical Computer Science}
+    ,volume=19
+    ,number=1
+    ,month=Jul
+    ,year=1982
+    ,pages={69-84}
+    }
+@inproceedings{pipp80
+    ,key={pippenger}
+    ,author={Pippenger, N.}
+    ,title={Pebbling}
+    ,booktitle={Proceedings 5th IBM Symposium on Mathematical Foundations
+                of Computer Sci.}
+    ,organization={IBM}
+    ,month=May
+    ,year=1980
+    ,pages={1-19}
+    }
+@InProceedings{raou84
+    ,key={raoult}
+    ,author={Raoult, Jean-Claude and Sethi, Ravi}
+    ,title={The global storage needs of a subcomputation}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={148-157}
+    }
+@techreport{huda84e
+    ,key={hudak}
+    ,author={Hudak, P.}
+    ,title={Distributed Applicative Processing Systems:
+            Project Goals, Motivation and Status Report}
+    ,institution={Yale University}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-317}
+    ,month=May
+    ,year=1984
+    }
+@article{kell84
+    ,key={keller}
+    ,author={Keller, R.M. and Lin, F.C.H.}
+    ,title={Simulated performance of a reduction-based multiprocessor}
+    ,journal={IEEE Computer}
+    ,volume=17
+    ,number=7
+    ,month=Jul
+    ,year=1984
+    ,pages={70-82}
+    }
+@article{kahn84
+    ,key={Kahn}
+    ,author={Kahn, K.}
+    ,title={Implementation of arrays}
+    ,journal={PROLOG Digest}
+    ,volume=2
+    ,number=4
+    ,month=Jan
+    ,year=1984
+    }
+@InProceedings{schw78
+    ,key={schwarz}
+    ,author={Schwarz, J.}
+    ,title={Verifying the safe use of destructive operations
+            in applicative programs}
+    ,booktitle={Program Transformations -- Proc. 3rd International
+                Symposium on Programming}
+    ,editor={Robinet, B.}
+    ,organization={Dunod Informatique}
+    ,year=1978
+    ,pages={395-411}
+    }
+@techreport{lamp79
+    ,key={lamport}
+    ,author={Lamport, Leslie}
+    ,title={@dq"Sometime" is sometimes @dq"not never"}
+    ,institution={SRI International}
+    ,type={Research Report}
+    ,number={CSL-86 #49}
+    ,month=Jan
+    ,year=1979
+    }
+@book{mann74
+    ,key={Manna}
+    ,editor={Manna, Z.}
+    ,title={Mathematical Theory of Computation}
+    ,publisher={McGraw-Hill Book Company}
+    ,address={New York}
+    ,year=1974
+    ,pages={322-328}
+    }
+@InProceedings{cous77
+    ,key={cousot}
+    ,author={Cousot, P. and Cousot, R.}
+    ,title={Abstract interpretation: a unified lattice model for static
+            analysis of programs by construction or approximation of fixpoints}
+    ,booktitle={4th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1977
+    ,pages={238-252}
+    }
+@InProceedings{cous79
+    ,key={cousot}
+    ,author={Cousot, P. and Cousot, R.}
+    ,title={Systematic design of program analysis frameworks}
+    ,booktitle={6th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1979
+    ,pages={269-282}
+    }
+@InProceedings{huda85a
+    ,key={hudak}
+    ,author={Hudak, P. and Bloss, A.}
+    ,title={The aggregate update problem in functional programming systems}
+    ,booktitle={12th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1985
+    ,pages={300-314}
+    }
+@techreport{huda85b
+    ,key={hudak}
+    ,author={Hudak, P. and Smith, L.}
+    ,title={Para-functional programming: a paradigm for programming
+            multiprocessor systems}
+    ,institution={Yale University}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-390}
+    ,month=Jun
+    ,year=1985
+    }
+@techreport{huda85c
+    ,key={hudak}
+    ,author={Hudak, P. and Young, J.}
+    ,title={A set-theoretic characterization of function strictness
+            in the Lambda Calculus}
+    ,institution={Yale University}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-391}
+    ,month=Jun
+    ,year=1985
+    }
+@article{huda85d
+    ,key={hudak}
+    ,author={Hudak, P. and Goldberg, B.}
+    ,title={Distributed execution of functional programs
+            using serial combinators}
+    ,journal={IEEE Transactions on Computers}
+    ,volume={C-34}
+    ,number=10
+    ,month=Oct
+    ,year=1985
+    ,pages={881-891}
+    ,note={Also appeared in Proceedings of 1985 International Conf. on
+           Parallel Processing, Aug. 1985, pp. 831-839.}
+    }
+@InProceedings{huda85e
+    ,key={hudak}
+    ,author={Hudak, P. and Goldberg, B.}
+    ,title={Serial combinators: ``optimal'' grains of parallelism}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={382-388}
+    }
+@phdthesis{mycr81b
+    ,key={mycroft}
+    ,author={Mycroft, A.}
+    ,title={Abstract Interpretation and Optimizing Transformations for
+            Applicative Programs}
+    ,school={University of Edinburgh}
+    ,year=1981
+    }
+@InProceedings{mycr80
+    ,key={Mycroft}
+    ,author={Mycroft, A.}
+    ,title={The theory and practice of transforming call-by-need into
+            call-by-value}
+    ,booktitle={Proceedings of International Symposium on Programming}
+    ,organization={Springer-Verlag LNCS Vol. 83}
+    ,year=1980
+    ,pages={269-281}
+    }
+@InProceedings{miln84
+    ,key={milner}
+    ,author={Milner, R.}
+    ,title={A proposal for {S}tandard {ML}}
+    ,booktitle={Proceedings 1984 ACM Conf. on LISP and Functional Programming}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Aug
+    ,pages={184-197}
+    }
+@book{gold83
+    ,key="goldberg"
+    ,author="Goldberg, A. and Robson, D."
+    ,title="Smalltalk-80: The Language and its Implementation"
+    ,publisher="Addison-Wesley Publishing Company"
+    ,address="Reading, Mass."
+    ,year=1983
+    }
+@techreport{john81
+    ,key={johnsson}
+    ,author={Johnsson, T.}
+    ,title={Detecting when call-by-value can be used instead of call-by-need}
+    ,institution={Chalmers University of Technology, Department of Computer Science}
+    ,type={Laboratory for Programming Methodology Memo}
+    ,number={14}
+    ,month=Oct
+    ,year=1981
+    }
+@InProceedings{dama82
+    ,key={damas}
+    ,author={Damas, Lu\'{\i}s and Milner, Robin}
+    ,title={Principal type schemes for functional languages}
+    ,booktitle={9th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1982
+    ,month=Aug
+    }
+@article{burt84
+    ,key={Burton}
+    ,author={Burton, F.W.}
+    ,title={Annotations to control parallelism and reduction order in the
+            distributed evaluation of functional programs}
+    ,journal={ACM Transactions on Programming Languages and Systems}
+    ,volume=6
+    ,number=2
+    ,month=Apr
+    ,year=1984
+    ,pages={159-174}
+    }
+@article{beel84
+    ,key={Beeler}
+    ,author={Beeler, M}
+    ,title={Beyond the baskett benchmark}
+    ,journal={Computer Architecture News}
+    ,volume=19
+    ,number=3
+    ,month=Mar
+    ,year=1984
+    }
+@InProceedings{smit84
+    ,key={smith}
+    ,author={Smith, B.C.}
+    ,title={Reflection and semantics in LISP}
+    ,booktitle={11th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1984
+    ,month=Jan
+    ,pages={121-132}
+    }
+@InProceedings{frie85
+    ,key={friedman}
+    ,author={Friedman, D.P. and Haynes, C.T.}
+    ,title={Constraining control}
+    ,booktitle={12th ACM Symposium on Principles of Programming Languages}
+    ,organization={ACM}
+    ,year=1985
+    ,pages={245-254}
+    }
+@article{seit85
+    ,key={seitz}
+    ,author={Seitz, C.L.}
+    ,title={The cosmic cube}
+    ,journal={CACM}
+    ,volume=28
+    ,number=1
+    ,month=Jan
+    ,year=1985
+    }
+@techreport{shap84b
+    ,key={shapiro}
+    ,author={Shapiro, E.}
+    ,title={Systolic Programming: A Paradigm of Parallel Processing}
+    ,institution={The Weizmann Institute of Science}
+    ,type={Department of Applied Mathematics}
+    ,number={CS84-21}
+    ,month=Aug
+    ,year=1984
+    }
+@book{papp80
+    ,key={Pappert}
+    ,author={Pappert, S.}
+    ,title={Mindstorms: Children, Computers and Powerful Ideas}
+    ,publisher={Basic Books}
+    ,place={New York}
+    ,year=1980
+    }
+@book{bare84
+    ,key={Barendregt}
+    ,author={Barendregt, H.P.}
+    ,title={The lambda calculus: its syntax and semantics}
+    ,publisher={North-Holland}
+    ,place={Amsterdam}
+    ,year=1984
+    }
+@techreport{rich85
+    ,key={richards}
+    ,author={Richards, H. Jr.}
+    ,title={An overview of the Burroughs NORMA}
+    ,institution={Burroughs Austin Research Center}
+    ,month=Jan
+    ,year=1985
+    }
+@techreport{huda85g
+    ,key={li}
+    ,author={Li, K. and Hudak, P.}
+    ,title={A new list compaction method}
+    ,institution={Yale University}
+    ,type={Research Report}
+    ,number={YALEU/DCS/RR-362}
+    ,month=Feb
+    ,year=1985
+    }
+@InProceedings{kell85
+    ,key={Keller}
+    ,author={Keller, R.M. and Lindstrom, G.}
+    ,title={Approaching distributed database implementations
+            through functional programming concepts}
+    ,booktitle={International Conf. on Distributed Systems}
+    ,month=May
+    ,year=1985
+    }
+@techreport{kieb85
+    ,key={kieburtz}
+    ,author={Kieburtz, R.B.}
+    ,title={The G-machine: a fast, graph-reduction evaluator}
+    ,institution={Department of Computer Science, Oregon Graduate Center}
+    ,month=Jan
+    ,number="CS/E-85-002"
+    ,year=1985
+    }
+@techreport{john85
+    ,key={Johnsson}
+    ,author={Johnsson, T.}
+    ,title={The G-machine: an abstract machine for graph reduction}
+    ,institution={PMG, Department of Computer Science, Chalmers University of Tech.}
+    ,month=Feb
+    ,year=1985
+    }
+@techreport{inte85
+    ,key={Intel}
+    ,author={Intel Corporation}
+    ,title={iPSC User's Guide -- Preliminary}
+    ,institution={Intel Corporation}
+    ,month=Jul
+    ,year=1985
+    ,number="175455-001"
+    }
+@unpublished{meye85
+    ,key={Meyer}
+    ,author={Meyer, A.R.}
+    ,title={Complexity of program flow-analysis for strictness}
+    ,note={(Unpublished summary)}
+    ,month=Aug
+    ,year=1985}
+@InProceedings{clac85
+    ,key={clack}
+    ,author={Clack, C. and Peyton Jones, Simon L.}
+    ,title={Strictness analysis -- a practical approach}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={35-49}
+    }
+@InProceedings{huda86a
+    ,key={hudak}
+    ,author={Hudak, P. and Young, J.}
+    ,title={Higher-order strictness analysis for untyped lambda calculus}
+    ,booktitle={12th ACM Symposium on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1986
+    ,pages={97-109}
+    }
+@InProceedings{huda86b
+    ,key={hudak}
+    ,author={Hudak, P. and Smith, L.}
+    ,title={Para-functional programming: a paradigm for programming
+            multiprocessor systems}
+    ,booktitle={12th ACM Symposium on Principles of Programming Languages}
+    ,month=Jan
+    ,year=1986
+    ,pages={243-254}
+    }
+@InProceedings{turn85
+    ,key={turner}
+    ,author={Turner, D.A.}
+    ,title={Miranda: a non-strict functional language with polymorphic types}
+    ,booktitle={Functional Programming Languages and Computer Architecture}
+    ,month=Sep
+    ,year=1985
+    ,publisher={Springer-Verlag LNCS 201}
+    ,pages={1-16}
+    }
+@techreport{stee76a
+    ,key={steele}
+    ,author={Steele, G.L. Jr.}
+    ,title={LAMBDA --- the ultimate imperative}
+    ,institution={Massachusetts Institute of Technology}
+    ,type={AI Memo}
+    ,month=Mar
+    ,year=1976
+    ,number=353
+    }
+@techreport{stee76b
+    ,key={steele}
+    ,author={Steele, G.L. Jr.}
+    ,title={LAMBDA --- the ultimate declarative}
+    ,institution={Massachusetts Institute of Technology}
+    ,type={AI Memo}
+    ,month=Nov
+    ,year=1976
+    ,number=379
+    }
+@techreport{stee78
+    ,key={steele}
+    ,author={Steele, G.L. Jr.}
+    ,title={The art of the interpreter or, the modularity complex
+            (parts zero, one, and two)}
+    ,institution={Massachusetts Institute of Technology}
+    ,type={AI Memo}
+    ,month=May
+    ,year=1978
+    ,number=453
+    }
+@techreport{RRRS
+    ,key={clinger}
+    ,author={{Clinger, W. et al.}}
+    ,title={The Revised Revised Report on Scheme, or
+            An UnCommon Lisp}
+    ,institution={Massachusetts Institute of Technology}
+    ,type={AI Memo}
+    ,month=Aug
+    ,year=1985
+    ,number=848
+    }
+@InProceedings{powe84
+    ,key={powell} 
+    ,author={Powell, M.L.}
+    ,title={A portable optimizing compiler for Modula-2}
+    ,booktitle={Proceedings Symposium on Compiler Construction}
+    ,organization={ACM, SIGPLAN Notices 19(6)}
+    ,month=Jun
+    ,year=1984
+    ,pages={310-318}
+    }
+@unpublished{gabr85
+    ,key={gabriel}
+    ,author={Gabriel, R.}
+    ,year=1985
+    ,title={(personal communication)}
+    }
+@unpublished{roza85
+    ,key={rozas}
+    ,author={Rozas, W.}
+    ,year=1985
+    ,title={(personal communication)}
+    }
+@article{szym78
+    ,key={szymanski}
+    ,author={Szymanski}
+    ,title={Assembling code for machines with span-dependent instructions}
+    ,journal={CACM}
+    ,volume=21
+    ,number=4
+    ,month=Apr
+    ,year=1978
+    ,pages={300-308}
+    }
+@phdthesis{elli85
+    ,key={ellis}
+    ,author={Ellis, J.R.}
+    ,title={Bulldog: A Compiler for VLIW Architectures}
+    ,school={Yale University}
+    ,note={Available as Research Report YALEU/DCS/RR-364}
+    ,year=1985
+    }
+@InProceedings{huda85f
+    ,key={fasel}
+    ,author={Fasel, J.H. and Hudak, P. and Douglass, R.J. and Michelson, R.}
+    ,title={A distributed implementation of functional program evaluation}
+    ,booktitle={Proceedings of AI-85}
+    ,month=May
+    ,year=1985
+    }
+
+@InProceedings{T00,
+  author = 	 "Walid Taha",
+  title = 	 "A Sound Reduction Semantics for Untyped {CBN} Multi-Stage
+                  Computation.  {O}r, the Theory of {MetaML} is Non-trivial.",
+  booktitle = 	 {Proc. 
+                  Workshop on Partial Evaluation and
+                  Semantics-Based Program Maniplation {(PEPM)}},
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 "2000",
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  address = 	 "Boston",
+  OPTorganization = {},
+  publisher = "ACM Press",
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Ong,
+  author = 	 "A. S. Murawski and C.-H. L. Ong",
+  title = 	 "Can safe recursion be interpreted in light logic?",
+  booktitle = 	 "Second International Workshop on 
+                  Implicit Computational Complexity",
+  year = 	 200,
+  address = 	 "Santa Barbara",
+  month = 	 jun
+}
+
+@Book{Hodges97,
+  author =       "Wilfred Hodges",
+  title =        "A Shorter Model Theory",
+  publisher =    "Cambridge University Press",
+  year =         "1997",
+}
+
+@Book{Nielson92,
+  author =       "Hanne Riis Nielson and Flenning Nielson",
+  title =        "Semantics with Applications : {A} Formal
+                 Introduction",
+  publisher =    "John Wiley \& Sons",
+  address =      "Chichester",
+  year =         "1992",
+  descriptor =   "Axiomatische Semantik, Denotationelle Semantik,
+                 Miranda, Operationale Semantik, Semantik",
+  annote =       "Einfuehrung und Grundlagen der Semantik von
+                 Programmiersprachen: operational, denotational und
+                 axiomatisch. Anhand einer Miniatursprache (While)
+                 werden die drei unterschiedlichen Methoden vorgestellt
+                 und verglichen.",
+}
+
+@InCollection{CharityI,
+  author =       "J. Robin B. Cockett and Dwight Spencer",
+  title =        "Strong Categorical Datatypes {I}",
+  editor =       "R. A. G. Seely",
+  booktitle =    "Proceedings International Summer Category Theory Meeting,
+                 Montr{\'e}al, Qu{\'e}bec, 23--30 June 1991",
+  series =       "Canadian Mathematical Society Conf.\ Proceedings",
+  volume =       "13",
+  pages =        "141--169",
+  publisher =    "American Mathematical Society",
+  address =      "Providence, RI",
+  year =         "1992",
+  url =          "ftp://ftp.cpsc.ucalgary.ca/pub/projects/charity/literature/papers_and_reports/dataI.ps.gz",
+}
+
+@Article{CharityII,
+  author =       "J. Robin B. Cockett and Dwight Spencer",
+  title =        "Strong Categorical Datatypes {II}: {A} Term Logic for
+                 Categorical Programming",
+  journal =      "Theoretical Computer Science",
+  volume =       "139",
+  number =       "1--2",
+  pages =        "69--113",
+  year =         "1995",
+  url =          "ftp://ftp.cpsc.ucalgary.ca/pub/projects/charity/literature/papers_and_reports/dataII.ps.gz",
+}
+
+@Book{Okasaki98,
+  key =          "Okasaki",
+  author =       "Chris Okasaki",
+  title =        "Purely Functional Data Structures",
+  publisher =    "Cambridge University Press",
+  year =         "1998",
+  address =      "Cambridge, UK",
+  annote =       "Data structures and efficiency analysis for functional
+                 programming. Code in ML and Haskell. Many references.",
+}
+
+@Manual{esterel-manual,
+  title = 	 {The {E}sterel v5.21 System Manual},
+  author = 	 {Gerard  Berry and the Esterel Team},
+  organization = {Centre de Math\'ematiques Appliqu\'ees, Ecole des Mines de Paris and INRIA},
+  month = 	 {March},
+  year = 	 {1999},
+  note = 	 {Available at \fr{http://www.inria.fr/meije/esterel}}
+}
+@Article{statecharts,
+  author = 	 {David Harel},
+  title = 	 {\textsc{Statecharts}: a visual formalism for complex systems},
+  journal = 	 {Science of Computer Programming},
+  year = 	 {1987},
+  volume = 	 {8},
+  number = 	 {3},
+  pages = 	 {231--274},
+  month = 	 {June}
+}
+@InProceedings{berry-rtp,
+  author = 	 {Gerard  Berry},
+  title = 	 {Real time programming: {S}pecial purpose or general purpose languages},
+  booktitle = 	 {IFIP World Computer Congress},
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 {1989},
+  address = 	 {San Francisco}
+}
+
+@InProceedings{ComputingForEmbedded,
+  author = 	 "Edward A. Lee",
+  title = 	 "Computing for Embedded Systems",
+  booktitle = 	 "IEEE Instrumentation and Measurement Technology
+     Conf.",
+  year = 	 2001,
+  address = 	 "Budapest, Hungary"
+}
+
+@InProceedings{WhatsAhead,
+  author = 	 "Edward A. Lee",
+  title = 	 "What's Ahead for Embedded Software?",
+  booktitle = 	 "IEEE Computer",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 2000,
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  month = 	 sep,
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Article{Okasaki98b,
+  key =          "Okasaki",
+  author =       "Chris Okasaki",
+  title =        "Even higher-order functions for parsing or Why would
+                 anyone ever want to use a sixth-order function?",
+  journal =      "Journal of Functional Programming",
+  year =         "1998",
+  volume =       "8",
+  number =       "2",
+  month =        mar,
+  pages =        "195--199",
+  annote =       "Parsing combinators for ML. 6 references.",
+}
+
+
+@InProceedings{craryModules,
+  author = 	 "K. Crary and R. Harper and S. Puri",
+  title = 	 "What is a recursive module?",
+  booktitle = 	 "Programming Language Design and Implementation
+                 ({PLDI})",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 1999,
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  OPTaddress = 	 {},
+  OPTmonth = 	 {},
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{McSi98,
+  author =       "Nicholas McKay and Satnam Singh",
+  title =        "Dynamic Specialization of {XC6200} {FPGA}s by Partial
+                 Evaluation",
+  editor =       "Reiner W. Hartenstein and Andres Keevallik",
+  series =       LNCS,
+  volume =       1482,
+  publisher =    "Springer-Verlag",
+  booktitle =    "International Workshop on
+                 Field-Programmable Logic and Applications",
+  year =         "1998",
+  pages =        "298--307",
+}
+
+@InProceedings{Kieburtz99,
+  author =       "Richard Kieburtz",
+  title =        "Taming Effects with Monadic Typing",
+  booktitle =    "the International
+                 Conf. on Functional Programming (ICFP '98)",
+  series =       "ACM SIGPLAN Notices",
+  volume =       "34(1)",
+  pages =        "51--62",
+  month =        jun,
+  year =         "1999",
+  organization = "ACM",
+}
+
+@Article{EP97,
+  author =       "Abbas Edalat and Peter John Potts",
+  title =        "A new representation for exact real numbers",
+  journal =      "Electronical Notes in Theoretical Computer Science",
+  year =         "1997",
+  volume =       "6",
+  pages =        "14 pp.",
+  note =         "Mathematical foundations of programming semantics
+                 (Pittsburgh, PA, 1997)",
+}
+@Article{Hofmann00a,
+  author =       "Martin Hofmann",
+  title =        "Programming Languages Capturing Complexity Classes",
+  journal =      "SIGACTN: SIGACT News (ACM Special Interest Group on
+                 Automata and Computability Theory)",
+  volume =       "31",
+  year =         "2000",
+}
+
+@PhdThesis{Koen,
+  author = 	 "Koen Claessen",
+  title = 	 "Embedded Languages for Describing and Verifying Hardware",
+  school = 	 "Chalmers",
+  year = 	 2001,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTmonth = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{Hawk,
+  author =       "John Matthews and Byron Cook and John Launchbury",
+  title =        "Microprocessor Specification in {H}awk",
+  booktitle =    "Proc. 1998 International Conf. on
+                 Computer Languages",
+  publisher =    "IEEE Computer Society Press",
+  year =         "1998",
+  ISBN =         "0-780-35005-7, 0-8186-8454-2, 0-8186-8456-9",
+  pages =        "90--101",
+  abstract =     "Modern microprocessors require an immense investment
+                 of time and effort to create and verify, from the
+                 high-level architectural design downwards. We are
+                 exploring ways to increase the productivity of design
+                 engineers by creating a domain-specific language for
+                 specifying and simulating processor architectures. We
+                 believe that the structuring principles used in modern
+                 functional programming languages, such as static
+                 typing, parametric polymorphism, first-class functions,
+                 and lazy evaluation provide a good formalism for such a
+                 domain-specific language, and have made initial
+                 progress by creating a library on top of the functional
+                 language Haskell. We have specified the integer subset
+                 of an out-of-order, superscalar DLX microprocessor,
+                 with register-renaming, a reorder buffer, a global
+                 reservation station, multiple execution units, and
+                 speculative branch execution. Two key abstractions of
+                 this library are the signal abstract data type (ADT),
+                 which models the simulation history of a wire, and the
+                 transaction ADT, which models the state of an entire
+                 instruction as it travels through the microprocessor.",
+  references =   "Aagaard, M., and Leeser, M. Reasoning about pipelines
+                 with structural hazards. In Second International
+                 Conf. on Theorem Provers in Circuit Design (Bad
+                 Herrenalb, Germany, Sept. 1994). Barton, D. Advanced
+                 modeling features of MHDL. In International Conf.
+                 on Electronic Hardware Description Languages (Jan.
+                 1995). Gill, A., Launchbury, J., and Jones, S. P. A
+                 short-cut to deforestation. In ACM Conf. on
+                 Functional Programming and Computer Architecture
+                 (Copenhagen, Denmark, June 1993). Hennessy, J. L., and
+                 Patterson, D. A. Computer Architecture: A Quantitative
+                 Approach. Morgan Kaufmann, 1995. Hudak, P., Peterson,
+                 J., and Fasel, J. A gentle introduction to Haskell.
+                 Available at www.haskell.org, Dec. 1997. Johnson, M.
+                 Superscalar Microprocessor Design. Prentice Hall, 1991.
+                 Jones, G., and Sheeran, M. Circuit design in Ruby. In
+                 Formal Methods for VLSI Design, J. Staunstrup, Ed.
+                 North-Holland, 1990. Li, Y., and Leeser, M. HML: An
+                 innovative hardware design language and its translation
+                 to VHDL. In Conf. on Hardware Design Languages
+                 (June 1995). Melham, T. Abstraction mechanisms for
+                 hardware verification. In VLSI Specification,
+                 Verification and Synthesis, G. Birtwhistle and P. A.
+                 Subrahmanyam, Eds. Kluwer Academic Publishers, 1988.
+                 O'Donnell, J. From transistors to computer
+                 architecture: Teaching functional circuit specification
+                 in Hydra. In Symposium on Functional Programming
+                 Languages in Education (July 1995). Paulson, L.
+                 Isabelle: A Generic Theorem Prover. Springer-Verlag,
+                 1994. Peterson, J., and et al. Report on the
+                 programming language Haskell: A non-strict, purely
+                 functional language, version 1.4. Available at
+                 www.haskell.org, Apr. 1997. Sinderson, E., and et al.
+                 Hawk: A hardware specification language, version 1.
+                 Available at www.cse.ogi.edu/PacSoft/projects/Hawk/,
+                 Oct. 1997. Windley, P., and Coe, M. A correctness model
+                 for pipelined microprocessors. In Second International
+                 Conf. on Theorem Provers in Circuit Design (Sept.
+                 1994).",
+  annote =       "checked",
+}
+
+@Book{Nordstrom90,
+  key =          "Bengt Nordstrom and Kent Peterson and Jan M. Smith",
+  author =       "Bengt Nordstr{\"o}m and Kent Peterson and Jan M.
+                 Smith",
+  title =        "Programming in Martin-L{\"o}f's Type Theory:  An Introduction",
+  publisher =    "Oxford University Press",
+  year =         "1990",
+  volume =       "7",
+  address =      "New York, NY",
+}
+
+@InProceedings{Aehlig00,
+  author =       "Klaus Aehlig and Helmut Schwichtenberg",
+  title =        "A Syntactical Analysis of Non-Size-Increasing
+                 Polynomial Time Computation",
+  pages =        "84--94",
+  booktitle =    "the Symposium on Logic in Computer Science ({LICS}'
+                 00)",
+  ISBN =         "0-7695-0725-5",
+  month =        jun,
+  publisher =    "IEEE",
+  year =         "2000",
+}
+
+@InProceedings{ac:fruit01,
+  author = {Antony Courtney and Conal Elliott},
+  title = "Genuinely Functional User Interfaces",
+  booktitle = {Proc. Haskell Workshop},
+  year = 2001,
+  month = {September}
+}
+
+@Article{henderson86ieee,
+  author =       "Peter Henderson",
+  title =        "Functional Programming, Formal Specification and Rapid
+Prototyping",
+  journal =      "IEEE Transactions on Software Engineering",
+  year =         1986,
+  volume =       12,
+  number =       2,
+  pages =        {241--250}
+}
+
+@incollection{ stoy82some,
+    author = "Joseph E. Stoy",
+    title = "Some Mathematical Aspects of Functional Programming",
+    booktitle = "Functional Programming and its Applications",
+    publisher = "Cambridge University Press",
+    editor = "John Darlington and Peter Henderson and David A. Turner",
+    pages = "217--252",
+    year = "1982"
+}
+
+@article{ turner84functional,
+    author = "David A. Turner",
+    title = "Functional Programs as Executable Specifications",
+    journal = "Philosophical Transactions of the Royal Society of London",
+    volume = "A312",
+    pages = "363--388",
+    year = "1984"
+}
+
+@Article{backus:78,
+  author =      "John Backus",
+  title =       "Can Programming Be Liberated from the von {N}eumann
+                 Style? {A} functional Style and Its Algebra of Programs",
+  journal =     "Communications of the ACM",
+  year =        "1978",
+  volume =      "21",
+  number =      "8",
+  pages =       "613-641"
+}
+
+@PhdThesis{tos94,
+  author = 	 "Healfdene Goguen",
+  title = 	 "A Typed Operational Semantics for Type Theory",
+  school = 	 "University of Edinburgh",
+  year = 	 1994,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTmonth = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Article{Hofmann2000,
+  author =       "Martin Hofmann",
+  title =        "A Type System for Bounded Space and Functional
+                 In-Place Update",
+  journal =      "Nordic Journal of Computing",
+  volume =       "7",
+  number =       "4",
+  month =        "Winter",
+  year =         "2000",
+  coden =        "NJCOFR",
+  ISSN =         "1236-6064",
+  bibdate =      "Sat Jul 14 11:08:02 MDT 2001",
+  url =          "http://www.cs.helsinki.fi/njc/References/hofmann2000:258.html",
+  acknowledgement = ack-nhfb,
+}
+
+@PhdThesis{russoThesis,
+  author = 	 "Claudio Russo",
+  title = 	 "Types for Modules",
+  school = 	 "Edinburgh University",
+  year = 	 1998,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  OPTaddress = 	 {},
+  OPTmonth = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InCollection{Pfenning99handbook,
+  author =   "Frank Pfenning",
+  title =   "Logical Frameworks",
+  booktitle =  "Handbook of Automated Reasoning",
+  publisher =  "Elsevier Science Publishers",
+  year =  1999,
+  editor =  "Alan Robinson and Andrei Voronkov",
+  volume =   {II},
+  keywords =  "LF, Elf, misc"
+}
+
+@Article{Harper93jacm,
+  author = "Robert Harper and Furio Honsell and Gordon Plotkin",
+  title = "A Framework for Defining Logics",
+  journal = "Journal of the Association for Computing Machinery",
+  volume = "40",
+  number = "1",
+  month = jan,
+  year = "1993",
+  pages = "143--184",
+  urldvi = "http://www.cs.cmu.edu/~fp/elf-papers/jacm93.dvi.gz",
+  keywords =  "LF"
+}
+
+@InCollection{Basin93le,
+  author = "David A. Basin and Robert L. Constable",
+  title =       "Metalogical Frameworks",
+  booktitle =   "Logical Environments",
+  publisher =   "Cambridge University Press",
+  year =        1993,
+  editor =      "G. Huet and G. Plotkin",
+  pages =       "1--29",
+  keywords =  "misc"
+}
+
+@Book{Paulson94book,
+  author = "Lawrence C. Paulson",
+  title = "Isabelle: A Generic Theorem Prover",
+  publisher = "Springer-Verlag LNCS 828",
+  year = 1994,
+  keywords =  "Isabelle"
+}
+
+@article (CHURCH40,
+key = "Church40" ,
+author = "Alonzo Church" ,
+title = "A Formulation of the Simple Theory of Types" ,
+journal = "Journal of Symbolic Logic" ,
+volume = "5" ,
+year = "1940" ,
+pages = "56--68" ,
+keywords= "hol, fp"
+)
+
+@InProceedings{appel01lics,
+  author =   {Andrew W. Appel},
+  title =   {Foundational Proof-Carrying Code},
+  booktitle =   {16th Annual IEEE Symposium on Logic in Computer Science
+
+                (LICS '01)},
+  year =  2001,
+  address =  {Boston, USA},
+  month =  {June},
+  note =  {to appear}
+}
+
+
+@InProceedings{Appel99ccs,
+  author =   "Andrew W. Appel and Edward W. Felten",
+  title =   "Proof-Carrying Authentication",
+  editor =  "G. Tsudik",
+  booktitle =  "Proc. 6th Conf. on Computer and
+    Communications Security",
+  year =  1999,
+  publisher =  "ACM Press",
+  address =  "Singapore",
+  month =  nov,
+  note =  "To appear",
+  keywords =  "LF, Elf"
+}
+
+@PhdThesis{Necula98phd,
+  author =   "George C. Necula",
+  title =   "Compiling with Proofs",
+  school =   "Carnegie Mellon University",
+  year =   1998,
+  month =  oct,
+  note =         "Available as Technical Report CMU-CS-98-154"
+}
+
+@InProceedings{Necula97popl,
+  author =   "George C. Necula",
+  title =   "Proof-Carrying Code",
+  booktitle =  "Conf. Record of the 24th Symposium on Principles
+    of Programming Languages (POPL'97)",
+  year =  1997,
+  publisher =  "ACM Press",
+  address =  "Paris, France",
+  month =  jan,
+  editor =       "Neil D. Jones",
+  pages =  "106--119"
+}
+
+@InProceedings{Necula96osdi,
+  author =   "George C. Necula and Peter Lee",
+  title =   "Safe Kernel Extensions Without Run-Time Checking",
+  booktitle =  "Proc. Second Symposium on Operating
+    System Design and Implementation (OSDI'96)",
+  year =  1996,
+  address =  "Seattle, Washington",
+  month =  oct,
+  pages =  "229--243"
+}
+
+@InProceedings{Schurmann01csl,
+  author =   {Carsten Sch{\"u}rmann},
+  title =   {Recursion for higher-order encodings},
+  booktitle =   {Proc. Conf. on Computer Science Logic
+(CSL
+  2001)},
+  pages =  {585--599},
+  year =  2001,
+  editor =  {Laurent Fribourg},
+  address =  {Paris, France},
+  month =  {August},
+  publisher =  {Springer Verlag LNCS 2142}
+}
+
+@InProceedings{Schurmann01lpar, author = {Carsten Sch{\"u}rmann},
+  title = {A type-theoretic approach to induction with higher-order
+  encodings}, booktitle = {Proc. Conf. on Logic for
+  Programming, Artificial Intelligence and Reasoning (LPAR 2001)},
+  year = 2001, address = {Havana, Cuba}, note = {to appear} }
+
+
+@InProceedings{polyp,
+  title =        "{PolyP}---a polytypic programming language extension",
+  author =       "Patrik Jansson and Johan Jeuring",
+  pages =        "470--482",
+  booktitle =    "Conf. Record of {POPL}~'97: The 24th {ACM}
+                 {SIGPLAN}-{SIGACT} Symposium on Principles of
+                 Programming Languages",
+  month =        "15--17 " # jan,
+  year =         "1997",
+  address =      "Paris, France",
+  references =   "\cite{TCS::BohmB1985} \cite{IEEETIT::Cameron1988}
+                 \cite{SPE::Contla1985} \cite{POPL::DamasM1982}
+                 \cite{IPL::Dershowitz1979} \cite{LICS::Freyd1990}
+                 \cite{POPL::HarperM1995} \cite{SCP::Jay1995}
+                 \cite{JFP::Jones1995} \cite{SCP::Malcolm1990}
+                 \cite{FACS::Meertens1992}
+                 \cite{TOPLAS::PalsbergXL1995}",
+}
+
+@PhdThesis{ParikThesis,
+  author =       "Patrik Jansson",
+  title =        "Functional Polytypic Programming",
+  type =         "PhD thesis",
+  school =       "Department of Computing Science, Chalmers Univ.\ of
+                 Technology and Univ.\ of G{\"o}teborg",
+  month =        may,
+  year =         "2000",
+  url =          "http://www.cs.chalmers.se/~patrikj/poly/polythesis/polythesis.ps.gz",
+}
+
+
+@InCollection{Gibbons,
+  author =       "Jeremy Gibbons",
+  title =        "Polytypic Downward Accumulations",
+  editor =       "J. Jeuring",
+  booktitle =    "Proceedings 4th Int.\ Conf.\ on Mathematics of Program
+                 Construction, MPC'98, Marstrand, Sweden, 15--17 June
+                 1998",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "1422",
+  pages =        "207--233",
+  publisher =    "Springer-Verlag",
+  address =      "Berlin",
+  year =         "1998",
+  url =          "http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/polyda.ps.gz",
+}
+
+@Article{Hinze,
+  author =       "Ralf Hinze",
+  title =        "Polytypic Functions over Nested Datatypes",
+  journal =      "Discrete Mathematics and Theoretical Computer
+                 Science",
+  volume =       "3",
+  number =       "4",
+  pages =        "193--214",
+  year =         "1999",
+  url =          "http://dmtcs.loria.fr/volumes/ps.gzpapers/dm030407.ps.gz",
+}
+
+@Book{b-book,
+  author =       "J.-R. Abrial",
+  title =        "The {B}-Book: Assigning Programs to Meanings",
+  publisher =    "Cambridge University Press",
+  year =         "1996",
+  price =        "\pounds 40.00",
+  ISBN =         "0-521-49619-5",
+  length =       "850",
+  annote =       "This book is a reference manual for the B-Method
+                 developed by Jean-Raymond Abrial, also the originator
+                 of the Z notation. B is designed for tool-assisted
+                 software development whereas Z is designed mainly for
+                 specification. \par Contents: Mathematical reasoning;
+                 Set notation; Mathematical objects; Introduction to
+                 abstract machines; Formal definition of abstract
+                 machines; Theory of abstract machines; Constructing
+                 large abstract machines; Example of abstract machines;
+                 Sequencing and loop; Programming examples; Refinement;
+                 Constructing large software systems; Example of
+                 refinement; \par Appendices: Summary of the most
+                 current notations; Syntax; Definitions; Visibility
+                 rules; Rules and axioms; Proof obligations.",
+}
+
+@book{vdm,
+    author = "Cliff B. Jones",
+    title = "Systematic Software Development Using {VDM}",
+    publisher = "Pren{\-}tice-Hall",
+    address = "Upper Saddle River, NJ 07458, USA",
+    isbn = "0-13-880733-7",
+    pages = "xiv + 333",
+    year = "1990"
+}
+
+@misc{Z,
+  author = "J. Spivey",
+  title = "A Specification Language and its Formal Semantics",
+  text = "J. M. Spivey, Understanding Z: A Specification Language and its
+Formal
+    Semantics, Cambridge U. P. (1988).",
+  year = "1988" }
+
+
+@InProceedings{Cierniak00,
+  author =       "Michal Cierniak and Guei-Yuan Lueh and James M.
+                 Stichnoth",
+  title =        "Practicing {JUDO}: Java under dynamic optimizations.",
+  pages =        "13--26",
+  booktitle =    "Proc. {ACM} {SIGPLAN} 2000 Conf. on
+                 Programming Language Design and Implementation
+                 ({PLDI}-00)",
+  month =        jun # " ~18--21",
+  series =       "ACM Sigplan Notices",
+  volume =       "35.5",
+  publisher =    "ACM Press",
+  address =      "N.Y.",
+  year =         "2000",
+}
+
+@InProceedings{Cierniak98,
+  author =       "Ali-Reza Adl-Tabatabai and Micha{\l} Cierniak and
+                 Guei-Yuan Lueh and Vishesh M. Parikh and James M.
+                 Stichnoth",
+  title =        "Fast, Effective Code Generation in a Just-in-Time
+                 {J}ava Compiler",
+  booktitle =    "Proc. {ACM} {SIGPLAN}~'98 Conf. on
+                 Programming Language Design and Implementation",
+  year =         "1998",
+  pages =        "280--290",
+  url =          "http://www.acm.org/pubs/articles/proceedings/pldi/277650/p280-adl-tabatabai/p280-adl-tabatabai.pdf",
+  genterms =     "ALGORITHMS, EXPERIMENTATION, LANGUAGES, PERFORMANCE",
+  categories =   "D.3.4 Software, PROGRAMMING LANGUAGES, Processors,
+                 Code generation. D.3.2 Software, PROGRAMMING LANGUAGES,
+                 Language Classifications, Java. D.3.4 Software,
+                 PROGRAMMING LANGUAGES, Processors, Compilers.",
+  annote =       "incomplete",
+}
+
+@InProceedings{FORTRANSpec,
+  author =       "Robert Gl{\"u}ck and Ryo Nakashige and Robert
+                 Z{\"o}chling",
+  year =         "1995",
+  title =        "Binding-Time Analysis Applied to Mathematical
+                 Algorithms",
+  booktitle =    "System Modelling and Optimization",
+  editor =       "J. Dole\v{z}al and J. Fidler",
+  publisher =    "Chapman \& Hall",
+  pages =        "137--146",
+  keywords =     "partial evaluation, numerical algorithms, scientific
+                 computing, Fortran",
+  summary =      "This paper shows how a binding-time analysis can be
+                 used to identify potential sources for specialization
+                 in mathematical algorithms. The method is surprisingly
+                 simple and effective. To demonstrate the effectiveness
+                 of this approach we used an automatic partial evaluator
+                 for Fortran that we developed. Results for five
+                 well-known algorithms show that some remarkable speedup
+                 factors can be obtained on a uniprocessor architecture
+                 (Romberg integration, cubic splines interpolation,
+                 partial differential equations, fast Fourier
+                 transformation, Chebyshev approximation)",
+  semno =        "D-244",
+  puf =          "Artikel i proceedings (med censur)",
+  id =           "KonR",
+}
+
+@InProceedings{Consel98,
+  author =       "Fran{\c{c}}ois No{\"e}l and Luke Hornof and Charles
+                 Consel and Julia L. Lawall",
+  title =        "Automatic, Template-Based Run-Time Specialization:
+                 Implementation and Experimental Study",
+  booktitle =    "Proc. 1998 International Conf. on
+                 Computer Languages",
+  publisher =    "IEEE Computer Society Press",
+  year =         "1998",
+  ISBN =         "0-780-35005-7, 0-8186-8454-2, 0-8186-8456-9",
+  pages =        "132--142",
+  abstract =     "Specializing programs with respect to run-time values
+                 has been shown to drastically improve code performance
+                 on realistic programs ranging from operating systems to
+                 graphics. Recently, various approaches to specializing
+                 code at run-time have been proposed. However, these
+                 approaches still suffer from shortcomings that limit
+                 their applicability: they are manual, too expensive, or
+                 require programs to be written in a dedicated language.
+                 We solve these problems by introducing new techniques
+                 to implement run-time specialization. The key to our
+                 approach is the use of code templates. Templates are
+                 automatically generated from ordinary programs and are
+                 optimized before run time, allowing high-quality code
+                 to be quickly generated at run time. Experimental
+                 results obtained on scientific and graphics code
+                 indicate that our approach is highly effective. Little
+                 run-time overhead is introduced, since code generation
+                 primarily consists of copying instructions. Run-time
+                 specialized programs run up to 10~times faster, and are
+                 nearly as fast as fully optimized programs (80\% on
+                 average). The combination of low run-time overhead and
+                 high code quality enables specialization to be
+                 amortized in as few as 3~runs. Although this approach
+                 is highly effective, its implementation is relatively
+                 simple since it exploits existing partial evaluation
+                 and compiler technologies.",
+  references =   "J. Auslander, M. Philipose, C. Chambers, S.J. Eggers,
+                 and B.N. Bershad. Fast, effective dynamic compilation.
+                 In PLDI'96 [21], pages 149--159. R. Bernstein.
+                 Multiplication by integer constants.
+                 Software---Practice and Experience, 16(7):641--652,
+                 July 1986. C. Consel, L. Hornof, F. No{\"e}l, J.
+                 Noy{\'e}, and E.N. Volanschi. A uniform approach for
+                 compile-time and run-time specialization. In O. Danvy,
+                 R. Gl{\"u}ck, and P. Thiemann, editors, Partial
+                 Evaluation, International Seminar, Dagstuhl Castle,
+                 number 1110 in Lecture Notes in Computer Science, pages
+                 54--72, February 1996. C. Consel and F. No{\"e}l. A
+                 general approach for run-time specialization and its
+                 application to C. In POPL96 [22], pages 145--156. D.R.
+                 Engler, W.C. Hsieh, and M.F. Kaashoek. `C: A language
+                 for high-level, efficient, and machine-independent
+                 dynamic code generation. In POPL96 [22], pages
+                 131--144. C. W. Fraser and D. R. Hanson. A code
+                 generation interface for ANSI C. Software---Practice
+                 and Experience, 21(9):963--988, 1991. R. Gl{\"u}ck, R.
+                 Nakashige, and R. Z{\"o}chling. Binding-time analysis
+                 applied to mathematical algorithms. In J. Dole{\v{z}}al
+                 and J. Fidler, editors, System Modelling and
+                 Optimization, pages 137--146. Chapman \& Hall, 1995. L.
+                 Hornof. Static Analyses for the Effective
+                 Specialization of Realistic Applications. PhD thesis,
+                 Universit{\'e} de Rennes I, June 1997. L. Hornof and J.
+                 Noy{\'e}. Accurate binding-time analysis for imperative
+                 languages: Flow, context, and return sensitivity. In
+                 PEPM'97 [19], pages 63--73. L. Hornof, J. Noy{\'e}, and
+                 C. Consel. Effective specialization of realistic
+                 programs via use sensitivity. In P. Van Hentenryck,
+                 editor, Proc. Fourth International
+                 Symposium on Static Analysis, SAS'97, volume 1302 of
+                 Lecture Notes in Computer Science, pages 293--314,
+                 Paris, France, September 1997. Springer-Verlag. N.D.
+                 Jones, Carsten K. Gomard, and P. Sestoft. Partial Evaluation
+                 and Automatic Program Generation. International Series
+                 in Computer Science. Prentice-Hall, June 1993. D.
+                 Keppel, S. Eggers, and R. Henry. A case for run-time
+                 code generation. Technical Report 91-11-04, Department
+                 of Computer Science, University of Washington, Seattle,
+                 WA, 1991. D. Kincaid and W. Cheney. Numerical Analysis:
+                 Mathematics of Scientific Computing. Brooks/Cole, 1991.
+                 P. Lee and M. Leone. Optimizing ML with run-time code
+                 generation. In PLDI'96 [21], pages 137--148. M. Leone
+                 and P. Lee. Lightweight run-time code generation. In
+                 ACM SIGPLAN Workshop on Partial Evaluation and
+                 Semantics-Based Program Manipulation, Orlando, FL, USA,
+                 June 1994. Technical Report 94/9, University of
+                 Melbourne, Australia. Karoline Malmkj{\ae}r. Abstract
+                 Interpretation of Partial-Evaluation Algorithms. PhD
+                 thesis, Department of Computing and Information
+                 Sciences, Kansas State University, Manhattan, Kansas,
+                 March 1993. G. Muller, B. Moura, F. Bellard, and C.
+                 Consel. JIT vs. offline compilers: Limits and benefits
+                 of byte-code compilation. Rapport de recherche 1063,
+                 IRISA, Rennes, France, December 1996. F. No{\"e}l.
+                 Sp{\'e}cialisation dynamique de code par {\'e}valuation
+                 partielle. PhD thesis, Universit{\'e} de Rennes I,
+                 October 1996. ACM SIGPLAN Symposium on Partial
+                 Evaluation and Semantics-Based Program Manipulation,
+                 Amsterdam, The Netherlands, June 1997. ACM Press. R.
+                 Pike, B. N. Locanthi, and J.F. Reiser.
+                 Hardware/software trade-offs for bitmap graphics on the
+                 blit. Software---Practice and Experience,
+                 15(2):131--151, 1985. Proc. ACM SIGPLAN
+                 '96 Conf. on Programming Language Design and
+                 Implementation, Philadelphia, PA, May 1996. ACM SIGPLAN
+                 Notices, 31(5). Conf. Record of the 23rd Annual
+                 ACM SIGPLAN-SIGACT Symposium on Principles Of
+                 Programming Languages, St. Petersburg Beach, FL, USA,
+                 January 1996. ACM Press. W. H. Press, S. A. Teukolsky,
+                 W. T. Vetterling, and B. P. Flannery. Numerical Recipes
+                 in FORTRAN The Art of Scientific Computing. Cambridge
+                 University Press, Cambridge, 2nd edition, 1993. C. Pu,
+                 H. Massalin, and J. Ioannidis. The Synthesis kernel.
+                 Computing Systems, 1(1):11--32, Winter 1988. M. Sperber
+                 and T. Thiemann. Two for the price of one: Composing
+                 partial evaluation and compilation. In Proceedings of
+                 the ACM SIGPLAN '97 Conf. on Programming Language
+                 Design and Implementation, pages 215--224, Las Vegas,
+                 Nevada, June 15--18, 1997. W. Taha and T. Sheard.
+                 Multi-state programming with explicit annotations. In
+                 PEPM'97 [19], pages 203--217. C. Yarvin and A. Sah.
+                 QuaC: Binary optimization for fast runtime code
+                 generation in C. Technical Report 94-792, Computer
+                 Science Department, University of California, Berkeley,
+                 1994.",
+  annote =       "checked",
+}
+
+@InCollection{Erratic,
+  author =       "A. K. Moran and D. Sands and M. Carlsson",
+  title =        "Erratic {F}udgets: {A} semantic theory for an embedded
+                 coordination language",
+  booktitle =    "Coordination '99",
+  series =       "{LNCS}",
+  volume =       "1594",
+  publisher =    "Springer-Verlag",
+  year =         "1999",
+  month =        apr,
+}
+
+@InProceedings{Mins97a,
+  author =       "Naftaly Minsky and Victoria Ungureanu",
+  editor =       "David Garlan and Daniel Le M{\`e}tayer",
+  title =        "Regulated Coordination in Open Distributed Systems",
+  booktitle =    "Proceedings COORDINATION'97",
+  series =       "LNCS 1282",
+  pages =        "81--97",
+  publisher =    "Springer-Verlag",
+  address =      "Berlin, Germany",
+  month =        sep,
+  year =         "1997",
+  keywords =     "olit coordination97",
+}
+
+@InProceedings{Inve97a,
+  author =       "Paola Inverardi and Alexander L. Wolf and Daniel
+                 Yankelevich",
+  title =        "Checking Assumptions in Component Dynamics at the
+                 Architectural Level",
+  booktitle =    "Proceedings of COORDINATION'97",
+  series =       "LNCS 1282",
+  pages =        "46--63",
+  publisher =    "Springer-Verlag",
+  month =        sep,
+  year =         "1997",
+  keywords =     "CHAM Coordination",
+}
+
+@InProceedings{BroJac99,
+  author =       "A. Brogi and JM. Jacquet",
+  title =        "{On the expressiveness of Coordination Models}",
+  booktitle =    "Proc. 3rd Int. Conf. on Coordination Models and
+                 Languages",
+  month =        apr,
+  address =      "Amsterdam, Netherland",
+  year =         "1999",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "1594",
+  pages =        "134--149",
+  editor =       "P. Ciancarini and A. Wolf",
+  publisher =    "Springer-Verlag, Berlin",
+  keyword =      "coordination semantics",
+}
+
+@InProceedings{BKZ99,
+  author =       "M. Bonsangue and J. Kok and G. Zavattaro",
+  title =        "{Comparing Software Architectures for coordination
+                 languages}",
+  booktitle =    "Proc. 3rd Int. Conf. on Coordination Models and
+                 Languages",
+  month =        apr,
+  address =      "Amsterdam, Netherland",
+  year =         "1999",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "1594",
+  pages =        "150--165",
+  editor =       "P. Ciancarini and A. Wolf",
+  publisher =    "Springer-Verlag, Berlin",
+  keyword =      "coordination semantics",
+}
+
+@Article{CoadyEtAl01,
+  author =       "Coady and Kiczales and Feeley and Hutchinson and Ong",
+  title =        "Structuring Operating System Aspects: Using {AOP} to
+                 Improve {OS} Structure Modularity",
+  journal =      "CACM: Communications of the ACM",
+  volume =       "44",
+  year =         "2001",
+}
+
+@Article{ElrFilBad01,
+  author =       "Elrad and Filman and Bader",
+  title =        "Aspect-Oriented Programming",
+  journal =      "CACM: Communications of the ACM",
+  volume =       "44",
+  year =         "2001",
+}
+
+@InProceedings{Heitmeyer01,
+  author =       "Heitmeyer",
+  title =        "Applying Practical Formal Methods to the Specification
+                 and Analysis of Security Properties",
+  booktitle =    "International Workshop on Methods, Models and
+                 Architectures for Network Security, LNCS",
+  year =         "2001",
+}
+
+@InProceedings{Heitmeyer97a,
+  author =       "Constance Heitmeyer and James Kirby and Bruce Labaw",
+  title =        "The {SCR} Method for Formally Specifying, Verifying,
+                 and Validating Software Requirements: Tool Support",
+  booktitle =    "Proc. ~19th~ International Conf. on
+                 Software Engineering",
+  year =         "1997",
+  pages =        "610--611",
+  publisher =    "ACM Press",
+  month =        may,
+}
+
+@InProceedings{heintze:lics92,
+  title =        "An {E}ngine for {L}ogic {P}rogram {A}nalysis",
+  author =       "N. Heintze and J. Jaffar",
+  pages =        "318--328",
+  booktitle =    "Proceedings, Seventh Annual {IEEE} Symposium on Logic
+                 in Computer Science",
+  year =         "1992",
+  month =        jun # " 22--25",
+  address =      "Santa Cruz, California",
+  organization = "IEEE Computer Society Press",
+  ISBN =         "0-8186-2735-2",
+  acknowledgement = ack-mmc,
+}
+
+@InProceedings{Abadi-etal99,
+  key =          "Abadi, {\em et al.}",
+  author =       "Mart\'{\i}n Abadi and Anindya Banerjee and Nevin
+                 Heintze and Jon G. Riecke",
+  title =        "A Core Calculus of Dependency",
+  booktitle =    "Conf. Record of POPL 99: The 26th ACM
+                 SIGPLAN-SIGACT Symposium on Principles of Programming
+                 Languages, San Antonio, Texas",
+  year =         "1999",
+  organization = "ACM",
+  address =      "New York, NY",
+  month =        jan,
+  pages =        "147--160",
+  annote =       "40 references.",
+}
+
+@Article{CMS,
+  author = 	 "Calcagno, Cristiano and Moggi, Eugenio and Sheard, Tim",
+  title = 	 "Closed Types for a Safe Imperative {MetaML}",
+  journal = 	 "Journal of Functional Programming",
+  year = 	 {2003},
+  OPTkey = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTpages = 	 {},
+  OPTmonth = 	 {},
+  note = 	 "To appear",
+  OPTannote = 	 {}
+}
+
+@InProceedings{PTS02,
+  author =       {Pa\v{s}ali\'{c}, Emir and Taha, Walid and Sheard, Tim},
+  title =        {Tagless Staged Interpreters for Typed Languages},
+  booktitle =    {the International Conf. on 
+                  Functional Programming ({ICFP} '02)},
+  year =         {2002},
+  address =      {Pittsburgh, USA},
+  month =        {October},
+  organization = {ACM},
+}
+
+@InProceedings{N02,
+  author =       {Aleksander Nanevski},
+  title =        {Meta-Programming with Names and Necessity},
+  booktitle =    {the International Conf. on 
+                  Functional Programming ({ICFP} '02)},
+  year =         {2002},
+  address =      {Pittsburgh, USA},
+  month =        {October},
+  organization = {ACM},
+}
+
+@Book{BasicCat,
+  author =       "Benjamin C. Pierce",
+  title =        "Basic Category Theory for Computer Scientists",
+  publisher =    "MIT Press",
+  address =      "Cambridge, Mass.",
+  year =         "1991",
+  ISBN =         "0-262-66071-7",
+  descriptor =   "Semantik, Programmiersprache, Natuerliche
+                 Transformation, Kategorie, Funktor",
+  annote =       "Das Buch ist ein einfuehrendes Lehrbuch in die
+                 Kategorientheorie. Es enthaelt einige Anwendungen der
+                 Kategorientheorie aus dem Bereich der Semantik von
+                 Programmiersprachen.",
+}
+
+@InProceedings{CayenneInterp,
+  author = 	 " Lennart Augustsson and Magnus Carlsson",
+  title = 	 "An exercise in dependent types: A well-typed interpreter",
+  booktitle = 	 "Workshop on Dependent Types in Programming",
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 1999,
+  OPTeditor = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTseries = 	 {},
+  address = 	 "Gothenburg",
+  OPTmonth = 	 {},
+  OPTorganization = {},
+  OPTpublisher = {},
+  note = 	 "Available online from \verb|www.cs.chalmers.se/~augustss/cayenne/interp.ps|",
+  OPTannote = 	 {}
+}
+
+@TechReport{Pu:83,
+  author = 	 "Calton Pu and Jonathan Walpole",
+  title = 	 "A Study of Dynamic Optimization Techniques: Lessons and Directions in Kernel Design",
+  institution =  "Oregon Graduate Institute",
+  year = 	 1993,
+  OPTkey = 	 {},
+  OPTtype = 	 {},
+  number = 	 "CSE-93-007",
+  OPTaddress = 	 {},
+  OPTmonth = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {},
+  note  =        "Available from \cite{ogi-tr-site}",
+}
+
+@article{dsls-on-line
+    ,author={Paul Hudak}
+    ,title={Building Domain Specific Embedded Languages}
+    ,journal={ACM Computing Surveys}
+    ,volume={28A}
+    ,month=Dec
+    ,year=1996
+    ,pages={(electronic)}
+    }
+
+@article{little-languages
+    ,author={Jon Bentley}
+    ,title={Little Languages}
+    ,journal={CACM}
+    ,volume=29
+    ,number=8
+    ,year=1986
+    ,pages={711-721}
+    }
+
+@inproceedings{dsel-reuse-98
+    ,author={Paul Hudak}
+    ,title={Modular Domain Specific Languages and Tools}
+    ,booktitle={Proceedings of Fifth International Conf. 
+                on Software Reuse}
+    ,organization={IEEE Computer Society}
+    ,year=1998
+    ,month=Jun
+    ,pages={134-142}
+    }
+
+@InProceedings{TMH01,
+  author =       "Walid Taha and Henning Makholm and John Hughes",
+  title =        "Tag Elimination and {Jones}-Optimality",
+  pages =        "257-275",
+  booktitle =    {Programs as Data Objects},
+  venue =        "Aarhus, Denmark",
+  year =         2001,
+  editor =       "Olivier Danvy and Andrzej Filinksi",
+  series =       LNCS,
+  volume =       2053,
+}
+
+@InProceedings{HarperMorrisett,
+  key =          "Harper \& Morrisett",
+  author =       "Robert Harper and Greg Morrisett",
+  title =        "Compiling Polymorphism Using Intentional Type
+                 Analysis",
+  booktitle =    "Conf. Record of POPL '95: 22nd Annual ACM
+                 SIGPLAN-SIGACT Symposium on Principles of Programming
+                 Languages, San Francisco, Calif.",
+  month =        jan,
+  year =         "1995",
+  organization = "ACM",
+  address =      "New York, NY",
+  pages =        "130--141",
+  annote =       "53 references.",
+}
+
+@InProceedings{FullyReflexive,
+  author =       "Valery Trifonov and Bratin Saha and Zhong Shao",
+  title =        "Fully reflexive intensional type analysis.",
+  pages =        "82--93",
+  booktitle =    "Proc. {ACM} Sigplan International
+                 Conf. on Functional Programming ({ICFP}-00)",
+  month =        sep # " ~18--21",
+  series =       "ACM Sigplan Notices",
+  volume =       "35.9",
+  publisher =    "ACM Press",
+  address =      "N.Y.",
+  year =         "2000",
+}
+
+
+@Unpublished{Huang,
+  author = 	 "Liwen Huang and Walid Taha",
+  title = 	 "A Practical Implementation of Tag Elimination",
+  note = 	 "In preperation"
+}
+
+@Unpublished{McCreight,
+  author = 	 "Andrew McCreight and Walid Taha",
+  title = 	 "An Experiment in Staging MetaPRL",
+  note = 	 "In preperation"
+}
+
+@InProceedings{XP99,
+  key =          "Xi \& Pfenning",
+  author =       "Howgwei Xi and Frank Pfenning",
+  title =        "Dependent Types in Practical Programming",
+  booktitle =    "Conf. Record of POPL 99: The 26th ACM
+                 SIGPLAN-SIGACT Symposium on Principles of Programming
+                 Languages, San Antonio, Texas",
+  year =         "1999",
+  organization = "ACM",
+  address =      "New York, NY",
+  month =        jan,
+  pages =        "214--227",
+  annote =       "28 references.",
+}
+
+
+@InProceedings{Dybjer87,
+  author =       "Peter Dybjer",
+  title =        "Inductively Defined Sets in {M}artin-{L}{\"o}f's Set
+                 Theory",
+  booktitle =    "Workshop on General Logic",
+  editor =       "A. Avron and R. Harper and F. Honsell and I. Mason and
+                 G. Plotkin",
+  institution =  "Report ECS-LFCS-88-52, Department of Computer Science,
+                 University of Edinburgh",
+  month =        feb,
+  year =         "1987",
+}
+
+
+@InCollection{Dybjer90,
+  author =       "Peter Dybjer",
+  title =        "Inductive Sets and Families in {M}artin-{L}{\"o}f's
+                 Type Theory and Their Set-Theoretic Semantics",
+  editor =       "G. Huet and G. Plotkin",
+  booktitle =    "Preliminary Proc.\ of 1st Int.\ Workshop on Logical
+                 Frameworks, Antibes, France, 7--11 May 1990",
+  pages =        "213--230",
+  note =         "ftp://ftp.inria.fr/INRIA/Projects/coq/types/Proceedings/book90.ps.Z",
+  year =         "1990",
+}
+
+@InCollection{Dybjer91,
+  author =       "Peter Dybjer",
+  title =        "Inductive Sets and Families in {M}artin-{L}{\"o}f's
+                 Type Theory and Their Set-Theoretic Semantics",
+  editor =       "G. Huet and G. Plotkin",
+  booktitle =    "Logical Frameworks",
+  publisher =    "Cambridge University Press",
+  year =         "1991",
+  pages =        "280--306",
+  url =          "ftp://ftp.cs.chalmers.se/pub/clics/peterd/Setsem_Inductive.ps",
+}
+
+
+@Article{Dybjer94,
+  author =       "Peter Dybjer",
+  title =        "Inductive Families",
+  journal =      "Formal Aspects of Computing",
+  year =         "1994",
+  volume =       "6",
+  number =       "4",
+  pages =        "440--465",
+  url =          "ftp://ftp.cs.chalmers.se/pub/clics/peterd/Inductive_Families.ps",
+}
+
+
+@Unpublished{Dybjer97,
+  author =       "Peter Dybjer",
+  title =        "A General Formulation of Simultaneous
+                 Inductive-Recursive Definitions in Type Theory",
+  month =        jun,
+  year =         "1997",
+  note =         "To appear in JSL",
+  url =          "ftp://ftp.cs.chalmers.se/pub/clics/peterd/Inductive_Recursive.ps",
+}
+
+@InCollection{Dybjer98,
+  author =       "Peter Dybjer and Anton Setzer",
+  title =        "Finite Axiomatizations of Inductive and
+                 Inductive-Recursive Definitions",
+  editor =       "R. Backhouse and T. Sheard",
+  booktitle =    "Informal Proc.\ of Workshop on Generic Programming,
+                 WGP'98, Marstrand, Sweden, 18 June 1998",
+  publisher =    "Dept.\ of Computing Science, Chalmers Univ.\ of
+                 Techn., and G{\"o}teborg Univ.",
+  month =        jun,
+  year =         "1998",
+  note =         "Electronic version available at
+                 http://wsinwp01.win.tue.nl:1234/WGPProceedings/",
+  url =          "http://www.math.uu.se/~setzer/articles/genprog98.ps.gz",
+}
+
+@InProceedings{Nordstrm81,
+  author =       "Bengt Nordstr{\"o}m",
+  title =        "Programming in Constructive Set Theory: Some
+                 Examples",
+  booktitle =    "Proc. ACM Conf. on Functional
+                 Programming and Computer Architecture, Portsmouth, NH",
+  pages =        "141--154",
+  publisher =    "ACM",
+  address =      "New York",
+  year =         "1981",
+}
+
+@Article{Magnusson94,
+  author =       "L. Magnusson and B. Nordstroem",
+  title =        "The {ALF} Proof Editor and Its Proof Engine",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "806",
+  pages =        "213--237",
+  year =         "1994",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Wed Sep 15 10:01:31 MDT 1999",
+  acknowledgement = ack-nhfb,
+  keywords =     "proofs; programs; TYPES",
+}
+
+@InCollection{NOR83a,
+  author =       "B. Nordstr{\"o}m and K. Petersson",
+  title =        "Types and Specifications",
+  booktitle =    "IFIP '83",
+  publisher =    "Elsevier Science Publishers",
+  editor =       "R. E. Mason",
+  pages =        "915--920",
+  year =         "1983",
+}
+
+@InCollection{NOR85a,
+  author =       "B. Nordstr{\"o}m",
+  title =        "Multilevel Functions in Type Theory",
+  booktitle =    "Programs as Data Objects",
+  editor =       "N. Jones",
+  publisher =    "Springer-Verlag, LNCS 217",
+  year =         "1985",
+}
+
+
+@Article{Coquand94,
+  author =       "Thierry Coquand and Bengt Nordstr{\"o}m and Jan M. Smith and
+                 Bjorne von Sydow",
+  title =        "Type Theory and Programming",
+  journal =      "Bulletin of the European Association for Theoretical
+                 Computer Science",
+  volume =       "52",
+  pages =        "203--228",
+  month =        feb,
+  year =         "1994",
+  note =         "Columns: Logic in Computer Science",
+}
+
+@Book{NPS90,
+  key =          "Nordstrom \& Peterson \& Smith",
+  author =       "Bengt Nordstr{\"o}m and Kent Peterson and Jan M.
+                 Smith",
+  title =        "Programming in Martin-Lof's Type Theory",
+  publisher =    "Oxford University Press",
+  year =         "1990",
+  volume =       "7",
+  series =       "International Series of Monographs on Computer
+                 Science",
+  address =      "New York, NY",
+  note    =      "Currently available online from first authors homepage."
+}
+
+@Article{Saibi:1995:FLC,
+  author =       "A. Saibi",
+  title =        "Formalization of a lambda-Calculus with Explicit
+                 Substitutions in {Coq}",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "996",
+  pages =        "183--202",
+  year =         "1995",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Wed Sep 15 10:01:31 MDT 1999",
+  acknowledgement = ack-nhfb,
+  keywords =     "types; proofs; programs",
+}
+
+@Article{Monin:1998:PRT,
+  author =       "J.-F Monin",
+  title =        "Proving a Real Time Algorithm for {ATM} in {Coq}",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "1512",
+  pages =        "277--??",
+  year =         "1998",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Tue Jan 5 08:21:58 MST 1999",
+  acknowledgement = ack-nhfb,
+}
+
+@Article{Leclerc:1994:PSC,
+  author =       "F. Leclerc and C. Paulin-Mohring",
+  title =        "Programming with Streams in {Coq} --- {A} Case Study:
+                 The Sieve of Eratosthenes",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "806",
+  pages =        "191--212",
+  year =         "1994",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Wed Sep 15 10:01:31 MDT 1999",
+  acknowledgement = ack-nhfb,
+  keywords =     "proofs; programs; TYPES",
+}
+
+@InProceedings{Chetali97a,
+  author =       "B. Chetali and B. Heyd",
+  year =         "1997",
+  title =        "Formal Verification of Concurrent Programs in {LP} and
+                 in {COQ}: {A} Comparative Analysis",
+  booktitle =    "Proc. 10th International Theorem Proving in Higher
+                 Order Logics Conf.",
+  pages =        "69--85",
+  abstract =     "This paper describes the formal verification of
+                 parallel programs using a rewrite and induction based
+                 theorem prover like LP and a higher order theorem
+                 prover based on the Calculus of Inductive Construction,
+                 namely COQ. The chosen specification environment is
+                 UNITY, a subset of temporal logic for specifying and
+                 verifying concurrent programs. By means of an example,
+                 a lift-control program, we describe the embedding of
+                 UNITY and we show how to verify mechanically program
+                 properties using the two provers. Then we summarize a
+                 comparison between the theorem proving environments,
+                 based on our practical experience with both systems for
+                 the verification of UNITY programs.",
+}
+
+@InProceedings{Zammit97a,
+  author =       "V. Zammit",
+  year =         "1997",
+  title =        "A Comparative Study of Coq and {HOL}",
+  booktitle =    "Proc. 10th International Theorem Proving in Higher
+                 Order Logics Conf.",
+  pages =        "323--337",
+  abstract =     "This paper illustrates the differences between the
+                 style of theory mechanisation of Coq and of HOL. This
+                 comparative study is based on the mechanisation of
+                 fragments of the theory of computation in these
+                 systems. Examples from these implementations are given
+                 to support some of the arguments discussed in this
+                 paper. The mechanisms for specifying definitions and
+                 for theorem proving are discussed separately, building
+                 in parallel two pictures of the different approaches of
+                 mechanisation given by these systems.",
+}
+
+@Article{PMW:synmps,
+  author =       "Christine Paulin-Mohring and Benjamin Werner",
+  title =        "Synthesis of {ML} Programs in the System {Coq}",
+  journal =      "Journal of Symbolic Computation",
+  volume =       "15",
+  number =       "5--6",
+  pages =        "607--640",
+  year =         "1993",
+  url =          "ftp://ftp.inria.fr/INRIA/Projects/coq/Benjamin.Werner/JSC93.dvi.gz",
+}
+
+@TechReport{PM92,
+  author =       "Christine Paulin-Mohring",
+  title =        "Inductive Definitions in the System {Coq}: Rules and
+                 Properties",
+  type =         "Research report",
+  number =       "RR 92-49",
+  institution =  "Laboratoire de l'Informatique du Parall{\'e}lisme,
+                 Ecole normale sup{\'e}rieure de Lyon",
+  month =        dec,
+  year =         "1992",
+  url =          "ftp://ftp.ens-lyon.fr/pub/LIP/Rapports/RR/RR1992/RR1992-49.ps.Z",
+}
+
+@InCollection{PM93,
+  author =       "Christine Paulin-Mohring",
+  title =        "Inductive Definitions in the System {Coq}: Rules and
+                 Properties",
+  editor =       "M. Bezem and J. F. Groote",
+  booktitle =    "Proc.\ of 1st Int.\ Conf.\ on Typed Lambda Calculi and
+                 Applications, TLCA'93, Utrecht, The Netherlands, 16--18
+                 March 1993",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "664",
+  pages =        "328--345",
+  publisher =    "Springer-Verlag",
+  address =      "Berlin",
+  year =         "1993",
+}
+
+@TechReport{Gim:appcit-r,
+  author =       "Eduardo Gim{\'e}nez",
+  title =        "Co-Inductive Types in {Coq}: An Experiment with the
+                 Alternating Bit Protocol",
+  type =         "Research report",
+  number =       "RR 95-38",
+  institution =  "Laboratoire de l'Informatique du Parall{\'e}lisme,
+                 Ecole Normale Sup{\'e}rieure de Lyon",
+  month =        jun,
+  year =         "1995",
+  url =          "ftp://ftp.ens-lyon.fr/pub/LIP/Rapports/RR/RR95/RR95-38.ps.Z",
+}
+
+@InCollection{Gim:appcit,
+  author =       "Eduardo Gim{\'e}nez",
+  title =        "An Application of Co-Inductive Types in {Coq}: An
+                 Experiment with the Alternating Bit Protocol",
+  editor =       "S. Berardi and M. Coppo",
+  booktitle =    "Selected Papers 3rd Int.\ Workshop on Types for Proofs
+                 and Programs, TYPES'95, Torino, Italy, 5--8 June 1995",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "1158",
+  pages =        "135--152",
+  publisher =    "Springer-Verlag",
+  address =      "Berlin",
+  year =         "1996",
+}
+
+@TechReport{G98,
+  author =       "Eduardo Gim{\'e}nez",
+  title =        "A Tutorial on Recursive Types in {Coq}",
+  type =         "Technical Report",
+  number =       "TR-0221",
+  institution =  "INRIA Rocquencourt",
+  month =        may,
+  year =         "1998",
+  url =          "ftp://ftp.inria.fr/INRIA/publication/RT/RT-0221.ps.gz",
+}
+
+@InCollection{CGJ:coqhw,
+  author =       "Solange Coupet-Grimal and Line Jakubiec",
+  title =        "{Coq} and Hardware Verification: {A} Case Study",
+  editor =       "J. von Wright and J. Grundy and J. Harrison",
+  booktitle =    "Proc.\ of 9th Int.\ Conf.\ on Theorem Proving in
+                 Higher Order Logics, TPHOLs'96, Turku, Finland, 26--30
+                 Aug 1996",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "1125",
+  pages =        "125--139",
+  publisher =    "Springer-Verlag",
+  address =      "Berlin",
+  year =         "1996",
+}
+
+@InCollection{Coq:patmdt,
+  author =       "Thierry Coquand",
+  title =        "Pattern Matching with Dependent Types",
+  editor =       "B. Nordstr{\"o}m and K. Pettersson and G. Plotkin",
+  booktitle =    "Informal Proc.\ of Workshop on Types for Proofs and
+                 Programs, B{\aa}stad, Sweden, 8--12 June 1992",
+  publisher =    "Dept.\ of Computing Science, Chalmers Univ.\ of
+                 Technology and G{\"o}teborg Univ.",
+  pages =        "71--84",
+  year =         "1992",
+  note =         "ftp://ftp.cs.chalmers.se/pub/cs-reports/baastad.92/proc.ps.Z",
+}
+
+@InCollection{Coq:infott,
+  author =       "Thierry Coquand",
+  title =        "Infinite Objects in Type Theory",
+  editor =       "H. Barendregt and T. Nipkow",
+  booktitle =    "Selected Papers 1st Int.\ Workshop on Types for Proofs
+                 and Programs, TYPES'93, Nijmegen, The Netherlands,
+                 24--28 May 1993",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "806",
+  pages =        "62--78",
+  publisher =    "Springer-Verlag",
+  address =      "Berlin",
+  year =         "1994",
+}
+
+@InProceedings{Argon96,
+  author =       "Pablo Arg{\'o}n and John Mullins and Olivier Roux",
+  title =        "A Correct Compiler Construction Using {Coq}",
+  editor =       "Didier Galmiche",
+  pages =        "3--12",
+  booktitle =    "Informal Proc. Workshop on Proof Search
+                 in Type-Theoretic Languages",
+  year =         "1996",
+  address =      "New Brunswick, New Jersey",
+  month =        jul,
+  keywords =     "misc",
+}
+
+@TechReport{ercim.inria.publications//RR-2536,
+  pages =        "33 p.",
+  type =         "Technical Report",
+  number =       "RR-2536",
+  institution =  "Inria, Institut National de Recherche en Informatique
+                 et en Automatique",
+  title =        "Proving Correctness of the Translation from Mini-{ML}
+                 to the {CAM} with the Coq Proof Development System",
+  bibdate =      "April 1, 1995",
+  author =       "Samuel Boutin",
+  language =     "A",
+  abstract =     "Nous d\&eacute;crivons dans ce papier comment, en
+                 utilisant le syst\&egrave;me d\&apos;aide \&agrave; la
+                 d\&eacute;monstration Coq, nous avons
+                 r\&eacute;alis\&eacute; une preuve formelle de la
+                 correction d\&apos;un compilateur d\&apos;un petit
+                 langage applicatif contenant des d\&eacute;finitions
+                 r\&eacute;cursives (Mini-ML) en code CAM (Categorical
+                 Abstract Machine). Notre objectif a \&eacute;t\&eacute;
+                 de m\&eacute;caniser une preuve
+                 pr\&eacute;sent\&eacute;e dans l\&apos;article de J.
+                 Despeyroux \&bsol;cite\&lcub;Des\&rcub; et
+                 \&eacute;crite \&agrave; l\&apos;aide du langage Typol.
+                 Nous utilisons des s\&eacute;mantiques naturelles pour
+                 mod\&eacute;liser l\&apos;\&eacute;valuation de nos
+                 langages. Nous ne sommes parvenus que partiellement
+                 \&agrave; m\&eacute;caniser cette preuve de correction.
+                 En effet, les sp\&eacute;cifications naturelles des
+                 langages source et cible contiennent des termes
+                 rationnels difficiles \&agrave; axiomatiser dans
+                 l\&apos;\&eacute;tat actuel du syst\&egrave;me. Nous
+                 proposons un d\&eacute;coupage de la preuve isolant
+                 cette difficult\&eacute;. In this report we show how we
+                 proved correctness of the translation from a small
+                 applicative language with recursive definitions
+                 (Mini-ML) to the Categorical abstract machine (CAM)
+                 using the Coq system. Our aim was to mechanize the
+                 proof of J. Despeyroux \&bsol;cite\&lcub;Des\&rcub;.
+                 Like her, we use natural semantics to axiomatise the
+                 semantics of our languages. We have only partially
+                 mecanised the proof. The semantics of the source and
+                 target languages use rational trees in their definition
+                 and at this stage the Coq system is inefficient in
+                 axiomatising such structures. We propose a presentation
+                 of the correctness proof to isolate this difficulty.",
+}
+
+@TechReport{ercim.inria.publications//RR-3488,
+  pages =        "30 p.",
+  type =         "Technical Report",
+  number =       "RR-3488",
+  institution =  "Inria, Institut National de Recherche en Informatique
+                 et en Automatique",
+  title =        "A certified Compiler for an Imperative Language",
+  bibdate =      "September 1, 1998",
+  author =       "Yves Bertot",
+  language =     "A",
+  abstract =     "Cet article d\&eacute;crit la v\&eacute;rification
+                 m\&eacute;canique de la d\&eacute;monstration de
+                 certification d\&apos;un compilateur vis-\&agrave;-vis
+                 des sp\&eacute;cifications s\&eacute;mantiques du
+                 langage source et du langage cible. Ces
+                 v\&eacute;rifications sont effectu\&eacute;es dans le
+                 formalisme de la th\&eacute;orie des types, \&agrave;
+                 l\&apos;aide du syst\&egrave;me Coq. Cette
+                 v\&eacute;rification permet d\&apos;introduire des
+                 outils th\&eacute;oriques adapt\&eacute;s:
+                 th\&eacute;or\&egrave;mes de fragmentation et principe
+                 de r\&eacute;currence g\&eacute;n\&eacute;ral. This
+                 paper describes the process of mechanically certifying
+                 a compiler with respect to the semantic specification
+                 of the source and target languages. The proofs are
+                 performed in type theory using the Coq system. These
+                 proofs introduce specific theoretical tools:
+                 fragmentation theorems and general induction
+                 principles.",
+}
+
+@Article{Terrasse:1995:ENS,
+  author =       "D. Terrasse",
+  title =        "Encoding Natural Semantics in Coq",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "936",
+  pages =        "230--??",
+  year =         "1995",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Sat May 11 13:45:32 MDT 1996",
+  acknowledgement = ack-nhfb,
+}
+
+@InProceedings{AFADL2000-Bodeveix,
+  author =       "J.-P. Bodeveix and Mamoun Filali and C. A. Munoz",
+  title =        "Formalisation de la m{\'e}thode {B} en {COQ} et {PVS}",
+  booktitle =    "AFADL'2000",
+  booktitle =    "Approches Formelles dans l'Assistance au
+                 {D}{\'e}veloppement de Logiciels",
+  year =         "2000",
+  address =      "LSR/IMAG -- BP 72 38402 Saint-Martin d'Heres Cedex --
+                 Grenoble -- France",
+  month =        jan,
+  organization = "LSR/IMAG",
+  publisher =    "LSR/IMAG",
+  local =        "yes",
+  url =          "http://www-lsr.imag.fr/afadl/Programme/ProgrammeAFADL2000.html",
+  pages =        "96--110",
+  year =         "2000",
+}
+
+@InProceedings{Cayenne,
+  key =          "Augustsson",
+  author =       "Lennart Augustsson",
+  title =        "Cayenne --- a language with dependent types",
+  booktitle =    "Proc. ACM SIGPLAN International
+                 Conf. on Functional Programming (ICFP '98)",
+  series =       "ACM SIGPLAN Notices",
+  volume =       "34(1)",
+  month =        jun,
+  year =         "1999",
+  organization = "ACM",
+  pages =        "239--250",
+  annote =       "A Haskell variant with dependent types. 27
+                 references.",
+}
+
+
+
+@Article{JAR::AndrewsBINPX1996,
+  title =        "{TPS}: {A} Theorem-Proving System for Classical Type
+                 Theory",
+  author =       "Peter B. Andrews and Matthew Bishop and Sunil Issar
+                 and Dan Nesmith and Frank Pfenning and Hongwei Xi",
+  journal =      "Journal of Automated Reasoning",
+  pages =        "321--353",
+  month =        jun,
+  year =         "1996",
+  volume =       "16",
+  number =       "3",
+}
+
+@InProceedings{XP98,
+  title =        "Eliminating Array Bound Checking through Dependent
+                 Types",
+  author =       "Hongwei Xi and Frank Pfenning",
+  booktitle =    "Proc. {ACM} {SIGPLAN}'98 Conf. on
+                 Programming Language Design and Implementation
+                 ({PLDI})",
+  address =      "Montreal, Canada",
+  month =        "17--19~" # jun,
+  year =         "1998",
+  pages =        "249--257",
+  references =   "\cite{PLDI::FreemanP1991} \cite{LOPLAS::Gupta1994}
+                 \cite{POPL::Necula1997} \cite{PLDI::NeculaL1998}
+                 \cite{PLDI::Pugh1992} \cite{JACM::Shostak1977}
+                 \cite{POPL::SusukiI1977}",
+}
+
+@InProceedings{FLINT,
+  title =        "A Type-Based Compiler for Standard {ML}",
+  author =       "Zhong Shao and Andrew W. Appel",
+  booktitle =    "Proc. {ACM} {SIGPLAN}'95 Conf. on
+                 Programming Language Design and Implementation
+                 ({PLDI})",
+  address =      "La Jolla, California",
+  month =        "18--21~" # jun,
+  year =         "1995",
+  pages =        "116--129",
+}
+
+@InProceedings{THW01, author = {Taha, Walid and Hudak, Paul and Wan,
+  Zhanyong}, title = "Directions in Functional Programming for
+  Real(-Time) Applications", booktitle = "the International Workshop
+  on Embedded Software {(EMSOFT '01)}", year = 2001, series = LNCS,
+  volume = 221, pages = "185--203", address = "Lake Tahoe", publisher =
+  "Springer-Verlag", }
+
+@InProceedings{Crary2000,
+  author =       "Karl Crary and Stephanie Weirich",
+  title =        "Resource Bound Certification.",
+  pages =        "184--198",
+  booktitle =    "the Symposium on Principles of Programming Languages
+                 ({POPL} '00)",
+  month =        jan # " ~19--21",
+  publisher =    "ACM Press",
+  address =      "N.Y.",
+  year =         "2000",
+}
+
+@InProceedings{inherit,
+  author =       "Torben Mogensen",
+  title =        "Inherited Limits",
+  booktitle =    "Partial Evaluation: Practice and Theory",
+  pages =        "189--202",
+  year =         1999,
+  volume =       1706,
+  series =       LNCS,
+  publisher =    "Springer-Verlag",
+}
+
+@Article{Shao:2002:TSC,
+  author =       "Zhong Shao and Bratin Saha and Valery Trifonov and
+                 Nikolaos Papaspyrou",
+  title =        "A type system for certified binaries",
+  journal =      "ACM SIG{\-}PLAN Notices",
+  volume =       "31",
+  number =       "1",
+  pages =        "217--232",
+  month =        jan,
+  year =         "2002",
+  coden =        "SINODQ",
+  ISSN =         "0362-1340",
+  bibdate =      "Tue Feb 12 10:39:33 MST 2002",
+  acknowledgement = ack-nhfb,
+  annote =       "Proc. 29th ACM SIGPLAN-SIGACT symposium
+                 on Principles of Programming Languages (POPL'02).",
+}
+
+@InProceedings{crary98intensional,
+  author =       "Karl Crary and Stephanie Weirich and J. Gregory
+                 Morrisett",
+  title =        "Intensional Polymorphism in Type-Erasure Semantics",
+  booktitle =    "{I}nternational {C}onference on {F}unctional
+                 {P}rogramming ({ICFP}) , Baltimore, Maryland, USA",
+  pages =        "301--312",
+  year =         "1998",
+  fullurl =      "citeseer.nj.nec.com/article/crary98intensional.html",
+}
+
+
+@InProceedings{Makholm,
+  author =       "Henning Makholm",
+  title =        "On {J}ones-Optimal Specialization
+                  for Strongly Typed Languages",
+  booktitle =    "\cite{saig00}",
+  pages =        "129--148",
+  year = 2000,
+}
+
+
+
+@Misc{MetaDOnline, key = "{Meta-D} Prototype", OPTauthor = {}, title =
+  "{M}eta-{D}: A Dependently Typed Multi-stage Language", howpublished = "Available online from
+  \fr{http://www.cse.ogi.edu/~pasalic/metad/}", year = 2002,
+  OPTnote = "", OPTannote = {} }
+
+@Unpublished{TM00,
+  author =       "Walid Taha and Henning Makholm",
+  title =        "Tag Elimination -- or --
+                  Type Specialisation is a Type-Indexed Effect",
+  note =         "In Subtyping and Dependent Types in Programming,
+                  APPSEM Workshop.  INRIA technical report",
+  OPTkey =       {},
+  year =         2000,
+  OPTannote =    {}
+}
+
+
+@InProceedings{ICFP99*233,
+  author =       "Karl Crary and Stephanie Weirich",
+  title =        "Flexible Type Analysis",
+  pages =        "233--248",
+  ISBN =         "1-58113-111-9",
+  booktitle =    "Proc. Fourth {ACM} {SIGPLAN}
+                 International Conf. on Functional Programming
+                 ({ICFP}-99)",
+  month =        sep # " ~27--29",
+  series =       "ACM Sigplan Notices",
+  volume =       "34.9",
+  publisher =    "ACM Press",
+  address =      "N.Y.",
+  year =         "1999"
+}
+
+@InProceedings{Cardelli:Linking,
+  title =        "Program Fragments, Linking, and Modularization",
+  author =       "Luca Cardelli",
+  pages =        "266--277",
+  booktitle =    "Conf. Record of {POPL}~'97: The 24th {ACM}
+                 {SIGPLAN}-{SIGACT} Symposium on Principles of
+                 Programming Languages",
+  month =        "15--17 " # jan,
+  year =         "1997",
+  address =      "Paris, France",
+  references =   "\cite{POPL::AbadiCCL1990} \cite{TOPLAS::ChambersL1995}
+                 \cite{POPL::HarperL1994} \cite{POPL::Leroy1994}
+                 \cite{POPL::MacQueen1986} \cite{POPL::ShaoA1993}",
+}
+
+@InCollection{TFF,
+  author =       "Philip Wadler",
+  title =        "Theorems for Free!",
+  booktitle =    "Proc.\ of 4th Int.\ Conf.\ on Funct.\ Prog.\ Languages
+                 and Computer Arch., FPCA'89, London, UK, 11--13 Sept.\
+                 1989",
+  pages =        "347--359",
+  publisher =    "ACM Press",
+  address =      "New York",
+  year =         "1989",
+  url =          "http://cm.bell-labs.com/cm/cs/who/wadler/papers/free/free.ps.gz",
+}
+
+@InProceedings{Abadi93,
+  author =       "Mart{\'\i}n  Abadi and Luca Cardelli and Pierre-Louis
+                  Curien",
+  title =        "Formal Parametric Polymorphism",
+  booktitle =    "Conf. Record of the Twentieth Annual ACM
+                 SIGPLAN-SIGACT Symposium on Principles of Programming
+                 Languages",
+  pages =        "157--170",
+  publisher =    "ACM New York, NY",
+  year =         "1993",
+  keywords =     "functional",
+  ISBN =         "0-89791-560-7",
+  abstract =     "A polymorphic function is parametric if its behavior
+                 does not depend on the type at which it is
+                 instantiated. Starting with J.C. Reynolds' (1983) work,
+                 the study of parametricity is typically semantic. The
+                 authors develop a syntactic approach to parametricity,
+                 and a formal system that embodies this approach: system
+                 R. Girard's system F (J.Y. Girard et al., 1989) deals
+                 with terms and types; R is an extension of F that deals
+                 also with relations between types. In R, it is possible
+                 to derive theorems about functions from their types, or
+                 'theorems for free', as P. Wadler (1989) calls them. An
+                 easy 'theorem for free' asserts that the type For all
+                 (X)X to Bool contains only constant functions; this is
+                 not provable in F. There are many harder and more
+                 substantial examples. Various metatheorems can also be
+                 obtained.",
+}
+
+@Article{DaviesPfenning01jacm,
+  author =       "Rowan Davies and Frank Pfenning",
+  title =         "A Modal Analysis of Staged Computation",
+  journal =        "Journal of the ACM",
+  year =   2001,
+  volume =       48,
+  number =       3,
+  pages =        "555--604",
+  annote =        "Preliminary version available as Technical
+           Report CMU-CS-99-153, August 1999",
+  keywords =     "fp, staged",
+  url =
+  "http://www.cs.cmu.edu/~fp/papers/CMU-CS-99-153.ps.gz"
+}
+
+@Article{MoggiSabry,
+  author = 	 "Eugenio Moggi and Amr Sabry",
+  title = 	 "Monadic Encapsulation of Effects",
+  journal = 	 "Journal of Functional Programming",
+  year = 	 {2001},
+  OPTkey = 	 {},
+  OPTvolume = 	 {},
+  OPTnumber = 	 {},
+  OPTpages = 	 {},
+  OPTmonth = 	 {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@Article{DrScheme,
+  author =       "Robert Bruce Findler and Cormac Flanagan and Matthew
+                 Flatt and Shriram Krishnamurthi and Matthias
+                 Felleisen",
+  title =        "{D}r{S}cheme: {A} Pedagogic Programming Environment
+                 for Scheme",
+  year =         "1997",
+  url =          "http://www.cs.rice.edu/CS/PLT/Publications/plilp97-fffkf.ps.gz",
+  keywords =     "Programming Environments, Scheme, Programming,
+                 Pedagogy, Algebraic Evaluation, Static Debugging,
+                 Teaching Programming to Introductory Students",
+  month =        sep,
+  pages =        "369--388",
+  volume =       "1292",
+  scope =        "Programming Environments",
+  journal =      "Programming Languages: Implementations, Logics, and
+                 Program s",
+}
+
+@Article{Garrigue99,
+  author =       "Garrigue and Remy",
+  title =        "Semi-Explicit First-Class Polymorphism for {ML}",
+  journal =      "INFCTRL: Information and Computation (formerly
+                 Information and Control)",
+  volume =       "155",
+  year =         "1999",
+}
+
+@InCollection{Wells,
+  author =       "J. B. Wells",
+  title =        "Typability and Type Checking in the Second-Order
+                 {$\lambda$}-Calculus Are Equivalent and Undecidable",
+  booktitle =    "Proc.\ of 9th Ann.\ IEEE Symp.\ on Logic in Computer
+                 Science, LICS'94, Paris, France, 4--7 July 1994",
+  pages =        "176--185",
+  publisher =    "IEEE Computer Society Press",
+  address =      "Los Alamitos, CA",
+  year =         "1994",
+}
+
+@InProceedings{OPT02,
+  author =       "Karol Ostrovsk\'y and K.~V.~S.~Prasad and Walid Taha",
+  title =        {Towards a Primitive Higher Order Calculus of Broadcasting Systems},
+  booktitle =    {The International Conf. on 
+                 Principles and Practice of 
+                 Declarative Programming ({PPDP} '02)},
+  year =         {2002},
+  address =      {Pittsburgh, USA},
+  month =        {October},
+  organization = {ACM},
+}
+
+@InProceedings{TemplateHaskell,
+  author =       "Tim Sheard and Simon Peyton-Jones",
+  title =        "Template meta-programming for Haskell.",
+  booktitle =    "Proc. of the workshop on Haskell",
+  pages =        "1--16",
+  publisher =    "ACM",
+  year =         "2002",
+  keywords =     "workshop, functional programming, FP, zz1002",
+  abstract =     "...extension to the purely functional programming
+                 language Haskell that supports compile-time
+                 meta-programming. The purpose of the system is to
+                 support the algorithmic construction of programs at
+                 compile-time. The ability to generate code at compile
+                 time allows the programmer to implement such features
+                 as polytypic programs, macro-like expansion, user
+                 directed optimization (such as inlining), and the
+                 generation of supporting data structures and functions
+                 from existing data structures and functions. Our design
+                 is being implemented in the Glasgow Haskell Compiler,
+                 ghc. [http://doi.acm.org/10.1145/581690.581691
+                 (paper)][10/'02]
+                 http://www.amazon.com/exec/obidos/ISBN=1581136056/fourwheeldriveinA/
+                 .",
+}
+
+@InProceedings{Michaylov,
+  author =       "Spiro Michaylov and Frank Pfenning",
+  title =        "Natural Semantics and Some of its Meta-Theory in
+                 {Elf}",
+  booktitle =    "Extensions of Logic Programming",
+  editor =       "Lars Halln{\"a}s",
+  publisher =    "Springer-Verlag LNCS",
+  year =         "1992",
+  note =         "To appear. A preliminary version is available as
+                 Technical Report MPI-I-91-211, Max-Planck-Institute for
+                 Computer Science, Saarbr{\"u}cken, Germany, August
+                 1991",
+}
+
+@InProceedings{Filinski99,
+  author =       "Andrzej Filinski",
+  title =        "A Semantic Account of Type-Directed Partial Evaluation",
+  year         = 1999,
+  volume       = 1702,
+  series       = LNCS,
+  publisher =    "Springer-Verlag",
+  booktitle    = {Principles and Practice of Declarative Programming
+                  {(PPDP)}},
+  pages        = "378--395",
+}
+
+@InProceedings{Filinski01,
+  author =       "Andrzej Filinski",
+  title =        "Normalization by Evaluation for the Computational Lambda-Calculus",
+  year         = 2001,
+  volume       = 2044,
+  series       = LNCS,
+  publisher =    "Springer-Verlag",
+  booktitle    = {Typed Lambda Calculi and Applications: 5th International Confe
+rence
+                  {(TLCA)}},
+  pages        = "151--165",
+}
+@InProceedings{MML,
+  author = 	 {Eugenio Moggi},
+  title = 	 {A Monadic Multi-stage Metalanguage},
+  booktitle = 	 {Foundations of Software Science and Computation Structures (FOSSACS)},
+  OPTcrossref =  {},
+  OPTkey = 	 {},
+  OPTpages = 	 {},
+  year = 	 {2003},
+  OPTeditor = 	 {},
+  volume = 	 {2620},
+  OPTnumber = 	 {LNCS},
+  series = 	 {},
+  OPTaddress = 	 {},
+  OPTmonth = 	 {},
+  OPTorganization = {},
+  OPTpublisher = {},
+  OPTnote = 	 {},
+  OPTannote = 	 {}
+}
+
+@InProceedings{LJB01,
+  AUTHOR       = {Lee, Chin Soon and Jones, Neil D. and Ben-Amram, Amir M.},
+  YEAR         = {2001},
+  TITLE        = {The Size-Change Principle for Program Termination},
+  BOOKTITLE    = POPL,
+  editor       = {},
+  publisher    = {ACM press},
+  organization = {},
+  address      = {},
+  series       = {},
+  volume       = {28},
+  pages        = {81--92},
+  month        = {january},
+  keywords     = {termination, program analysis, lexical order, pspace
+hardness},
+  summary = {The ``size-change termination''  principle for a first-order
+functional language with well-founded data is: a program terminates on all
+inputs if {\em every infinite call sequence} (following program control flow)
+would cause an  infinite descent in some data values.
+Size-change analysis is based only on local
+approximations to parameter size changes derivable from program syntax.
+The set of infinite call sequences that follow program flow and can be
+recognized as causing infinite descent is an
+$\omega$-regular set, representable by a B\"uchi automaton.
+Algorithms for such automata can be used to decide size-change termination.
+We also give a direct algorithm operating on ``size-change graphs''
+(without the
+passage to automata).
+Compared to other results in the literature, termination analysis
+based on the size-change principle is surprisingly simple and general:
+lexical orders (also called lexicographic orders), indirect function
+calls and permuted arguments (descent that is not {\em in-situ}) are
+all handled {\em automatically and without special treatment}, with no
+need for manually supplied argument orders, or theorem-proving methods
+not certain to terminate at analysis time.
+We establish the  problem's
+{\em intrinsic complexity}. This turns out to be surprisingly high,
+complete for {\sc pspace}, in spite of the simplicity of the principle.
+{\sc pspace} hardness is proved by a reduction from Boolean program
+termination. An interesting consequence: the same hardness result applies
+to many other analyses found in the termination and quasi-termination
+literature.},
+  SEMNO        = {D-429},
+  PUF          = {Artikel i proceedings (med censur)},
+  ID           = {KonR},
+  POSTSCRIPT   = {http://www.diku.dk/~neil/term.ps}
+ }
+
+@InProceedings{CBUE02,
+  author =       "Krzysztof Czarnecki and Thomas Bednasch and Peter
+                 Unger and Ulrich Eisenecker",
+  year =         "2002",
+  title =        "Generative Programming for Embedded Software: An
+                 Industrial Experience Report",
+  booktitle =    "Generative Programming and Component Engineer
+                 SIGPLAN/SIGSOFT Conf., GPCE 2002",
+  editor =       "Don Batory and Charles Consel and Walid Taha",
+  publisher =    "Springer",
+  organization = "ACM",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "2487",
+  pages =        "156--172",
+  month =        oct,
+}
+
+@InProceedings{L02,
+  author =       "Chin Soon Lee",
+  year =         "2002",
+  title =        "Program termination analysis in polynomial time",
+  booktitle =    "Generative Programming and Component Engineering: ACM
+                 SIGPLAN/SIGSOFT Conf., GPCE 2002",
+  editor =       "Don Batory and Charles Consel and Walid Taha",
+  publisher =    "Springer",
+  organization = "ACM",
+  series =       "Lecture Notes in Computer Science",
+  volume =       "2487",
+  pages =        "218--235",
+  month =        oct,
+  keywords =     "program termination analysis, size-change
+                 termination",
+  summary =      "Recall the {"}size-change principle{"} for program
+                 termination: An infinite computation is impossible, if
+                 it would give rise to an infinite sequence of size
+                 decreases for some data values. For an actual analysis,
+                 {"}size-change graphs{"} are used to capture data size
+                 changes in possible program state transitions. A graph
+                 sequence that respects program control flow is called a
+                 {"}multipath.{"} Multipaths describe possible state
+                 transition sequences. To show that such sequences are
+                 finite, it is sufficient that the graphs satisfy
+                 {"}size-change termination{"} (SCT): Every infinite
+                 multipath has infinite descent, according to the arcs
+                 of the graphs. This is an application of the
+                 size-change principle. SCT is decidable, but complete
+                 for PSPACE. In this paper, we explore efficient
+                 approximations that are sufficiently precise in
+                 practice. For size-change graphs that can loop (i.e.,
+                 they give rise to an infinite multipath), and that
+                 satisfy SCT, it is usually easy to identify among them
+                 an {"}anchor{"}-- some graph whose infinite occurrence
+                 in a multipath causes infinite descent. The SCT
+                 approximations are based on finding and eliminating
+                 anchors as far as possible. If the remaining graphs
+                 cannot loop, then SCT is established. An efficient
+                 method is proposed to find anchors among {"}fan-in
+                 free{"} graphs, as such graphs occur commonly in
+                 practice. This leads to a worst-case quadratic-time
+                 approximation of SCT. An extension of the method
+                 handles general graphs and can detect some rather
+                 subtle descent. It leads to a worst-case cubic-time
+                 approximation of SCT. Experiments confirm the
+                 effectiveness and efficiency of the approximations in
+                 practice.",
+  semno =        "D-472",
+  puf =          "Artikel i proceedings (med censur)",
+  id =           "KonR",
+}
+@InProceedings{satnam,
+  author =       "Nicholas McKay and Satnam Singh",
+  title =        "Dynamic Specialization of {XC6200} {FPGA}s by Partial
+                 Evaluation",
+  editor =       "Reiner W. Hartenstein and Andres Keevallik",
+  series =       LNCS,
+  volume =       1482,
+  publisher =    "Springer-Verlag",
+  booktitle =    "International Workshop on
+                 Field-Programmable Logic and Applications",
+  year =         "1998",
+  pages =        "298--307",
+}
+
+@Article{transmeta,
+  author =       "Linda Geppert and Tekla S. Perry",
+  journal =      "IEEE Spectrum",
+  number =       "5",
+  pages =        "26--33",
+  title =        "Transmeta's magic show",
+  volume =       "37",
+  year =         "1999",
+  crindex =      "Fichier",
+  url =          "http://www.spectrum.ieee.org/spectrum/may00/features/tran.html",
+}
+
+@InProceedings{DML,
+  author =       "Hongwei Xi and Frank Pfenning",
+  title =        "Dependent types in practical programming",
+  editor =       "{ACM}",
+  booktitle =    "{POPL} '99. Proc. 26th {ACM}
+                 {SIGPLAN-SIGACT} on Principles of programming
+                 languages, January 20--22, 1999, San Antonio, {TX}",
+  publisher =    "ACM Press",
+  address =      "New York, NY, USA",
+  year =         "1999",
+  ISBN =         "????",
+  series =       "ACM SIG{\-}PLAN Notices",
+  pages =        "214--227",
+  year =         "1999",
+  bibdate =      "Mon May 3 12:58:58 MDT 1999",
+  url =          "http://www.acm.org:80/pubs/citations/proceedings/plan/292540/p214-xi/",
+  acknowledgement = ack-nhfb,
+  subject =      "{\bf F.4.1} Theory of Computation, MATHEMATICAL LOGIC
+                 AND FORMAL LANGUAGES, Mathematical Logic. {\bf D.3.2}
+                 Software, PROGRAMMING LANGUAGES, Language
+                 Classifications, ML. {\bf D.1.1} Software, PROGRAMMING
+                 TECHNIQUES, Applicative (Functional) Programming. {\bf
+                 D.3.3} Software, PROGRAMMING LANGUAGES, Language
+                 Constructs and Features, Polymorphism.",
+}
+@Article{lava,
+  author =       "Per Bjesse and Koen Claessen and Mary Sheeran and
+                 Satnam Singh",
+  title =        "{Lava}: Hardware Design in {Haskell}",
+  journal =      "ACM SIG{\-}PLAN Notices",
+  volume =       "34",
+  number =       "1",
+  pages =        "174--184",
+  month =        jan,
+  year =         "1999",
+  coden =        "SINODQ",
+  ISSN =         "0362-1340",
+  bibdate =      "Wed Dec 30 14:35:17 1998",
+  acknowledgement = ack-nhfb,
+  affiliation =  "Chalmers University; Xilinx",
+}
+
+@InProceedings{aliastypes,
+  author =       "Frederick Smith and David Walker and Greg Morrisett",
+  title =        "Alias Types",
+  editor =       "Gert Smolka",
+  booktitle =    "Ninth European Symposium on Programming",
+  publisher =    "Springer-Verlag",
+  series =       "Lecture Notes in Computer Science",
+  month =        apr,
+  volume =       "1782",
+  year =         "2000",
+  pages =        "366--381",
+}
+
+@Article{Hume,
+  author =       "Kevin Hammond",
+  title =        "The Dynamic Properties of {Hume}: {A}
+                 Functionally-Based Concurrent Language with Bounded
+                 Time and Space Behaviour",
+  journal =      "Lecture Notes in Computer Science",
+  volume =       "2011",
+  pages =        "122--??",
+  year =         "2001",
+  coden =        "LNCSD9",
+  ISSN =         "0302-9743",
+  bibdate =      "Sat Feb 2 13:03:29 MST 2002",
+  url =          "http://link.springer-ny.com/link/service/series/0558/bibs/2011/20110122.htm;
+                 http://link.springer-ny.com/link/service/series/0558/papers/2011/20110122.pdf",
+  acknowledgement = ack-nhfb,
+}
+
+@InProceedings{TN03,
+  author =       "Walid Taha and Michael Florentin Nielsen",
+  title =        "Environment Classifiers",
+  booktitle =    "In Proc. ACM Symposium on Principles of
+                  Programming Languages {(POPL '03)}",
+  year =         2003,
+  address =      "New Orleans"
+}
+
+
diff --git a/papers/ivor/code.tex b/papers/ivor/code.tex
new file mode 100644
--- /dev/null
+++ b/papers/ivor/code.tex
@@ -0,0 +1,31 @@
+\section{Haskell Code}
+
+This appendix contains some of the more important definitions from the
+logic theorem prover and functional language implementation. The
+complete code for both examples is available from
+\url{http://www.dcs.st-and.ac.uk/~eb/Ivor}; the code presented here
+illustrates the building of complex tactics with \Ivor{}.
+
+\subsection{Propositional Logic}
+
+Two domain specific tactics are needed; firstly 
+Secondly, we need a tactic to prove a contradiction as discussed in
+section \ref{example1}:
+
+\begin{verbatim}
+> contradiction :: String -> String -> Tactic
+> contradiction x y = claim (name "false") "False" >+>
+>                     induction "false" >+>
+>                     (try (fill $ x ++ " " ++ y)
+>                           idTac
+>                           (fill $ y ++ " " ++ x))
+\end{verbatim}
+
+\subsection{\Funl{}}
+
+\label{funlapp}
+
+When building a function definition, we prove a \hdecl{theorem} of the
+appropriate type. Then the \hdecl{buildTerm} tactic traverses the
+structure of the raw term, constructing a proof of the
+theorem. 
diff --git a/papers/ivor/conclusions.tex b/papers/ivor/conclusions.tex
new file mode 100644
--- /dev/null
+++ b/papers/ivor/conclusions.tex
@@ -0,0 +1,122 @@
+\section{Related Work}
+
+The ability to extend a theorem prover with user defined tactics has
+its roots in Robin Milner's LCF~\cite{lcf-milner}. This introduced the
+programming language ML to allow users to write tactics; we follow the
+LCF approach in exposing the tactic engine as an API. 
+%However, unlike
+%other systems, we have not treated the theorem prover as an end in
+%itself, but intend to expose the technology to any Haskell application
+%which may need it.  
+The implementation of \Ivor{} is based on the
+presentation of \Oleg{} in Conor McBride's
+thesis~\cite{mcbride-thesis}. We use implementation
+techniques from \cite{not-a-number} for dealing with variables and
+renaming.
+
+The core language of \Epigram{}~\cite{view-left,epireloaded} is
+similar to $\source$, with extensions for observational
+equality. \Epigram{} is a dependently typed functional programming
+language, where types can be predicated on arbitrary values so that
+types can be read as precise specifications.
+Another recent language which shares the aim of begin theorem proving
+technology closer to programers is Sheard's
+$\Omega$mega~\cite{sheard-langfuture}. While \Ivor{} emphasises
+interactive theorem proving, $\Omega$mega emphasises programming but
+nevertheless allows more precise types to be given to programs through
+Generalised Algebraic Data Types~\cite{gadts} and extensible
+kinds. 
+
+Other theorem provers such as \Coq{}~\cite{coq-manual},
+\Agda{}~\cite{agda} and Isabelle~\cite{isabelle} have varying degrees
+of extensibility. 
+%The interface design largely follows that of
+%\Coq{}. 
+\Coq{} includes a high level domain specific language for
+combining tactics and creating new tactics, along the lines of the
+tactic combinators presented in section \ref{combinators}. This
+language is ideal for many purposes, such as our \hdecl{contradiction}
+tactic, but more complex examples such as \hdecl{buildTerm} would
+require extending \Coq{} itself. Using a
+DSEL~\cite{hudak-edsl} as provided by \Ivor{} gives complete
+flexibility in the construction of tactics, and allows a close
+relationship between the tactics and the structures on which they
+operate (e.g. \hdecl{Raw}). 
+%In future, it may
+%be worth exploring automatic translation between \Ivor{} and other
+%theorem provers.
+
+Isabelle~\cite{isabelle} is a
+generic theorem prover, in that it includes a large body of object
+logics and a meta-language for defining new logics. It includes a
+typed, extensible tactic language, and can be called from ML programs,
+but unlike \Ivor{} is not based on a dependent type theory.
+There is therefore no \remph{proof term} associated with an Isabelle
+proof --- the proof term gives a derivation tree for the
+proof, allowing easy and independent rechecking without referring to
+the tactics used to build the proof. 
+
+The implementation of \Funl{} allows a theorem prover to be attached
+to the language in a straightforward way, using \Ivor{}'s tactics
+directly. This would be a possible method of attaching a theorem
+prover to a more full featured programming language such as the
+Sparkle~\cite{sparkle} prover for Clean~\cite{clean}. Implementing a
+full language in this way would require some extra work to deal
+with general recursion and partial definitions (in particular, dealing
+with $\perp$ as a possible value), but the general method remains the same.
+
+\section{Conclusions and Further Work}
+
+We have seen an overview of the \Ivor{} library, including the term
+and tactic language. By exposing the tactic API and
+providing an interface for term construction and evaluation, we are
+able to embed theorem proving technology in a Haskell
+application. This in itself is not a new idea, having first been seen
+as far back as the LCF~\cite{lcf-milner} prover --- however, the
+theorem proving technology is not an end in itself, but a
+mechanism for constructing domain specific tools such as the
+propositional logic theorem prover in section \ref{example1} and the
+programming language with built in equational reasoning support in
+section \ref{example2}.
+
+The library includes several features we have not been able to discuss
+here, e.g. dependently typed pattern matching~\cite{coquand-pm}, which
+gives a better notation for \remph{programming} as well as proof.
+There is experimental support for multi-stage programming with
+dependent types, exploited in~\cite{dtpmsp-gpce}.  The term language
+can be extended with primitive types and operations, e.g. integers and
+strings with associated arithmetic and string manipulation
+operators. Such features would be essential in a representation of a
+real programming language. In this paper, we have stated that
+$\source$ is strongly normalising, with no general recursion allowed,
+but again in the representation of a real programming language general
+recursion may be desirable --- however, this means that correctness
+proofs can no longer be total. The library can optionally allow
+general recursive definitions, but such definitions cannot be reduced
+by the typechecker. Finally, a command driven interface is available,
+which can be accessed as a Haskell API or used from a command line
+driver program, and allows user directed proof scripts in the style of
+other proof assistants. These and other features are fully documented
+on the web
+site\footnote{\url{http://www.cs.st-andrews.ac.uk/~eb/Ivor/}}.
+
+%% \subsection{Further Work}
+
+Development of the library has been driven by the requirements of
+our research into Hume~\cite{Hume-GPCE}, a resource aware functional
+language. We are investigating the use of dependent types in
+representing and verifying resource bounded functional
+programs~\cite{dt-framework}. 
+For this, automatic generation of
+injectivity and disjointness lemmas for constructors will be
+essential~\cite{concon}.
+Future versions will include
+optimisations from \cite{brady-thesis} and some support for compiling
+$\source$ terms; this would not only improve the efficiency of the
+library (and in particular its use for evaluating certified code)
+but also facilitate the use of \Ivor{} in a real language
+implementation. Finally, an implementation of coinductive
+types~\cite{coinductive} is likely to be very useful; currently it can
+be achieved by implementing recursive functions which do not reduce at
+the type level, but a complete implementation with criteria for
+checking productivity would be valuable for modelling streams in Hume.
diff --git a/papers/ivor/corett.tex b/papers/ivor/corett.tex
new file mode 100644
--- /dev/null
+++ b/papers/ivor/corett.tex
@@ -0,0 +1,330 @@
+\section{The Type Theory, $\source$}
+
+\renewcommand{\Vnil}{\DC{vnil}}
+\renewcommand{\Vcons}{\DC{vcons}}
+
+\subsection{The Core Calculus}
+
+\label{corett}
+
+The core type theory of \Ivor{} is a strongly normalising dependently
+typed $\lambda$-calculus with inductive families~\cite{dybjer94},
+similar to Luo's UTT~\cite{luo94}, the Calculus of Inductive
+Constructions in \Coq{}~\cite{coq-manual}, or \Epigram{}'s
+ETT~\cite{epireloaded}.  This language, which I call
+$\source$~\cite{brady-thesis}, is an enriched lambda calculus, with
+the usual reduction rules, and properties of subject reduction, Church
+Rosser, and uniqueness of types up to conversion. 
+More details on programming in $\source$ are given
+in~\cite{brady-thesis,dt-framework}.
+The strong
+normalisation property (i.e. that evaluation always terminates) is
+guaranteed by allowing only primitive recursion over strictly positive
+inductive datatypes. The syntax of terms ($\vt$) and binders ($\vb$)
+in this language is:
+
+\DM{
+\begin{array}{rll@{\hg}|rll}
+\vt ::= & \Type_i & (\mbox{type universes}) &
+\hg\vb ::= & \lam{\vx}{\vt} & (\mbox{abstraction}) \\
+
+ \mid  & \vx & (\mbox{variable}) &
+ \mid & \LET\:\vx\defq\vt\Hab\vt & (\mbox{let binding}) \\
+
+ \mid   & \vb\SC\:\vt & (\mbox{binding}) &
+ \mid & \all{\vx}{\vt} & (\mbox{function space}) \\
+
+ \mid   & \vt\:\vt & (\mbox{application})
+
+\end{array}
+}
+
+We may also write the function space
+\mbox{$\all{\vx}{\vS}\SC\vT$} as \mbox{$\fbind{\vx}{\vS}{\vT}$}, or
+abbreviate it to \mbox{$\vS\to\vT$} if $\vx$ is not free in
+$\vT$. This is both for readability and a notation more consistent
+with traditional functional programming languages.
+Universe levels on types (e.g. $\Type_0$ for values, $\Type_1$ for
+types, etc.) may be inferred as in~\cite{implicit-pollack}.
+Contexts ($\Gamma$) are collections of binders.
+
+%% defined inductively; the empty context
+%% is valid, as is a context extended with a $\lambda$, $\forall$ or
+%% $\LET$ binding:
+
+%% \DM{
+%% \Axiom{\proves\RW{valid}}
+%% \hg
+%% \Rule{\Gamma\proves\RW{valid}}
+%% {\Gamma;\vb\proves\RW{valid}}
+%% }
+
+The typing rules, given below, depend on a conversion
+relation \mbox{$\Gamma\proves\vx\conv\vy$}, which holds if and only if
+$\vx$ and $\vy$ have a common reduct. This requires the typechecker to
+normalise terms, to find the common reduct, so it is
+important for decidability of typechecking that the language is
+strongly normalising.
+
+\DM{\begin{array}{c}
+\Rule{\Gamma\proves\RW{valid}}
+{\Gamma\vdash\Type_n\Hab\Type_{n+1}}\hspace*{0.1in}\mathsf{Type}
+\\
+\Rule{(\lam{\vx}{\vS})\in\Gamma}
+{\Gamma\vdash\vx\Hab\vS}\hspace*{0.1in}\mathsf{Var}_1
+\hg
+\Rule{(\all{\vx}{\vS})\in\Gamma}
+{\Gamma\vdash\vx\Hab\vS}\hspace*{0.1in}\mathsf{Var}_2
+\hg
+\Rule{(\LET\:\vx\Hab\vS\defq\vs)\in\Gamma}
+{\Gamma\vdash\vx\Hab\vS}\hspace*{0.1in}\mathsf{Val}
+\\
+\Rule{\Gamma\vdash\vf\Hab\fbind{\vx}{\vS}{\vT}\hg\Gamma\vdash\vs\Hab\vS}
+{\Gamma\vdash\vf\:\vs\Hab\vT[\vs/\vx]} % \LET\:\vx\Hab\vS\:\defq\:\vs\:\IN\:\vT}
+\hspace*{0.1in}\mathsf{App}
+\\
+
+\Rule{\Gamma;\lam{\vx}{\vS}\vdash\ve\Hab\vT\hg\Gamma\proves\fbind{\vx}{\vS}{\vT}\Hab\Type_n}
+{\Gamma\vdash\lam{\vx}{\vS}.\ve\Hab\fbind{\vx}{\vS}{\vT}}\hspace*{0.1in}\mathsf{Lam}
+\\
+\Rule{\Gamma;\all{\vx}{\vS}\vdash\vT\Hab\Type_n\hg\Gamma\vdash\vS\Hab\Type_n}
+{\Gamma\vdash\fbind{\vx}{\vS}{\vT}\Hab\Type_n}\hspace*{0.1in}\mathsf{Forall}
+\\
+
+\Rule{\begin{array}{c}\Gamma\proves\ve_1\Hab\vS\hg
+      \Gamma;\LET\:\vx\defq\ve_1\Hab\vS\proves\ve_2\Hab\vT\\
+      \Gamma\proves\vS\Hab\Type_n\hg
+      \Gamma;\LET\:\vx\defq\ve_1\Hab\vS\proves\vT\Hab\Type_n\end{array}
+      }
+{\Gamma\vdash\LET\:\vx\defq\ve_1\Hab\vS\SC\:\ve_2\Hab
+   \vT[\ve_1/\vx]}   
+%\Let\:\vx\Hab\vS\defq\ve_1\:\IN\:\vT}
+\hspace*{0.1in}\mathsf{Let}
+\\
+
+\Rule{\Gamma\proves\vx\Hab\vA\hg\Gamma\proves\vA'\Hab\Type_n\hg
+      \Gamma\proves\vA\converts\vA'}
+     {\Gamma\proves\vx\Hab\vA'}
+\hspace*{0.1in}\mathsf{Conv}
+\end{array}
+}
+%{Typing rules for $\source$}
+%{typerules}
+
+\subsection{Inductive Families}
+
+\label{indfamilies}
+
+Inductive families \cite{dybjer94} are a form of simultaneously
+defined collection of algebraic data types (such as Haskell
+\texttt{data} declarations) which can be parametrised over
+\remph{values} as well as types.  An inductive family is declared 
+in a similar style to a Haskell GADT declaration~\cite{gadts}
+as
+follows, using the de Bruijn telescope notation, $\tx$, to indicate a
+sequence of zero or more $\vx$:
+
+\DM{
+\AR{
+\Data\:\TC{T}\:(\tx\Hab\ttt)\Hab\vt\hg\Where\hg
+\DC{c}_1\Hab\vt\:\mid\:\ldots\:\mid\:\DC{c}_n\Hab\vt
+}
+}
+
+Constructors may take recursive arguments in the family
+$\TC{T}$. Furthermore these arguments may be indexed by another type,
+as long it does not involve $\TC{T}$ --- this restriction is known as
+\demph{strict positivity} and ensures that recursive arguments of a
+constructor are structurally smaller than the value itself.
+
+The Peano style natural numbers can be declared as follows:
+
+\DM{
+\Data\:\Nat\Hab\Type\hg\Where\hg\Z\Hab\Nat\:\mid\:\suc\Hab\fbind{\vk}{\Nat}{\Nat}
+}
+
+A data type may have zero or more parameters (which are invariant
+across a structure) and a number of indices, given by the type. For
+example, a list is parametrised over its element type:
+
+\DM{
+\AR{
+\Data\:\List\:(\vA\Hab\Type)\Hab\Type\hg\Where
+\ARd{
+& \nil\Hab\List\:\vA\\
+\mid & \cons\Hab\fbind{\vx}{\vA}{\fbind{\vxs}{\List\:\vA}{\List\:\vA}}
+}
+}
+}
+
+Types can be
+parametrised over values. Using this, we can declare the type of
+vectors (lists with length), where the empty list is statically known
+to have length zero, and the non empty list is statically known to
+have a non zero length. $\Vect$ is parametrised over its element type,
+like $\List$, but \remph{indexed} over its length.
+
+\DM{
+\AR{
+\Data\:\Vect\:(\vA\Hab\Type)\Hab\Nat\to\Type\hg\Where \\
+\hg\hg\ARd{
+& \Vnil\Hab\Vect\:\vA\:\Z\\
+\mid & \Vcons\Hab\fbind{\vk}{\Nat}{
+\fbind{\vx}{\vA}{\fbind{\vxs}{\Vect\:\vA\:\vk}{\Vect\:\vA\:(\suc\:\vk)}}
+}
+}
+}
+}
+
+\subsection{Elimination Rules}
+
+\label{elimops}
+
+When we declare an inductive family $\dD$, we give the constructors
+which explain how to build objects in that family.
+\Ivor{} generates from this an \demph{elimination operator} $\delim$ and corresponding
+reductions, which implements the reduction and recursion
+behaviour of terms in the family --- it is a fold
+operator.  The method for constructing elimination operators
+automatically is well documented, in particular
+by~\cite{dybjer94,luo94,mcbride-thesis}.  For $\Vect$, \Ivor{} generates the
+following operator:
+
+\DM{
+\AR{
+\begin{array}{ll}
+\vectelim\Hab & \fbind{\vA}{\Type}{\fbind{\vn}{\Nat}{
+                \fbind{\vv}{\Vect\:\vA\:\vn}{}}} \\
+              & \fbind{\motive}{
+  \fbind{\vn}{\Nat}{\fbind{\vv}{\Vect\:\vA\:\vn}{\Type}}}{} 
+   \\
+              & \fbind{\meth{\Vnil}}{\motive\:\Z\:(\Vnil\:\vA)}{} \\
+              & (\meth{\Vcons}\Hab
+  \AR{
+  \fbind{\vk}{\Nat}{\fbind{\vx}{\vA}{\fbind{\vxs}{\Vect\:\vA\:\vk}{}}} \\
+  \fbind{\VV{ih}}{\motive\:\vk\:\vxs}{\motive\:(\suc\:\vk)\:
+        (\Vcons\:\vA\:\vk\:\vx\:\vxs)})\to} \\
+              & \motive\:\vn\:\vv 
+\end{array}
+\\
+\PA{\A\A\A\A\A\A}{
+& \vectelim & \vA & \Z & (\Vnil\:\vA) & \motive & \meth{\Vnil} & \meth{\Vcons} &
+      \IRet{\meth{\Vnil}} \\
+& \vectelim & \vA & (\suc\:\vk) & (\Vcons\:\vA\:\vk\:\vx\:\vxs) & \motive &
+      \meth{\Vnil} & \meth{\Vcons} & \\
+& & & \IMRet{6}{\meth{\Vcons}\:\vk\:\vx\:\vxs\:(\vectelim\:\vA\:\vk\:\vxs\:\motive\:\meth{\Vnil}\:\meth{\Vcons})} \\
+}
+}
+}
+
+The arguments are the \demph{parameters}
+and \demph{indices} ($\vA$ and $\vn$ here), the \demph{target} (the
+object being eliminated; $\vv$ here), the \demph{motive} (a function
+which computes the return type of the elimination; $\vP$ here) and the
+\demph{methods} (which describe how to achieve the motive for each
+constructor form).  Note the distinction between parameters and
+indices --- the parameter $\vA$ is invariant across the structure so
+is not passed to the methods as an argument, but $\vn$ does vary, so
+is passed. A more detailed explanation of this distinction can be
+found in~\cite{luo94,brady-thesis}.
+A case analysis operator $\dcase$, is obtained similarly, but without
+the induction hypotheses.
+
+%These operators are the only means to
+%analyse a data structure and the only operators which can make
+%recursive calls. This, along with the restriction that data types must
+%be strictly positive, ensures that evaluation always terminates.
+
+\subsection{The Development Calculus}
+
+\label{sec:devcalc}
+
+For developing terms interactively, the type theory needs to support
+\remph{incomplete} terms, and a method for term construction. We
+extend $\source$ with the concept of \demph{holes}, which stand for
+the parts of constructions which have not yet been instantiated; this
+largely follows McBride's \Oleg{} development
+calculus~\cite{mcbride-thesis}.
+
+The basic idea is to extend the syntax for binders with a \remph{hole}
+binding and a \remph{guess} binding. The \remph{guess} binding is
+similar to a $\LET$ binding, but without any computational force,
+i.e. the bound names do not reduce:
+
+\DM{
+\vb ::= \ldots 
+ \:\mid\: \hole{\vx}{\vt} \:\:(\mbox{hole binding}) \:\:
+ \:\mid\: \guess{\vx}{\vt}{\vt} \:\:(\mbox{guess})
+}
+
+Using binders to represent holes as discussed in~\cite{mcbride-thesis}
+is useful in a dependently typed setting since one value may determine
+another. Attaching a ``guess'' to a binder ensures that instantiating one
+such value also instantiates all of its dependencies. The typing rules for
+binders ensure that no $?$ bindings leak into types, and are given
+below.
+
+\DM{
+\AR{
+\Rule{
+\Gamma;\hole{\vx}{\vS}\proves\ve\Hab\vT
+}
+{
+\Gamma\proves\hole{\vx}{\vS}\SC\ve\Hab\vT
+}
+\hspace*{0.1cm}\vx\not\in\vT
+\hspace*{0.1in}\mathsf{Hole}
+\hg
+\Rule{
+\Gamma;\guess{\vx}{\vS}{\ve_1}\proves\ve_2\Hab\vT
+}
+{
+\Gamma\proves\guess{\vx}{\vS}{\ve_1}\SC\ve_2\Hab\vT
+}
+\hspace*{0.1cm}\vx\not\in\vT
+\hspace*{0.1in}\mathsf{Guess}
+
+}
+}
+%{Typing rules for $\source$ holes}
+%{typerulesholes}
+
+%% \subsection{Hole Manipulation}
+
+%% \label{holeops}
+
+%% Construction of terms through the \Ivor{} library relies on four basic
+%% operations on holes: \demph{claim}, which introduces a new hole of a
+%% given type; \demph{fill}, which attaches a guess to a hole;
+%% \demph{abandon}, which removes a guess from a hole; and \demph{solve}
+%% which finalises a guess by converting it to a $\LET$ binding,
+%% providing that the guess is \remph{pure}, i.e. does not contain any
+%% hole bindings or guesses.
+
+%% \DM{
+%% \begin{array}{l@{\hg}l}
+%% \mbox{Claim} & 
+%% \Rule{\Gamma\proves\ve\Hab\vT\hg
+%% \Gamma\proves\vS\Hab\Type
+%% }
+%% {\Gamma\proves\hole{\vx}{\vS}\SC\ve\Hab\vT
+%% }
+%% \\
+%% \mbox{Fill} & 
+%% \Rule{\Gamma\proves\hole{\vx}{\vS}\SC\ve\Hab\vT\hg
+%% \Gamma\proves\vv\Hab\vS}
+%% {\Gamma\proves\guess{\vx}{\vS}{\vv}\SC\ve\Hab\vT}
+%% \\
+%% \mbox{Abandon} &
+%% \Rule{\Gamma\proves\guess{\vx}{\vS}{\vv}\SC\ve\Hab\vT}
+%% {\Gamma\proves\hole{\vx}{\vS}\SC\ve\Hab\vT}
+%% \\
+%% \mbox{Solve} &
+%% \Rule{\Gamma\proves\guess{\vx}{\vS}{\vv}\SC\ve\Hab\vT}
+%% {\Gamma\proves\LET\:\vx\Hab\vS\defq\:\vv\SC\ve\Hab\vT}
+%% \hspace*{0.1cm}\vv\:\mbox{pure}
+
+%% \end{array}
+%% }
+
+
diff --git a/papers/ivor/dtp.bib b/papers/ivor/dtp.bib
new file mode 100644
--- /dev/null
+++ b/papers/ivor/dtp.bib
@@ -0,0 +1,151 @@
+@phdthesis{ brady-thesis,
+    author = {Edwin Brady},
+    title = {Practical Implementation of a Dependently Typed Functional Programming Language},
+    year = 2005,
+    school = {University of Durham}
+}
+
+@article{view-left,
+   journal = {Journal of Functional Programming},
+   number = {1},
+   volume = {14},
+   title = {The View From The Left},
+   year = {2004},
+   author = {Conor McBride and James McKinna},
+   pages = {69--111}
+}
+
+@misc{epigram-afp,
+    author = {Conor McBride},
+    title = {Epigram: Practical Programming with Dependent Types},
+    year = {2004},
+    howpublished = {Lecture Notes, International Summer School on Advanced Functional Programming}
+}
+
+@misc{coq-manual,
+   howpublished = {\verb+http://coq.inria.fr/+},
+   title = {The {Coq} Proof Assistant --- Reference Manual},
+   year = {2004},
+   author = {{Coq Development Team}}
+}
+
+@inproceedings{extraction-coq,
+   title = {A New Extraction for {Coq}},
+   year = {2002},
+   booktitle = {Types for proofs and programs},
+   editor = {Herman Geuvers and Freek Wiedijk},
+   publisher = {Springer},
+   author = {Pierre Letouzey},
+   series = {LNCS}
+}
+
+@techreport{lego-manual,
+   title = {\textsc{Lego} Proof Development System: User's Manual},
+   year = {1992},
+   institution = {Department of Computer Science, University of Edinburgh},
+   author = {Zhaohui Luo and Robert Pollack}
+}
+
+@book{luo94,
+   title = {Computation and Reasoning -- A Type Theory for Computer Science},
+   year = {1994},
+   publisher = {OUP},
+   author = {Zhaohui Luo},
+   series = {International Series of Monographs on Computer Science}
+}
+
+@phdthesis{goguen-thesis,
+   school = {University of Edinburgh},
+   title = {A Typed Operational Semantics for Type Theory},
+   year = {1994},
+   author = {Healfdene Goguen}
+}
+
+@phdthesis{mcbride-thesis,
+   month = {May},
+   school = {University of Edinburgh},
+   title = {Dependently Typed Functional Programs and their         proofs},
+   year = {2000},
+   author = {Conor McBride}
+}
+
+@misc{mckinnabrady-phase,
+   title = {Phase Distinctions in the Compilation of {Epigram}},
+   year = 2005,
+   author = {James McKinna and Edwin Brady},
+   note = {Draft}
+}
+
+@article{pugh-omega,
+   title =  "The {Omega} {Test}: a fast and practical integer programming algorithm for dependence analysis", 
+   author = "William Pugh", 
+   journal = "Communication of the ACM", 
+   year = 1992, 
+   pages = {102--114}
+}
+
+@Article{RegionTypes,
+  refkey =       "C1753",
+  title =        "Region-Based Memory Management",
+  author =       "M. Tofte and J.-P. Talpin",
+  pages =        "109--176",
+  journal =      "Information and Computation",
+  month =        "1~" # feb,
+  year =         "1997",
+  volume =       "132",
+  number =       "2"
+}
+
+@phdthesis{ pedro-thesis,
+    author = {Pedro Vasconcelos},
+    title = {Space Cost Modelling for Concurrent Resource Sensitive Systems},
+    year = 2006,
+    school = {University of St Andrews}
+}
+
+@book{curry-feys,
+   title = {Combinatory Logic, volume 1},
+   year = {1958},
+   publisher = {North Holland},
+   author = {Haskell B. Curry and Robert Feys}
+}
+@inproceedings{howard,
+   title = {The formulae-as-types notion of construction},
+   year = {1980},
+   booktitle = {To H.B.Curry: Essays on combinatory logic, lambda calculus and formalism},
+   editor = {Jonathan P. Seldin and J. Roger Hindley},
+   publisher = {Academic Press},
+   author = {William A. Howard},
+   note = {A reprint of an unpublished manuscript from 1969}
+}
+
+@misc{ydtm,
+    author = {Thorsten Altenkirch and Conor McBride and James McKinna},
+    title = {Why Dependent Types Matter},
+    note = {Submitted for publication},
+    year = 2005}
+
+@inproceedings{regular-types,
+    author = { Peter Morris and Conor McBride and Thorsten Altenkirch},
+    title = {Exploring The Regular Tree Types},
+    year = 2005,
+    booktitle = {Types for Proofs and Programs 2004}
+}
+
+@inproceedings{xi_arraybounds,
+author = "Hongwei Xi and Frank Pfenning",
+title = {Eliminating Array Bound Checking through Dependent Types},
+booktitle = "Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation",
+year = 1998,
+month = "June",
+address = "Montreal",
+pages = "249--257",
+}
+
+@misc{interp-cayenne,
+   url = {\verb+http://www.cs.chalmers.se/~augustss/cayenne/+},
+   title = {An exercise in dependent types: A well-typed interpreter},
+   year = {1999},
+   author = {Lennart Augustsson and Magnus Carlsson}
+}
+
diff --git a/papers/ivor/embounded.bib b/papers/ivor/embounded.bib
new file mode 100644
--- /dev/null
+++ b/papers/ivor/embounded.bib
@@ -0,0 +1,279 @@
+@Book{BurnsWellings,
+author = {A. Burns and A.J. Wellings}, 
+title = {{Real-Time Systems and Programming Languages (Third Edition)}},
+publisher = {Addison Wesley Longman}, 
+year = 2001
+}
+
+@Book{Ganssle:Book,
+author = {J.G. Ganssle},
+title = {{The Art of Programming Embedded Systems}},
+publisher = {Academic Press},
+year = {1992},
+note = {ISBN 0-12274880-8},
+}
+
+@Book{Ganssle:Design,
+author = {J.G. Ganssle},
+title = {{The Art of Designing Embedded Systems}},
+publisher = {Newnes},
+year = {1999},
+note = {ISBN 0-75069869-1},
+}
+
+@article{Ganssle:OnLanguage,
+author = {J.G. Ganssle},
+title = {{On Language}},
+journal ={{Electronic Eng. Times}},
+month = "March",
+year = {2003}
+}
+
+@article{Ganssle:MicroMinis,
+author = {J.G. Ganssle},
+title = {{Micro Minis}},
+journal ={{Embedded Systems Programming}},
+month = "March",
+year = {2003}
+}
+
+@article{Barr:EmbeddedSystProg,
+author = {M. Barr},
+title = {{The Long Winter}},
+journal ={{Electronic Systems Programming}},
+month = "January",
+year = {2003}
+}
+
+@unpublished{Ganssle:WebSite,
+author = {The Ganssle Group},
+title = {{Perfecting the Art of Building Embedded Systems}},
+month = "May",
+year = 2003,
+note = {\url{http://www.ganssle.com}}
+}
+
+@article{Schoitsch,
+author = {E. Schoitsch},
+title = {{Embedded Systems -- Introduction}},
+journal = {ERCIM News},
+pages = {10--11},
+volume = 52,
+month = jan,
+year = 2003
+}
+
+@article{UMLESE,
+author = {C. Holland},
+title = {{Telelogic Second Generation Tools}},
+journal = {Embedded Systems Europe},
+month = aug,
+year = 2002
+}
+
+@article{DSL,
+author = {P. Hudak},
+title = {{Building Domain-Specific Embedded Languages}},
+journal = {ACM Computing Surveys},
+volume = 28,
+number = 4,
+month = dec,
+year = 1996
+}
+
+@article{DSL:devicedriver,
+author = {C. Conway},
+title = {{A Domain-Specific Language for Device Drivers}},
+journal = {ACM Computing Surveys},
+volume = 28,
+number = 4,
+month = dec,
+year = 1996
+}
+
+@unpublished{Klocwork,
+author = {Klocwork},
+year = 2003,
+}
+
+@inproceedings{Bernat1,
+author = {Bernat, G. and Burns, A. and Wellings, A.},
+title  = {{Portable Worst-Case Execution Time Analysis Using Java Byte Code}},
+booktitle = {Proc. 12th Euromicro International Conf. on
+			Real-Time Systems},
+address = {Stockholm},
+year    = 2000,
+month   = {June}
+}
+
+@inproceedings{Bernat2,
+author = {Bernat, G. and Colin, A. and Petters, S. M.},
+title  = {{WCET Analysis of Probabilistic Hard Real-Time Systems}},
+booktitle = {Proc. 23rd IEEE Real-Time Systems Symposium (RTSS 2002)},
+address  = {Austin, TX. (USA)},
+year     = 2002,
+month    = {December}
+}
+
+@inproceedings{SizedRecursion,
+author = {P. Vasconcelos and K. Hammond},
+title = {{Inferring Costs for Recursive, Polymorphic and Higher-Order Functions}},
+booktitle = {Proc. Implementation of Functional Languages (IFL 2003)},
+publisher = {Springer-Verlag},
+year = {2003}
+}
+
+@inproceedings{HAM,
+author = {K. Hammond and G.J. Michaelson},
+title = {{An Abstract Machine Implementation for Hume}},
+booktitle = {submitted to Intl. Conf. on Compilers, Architectures and Synthesis for Embedded Systems (CASES~03)},
+year = {2003}
+}
+
+@unpublished{EmbeddedSystSurvey,
+author = {Embedded.com},
+title = {Poll: What Language do you use for embedded work?},
+note = {\url{http://www.embedded.com/pollArchive/?surveyno=2228}},
+year = 2003,
+}
+
+@inproceedings{ESP,
+author = {S. Kumar and K. Li},
+title = {Automatic Memory Management for Programmable Devices},
+booktitle = {Proc. ACM Intl. Symp. on Memory Management, Berlin, Germany},
+month = jun,
+year = 2002,
+pages = {245--255},
+}
+
+@inproceedings{RegionJava,
+author = {F. Qian and L. Hendrie},
+title = {An Adaptive Region-Based Allocator for Java},
+booktitle = {Proc. ACM Intl. Symp. on Memory Management, Berlin, Germany},
+month = jun,
+year = 2002,
+pages = {233--244},
+}
+
+@inproceedings{RegionsRTSJ,
+author = {M. Deters and R.K. Cytron},
+title = {Automated Discovery of Scoped Memory Regions for Real-Time Java},
+booktitle = {Proc. ACM Intl. Symp. on Memory Management, Berlin, Germany},
+month = jun,
+year = 2002,
+pages = {132--141},
+}
+
+@inproceedings{RTGC,
+author = {S. Nettles and J. O'Toole},
+title = {{Real-Time Replication Garbage Collection}},
+booktitle = {ACM Sigplan Notices},
+volume = 28,
+number = 6,
+month = jun,
+year = 1993,
+pages = {217--226},
+}
+
+@inproceedings{Blelloch,
+author = {P. Cheng and G. Blelloch},
+title = {{A Parallel, Real-Time Garbage Collector}},
+booktitle = {ACM Sigplan Notices},
+volume = 36,
+number = 5,
+month = may,
+year = 2001,
+pages = {125--136},
+}
+
+@inproceedings{RegionsGC,
+author = {N. Hallenberg and M. Elsman and M. Tofte},
+title = {{Combining Region Inference and Garbage Collection}},
+booktitle = {Proc. ACM Conf. on Prog. Lang. Design and Impl. (PLDI~'02), Berlin, Germany},
+month = jun,
+year = 2002,
+}
+
+
+@article{RTSJIssues,
+author = {K. Nilsen},
+title = {{Issues in the Design and Implementation of Real-Time Java}},
+booktitle = {Java Developers' Journal},
+volume = 1,
+number = 1,
+year = 1996,
+pages = 44
+}
+
+
+
+@unpublished{CyCab,
+author = {RoboSoft SA},
+title = {{CyCab Outdoor Vehicle, for Road and/or All-terrain Use}},
+note = {\url{http://www.robosoft.fr/SHEET/01Mobil/2001Cycab/CyCab.html}},
+year = 2003,
+month = may
+}
+
+
+@unpublished{Joyner,
+author = {I. Joyner},
+title = {{C++??: a Critique of C++, 3rd Edition}},
+year = 1996,
+institution = {Unisys - ACUS, Australia},
+note = {\url{http://www.kcl.ac.uk/kis/support/cit//fortran/cpp/cppcritique.ps}}
+}
+
+@unpublished{Sakkinen,
+author = {M. Sakkinen},
+title = {{The Darker Side of C++ Revisited}},
+year = 1993,
+institution = {Univerity of Jyv\"{a}skyl\"{a}},
+note = {Technical Report 1993-I-13, \url{http://www.kcl.ac.uk/kis/support/cit//fortran/cpp/dark-cpl.ps}},
+}
+
+@TechReport{BCLogicDelvb,
+  author = 	 {Hans-Wolfgang Loidl and Olha Shkaravska and Lennart Beringer},
+  title = 	 {Preliminary investigations into a bytecode logic for Grail},
+  institution =  {Institut f{\"u}r Informatik, LMU University and LFCS, Edinburgh University},
+  year = 	 2003,
+  month =	 jan,
+  note =	 {Project Deliverable}
+}
+
+@InProceedings{HWLtofillin,
+  author = 	 {Lennart Beringer and Kenneth MacKenzie and Ian Stark},
+  title = 	 {Grail: a functional form for imperative mobile code},
+  booktitle =	 {FGC03 --- Workshop on Foundations of Global Computing},
+  year =	 2003,
+  address =	 {28--29 June 2003, Eindhoven, The Netherlands},
+  note =	 {Submitted}
+}
+
+
+@inproceedings{AbsInt:EmsoftTahoe,
+  author    =  "C. Ferdinand and R. Heckmann and M. Langenbach and
+                    F. Martin and M. Schmidt and
+                    H. Theiling and S. Thesing and R. Wilhelm",
+  title     =  {Reliable and Precise {WCET} Determination for a Real-Life Processor},
+  booktitle =  {Proc. EMSOFT 2001, First Workshop on Embedded Software},
+  publisher =  {Springer-Verlag},
+  series    =  {LNCS},
+  volume    =  2211,
+  pages     =  {469--485},
+  year      =  2001
+}
+
+
+@inproceedings{AbsInt:Avionics,
+  author    =  "S. Thesing and J. Souyris and R. Heckmann and
+                        F. Randimbivololona and M. Langenbach and
+                        R. Wilhelm and C. Ferdinand",
+  title     =  {An Abstract Interpretation-Based Timing Validation
+                        of Hard Real-Time Avionics Software},
+  booktitle =  {Proc. 2003 Intl. Conf.
+                        on Dependable Systems and Networks (DSN 2003)},
+  pages     =  {625--632},
+  year      =  2003
+}
+
diff --git a/papers/ivor/examples.tex b/papers/ivor/examples.tex
new file mode 100644
--- /dev/null
+++ b/papers/ivor/examples.tex
@@ -0,0 +1,285 @@
+\section{Examples}
+
+In this section we show two examples of embedding \Ivor{} in a Haskell
+program. The first shows an embedding of a simple theorem prover for
+propositional logic. The second example extends this theorem prover by
+using the same logic as a basis for showing properties of a functional
+language.
+
+\subsection{A Propositional Logic Theorem Prover}
+
+\label{example1}
+
+Propositional logic is straightforward to model in dependent type
+theory; here we show how \Ivor{} can be used to implement a theorem
+prover for propositional logic. The full implementation is available
+from \url{http://www.cs.st-andrews.ac.uk/~eb/Ivor/}.  The language of
+propositional logic is defined as follows, where $\vx$ stands for an
+arbitrary free variable:
+
+\DM{
+\begin{array}{rll}
+\vL ::= & \vx 
+\mid \vL \land \vL
+\mid \vL \lor \vL
+\mid \vL \to \vL
+\mid \neg\vL
+\end{array}
+}
+
+\newcommand{\Tand}{\TC{And}}
+\newcommand{\andintro}{\DC{and\_intro}}
+\newcommand{\Tor}{\TC{Or}}
+\newcommand{\orintrol}{\DC{inl}}
+\newcommand{\orintror}{\DC{inr}}
+
+There is a simple mapping from this language to dependent type theory
+--- the $\land$ and $\lor$ connectives can be declared as inductive
+families, where the automatically derived elimination rules give the
+correct elimination behaviour, and the $\to$ connective follows the
+same rules as the function arrow. Negation can be defined with the
+empty type.
+
+The $\land$ connective is declared as an inductive family, where an
+instance of the family gives a proof of the connective. The $\andintro$
+constructor builds a proof of $\vA\land\vB$, given a proof of $\vA$ and
+a proof of $\vB$:
+
+\DM{
+\AR{
+\Data\:\Tand\:(\vA,\vB\Hab\Type)\Hab\Type\hg\Where\\
+\hg\hg
+\andintro\Hab\fbind{\va}{\vA}{\fbind{\vb}{\vB}{\Tand\:\vA\:\vB}}
+}
+}
+
+Similarly, $\lor$ is declared as an inductive family; an instance of
+$\vA\lor\vB$ is built either from a proof of $\vA$ ($\orintrol$) or a
+proof of $\vB$ ($\orintror$):
+
+\DM{
+\AR{
+\Data\:\Tor\:(\vA,\vB\Hab\Type)\Hab\Type\hg\Where\\
+\hg\hg\ARd{
+& \orintrol\Hab\fbind{\va}{\vA}{\Tor\:\vA\:\vB}\\
+\mid & \orintror\Hab\fbind{\vb}{\vB}{\Tor\:\vA\:\vB}
+}
+}
+}
+
+I will write $\interp{\ve}$ to denote the translate from an expression
+$\ve\in\vL$ to an implementation in $\source$; in the implementation,
+this is a parser from strings to \hdecl{ViewTerm}s:
+
+\DM{
+\AR{
+\interp{\ve_1\land\ve_2}\:=\:\Tand\:\interp{\ve_1}\:\interp{\ve_2}\\
+\interp{\ve_1\lor\ve_2}\:=\:\Tor\:\interp{\ve_1}\:\interp{\ve_2}\\
+\interp{\ve_1\to\ve_2}\:=\:\interp{\ve_1}\to\interp{\ve_2}\\
+}
+}
+
+To implement negation, we declare the empty type:
+
+\DM{
+\Data\:\False\Hab\Type\hg\Where
+}
+
+Then $\interp{\neg\ve}\:=\:\interp{\ve}\to\False$. The automatically
+derived elimination shows that a value
+of \remph{any} type can be created from a proof of the empty type:
+
+\DM{
+\Elim{\False}\Hab\fbind{\vx}{\False}{
+\fbind{\motive}{\False\to\Type}{\motive\:\vx}}
+}
+
+In the implementation, we initialise the \hdecl{Context} with these
+types (using \hdecl{addData}) and propositional variables
+$\vA\ldots\vZ$ (using \hdecl{addAxiom}\footnote{This adds a name with
+  a type but no definition to the context.}).
+
+\subsubsection{Domain Specific Tactics}
+Mostly, the implementation of a propositional logic theorem prover
+consists of a parser and pretty printer for the language $\vL$, and a
+top level loop for applying introduction and elimination
+tactics. However, some domain
+specific tactics are needed, in particular to deal with negation and
+proof by contradiction. 
+
+To prove a negation $\neg\vA$, we assume $\vA$ and attempt to prove
+$\False$. This is achieved with an \hdecl{assumeFalse} tactic which
+assumes the negation of the goal. Negation is defined with a function
+$\FN{not}$; the \hdecl{assumeFalse} tactic then unfolds this name so
+that a goal (in $\source$ syntax) $\FN{not}\:\vA$ is transformed to
+$\vA\:\to\:\False$, then $\vA$ can be introduced.
+
+\begin{verbatim}
+assumeFalse :: Tactic
+assumeFalse = unfold (name "not") >+> intro 
+\end{verbatim}
+
+The proof by contradiction tactic
+is implemented as follows:
+\\
+
+\begin{verbatim}
+contradiction :: String -> String -> Tactic
+contradiction x y = claim (name "false") "False" >+>
+                    induction "false" >+>
+                    (try (fill $ x ++ " " ++ y)
+                          idTac
+                          (fill $ y ++ " " ++ x))
+\end{verbatim}
+
+This tactic takes the names of the two contradiction premises. One is
+of type $\vA\to\False$ for some $\vA$, the other is of type $\vA$. The
+tactic works by claiming there is a contradiction and solving the goal
+by induction over that assumed contradiction (which gives no subgoals,
+since $\Elim{\False}$ has no methods). Finally, using \texttt{>+>} to
+solve the next subgoal (and discharge the assumption of the
+contradiction), it looks for a value of type $\False$ by first
+applying $\vy$ to $\vx$ then, if that fails, applying $\vx$ to $\vy$.
+
+\subsection{\Funl{}, a Functional Language with a Built-in Theorem Prover}
+
+\label{example2}
+
+Propositional logic is an example of a simple formal system which can
+be embedded in a Haskell program using \Ivor{}; however, more complex
+languages can be implemented. \Funl{} is a simple functional language,
+with primitive recursion over integers and higher order functions. It
+is implemented on top of \Ivor{} as a framework for both language
+representation and correctness proofs in that language. By using the
+same framework for both, it is a small step from implementing the
+language to implementing a theorem prover for showing properties of
+programs, making use of the theorem prover developed
+in sec. \ref{example1}.
+An implementation is available from
+\url{http://www.cs.st-andrews.ac.uk/~eb/Funl/}; in this section I will
+sketch some of the important details of this implementation. Like the
+propositional logic theorem prover, much of the detail is in the
+parsing and pretty printing of terms and propositions, relying on
+\Ivor{} for typechecking and evaluation.
+
+\subsubsection{Programs and Properties}
+
+The \Funl{} language allows programs and statements of the properties
+those programs should satisfy to be expressed within the same input file.
+Functions are defined as in the following examples, using \hdecl{rec}
+to mark a primitive recursive definition:
+
+\begin{verbatim}
+fac : Int -> Int =
+     lam x . rec x 1 (lam k. lam recv. (k+1)*recv);
+myplus : Int -> Int -> Int =
+     lam x. lam y. rec x y (lam k. lam recv. 1+recv);
+\end{verbatim}
+
+The \hdecl{myplus} function above defines addition by primitive
+recursion over its input. To show that this really is a definition of
+addition, we may wish to show that it satisfies some appropriate
+properties of addition. In the \Funl{} syntax, we declare the
+properties we wish to show as follows:
+
+\begin{verbatim}
+myplusn0 proves 
+     forall x:Int. myplus x 0 = x;
+myplusnm1 proves 
+     forall x:Int. forall y:Int. myplus x (1+y) = 1+(myplus x y);
+myplus_commutes proves 
+     forall x:Int. forall y:Int. myplus x y = myplus y x;
+\end{verbatim}
+
+On compiling a program, the compiler requires that proofs are provided
+for the stated properties. Once built, the proofs can be saved as
+proof terms, so that properties need only be proved once.
+
+\subsubsection{Building Terms}
+Terms are parsed into a data type \hdecl{Raw}; the name
+\hdecl{Raw} reflects the fact that these are raw, untyped terms; note
+in particular that \hdecl{Rec} is an operator for primitive recursion
+on arbitrary types, like the $\delim$ operators in $\source$ --- it
+would be fairly simple to write a first pass which translated
+recursive calls into such an operator using techniques similar to
+McBride and McKinna's labelled types~\cite{view-left}, which are
+implemented in \Ivor{}. Using this, we could easily extend the
+language with more primitive types (e.g. lists) or even user defined
+data types. The representation is as follows:
+
+\begin{verbatim}
+data Raw = Var String | Lam String Ty Raw | App Raw Raw
+         | Num Int | Boolval Bool  | InfixOp Op Raw Raw
+         | If Raw Raw Raw | Rec Raw [Raw]
+\end{verbatim}
+
+Building a \Funl{} function consists of creating a \hdecl{theorem} 
+with a goal representing the function's type, then using the
+\hdecl{buildTerm} tactic to traverse the
+structure of the raw term, constructing a proof of the
+theorem --- note especially that \texttt{rec} translates into an
+application of the appropriate elimination rule via the
+\texttt{induction} tactic:
+
+\begin{verbatim}
+buildTerm :: Raw -> Tactic
+buildTerm (Var x) = refine x
+buildTerm (Lam x ty sc) = introName (name x) >+> buildTerm sc
+buildTerm (Language.App f a) = buildTerm f >+> buildTerm a
+buildTerm (Num x) = fill (mkNat x)
+buildTerm (If a t e) = 
+    cases (mkTerm a) >+> buildTerm t >+> buildTerm e
+buildTerm (Rec t alts) =
+    induction (mkTerm t) >+> tacs (map buildTerm alts)
+buildTerm (InfixOp Plus x y) = 
+    refine "plus" >+> buildTerm x >+> buildTerm y
+buildTerm (InfixOp Times x y) = ...
+\end{verbatim}
+
+A helper function, \hdecl{mkTerm}, is used to translate simple
+expressions into \hdecl{ViewTerm}s. This is used for the scrutinees of
+\hdecl{if} and \hdecl{rec} expressions, although if more complex
+expressions are desired here, it would be possible to use
+\hdecl{buildTerm} instead.
+
+\begin{verbatim}
+mkTerm :: Raw -> ViewTerm
+mkTerm (Var x) = (Name Unknown (name x))
+mkTerm (Lam x ty sc) = Lambda (name x) (mkType ty) (mkTerm sc)
+mkTerm (Apply f a) = App (mkTerm f) (mkTerm a)
+mkTerm (Num x) = mkNat x
+mkTerm (InfixOp Plus x y) = 
+    App (App (Name Free (name "plus")) (mkTerm x)) (mkTerm y)
+mkTerm (InfixOp Times x y) = ...
+\end{verbatim}
+
+\Ivor{} handles
+the typechecking and any issues with renaming, using techniques from
+\cite{not-a-number}; if there are any type errors in the \hdecl{Raw}
+term, this tactic will fail (although some extra work is required to
+produce readable error messages). By using \Ivor{} to handle
+typechecking and evaluation, we are in no danger of constructing or 
+evaluating an ill-typed term.
+
+
+\subsubsection{Building Proofs}
+We also define a language of propositions over terms in \Funl{}.
+This uses propositional logic, just like the theorem prover in
+section \ref{example1}, but extended with equational reasoning. For
+the equational reasoning, we use a library of equality proofs to
+create tactics for applying commutativity and associativity of
+addition and simplification of expressions.
+
+A basic language of propositions with the obvious translation to
+$\source$ is:
+
+\begin{verbatim}
+data Prop = Eq Raw Raw
+          | And Prop Prop | Or Prop Prop
+          | All String Ty Prop | FalseProp
+\end{verbatim}
+
+This allows equational reasoning over \Funl{} programs, quantification
+over variables and conjunction and disjunction of propositions. A more
+full featured prover may require relations other than \hdecl{Eq} or
+even user defined relations.
diff --git a/papers/ivor/intro.tex b/papers/ivor/intro.tex
new file mode 100644
--- /dev/null
+++ b/papers/ivor/intro.tex
@@ -0,0 +1,124 @@
+\section{Introduction}
+
+%\Ivor{} is a tactic-based theorem proving engine with a Haskell
+%API. Unlike other systems such as \Coq{}~\cite{coq-manual} and
+%Agda~\cite{agda}, the tactic engine is primarily intended to be used
+%by programs, rather than a human operator. 
+
+Type theory based theorem provers such as \Coq{}~\cite{coq-manual} and
+\Agda{}~\cite{agda} have been used as tools for verification of programs
+(e.g.~\cite{leroy-compiler,why-tool,mckinna-expr}), extraction of
+correct programs from proofs (e.g.~\cite{extraction-coq})
+and formal proofs of mathematical properties
+(e.g.~\cite{fta,four-colour}).  However, these tools are designed with a
+human operator in mind; the interface is textual which makes it
+difficult for an external program to interact with them. 
+In contrast, the \Ivor{} library is designed to provide an
+implementation of dependent type theory (i.e. dependently typed
+$\lambda$-calculus) and tactics for proof and
+program development to a Haskell application programmer, via a stable,
+well-documented and lightweight (as far as possible) API. The goal is
+to allow: i) easy embedding of theorem proving tools in a Haskell
+application; and ii) easy extension of the theorem prover with
+\remph{domain specific} tactics, via a domain specific embedded
+language (DSEL) for tactic construction.
+
+%% \Coq{}
+%% provides an extraction mechanism~\cite{extraction-coq} which generates
+%% ML or Haskell code from a proof term, but this does not allow the easy
+%% \remph{construction} of proof terms by an external tool. It is also
+%% extensible to some extent, for example using a domain specific
+%% language for creating user tactics, but the result is difficult to
+%% embed in an external program.
+
+%More
+%recently, dependent types have been incorporated into programming
+%languages such as Cayenne~\cite{cayenne-icfp}, DML~\cite{xi-thesis} and
+%\Epigram{}~\cite{view-left,epigram-afp}.
+
+
+%% have been used for several
+%% large practical applications, including correctness proofs for a
+%% compiler~\cite{leroy-compiler} and a computer assisted proof of the
+%% four colour theorem~\cite{four-colour}. 
+
+\subsection{Motivating Examples}
+
+Many situations can benefit from a dependently typed proof and
+programming framework accessible as a library from a Haskell program.
+For each of these, by using an implementation of a well understood
+type theory, we can be confident that the underlying framework is
+sound. 
+
+%% --- provided of course that the implementation itself is correct. 
+%% Implementing
+%% eliminates the need to prove that a language and proof system are consistent with
+%% each other or that a special purpose proof framework is sound.
+
+\begin{description}
+\item[Programming Languages] 
+Dependent type theory is a possible internal representation for a
+functional programming language. 
+%The core language of the Glasgow
+%Haskell Compiler is \SystemF{}~\cite{core} --- dependent type theory
+%generalises this by allowing types to be parametrised over values.
+Correctness
+properties of programs in purely functional languages can be proven by
+equational reasoning, 
+e.g. with Sparkle~\cite{sparkle} for the Clean language~\cite{clean}, or
+Cover~\cite{cover} for translating Haskell into
+\Agda{}~\cite{agda}. However these tools 
+separate the language implementation from the theorem prover --- every
+language feature must be translated into the theorem prover's
+representation, and any time the language implementation is changed,
+this translation must also be changed.
+In section
+\ref{example2}, we will see how \Ivor{} can be used to implement a
+language with a built-in theorem prover, with a common representation
+for both.
+
+\item[Verified DSL Implementation] 
+
+We have previously implementated a verified domain specific
+language~\cite{dtpmsp-gpce} with \Ivor{}.  The abstract syntax tree of
+a program is a dependent data structure, and the type system
+guarantees that invariant properties of the program are maintained
+during evaluation.  Using staging annotations~\cite{multi-taha}, such
+an interpreter can be specialised to a translator. We are continuing
+to explore these techniques in the context of resource aware
+programming~\cite{dt-framework}.
+
+\item[Formal Systems] 
+
+A formal system can be modelled in dependent type theory, and
+derivations within the system can be constructed and checked. 
+A simple example is propositional logic --- the connectives
+$\land$, $\lor$ and $\to$ are represented as types, and a theorem
+prover is used to prove logical formulae.  Having an implementation of
+type theory and an interactive theorem prover accessible as an API
+makes it easy to write tools for working in a formal system, whether
+for educational or practical purposes.  In section \ref{example1}, I
+will give details of an implementation of propositional logic.
+
+\end{description}
+
+In general, the library can be used wherever formally certified code
+is needed --- evaluation of dependently typed \Ivor{} programs is
+possible from Haskell programs and the results can be inspected
+easily.  Domain specific tactics are often required; e.g. an
+implementation of a programming language with subtyping may require a
+tactic for inserting coercions, or a computer arithmetic system may
+require an implementation of Pugh's Omega decision
+procedure~\cite{pugh-omega}.  \Ivor{}'s API is designed to make
+implementation of such tactics as easy as possible.
+
+In \Ivor{}'s dependent type system, types may be predicated on
+arbitrary values. Programs and properties can be
+expressed within the same self-contained system --- properties are
+proved by construction, at the same time as the program is
+written. The tactic language can thus be used not only for
+constructing proofs but also for interactive program development.
+
+%\subsection{Why Do We Need Another Theorem Prover?}
+
+%Relationship to e.g. \Coq{}.
diff --git a/papers/ivor/ivor.tex b/papers/ivor/ivor.tex
new file mode 100644
--- /dev/null
+++ b/papers/ivor/ivor.tex
@@ -0,0 +1,84 @@
+%\documentclass{article}
+\documentclass[orivec,dvips,10pt]{llncs}
+
+\usepackage{epsfig}
+\usepackage{path}
+\usepackage{url}
+\usepackage{amsmath,amssymb} 
+
+\newenvironment{template}{\sffamily}
+
+\usepackage{graphics,epsfig}
+\usepackage{stmaryrd}
+
+\input{macros.ltx}
+\input{library.ltx}
+
+\NatPackage
+
+\newcommand{\Ivor}{\textsc{Ivor}}
+\newcommand{\Funl}{\textsc{Funl}}
+\newcommand{\Agda}{\textsc{Agda}}
+
+\newcommand{\mysubsubsection}[1]{
+\noindent
+\textbf{#1}
+}
+\newcommand{\hdecl}[1]{\texttt{#1}}
+
+\begin{document}
+
+\title{\Ivor{}, a Proof Engine}
+\author{Edwin Brady}
+
+\institute{School of Computer Science, \\
+ University of St Andrews, St Andrews, Scotland. \\ \texttt{Email: eb@cs.st-andrews.ac.uk}.\\
+\texttt{Tel: +44-1334-463253}, \texttt{Fax: +44-1334-463278} \vspace{0.1in}
+}
+ 
+\maketitle
+
+\begin{abstract}
+Dependent type theory has several practical applications in the fields
+of theorem proving, program verification and programming language
+design. \Ivor{} is a Haskell library designed to allow easy extending
+and embedding of a type theory based theorem prover in a Haskell
+application. In this paper, I give an overview of the library and show
+how it can be used to embed theorem proving technology in an
+implementation of a simple functional programming language; by using
+type theory as a core representation, we can construct and evaluate
+terms and prove correctness properties of those terms within the
+\remph{same} framework, ensuring consistency of the implementation and
+the theorem prover. 
+
+\end{abstract}
+
+\input{intro}
+
+\input{corett}
+
+%\input{usage}
+
+\input{tactics}
+
+\input{examples}
+
+\input{conclusions}
+
+\section*{Acknowledgements}
+
+My thanks to Kevin Hammond and James McKinna for their comments on an
+earlier draft of this paper, and to the anonymous reviewers for their
+helpful comments.
+This work is generously supported by EPSRC grant EP/C001346/1. 
+
+\bibliographystyle{abbrv}
+\begin{small}
+\bibliography{../bib/literature.bib}
+
+%\appendix
+
+%\input{code}
+
+\end{small}
+\end{document}
diff --git a/papers/ivor/library.ltx b/papers/ivor/library.ltx
new file mode 100644
--- /dev/null
+++ b/papers/ivor/library.ltx
@@ -0,0 +1,325 @@
+%%%%%%%%%%%%%%% library file for datatypes etc.
+
+%%% Identifiers
+
+\newcommand{\va}{\VV{a}}
+\newcommand{\vb}{\VV{b}}
+\newcommand{\vc}{\VV{c}}
+\newcommand{\vd}{\VV{d}}
+\newcommand{\ve}{\VV{e}}
+\newcommand{\vf}{\VV{f}}
+\newcommand{\vg}{\VV{g}}
+\newcommand{\vh}{\VV{h}}
+\newcommand{\vi}{\VV{i}}
+\newcommand{\vj}{\VV{j}}
+\newcommand{\vk}{\VV{k}}
+\newcommand{\vl}{\VV{l}}
+\newcommand{\vm}{\VV{m}}
+\newcommand{\vn}{\VV{n}}
+\newcommand{\vo}{\VV{o}}
+\newcommand{\vp}{\VV{p}}
+\newcommand{\vq}{\VV{q}}
+\newcommand{\vr}{\VV{r}}
+\newcommand{\vs}{\VV{s}}
+\newcommand{\vt}{\VV{t}}
+\newcommand{\vu}{\VV{u}}
+\newcommand{\vv}{\VV{v}}
+\newcommand{\vw}{\VV{w}}
+\newcommand{\vx}{\VV{x}}
+\newcommand{\vy}{\VV{y}}
+\newcommand{\vz}{\VV{z}}
+\newcommand{\vA}{\VV{A}}
+\newcommand{\vB}{\VV{B}}
+\newcommand{\vC}{\VV{C}}
+\newcommand{\vD}{\VV{D}}
+\newcommand{\vE}{\VV{E}}
+\newcommand{\vF}{\VV{F}}
+\newcommand{\vG}{\VV{G}}
+\newcommand{\vH}{\VV{H}}
+\newcommand{\vI}{\VV{I}}
+\newcommand{\vJ}{\VV{J}}
+\newcommand{\vK}{\VV{K}}
+\newcommand{\vL}{\VV{L}}
+\newcommand{\vM}{\VV{M}}
+\newcommand{\vN}{\VV{N}}
+\newcommand{\vO}{\VV{O}}
+\newcommand{\vP}{\VV{P}}
+\newcommand{\vQ}{\VV{Q}}
+\newcommand{\vR}{\VV{R}}
+\newcommand{\vS}{\VV{S}}
+\newcommand{\vT}{\VV{T}}
+\newcommand{\vU}{\VV{U}}
+\newcommand{\vV}{\VV{V}}
+\newcommand{\vW}{\VV{W}}
+\newcommand{\vX}{\VV{X}}
+\newcommand{\vY}{\VV{Y}}
+\newcommand{\vZ}{\VV{Z}}
+\newcommand{\vas}{\VV{as}}
+\newcommand{\vbs}{\VV{bs}}
+\newcommand{\vcs}{\VV{cs}}
+\newcommand{\vds}{\VV{ds}}
+\newcommand{\ves}{\VV{es}}
+\newcommand{\vfs}{\VV{fs}}
+\newcommand{\vgs}{\VV{gs}}
+\newcommand{\vhs}{\VV{hs}}
+\newcommand{\vis}{\VV{is}}
+\newcommand{\vjs}{\VV{js}}
+\newcommand{\vks}{\VV{ks}}
+\newcommand{\vls}{\VV{ls}}
+\newcommand{\vms}{\VV{ms}}
+\newcommand{\vns}{\VV{ns}}
+\newcommand{\vos}{\VV{os}}
+\newcommand{\vps}{\VV{ps}}
+\newcommand{\vqs}{\VV{qs}}
+\newcommand{\vrs}{\VV{rs}}
+%\newcommand{\vss}{\VV{ss}}
+\newcommand{\vts}{\VV{ts}}
+\newcommand{\vus}{\VV{us}}
+\newcommand{\vvs}{\VV{vs}}
+\newcommand{\vws}{\VV{ws}}
+\newcommand{\vxs}{\VV{xs}}
+\newcommand{\vys}{\VV{ys}}
+\newcommand{\vzs}{\VV{zs}}
+
+%%% Telescope Identifiers
+
+\newcommand{\ta}{\vec{\VV{a}}}
+\newcommand{\tb}{\vec{\VV{b}}}
+\newcommand{\tc}{\vec{\VV{c}}}
+\newcommand{\td}{\vec{\VV{d}}}
+\newcommand{\te}{\vec{\VV{e}}}
+\newcommand{\tf}{\vec{\VV{f}}}
+\newcommand{\tg}{\vec{\VV{g}}}
+%\newcommand{\th}{\vec{\VV{h}}}
+\newcommand{\ti}{\vec{\VV{i}}}
+\newcommand{\tj}{\vec{\VV{j}}}
+\newcommand{\tk}{\vec{\VV{k}}}
+\newcommand{\tl}{\vec{\VV{l}}}
+\newcommand{\tm}{\vec{\VV{m}}}
+\newcommand{\tn}{\vec{\VV{n}}}
+%\newcommand{\to}{\vec{\VV{o}}}
+\newcommand{\tp}{\vec{\VV{p}}}
+\newcommand{\tq}{\vec{\VV{q}}}
+\newcommand{\tr}{\vec{\VV{r}}}
+\newcommand{\tts}{\vec{\VV{s}}}
+\newcommand{\ttt}{\vec{\VV{t}}}
+\newcommand{\tu}{\vec{\VV{u}}}
+%\newcommand{\tv}{\vec{\VV{v}}}
+\newcommand{\tw}{\vec{\VV{w}}}
+\newcommand{\tx}{\vec{\VV{x}}}
+\newcommand{\ty}{\vec{\VV{y}}}
+\newcommand{\tz}{\vec{\VV{z}}}
+\newcommand{\tA}{\vec{\VV{A}}}
+\newcommand{\tB}{\vec{\VV{B}}}
+\newcommand{\tC}{\vec{\VV{C}}}
+\newcommand{\tD}{\vec{\VV{D}}}
+\newcommand{\tE}{\vec{\VV{E}}}
+\newcommand{\tF}{\vec{\VV{F}}}
+\newcommand{\tG}{\vec{\VV{G}}}
+\newcommand{\tH}{\vec{\VV{H}}}
+\newcommand{\tI}{\vec{\VV{I}}}
+\newcommand{\tJ}{\vec{\VV{J}}}
+\newcommand{\tK}{\vec{\VV{K}}}
+\newcommand{\tL}{\vec{\VV{L}}}
+\newcommand{\tM}{\vec{\VV{M}}}
+\newcommand{\tN}{\vec{\VV{N}}}
+\newcommand{\tO}{\vec{\VV{O}}}
+\newcommand{\tP}{\vec{\VV{P}}}
+\newcommand{\tQ}{\vec{\VV{Q}}}
+\newcommand{\tR}{\vec{\VV{R}}}
+\newcommand{\tS}{\vec{\VV{S}}}
+\newcommand{\tT}{\vec{\VV{T}}}
+\newcommand{\tU}{\vec{\VV{U}}}
+\newcommand{\tV}{\vec{\VV{V}}}
+\newcommand{\tW}{\vec{\VV{W}}}
+\newcommand{\tX}{\vec{\VV{X}}}
+\newcommand{\tY}{\vec{\VV{Y}}}
+\newcommand{\tZ}{\vec{\VV{Z}}}
+
+
+
+%%% Nat
+
+\newcommand{\NatPackage}{
+  \newcommand{\Nat}{\TC{\mathbb{N}}}
+  \newcommand{\Z}{\DC{0}}
+  \newcommand{\suc}{\DC{s}}
+  \newcommand{\NatDecl}{
+    \Data \hg
+    \Axiom{\Nat\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\Z\Hab\Nat} \hg
+    \Rule{\vn\Hab\Nat}
+         {\suc\:\vn\Hab\Nat}
+}}
+
+%%% Bool
+
+\newcommand{\BoolPackage}{
+  \newcommand{\Bool}{\TC{Bool}}
+  \newcommand{\true}{\DC{true}}
+  \newcommand{\false}{\DC{false}}
+  \newcommand{\BoolDecl}{
+    \Data \hg
+    \Axiom{\Bool\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\true\Hab\Bool} \hg
+    \Axiom{\false\Hab\Bool}
+}}
+
+%%% So
+
+\newcommand{\SoPackage}{
+  \newcommand{\So}{\TC{So}}
+  \newcommand{\oh}{\DC{oh}}
+  \newcommand{\SoDecl}{
+    \Data \hg
+    \Rule{\vb\Hab\Bool}
+         {\So\:\vb\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\oh\Hab\So\:\true}
+}}
+
+%%% Unit
+
+\newcommand{\UnitPackage}{
+  \newcommand{\Unit}{\TC{Unit}}
+  \newcommand{\void}{\DC{void}}
+  \newcommand{\UnitDecl}{
+    \Data \hg
+    \Axiom{\Unit\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\void\Hab\Unit}
+}}
+
+%%% Maybe
+
+\newcommand{\MaybePackage}{
+  \newcommand{\Maybe}{\TC{Maybe}}
+  \newcommand{\yes}{\DC{yes}}
+  \newcommand{\no}{\DC{no}}
+  \newcommand{\MaybeDecl}{
+    \Data \hg
+    \Rule{\vA\Hab\Type}
+         {\Maybe\:\vA\Hab\Type} \hg
+    \Where \hg
+    \Rule{\va \Hab \vA}
+         {\yes\:\va\Hab\Maybe\:\vA} \hg
+    \Axiom{\no\Hab\Maybe\:\vA}
+}}
+
+%%% Cross
+
+\newcommand{\pr}[2]{(#1\DC{,}#2)}  %grrrr
+\newcommand{\CrossPackage}{
+  \newcommand{\Cross}{\times}
+  \newcommand{\CrossDecl}{
+    \Data \hg
+    \Rule{\vA,\vB\Hab\Type}
+         {\vA\Cross\vB\Hab\Type} \hg
+    \Where \hg
+    \Rule{\va \Hab \vA \hg \vb\Hab\vB}
+         {\pr{\va}{\vb}\Hab\vA\Cross\vB}
+}}
+
+%%% Fin
+
+\newcommand{\FinPackage}{
+  \newcommand{\Fin}{\TC{Fin}}
+  \newcommand{\fz}{\DC{f0}}
+  \newcommand{\fs}{\DC{fs}}
+  \newcommand{\FinDecl}{
+    \AR{
+    \Data \hg
+    \Rule{\vn\Hab\Nat}
+         {\Fin\:\vn\Hab\Type} \hg \\
+    \Where \hg
+    \begin{array}[t]{c}
+    \Axiom{\fz\Hab\Fin\:(\suc\:\vn)} \hg
+    \Rule{\vi\Hab\Fin\:\vn}
+         {\fs\:\vi\Hab\Fin\:(\suc\:\vn)}
+    \end{array}
+    }
+}}
+
+%%% Vect
+
+\newcommand{\VectPackage}{
+  \newcommand{\Vect}{\TC{Vect}}
+  \newcommand{\vnil}{\varepsilon}
+  \newcommand{\vcons}{\,\dcolon\,}
+  \newcommand{\vsnoc}{\,\dcolon\,}
+  \newcommand{\VectConsDecl}{
+    \Data \hg
+    \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
+         {\Vect\:\vA\:\vn\Hab\Type} \hg
+    \Where \hg \begin{array}[t]{c}
+    \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
+    \Rule{\vx\Hab\vA \hg \vxs\Hab \Vect\:\vA\:\vn }
+         {\vx\vcons\vxs\Hab\Vect\:\vA\:(\suc\vn)}
+    \end{array}
+}
+  \newcommand{\VectSnocDecl}{
+    \Data \hg
+    \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
+         {\Vect\:\vA\:\vn\Hab\Type} \hg
+    \Where \hg \begin{array}[t]{c}
+    \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
+    \Rule{\vxs\Hab \Vect\:\vA\:\vn \hg \vx\Hab\vA}
+         {\vxs\vsnoc\vx\Hab\Vect\:\vA\:(\suc\vn)}
+    \end{array}
+}
+}
+
+%%% Compare
+
+%Data Compare : (x:nat)(y:nat)Type
+%  = lt : (x:nat)(y:nat)(Compare x (plus (S y) x))
+%  | eq : (x:nat)(Compare x x)
+%  | gt : (x:nat)(y:nat)(Compare (plus (S x) y) y);
+
+
+\newcommand{\ComparePackage}{
+  \newcommand{\Compare}{\TC{Compare}}
+  \newcommand{\ltComp}{\DC{lt}}
+  \newcommand{\eqComp}{\DC{eq}}
+  \newcommand{\gtComp}{\DC{gt}}
+  \newcommand{\CompareDecl}{
+    \Data \hg
+    \Rule{\vm\Hab\Nat\hg\vn\Hab\Nat}
+         {\Compare\:\vm\:\vn\Hab\Type} \\
+    \Where \hg\begin{array}[t]{c}
+    \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
+         {\ltComp_{\vx}\:\vy\Hab\Compare\:\vx\:(\FN{plus}\:\vx\:(\suc\:\vy))} \\
+    \Rule{\vx\Hab\Nat}
+         {\eqComp_{\vx}\Hab\Compare\:\vx\:\vx}\\
+    \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
+         {\gtComp_{\vy}\:\vx\Hab\Compare\:(\FN{plus}\:\vy\:(\suc\:\vx))\:\vy} \\
+    \end{array}	 
+  }
+
+%Data CompareM : Type
+%  = ltM : (ydiff:nat)CompareM
+%  | eqM : CompareM
+%  | gtM : (xdiff:nat)CompareM;
+
+  \newcommand{\CompareM}{\TC{Compare^-}}
+  \newcommand{\ltCompM}{\DC{lt^-}}
+  \newcommand{\eqCompM}{\DC{eq^-}}
+  \newcommand{\gtCompM}{\DC{gt^-}}
+  \newcommand{\CompareMDecl}{
+
+     \Data \hg
+     \Axiom{\CompareM\Hab\Type} \\
+     \Where \hg\begin{array}[t]{c}
+     \Rule{\vy\Hab\Nat}
+          {\ltCompM\:\vy\Hab\CompareM} \\
+     \Axiom{\eqCompM\Hab\CompareM}\\
+     \Rule{\vx\Hab\Nat}
+          {\gtCompM\:\vx\Hab\CompareM} \\
+     \end{array}	
+  }
+  \newcommand{\CompareRec}{\FN{CompareRec}}
+  \newcommand{\CompareRecM}{\FN{CompareRec^-}}
+
+}
diff --git a/papers/ivor/llncs.cls b/papers/ivor/llncs.cls
new file mode 100644
--- /dev/null
+++ b/papers/ivor/llncs.cls
@@ -0,0 +1,1190 @@
+% LLNCS DOCUMENT CLASS -- version 2.14 (17-Aug-2004)
+% Springer Verlag LaTeX2e support for Lecture Notes in Computer Science
+%
+%%
+%% \CharacterTable
+%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%%   Digits        \0\1\2\3\4\5\6\7\8\9
+%%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%%   Dollar        \$     Percent       \%     Ampersand     \&
+%%   Acute accent  \'     Left paren    \(     Right paren   \)
+%%   Asterisk      \*     Plus          \+     Comma         \,
+%%   Minus         \-     Point         \.     Solidus       \/
+%%   Colon         \:     Semicolon     \;     Less than     \<
+%%   Equals        \=     Greater than  \>     Question mark \?
+%%   Commercial at \@     Left bracket  \[     Backslash     \\
+%%   Right bracket \]     Circumflex    \^     Underscore    \_
+%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%%   Right brace   \}     Tilde         \~}
+%%
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesClass{llncs}[2004/08/17 v2.14
+^^J LaTeX document class for Lecture Notes in Computer Science]
+% Options
+\let\if@envcntreset\iffalse
+\DeclareOption{envcountreset}{\let\if@envcntreset\iftrue}
+\DeclareOption{citeauthoryear}{\let\citeauthoryear=Y}
+\DeclareOption{oribibl}{\let\oribibl=Y}
+\let\if@custvec\iftrue
+\DeclareOption{orivec}{\let\if@custvec\iffalse}
+\let\if@envcntsame\iffalse
+\DeclareOption{envcountsame}{\let\if@envcntsame\iftrue}
+\let\if@envcntsect\iffalse
+\DeclareOption{envcountsect}{\let\if@envcntsect\iftrue}
+\let\if@runhead\iffalse
+\DeclareOption{runningheads}{\let\if@runhead\iftrue}
+
+\let\if@openbib\iffalse
+\DeclareOption{openbib}{\let\if@openbib\iftrue}
+
+% languages
+\let\switcht@@therlang\relax
+\def\ds@deutsch{\def\switcht@@therlang{\switcht@deutsch}}
+\def\ds@francais{\def\switcht@@therlang{\switcht@francais}}
+
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+
+\ProcessOptions
+
+\LoadClass[twoside]{article}
+\RequirePackage{multicol} % needed for the list of participants, index
+
+\setlength{\textwidth}{12.2cm}
+\setlength{\textheight}{19.3cm}
+\renewcommand\@pnumwidth{2em}
+\renewcommand\@tocrmarg{3.5em}
+%
+\def\@dottedtocline#1#2#3#4#5{%
+  \ifnum #1>\c@tocdepth \else
+    \vskip \z@ \@plus.2\p@
+    {\leftskip #2\relax \rightskip \@tocrmarg \advance\rightskip by 0pt plus 2cm
+               \parfillskip -\rightskip \pretolerance=10000
+     \parindent #2\relax\@afterindenttrue
+     \interlinepenalty\@M
+     \leavevmode
+     \@tempdima #3\relax
+     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
+     {#4}\nobreak
+     \leaders\hbox{$\m@th
+        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
+        mu$}\hfill
+     \nobreak
+     \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
+     \par}%
+  \fi}
+%
+\def\switcht@albion{%
+\def\abstractname{Abstract.}
+\def\ackname{Acknowledgement.}
+\def\andname{and}
+\def\lastandname{\unskip, and}
+\def\appendixname{Appendix}
+\def\chaptername{Chapter}
+\def\claimname{Claim}
+\def\conjecturename{Conjecture}
+\def\contentsname{Table of Contents}
+\def\corollaryname{Corollary}
+\def\definitionname{Definition}
+\def\examplename{Example}
+\def\exercisename{Exercise}
+\def\figurename{Fig.}
+\def\keywordname{{\bf Key words:}}
+\def\indexname{Index}
+\def\lemmaname{Lemma}
+\def\contriblistname{List of Contributors}
+\def\listfigurename{List of Figures}
+\def\listtablename{List of Tables}
+\def\mailname{{\it Correspondence to\/}:}
+\def\noteaddname{Note added in proof}
+\def\notename{Note}
+\def\partname{Part}
+\def\problemname{Problem}
+\def\proofname{Proof}
+\def\propertyname{Property}
+\def\propositionname{Proposition}
+\def\questionname{Question}
+\def\remarkname{Remark}
+\def\seename{see}
+\def\solutionname{Solution}
+\def\subclassname{{\it Subject Classifications\/}:}
+\def\tablename{Table}
+\def\theoremname{Theorem}}
+\switcht@albion
+% Names of theorem like environments are already defined
+% but must be translated if another language is chosen
+%
+% French section
+\def\switcht@francais{%\typeout{On parle francais.}%
+ \def\abstractname{R\'esum\'e.}%
+ \def\ackname{Remerciements.}%
+ \def\andname{et}%
+ \def\lastandname{ et}%
+ \def\appendixname{Appendice}
+ \def\chaptername{Chapitre}%
+ \def\claimname{Pr\'etention}%
+ \def\conjecturename{Hypoth\`ese}%
+ \def\contentsname{Table des mati\`eres}%
+ \def\corollaryname{Corollaire}%
+ \def\definitionname{D\'efinition}%
+ \def\examplename{Exemple}%
+ \def\exercisename{Exercice}%
+ \def\figurename{Fig.}%
+ \def\keywordname{{\bf Mots-cl\'e:}}
+ \def\indexname{Index}
+ \def\lemmaname{Lemme}%
+ \def\contriblistname{Liste des contributeurs}
+ \def\listfigurename{Liste des figures}%
+ \def\listtablename{Liste des tables}%
+ \def\mailname{{\it Correspondence to\/}:}
+ \def\noteaddname{Note ajout\'ee \`a l'\'epreuve}%
+ \def\notename{Remarque}%
+ \def\partname{Partie}%
+ \def\problemname{Probl\`eme}%
+ \def\proofname{Preuve}%
+ \def\propertyname{Caract\'eristique}%
+%\def\propositionname{Proposition}%
+ \def\questionname{Question}%
+ \def\remarkname{Remarque}%
+ \def\seename{voir}
+ \def\solutionname{Solution}%
+ \def\subclassname{{\it Subject Classifications\/}:}
+ \def\tablename{Tableau}%
+ \def\theoremname{Th\'eor\`eme}%
+}
+%
+% German section
+\def\switcht@deutsch{%\typeout{Man spricht deutsch.}%
+ \def\abstractname{Zusammenfassung.}%
+ \def\ackname{Danksagung.}%
+ \def\andname{und}%
+ \def\lastandname{ und}%
+ \def\appendixname{Anhang}%
+ \def\chaptername{Kapitel}%
+ \def\claimname{Behauptung}%
+ \def\conjecturename{Hypothese}%
+ \def\contentsname{Inhaltsverzeichnis}%
+ \def\corollaryname{Korollar}%
+%\def\definitionname{Definition}%
+ \def\examplename{Beispiel}%
+ \def\exercisename{\"Ubung}%
+ \def\figurename{Abb.}%
+ \def\keywordname{{\bf Schl\"usselw\"orter:}}
+ \def\indexname{Index}
+%\def\lemmaname{Lemma}%
+ \def\contriblistname{Mitarbeiter}
+ \def\listfigurename{Abbildungsverzeichnis}%
+ \def\listtablename{Tabellenverzeichnis}%
+ \def\mailname{{\it Correspondence to\/}:}
+ \def\noteaddname{Nachtrag}%
+ \def\notename{Anmerkung}%
+ \def\partname{Teil}%
+%\def\problemname{Problem}%
+ \def\proofname{Beweis}%
+ \def\propertyname{Eigenschaft}%
+%\def\propositionname{Proposition}%
+ \def\questionname{Frage}%
+ \def\remarkname{Anmerkung}%
+ \def\seename{siehe}
+ \def\solutionname{L\"osung}%
+ \def\subclassname{{\it Subject Classifications\/}:}
+ \def\tablename{Tabelle}%
+%\def\theoremname{Theorem}%
+}
+
+% Ragged bottom for the actual page
+\def\thisbottomragged{\def\@textbottom{\vskip\z@ plus.0001fil
+\global\let\@textbottom\relax}}
+
+\renewcommand\small{%
+   \@setfontsize\small\@ixpt{11}%
+   \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
+   \abovedisplayshortskip \z@ \@plus2\p@
+   \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+   \def\@listi{\leftmargin\leftmargini
+               \parsep 0\p@ \@plus1\p@ \@minus\p@
+               \topsep 8\p@ \@plus2\p@ \@minus4\p@
+               \itemsep0\p@}%
+   \belowdisplayskip \abovedisplayskip
+}
+
+\frenchspacing
+\widowpenalty=10000
+\clubpenalty=10000
+
+\setlength\oddsidemargin   {63\p@}
+\setlength\evensidemargin  {63\p@}
+\setlength\marginparwidth  {90\p@}
+
+\setlength\headsep   {16\p@}
+
+\setlength\footnotesep{7.7\p@}
+\setlength\textfloatsep{8mm\@plus 2\p@ \@minus 4\p@}
+\setlength\intextsep   {8mm\@plus 2\p@ \@minus 2\p@}
+
+\setcounter{secnumdepth}{2}
+
+\newcounter {chapter}
+\renewcommand\thechapter      {\@arabic\c@chapter}
+
+\newif\if@mainmatter \@mainmattertrue
+\newcommand\frontmatter{\cleardoublepage
+            \@mainmatterfalse\pagenumbering{Roman}}
+\newcommand\mainmatter{\cleardoublepage
+       \@mainmattertrue\pagenumbering{arabic}}
+\newcommand\backmatter{\if@openright\cleardoublepage\else\clearpage\fi
+      \@mainmatterfalse}
+
+\renewcommand\part{\cleardoublepage
+                 \thispagestyle{empty}%
+                 \if@twocolumn
+                     \onecolumn
+                     \@tempswatrue
+                   \else
+                     \@tempswafalse
+                 \fi
+                 \null\vfil
+                 \secdef\@part\@spart}
+
+\def\@part[#1]#2{%
+    \ifnum \c@secnumdepth >-2\relax
+      \refstepcounter{part}%
+      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+    \else
+      \addcontentsline{toc}{part}{#1}%
+    \fi
+    \markboth{}{}%
+    {\centering
+     \interlinepenalty \@M
+     \normalfont
+     \ifnum \c@secnumdepth >-2\relax
+       \huge\bfseries \partname~\thepart
+       \par
+       \vskip 20\p@
+     \fi
+     \Huge \bfseries #2\par}%
+    \@endpart}
+\def\@spart#1{%
+    {\centering
+     \interlinepenalty \@M
+     \normalfont
+     \Huge \bfseries #1\par}%
+    \@endpart}
+\def\@endpart{\vfil\newpage
+              \if@twoside
+                \null
+                \thispagestyle{empty}%
+                \newpage
+              \fi
+              \if@tempswa
+                \twocolumn
+              \fi}
+
+\newcommand\chapter{\clearpage
+                    \thispagestyle{empty}%
+                    \global\@topnum\z@
+                    \@afterindentfalse
+                    \secdef\@chapter\@schapter}
+\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
+                       \if@mainmatter
+                         \refstepcounter{chapter}%
+                         \typeout{\@chapapp\space\thechapter.}%
+                         \addcontentsline{toc}{chapter}%
+                                  {\protect\numberline{\thechapter}#1}%
+                       \else
+                         \addcontentsline{toc}{chapter}{#1}%
+                       \fi
+                    \else
+                      \addcontentsline{toc}{chapter}{#1}%
+                    \fi
+                    \chaptermark{#1}%
+                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
+                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
+                    \if@twocolumn
+                      \@topnewpage[\@makechapterhead{#2}]%
+                    \else
+                      \@makechapterhead{#2}%
+                      \@afterheading
+                    \fi}
+\def\@makechapterhead#1{%
+% \vspace*{50\p@}%
+  {\centering
+    \ifnum \c@secnumdepth >\m@ne
+      \if@mainmatter
+        \large\bfseries \@chapapp{} \thechapter
+        \par\nobreak
+        \vskip 20\p@
+      \fi
+    \fi
+    \interlinepenalty\@M
+    \Large \bfseries #1\par\nobreak
+    \vskip 40\p@
+  }}
+\def\@schapter#1{\if@twocolumn
+                   \@topnewpage[\@makeschapterhead{#1}]%
+                 \else
+                   \@makeschapterhead{#1}%
+                   \@afterheading
+                 \fi}
+\def\@makeschapterhead#1{%
+% \vspace*{50\p@}%
+  {\centering
+    \normalfont
+    \interlinepenalty\@M
+    \Large \bfseries  #1\par\nobreak
+    \vskip 40\p@
+  }}
+
+\renewcommand\section{\@startsection{section}{1}{\z@}%
+                       {-18\p@ \@plus -4\p@ \@minus -4\p@}%
+                       {12\p@ \@plus 4\p@ \@minus 4\p@}%
+                       {\normalfont\large\bfseries\boldmath
+                        \rightskip=\z@ \@plus 8em\pretolerance=10000 }}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
+                       {-18\p@ \@plus -4\p@ \@minus -4\p@}%
+                       {8\p@ \@plus 4\p@ \@minus 4\p@}%
+                       {\normalfont\normalsize\bfseries\boldmath
+                        \rightskip=\z@ \@plus 8em\pretolerance=10000 }}
+\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+                       {-18\p@ \@plus -4\p@ \@minus -4\p@}%
+                       {-0.5em \@plus -0.22em \@minus -0.1em}%
+                       {\normalfont\normalsize\bfseries\boldmath}}
+\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
+                       {-12\p@ \@plus -4\p@ \@minus -4\p@}%
+                       {-0.5em \@plus -0.22em \@minus -0.1em}%
+                       {\normalfont\normalsize\itshape}}
+\renewcommand\subparagraph[1]{\typeout{LLNCS warning: You should not use
+                  \string\subparagraph\space with this class}\vskip0.5cm
+You should not use \verb|\subparagraph| with this class.\vskip0.5cm}
+
+\DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{"00}
+\DeclareMathSymbol{\Delta}{\mathalpha}{letters}{"01}
+\DeclareMathSymbol{\Theta}{\mathalpha}{letters}{"02}
+\DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{"03}
+\DeclareMathSymbol{\Xi}{\mathalpha}{letters}{"04}
+\DeclareMathSymbol{\Pi}{\mathalpha}{letters}{"05}
+\DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{"06}
+\DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{"07}
+\DeclareMathSymbol{\Phi}{\mathalpha}{letters}{"08}
+\DeclareMathSymbol{\Psi}{\mathalpha}{letters}{"09}
+\DeclareMathSymbol{\Omega}{\mathalpha}{letters}{"0A}
+
+\let\footnotesize\small
+
+\if@custvec
+\def\vec#1{\mathchoice{\mbox{\boldmath$\displaystyle#1$}}
+{\mbox{\boldmath$\textstyle#1$}}
+{\mbox{\boldmath$\scriptstyle#1$}}
+{\mbox{\boldmath$\scriptscriptstyle#1$}}}
+\fi
+
+\def\squareforqed{\hbox{\rlap{$\sqcap$}$\sqcup$}}
+\def\qed{\ifmmode\squareforqed\else{\unskip\nobreak\hfil
+\penalty50\hskip1em\null\nobreak\hfil\squareforqed
+\parfillskip=0pt\finalhyphendemerits=0\endgraf}\fi}
+
+\def\getsto{\mathrel{\mathchoice {\vcenter{\offinterlineskip
+\halign{\hfil
+$\displaystyle##$\hfil\cr\gets\cr\to\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr\gets
+\cr\to\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr\gets
+\cr\to\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
+\gets\cr\to\cr}}}}}
+\def\lid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
+$\displaystyle##$\hfil\cr<\cr\noalign{\vskip1.2pt}=\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr<\cr
+\noalign{\vskip1.2pt}=\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr<\cr
+\noalign{\vskip1pt}=\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
+<\cr
+\noalign{\vskip0.9pt}=\cr}}}}}
+\def\gid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
+$\displaystyle##$\hfil\cr>\cr\noalign{\vskip1.2pt}=\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr>\cr
+\noalign{\vskip1.2pt}=\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr>\cr
+\noalign{\vskip1pt}=\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
+>\cr
+\noalign{\vskip0.9pt}=\cr}}}}}
+\def\grole{\mathrel{\mathchoice {\vcenter{\offinterlineskip
+\halign{\hfil
+$\displaystyle##$\hfil\cr>\cr\noalign{\vskip-1pt}<\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
+>\cr\noalign{\vskip-1pt}<\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
+>\cr\noalign{\vskip-0.8pt}<\cr}}}
+{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
+>\cr\noalign{\vskip-0.3pt}<\cr}}}}}
+\def\bbbr{{\rm I\!R}} %reelle Zahlen
+\def\bbbm{{\rm I\!M}}
+\def\bbbn{{\rm I\!N}} %natuerliche Zahlen
+\def\bbbf{{\rm I\!F}}
+\def\bbbh{{\rm I\!H}}
+\def\bbbk{{\rm I\!K}}
+\def\bbbp{{\rm I\!P}}
+\def\bbbone{{\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l}
+{\rm 1\mskip-4.5mu l} {\rm 1\mskip-5mu l}}}
+\def\bbbc{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm C$}\hbox{\hbox
+to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
+{\setbox0=\hbox{$\textstyle\rm C$}\hbox{\hbox
+to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptstyle\rm C$}\hbox{\hbox
+to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptscriptstyle\rm C$}\hbox{\hbox
+to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}}}
+\def\bbbq{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm
+Q$}\hbox{\raise
+0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}}
+{\setbox0=\hbox{$\textstyle\rm Q$}\hbox{\raise
+0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptstyle\rm Q$}\hbox{\raise
+0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptscriptstyle\rm Q$}\hbox{\raise
+0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}}}
+\def\bbbt{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm
+T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
+{\setbox0=\hbox{$\textstyle\rm T$}\hbox{\hbox
+to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptstyle\rm T$}\hbox{\hbox
+to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptscriptstyle\rm T$}\hbox{\hbox
+to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}}}
+\def\bbbs{{\mathchoice
+{\setbox0=\hbox{$\displaystyle     \rm S$}\hbox{\raise0.5\ht0\hbox
+to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox
+to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}}
+{\setbox0=\hbox{$\textstyle        \rm S$}\hbox{\raise0.5\ht0\hbox
+to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox
+to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptstyle      \rm S$}\hbox{\raise0.5\ht0\hbox
+to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox
+to0pt{\kern0.5\wd0\vrule height0.45\ht0\hss}\box0}}
+{\setbox0=\hbox{$\scriptscriptstyle\rm S$}\hbox{\raise0.5\ht0\hbox
+to0pt{\kern0.4\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox
+to0pt{\kern0.55\wd0\vrule height0.45\ht0\hss}\box0}}}}
+\def\bbbz{{\mathchoice {\hbox{$\mathsf\textstyle Z\kern-0.4em Z$}}
+{\hbox{$\mathsf\textstyle Z\kern-0.4em Z$}}
+{\hbox{$\mathsf\scriptstyle Z\kern-0.3em Z$}}
+{\hbox{$\mathsf\scriptscriptstyle Z\kern-0.2em Z$}}}}
+
+\let\ts\,
+
+\setlength\leftmargini  {17\p@}
+\setlength\leftmargin    {\leftmargini}
+\setlength\leftmarginii  {\leftmargini}
+\setlength\leftmarginiii {\leftmargini}
+\setlength\leftmarginiv  {\leftmargini}
+\setlength  \labelsep  {.5em}
+\setlength  \labelwidth{\leftmargini}
+\addtolength\labelwidth{-\labelsep}
+
+\def\@listI{\leftmargin\leftmargini
+            \parsep 0\p@ \@plus1\p@ \@minus\p@
+            \topsep 8\p@ \@plus2\p@ \@minus4\p@
+            \itemsep0\p@}
+\let\@listi\@listI
+\@listi
+\def\@listii {\leftmargin\leftmarginii
+              \labelwidth\leftmarginii
+              \advance\labelwidth-\labelsep
+              \topsep    0\p@ \@plus2\p@ \@minus\p@}
+\def\@listiii{\leftmargin\leftmarginiii
+              \labelwidth\leftmarginiii
+              \advance\labelwidth-\labelsep
+              \topsep    0\p@ \@plus\p@\@minus\p@
+              \parsep    \z@
+              \partopsep \p@ \@plus\z@ \@minus\p@}
+
+\renewcommand\labelitemi{\normalfont\bfseries --}
+\renewcommand\labelitemii{$\m@th\bullet$}
+
+\setlength\arraycolsep{1.4\p@}
+\setlength\tabcolsep{1.4\p@}
+
+\def\tableofcontents{\chapter*{\contentsname\@mkboth{{\contentsname}}%
+                                                    {{\contentsname}}}
+ \def\authcount##1{\setcounter{auco}{##1}\setcounter{@auth}{1}}
+ \def\lastand{\ifnum\value{auco}=2\relax
+                 \unskip{} \andname\
+              \else
+                 \unskip \lastandname\
+              \fi}%
+ \def\and{\stepcounter{@auth}\relax
+          \ifnum\value{@auth}=\value{auco}%
+             \lastand
+          \else
+             \unskip,
+          \fi}%
+ \@starttoc{toc}\if@restonecol\twocolumn\fi}
+
+\def\l@part#1#2{\addpenalty{\@secpenalty}%
+   \addvspace{2em plus\p@}%  % space above part line
+   \begingroup
+     \parindent \z@
+     \rightskip \z@ plus 5em
+     \hrule\vskip5pt
+     \large               % same size as for a contribution heading
+     \bfseries\boldmath   % set line in boldface
+     \leavevmode          % TeX command to enter horizontal mode.
+     #1\par
+     \vskip5pt
+     \hrule
+     \vskip1pt
+     \nobreak             % Never break after part entry
+   \endgroup}
+
+\def\@dotsep{2}
+
+\def\hyperhrefextend{\ifx\hyper@anchor\@undefined\else
+{chapter.\thechapter}\fi}
+
+\def\addnumcontentsmark#1#2#3{%
+\addtocontents{#1}{\protect\contentsline{#2}{\protect\numberline
+                     {\thechapter}#3}{\thepage}\hyperhrefextend}}
+\def\addcontentsmark#1#2#3{%
+\addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}\hyperhrefextend}}
+\def\addcontentsmarkwop#1#2#3{%
+\addtocontents{#1}{\protect\contentsline{#2}{#3}{0}\hyperhrefextend}}
+
+\def\@adcmk[#1]{\ifcase #1 \or
+\def\@gtempa{\addnumcontentsmark}%
+  \or    \def\@gtempa{\addcontentsmark}%
+  \or    \def\@gtempa{\addcontentsmarkwop}%
+  \fi\@gtempa{toc}{chapter}}
+\def\addtocmark{\@ifnextchar[{\@adcmk}{\@adcmk[3]}}
+
+\def\l@chapter#1#2{\addpenalty{-\@highpenalty}
+ \vskip 1.0em plus 1pt \@tempdima 1.5em \begingroup
+ \parindent \z@ \rightskip \@tocrmarg
+ \advance\rightskip by 0pt plus 2cm
+ \parfillskip -\rightskip \pretolerance=10000
+ \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip
+ {\large\bfseries\boldmath#1}\ifx0#2\hfil\null
+ \else
+      \nobreak
+      \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern
+      \@dotsep mu$}\hfill
+      \nobreak\hbox to\@pnumwidth{\hss #2}%
+ \fi\par
+ \penalty\@highpenalty \endgroup}
+
+\def\l@title#1#2{\addpenalty{-\@highpenalty}
+ \addvspace{8pt plus 1pt}
+ \@tempdima \z@
+ \begingroup
+ \parindent \z@ \rightskip \@tocrmarg
+ \advance\rightskip by 0pt plus 2cm
+ \parfillskip -\rightskip \pretolerance=10000
+ \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip
+ #1\nobreak
+ \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern
+ \@dotsep mu$}\hfill
+ \nobreak\hbox to\@pnumwidth{\hss #2}\par
+ \penalty\@highpenalty \endgroup}
+
+\def\l@author#1#2{\addpenalty{\@highpenalty}
+ \@tempdima=15\p@ %\z@
+ \begingroup
+ \parindent \z@ \rightskip \@tocrmarg
+ \advance\rightskip by 0pt plus 2cm
+ \pretolerance=10000
+ \leavevmode \advance\leftskip\@tempdima %\hskip -\leftskip
+ \textit{#1}\par
+ \penalty\@highpenalty \endgroup}
+
+\setcounter{tocdepth}{0}
+\newdimen\tocchpnum
+\newdimen\tocsecnum
+\newdimen\tocsectotal
+\newdimen\tocsubsecnum
+\newdimen\tocsubsectotal
+\newdimen\tocsubsubsecnum
+\newdimen\tocsubsubsectotal
+\newdimen\tocparanum
+\newdimen\tocparatotal
+\newdimen\tocsubparanum
+\tocchpnum=\z@            % no chapter numbers
+\tocsecnum=15\p@          % section 88. plus 2.222pt
+\tocsubsecnum=23\p@       % subsection 88.8 plus 2.222pt
+\tocsubsubsecnum=27\p@    % subsubsection 88.8.8 plus 1.444pt
+\tocparanum=35\p@         % paragraph 88.8.8.8 plus 1.666pt
+\tocsubparanum=43\p@      % subparagraph 88.8.8.8.8 plus 1.888pt
+\def\calctocindent{%
+\tocsectotal=\tocchpnum
+\advance\tocsectotal by\tocsecnum
+\tocsubsectotal=\tocsectotal
+\advance\tocsubsectotal by\tocsubsecnum
+\tocsubsubsectotal=\tocsubsectotal
+\advance\tocsubsubsectotal by\tocsubsubsecnum
+\tocparatotal=\tocsubsubsectotal
+\advance\tocparatotal by\tocparanum}
+\calctocindent
+
+\def\l@section{\@dottedtocline{1}{\tocchpnum}{\tocsecnum}}
+\def\l@subsection{\@dottedtocline{2}{\tocsectotal}{\tocsubsecnum}}
+\def\l@subsubsection{\@dottedtocline{3}{\tocsubsectotal}{\tocsubsubsecnum}}
+\def\l@paragraph{\@dottedtocline{4}{\tocsubsubsectotal}{\tocparanum}}
+\def\l@subparagraph{\@dottedtocline{5}{\tocparatotal}{\tocsubparanum}}
+
+\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
+ \fi\section*{\listfigurename\@mkboth{{\listfigurename}}{{\listfigurename}}}
+ \@starttoc{lof}\if@restonecol\twocolumn\fi}
+\def\l@figure{\@dottedtocline{1}{0em}{1.5em}}
+
+\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
+ \fi\section*{\listtablename\@mkboth{{\listtablename}}{{\listtablename}}}
+ \@starttoc{lot}\if@restonecol\twocolumn\fi}
+\let\l@table\l@figure
+
+\renewcommand\listoffigures{%
+    \section*{\listfigurename
+      \@mkboth{\listfigurename}{\listfigurename}}%
+    \@starttoc{lof}%
+    }
+
+\renewcommand\listoftables{%
+    \section*{\listtablename
+      \@mkboth{\listtablename}{\listtablename}}%
+    \@starttoc{lot}%
+    }
+
+\ifx\oribibl\undefined
+\ifx\citeauthoryear\undefined
+\renewenvironment{thebibliography}[1]
+     {\section*{\refname}
+      \def\@biblabel##1{##1.}
+      \small
+      \list{\@biblabel{\@arabic\c@enumiv}}%
+           {\settowidth\labelwidth{\@biblabel{#1}}%
+            \leftmargin\labelwidth
+            \advance\leftmargin\labelsep
+            \if@openbib
+              \advance\leftmargin\bibindent
+              \itemindent -\bibindent
+              \listparindent \itemindent
+              \parsep \z@
+            \fi
+            \usecounter{enumiv}%
+            \let\p@enumiv\@empty
+            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+      \if@openbib
+        \renewcommand\newblock{\par}%
+      \else
+        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
+      \fi
+      \sloppy\clubpenalty4000\widowpenalty4000%
+      \sfcode`\.=\@m}
+     {\def\@noitemerr
+       {\@latex@warning{Empty `thebibliography' environment}}%
+      \endlist}
+\def\@lbibitem[#1]#2{\item[{[#1]}\hfill]\if@filesw
+     {\let\protect\noexpand\immediate
+     \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
+\newcount\@tempcntc
+\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
+  \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do
+    {\@ifundefined
+       {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bfseries
+        ?}\@warning
+       {Citation `\@citeb' on page \thepage \space undefined}}%
+    {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}%
+     \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne
+       \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}%
+     \else
+      \advance\@tempcntb\@ne
+      \ifnum\@tempcntb=\@tempcntc
+      \else\advance\@tempcntb\m@ne\@citeo
+      \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}}
+\def\@citeo{\ifnum\@tempcnta>\@tempcntb\else
+               \@citea\def\@citea{,\,\hskip\z@skip}%
+               \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else
+               {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else
+                \def\@citea{--}\fi
+      \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi}
+\else
+\renewenvironment{thebibliography}[1]
+     {\section*{\refname}
+      \small
+      \list{}%
+           {\settowidth\labelwidth{}%
+            \leftmargin\parindent
+            \itemindent=-\parindent
+            \labelsep=\z@
+            \if@openbib
+              \advance\leftmargin\bibindent
+              \itemindent -\bibindent
+              \listparindent \itemindent
+              \parsep \z@
+            \fi
+            \usecounter{enumiv}%
+            \let\p@enumiv\@empty
+            \renewcommand\theenumiv{}}%
+      \if@openbib
+        \renewcommand\newblock{\par}%
+      \else
+        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
+      \fi
+      \sloppy\clubpenalty4000\widowpenalty4000%
+      \sfcode`\.=\@m}
+     {\def\@noitemerr
+       {\@latex@warning{Empty `thebibliography' environment}}%
+      \endlist}
+      \def\@cite#1{#1}%
+      \def\@lbibitem[#1]#2{\item[]\if@filesw
+        {\def\protect##1{\string ##1\space}\immediate
+      \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
+   \fi
+\else
+\@cons\@openbib@code{\noexpand\small}
+\fi
+
+\def\idxquad{\hskip 10\p@}% space that divides entry from number
+
+\def\@idxitem{\par\hangindent 10\p@}
+
+\def\subitem{\par\setbox0=\hbox{--\enspace}% second order
+                \noindent\hangindent\wd0\box0}% index entry
+
+\def\subsubitem{\par\setbox0=\hbox{--\,--\enspace}% third
+                \noindent\hangindent\wd0\box0}% order index entry
+
+\def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}
+
+\renewenvironment{theindex}
+               {\@mkboth{\indexname}{\indexname}%
+                \thispagestyle{empty}\parindent\z@
+                \parskip\z@ \@plus .3\p@\relax
+                \let\item\par
+                \def\,{\relax\ifmmode\mskip\thinmuskip
+                             \else\hskip0.2em\ignorespaces\fi}%
+                \normalfont\small
+                \begin{multicols}{2}[\@makeschapterhead{\indexname}]%
+                }
+                {\end{multicols}}
+
+\renewcommand\footnoterule{%
+  \kern-3\p@
+  \hrule\@width 2truecm
+  \kern2.6\p@}
+  \newdimen\fnindent
+  \fnindent1em
+\long\def\@makefntext#1{%
+    \parindent \fnindent%
+    \leftskip \fnindent%
+    \noindent
+    \llap{\hb@xt@1em{\hss\@makefnmark\ }}\ignorespaces#1}
+
+\long\def\@makecaption#1#2{%
+  \vskip\abovecaptionskip
+  \sbox\@tempboxa{{\bfseries #1.} #2}%
+  \ifdim \wd\@tempboxa >\hsize
+    {\bfseries #1.} #2\par
+  \else
+    \global \@minipagefalse
+    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+  \fi
+  \vskip\belowcaptionskip}
+
+\def\fps@figure{htbp}
+\def\fnum@figure{\figurename\thinspace\thefigure}
+\def \@floatboxreset {%
+        \reset@font
+        \small
+        \@setnobreak
+        \@setminipage
+}
+\def\fps@table{htbp}
+\def\fnum@table{\tablename~\thetable}
+\renewenvironment{table}
+               {\setlength\abovecaptionskip{0\p@}%
+                \setlength\belowcaptionskip{10\p@}%
+                \@float{table}}
+               {\end@float}
+\renewenvironment{table*}
+               {\setlength\abovecaptionskip{0\p@}%
+                \setlength\belowcaptionskip{10\p@}%
+                \@dblfloat{table}}
+               {\end@dblfloat}
+
+\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname
+  ext@#1\endcsname}{#1}{\protect\numberline{\csname
+  the#1\endcsname}{\ignorespaces #2}}\begingroup
+    \@parboxrestore
+    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+  \endgroup}
+
+% LaTeX does not provide a command to enter the authors institute
+% addresses. The \institute command is defined here.
+
+\newcounter{@inst}
+\newcounter{@auth}
+\newcounter{auco}
+\newdimen\instindent
+\newbox\authrun
+\newtoks\authorrunning
+\newtoks\tocauthor
+\newbox\titrun
+\newtoks\titlerunning
+\newtoks\toctitle
+
+\def\clearheadinfo{\gdef\@author{No Author Given}%
+                   \gdef\@title{No Title Given}%
+                   \gdef\@subtitle{}%
+                   \gdef\@institute{No Institute Given}%
+                   \gdef\@thanks{}%
+                   \global\titlerunning={}\global\authorrunning={}%
+                   \global\toctitle={}\global\tocauthor={}}
+
+\def\institute#1{\gdef\@institute{#1}}
+
+\def\institutename{\par
+ \begingroup
+ \parskip=\z@
+ \parindent=\z@
+ \setcounter{@inst}{1}%
+ \def\and{\par\stepcounter{@inst}%
+ \noindent$^{\the@inst}$\enspace\ignorespaces}%
+ \setbox0=\vbox{\def\thanks##1{}\@institute}%
+ \ifnum\c@@inst=1\relax
+   \gdef\fnnstart{0}%
+ \else
+   \xdef\fnnstart{\c@@inst}%
+   \setcounter{@inst}{1}%
+   \noindent$^{\the@inst}$\enspace
+ \fi
+ \ignorespaces
+ \@institute\par
+ \endgroup}
+
+\def\@fnsymbol#1{\ensuremath{\ifcase#1\or\star\or{\star\star}\or
+   {\star\star\star}\or \dagger\or \ddagger\or
+   \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger
+   \or \ddagger\ddagger \else\@ctrerr\fi}}
+
+\def\inst#1{\unskip$^{#1}$}
+\def\fnmsep{\unskip$^,$}
+\def\email#1{{\tt#1}}
+\AtBeginDocument{\@ifundefined{url}{\def\url#1{#1}}{}%
+\@ifpackageloaded{babel}{%
+\@ifundefined{extrasenglish}{}{\addto\extrasenglish{\switcht@albion}}%
+\@ifundefined{extrasfrenchb}{}{\addto\extrasfrenchb{\switcht@francais}}%
+\@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht@deutsch}}%
+}{\switcht@@therlang}%
+}
+\def\homedir{\~{ }}
+
+\def\subtitle#1{\gdef\@subtitle{#1}}
+\clearheadinfo
+%
+\renewcommand\maketitle{\newpage
+  \refstepcounter{chapter}%
+  \stepcounter{section}%
+  \setcounter{section}{0}%
+  \setcounter{subsection}{0}%
+  \setcounter{figure}{0}
+  \setcounter{table}{0}
+  \setcounter{equation}{0}
+  \setcounter{footnote}{0}%
+  \begingroup
+    \parindent=\z@
+    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
+    \if@twocolumn
+      \ifnum \col@number=\@ne
+        \@maketitle
+      \else
+        \twocolumn[\@maketitle]%
+      \fi
+    \else
+      \newpage
+      \global\@topnum\z@   % Prevents figures from going at top of page.
+      \@maketitle
+    \fi
+    \thispagestyle{empty}\@thanks
+%
+    \def\\{\unskip\ \ignorespaces}\def\inst##1{\unskip{}}%
+    \def\thanks##1{\unskip{}}\def\fnmsep{\unskip}%
+    \instindent=\hsize
+    \advance\instindent by-\headlineindent
+    \if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else
+       \addcontentsline{toc}{title}{\the\toctitle}\fi
+    \if@runhead
+       \if!\the\titlerunning!\else
+         \edef\@title{\the\titlerunning}%
+       \fi
+       \global\setbox\titrun=\hbox{\small\rm\unboldmath\ignorespaces\@title}%
+       \ifdim\wd\titrun>\instindent
+          \typeout{Title too long for running head. Please supply}%
+          \typeout{a shorter form with \string\titlerunning\space prior to
+                   \string\maketitle}%
+          \global\setbox\titrun=\hbox{\small\rm
+          Title Suppressed Due to Excessive Length}%
+       \fi
+       \xdef\@title{\copy\titrun}%
+    \fi
+%
+    \if!\the\tocauthor!\relax
+      {\def\and{\noexpand\protect\noexpand\and}%
+      \protected@xdef\toc@uthor{\@author}}%
+    \else
+      \def\\{\noexpand\protect\noexpand\newline}%
+      \protected@xdef\scratch{\the\tocauthor}%
+      \protected@xdef\toc@uthor{\scratch}%
+    \fi
+    \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c@auco}}%
+    \addcontentsline{toc}{author}{\toc@uthor}%
+    \if@runhead
+       \if!\the\authorrunning!
+         \value{@inst}=\value{@auth}%
+         \setcounter{@auth}{1}%
+       \else
+         \edef\@author{\the\authorrunning}%
+       \fi
+       \global\setbox\authrun=\hbox{\small\unboldmath\@author\unskip}%
+       \ifdim\wd\authrun>\instindent
+          \typeout{Names of authors too long for running head. Please supply}%
+          \typeout{a shorter form with \string\authorrunning\space prior to
+                   \string\maketitle}%
+          \global\setbox\authrun=\hbox{\small\rm
+          Authors Suppressed Due to Excessive Length}%
+       \fi
+       \xdef\@author{\copy\authrun}%
+       \markboth{\@author}{\@title}%
+     \fi
+  \endgroup
+  \setcounter{footnote}{\fnnstart}%
+  \clearheadinfo}
+%
+\def\@maketitle{\newpage
+ \markboth{}{}%
+ \def\lastand{\ifnum\value{@inst}=2\relax
+                 \unskip{} \andname\
+              \else
+                 \unskip \lastandname\
+              \fi}%
+ \def\and{\stepcounter{@auth}\relax
+          \ifnum\value{@auth}=\value{@inst}%
+             \lastand
+          \else
+             \unskip,
+          \fi}%
+ \begin{center}%
+ \let\newline\\
+ {\Large \bfseries\boldmath
+  \pretolerance=10000
+  \@title \par}\vskip .8cm
+\if!\@subtitle!\else {\large \bfseries\boldmath
+  \vskip -.65cm
+  \pretolerance=10000
+  \@subtitle \par}\vskip .8cm\fi
+ \setbox0=\vbox{\setcounter{@auth}{1}\def\and{\stepcounter{@auth}}%
+ \def\thanks##1{}\@author}%
+ \global\value{@inst}=\value{@auth}%
+ \global\value{auco}=\value{@auth}%
+ \setcounter{@auth}{1}%
+{\lineskip .5em
+\noindent\ignorespaces
+\@author\vskip.35cm}
+ {\small\institutename}
+ \end{center}%
+ }
+
+% definition of the "\spnewtheorem" command.
+%
+% Usage:
+%
+%     \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font}
+% or  \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font}
+% or  \spnewtheorem*{env_nam}{caption}{cap_font}{body_font}
+%
+% New is "cap_font" and "body_font". It stands for
+% fontdefinition of the caption and the text itself.
+%
+% "\spnewtheorem*" gives a theorem without number.
+%
+% A defined spnewthoerem environment is used as described
+% by Lamport.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\@thmcountersep{}
+\def\@thmcounterend{.}
+
+\def\spnewtheorem{\@ifstar{\@sthm}{\@Sthm}}
+
+% definition of \spnewtheorem with number
+
+\def\@spnthm#1#2{%
+  \@ifnextchar[{\@spxnthm{#1}{#2}}{\@spynthm{#1}{#2}}}
+\def\@Sthm#1{\@ifnextchar[{\@spothm{#1}}{\@spnthm{#1}}}
+
+\def\@spxnthm#1#2[#3]#4#5{\expandafter\@ifdefinable\csname #1\endcsname
+   {\@definecounter{#1}\@addtoreset{#1}{#3}%
+   \expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand
+     \csname the#3\endcsname \noexpand\@thmcountersep \@thmcounter{#1}}%
+   \expandafter\xdef\csname #1name\endcsname{#2}%
+   \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#4}{#5}}%
+                              \global\@namedef{end#1}{\@endtheorem}}}
+
+\def\@spynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname
+   {\@definecounter{#1}%
+   \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}%
+   \expandafter\xdef\csname #1name\endcsname{#2}%
+   \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#3}{#4}}%
+                               \global\@namedef{end#1}{\@endtheorem}}}
+
+\def\@spothm#1[#2]#3#4#5{%
+  \@ifundefined{c@#2}{\@latexerr{No theorem environment `#2' defined}\@eha}%
+  {\expandafter\@ifdefinable\csname #1\endcsname
+  {\global\@namedef{the#1}{\@nameuse{the#2}}%
+  \expandafter\xdef\csname #1name\endcsname{#3}%
+  \global\@namedef{#1}{\@spthm{#2}{\csname #1name\endcsname}{#4}{#5}}%
+  \global\@namedef{end#1}{\@endtheorem}}}}
+
+\def\@spthm#1#2#3#4{\topsep 7\p@ \@plus2\p@ \@minus4\p@
+\refstepcounter{#1}%
+\@ifnextchar[{\@spythm{#1}{#2}{#3}{#4}}{\@spxthm{#1}{#2}{#3}{#4}}}
+
+\def\@spxthm#1#2#3#4{\@spbegintheorem{#2}{\csname the#1\endcsname}{#3}{#4}%
+                    \ignorespaces}
+
+\def\@spythm#1#2#3#4[#5]{\@spopargbegintheorem{#2}{\csname
+       the#1\endcsname}{#5}{#3}{#4}\ignorespaces}
+
+\def\@spbegintheorem#1#2#3#4{\trivlist
+                 \item[\hskip\labelsep{#3#1\ #2\@thmcounterend}]#4}
+
+\def\@spopargbegintheorem#1#2#3#4#5{\trivlist
+      \item[\hskip\labelsep{#4#1\ #2}]{#4(#3)\@thmcounterend\ }#5}
+
+% definition of \spnewtheorem* without number
+
+\def\@sthm#1#2{\@Ynthm{#1}{#2}}
+
+\def\@Ynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname
+   {\global\@namedef{#1}{\@Thm{\csname #1name\endcsname}{#3}{#4}}%
+    \expandafter\xdef\csname #1name\endcsname{#2}%
+    \global\@namedef{end#1}{\@endtheorem}}}
+
+\def\@Thm#1#2#3{\topsep 7\p@ \@plus2\p@ \@minus4\p@
+\@ifnextchar[{\@Ythm{#1}{#2}{#3}}{\@Xthm{#1}{#2}{#3}}}
+
+\def\@Xthm#1#2#3{\@Begintheorem{#1}{#2}{#3}\ignorespaces}
+
+\def\@Ythm#1#2#3[#4]{\@Opargbegintheorem{#1}
+       {#4}{#2}{#3}\ignorespaces}
+
+\def\@Begintheorem#1#2#3{#3\trivlist
+                           \item[\hskip\labelsep{#2#1\@thmcounterend}]}
+
+\def\@Opargbegintheorem#1#2#3#4{#4\trivlist
+      \item[\hskip\labelsep{#3#1}]{#3(#2)\@thmcounterend\ }}
+
+\if@envcntsect
+   \def\@thmcountersep{.}
+   \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
+\else
+   \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape}
+   \if@envcntreset
+      \@addtoreset{theorem}{section}
+   \else
+      \@addtoreset{theorem}{chapter}
+   \fi
+\fi
+
+%definition of divers theorem environments
+\spnewtheorem*{claim}{Claim}{\itshape}{\rmfamily}
+\spnewtheorem*{proof}{Proof}{\itshape}{\rmfamily}
+\if@envcntsame % alle Umgebungen wie Theorem.
+   \def\spn@wtheorem#1#2#3#4{\@spothm{#1}[theorem]{#2}{#3}{#4}}
+\else % alle Umgebungen mit eigenem Zaehler
+   \if@envcntsect % mit section numeriert
+      \def\spn@wtheorem#1#2#3#4{\@spxnthm{#1}{#2}[section]{#3}{#4}}
+   \else % nicht mit section numeriert
+      \if@envcntreset
+         \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
+                                   \@addtoreset{#1}{section}}
+      \else
+         \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4}
+                                   \@addtoreset{#1}{chapter}}%
+      \fi
+   \fi
+\fi
+\spn@wtheorem{case}{Case}{\itshape}{\rmfamily}
+\spn@wtheorem{conjecture}{Conjecture}{\itshape}{\rmfamily}
+\spn@wtheorem{corollary}{Corollary}{\bfseries}{\itshape}
+\spn@wtheorem{definition}{Definition}{\bfseries}{\itshape}
+\spn@wtheorem{example}{Example}{\itshape}{\rmfamily}
+\spn@wtheorem{exercise}{Exercise}{\itshape}{\rmfamily}
+\spn@wtheorem{lemma}{Lemma}{\bfseries}{\itshape}
+\spn@wtheorem{note}{Note}{\itshape}{\rmfamily}
+\spn@wtheorem{problem}{Problem}{\itshape}{\rmfamily}
+\spn@wtheorem{property}{Property}{\itshape}{\rmfamily}
+\spn@wtheorem{proposition}{Proposition}{\bfseries}{\itshape}
+\spn@wtheorem{question}{Question}{\itshape}{\rmfamily}
+\spn@wtheorem{solution}{Solution}{\itshape}{\rmfamily}
+\spn@wtheorem{remark}{Remark}{\itshape}{\rmfamily}
+
+\def\@takefromreset#1#2{%
+    \def\@tempa{#1}%
+    \let\@tempd\@elt
+    \def\@elt##1{%
+        \def\@tempb{##1}%
+        \ifx\@tempa\@tempb\else
+            \@addtoreset{##1}{#2}%
+        \fi}%
+    \expandafter\expandafter\let\expandafter\@tempc\csname cl@#2\endcsname
+    \expandafter\def\csname cl@#2\endcsname{}%
+    \@tempc
+    \let\@elt\@tempd}
+
+\def\theopargself{\def\@spopargbegintheorem##1##2##3##4##5{\trivlist
+      \item[\hskip\labelsep{##4##1\ ##2}]{##4##3\@thmcounterend\ }##5}
+                  \def\@Opargbegintheorem##1##2##3##4{##4\trivlist
+      \item[\hskip\labelsep{##3##1}]{##3##2\@thmcounterend\ }}
+      }
+
+\renewenvironment{abstract}{%
+      \list{}{\advance\topsep by0.35cm\relax\small
+      \leftmargin=1cm
+      \labelwidth=\z@
+      \listparindent=\z@
+      \itemindent\listparindent
+      \rightmargin\leftmargin}\item[\hskip\labelsep
+                                    \bfseries\abstractname]}
+    {\endlist}
+
+\newdimen\headlineindent             % dimension for space between
+\headlineindent=1.166cm              % number and text of headings.
+
+\def\ps@headings{\let\@mkboth\@gobbletwo
+   \let\@oddfoot\@empty\let\@evenfoot\@empty
+   \def\@evenhead{\normalfont\small\rlap{\thepage}\hspace{\headlineindent}%
+                  \leftmark\hfil}
+   \def\@oddhead{\normalfont\small\hfil\rightmark\hspace{\headlineindent}%
+                 \llap{\thepage}}
+   \def\chaptermark##1{}%
+   \def\sectionmark##1{}%
+   \def\subsectionmark##1{}}
+
+\def\ps@titlepage{\let\@mkboth\@gobbletwo
+   \let\@oddfoot\@empty\let\@evenfoot\@empty
+   \def\@evenhead{\normalfont\small\rlap{\thepage}\hspace{\headlineindent}%
+                  \hfil}
+   \def\@oddhead{\normalfont\small\hfil\hspace{\headlineindent}%
+                 \llap{\thepage}}
+   \def\chaptermark##1{}%
+   \def\sectionmark##1{}%
+   \def\subsectionmark##1{}}
+
+\if@runhead\ps@headings\else
+\ps@empty\fi
+
+\setlength\arraycolsep{1.4\p@}
+\setlength\tabcolsep{1.4\p@}
+
+\endinput
+%end of file llncs.cls
diff --git a/papers/ivor/macros.ltx b/papers/ivor/macros.ltx
new file mode 100644
--- /dev/null
+++ b/papers/ivor/macros.ltx
@@ -0,0 +1,954 @@
+%\usepackage{amstex}
+\usepackage{amssymb}
+\usepackage{latexsym}
+\usepackage{eepic}
+
+
+%%%%%%%%% INFERENCE RULES
+
+\newlength{\rulevgap}
+\setlength{\rulevgap}{0.05in}
+\newlength{\ruleheight}
+\newlength{\ruledepth}
+\newsavebox{\rulebox}
+\newlength{\GapLength}
+\newcommand{\gap}[1]{\settowidth{\GapLength}{#1} \hspace*{\GapLength}}
+\newcommand{\dotstep}[2]{\begin{tabular}[b]{@{}c@{}}
+                         #1\\$\vdots$\\#2
+                         \end{tabular}}
+\newlength{\fracwid}
+\newcommand{\dotfrac}[2]{\settowidth{\fracwid}{$\frac{#1}{#2}$}
+                         \addtolength{\fracwid}{0.1in}
+                         \begin{tabular}[b]{@{}c@{}}
+                         $#1$\\
+                         \parbox[c][0.02in][t]{\fracwid}{\dotfill} \\
+                         $#2$\\
+                         \end{tabular}}
+\newcommand{\Rule}[2]{\savebox{\rulebox}[\width][b]                         %
+                              {\( \frac{\raisebox{0in} {\( #1 \)}}       %
+                                       {\raisebox{-0.03in}{\( #2 \)}} \)}   %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\Case}[2]{\savebox{\rulebox}[\width][b]                         %
+                              {\( \dotfrac{\raisebox{0in} {\( #1 \)}}       %
+                                       {\raisebox{-0.03in}{\( #2 \)}} \)}   %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\Axiom}[1]{\savebox{\rulebox}[\width][b]                        %
+                               {$\frac{}{\raisebox{-0.03in}{$#1$}}$}        %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\RuleSide}[3]{\gap{$#2$} \hspace*{0.1in}               %
+                            \Rule{#1}{#3}                          %
+                          \hspace*{0.1in}$#2$}
+\newcommand{\AxiomSide}[2]{\gap{$#1$} \hspace*{0.1in}              %
+                             \Axiom{#2}                            %
+                           \hspace*{0.1in}$#1$}
+\newcommand{\RULE}[1]{\textbf{#1}}
+\newcommand{\hg}{\hspace{0.2in}}
+
+\newcommand{\ProofState}
+                      [2]{\parbox{10cm}{\AR{\hg\AR{#1}\\\Axiom{\hg#2\hg}}}}
+
+%%%%%%%%%%%% TRISTUFF
+
+\newcommand{\btr}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+\blacken\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\end{picture}
+}
+
+\newcommand{\btl}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+\blacken\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\end{picture}
+}
+
+\newcommand{\wtr}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+%\blacken\path(57,192)(57,12)(12,102)
+%	(57,192)(57,192)
+\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\end{picture}
+}
+
+\newcommand{\wtl}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+%\blacken\path(12,192)(12,12)(57,102)
+%	(12,192)(12,192)
+\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\end{picture}
+}
+
+
+
+%%%%%%%%%%%% FONTS
+
+\newcommand{\TC}[1]{\mathsf{#1}}
+\newcommand{\DC}[1]{\mathsf{#1}}
+\newcommand{\VV}[1]{\mathit{#1}}
+\newcommand{\FN}[1]{\mathbf{#1}}
+\newcommand{\HFN}[1]{\mathtt{#1}}
+\newcommand{\RW}[1]{\underline{\textrm{#1}}}
+\newcommand{\MO}[1]{\mbox{\textsc{#1}}}
+
+\newcommand{\HF}[1]{\mathtt{#1}}
+
+\newcommand{\MV}[1]{\nhole\mathit{#1}}
+\newcommand{\Lang}[1]{\mathsf{#1}}
+\newcommand{\Name}[1]{\mathit{#1}}
+
+\newcommand{\demph}[1]{\textbf{#1}}
+\newcommand{\remph}[1]{\emph{#1}}
+
+%%%% Keywords for meta operations
+\newcommand{\IF}{\;\RW{if}\;\;}
+\newcommand{\THEN}{\RW{then}}
+\newcommand{\ELSE}{\RW{else}}
+\newcommand{\AND}{\RW{and}}
+\newcommand{\Otherwise}{\RW{otherwise}}
+\newcommand{\Do}{\RW{do}}
+\newcommand{\Return}{\RW{return}}
+
+\newcommand{\CASE}{\RW{case}}
+\newcommand{\LET}{\RW{let}}
+\newcommand{\IN}{\RW{in}}
+\newcommand{\of}{\RW{of}}
+
+\newcommand{\CLASS}{\mathtt{class}}
+\newcommand{\INSTANCE}{\mathtt{instance}}
+
+%%%%%%%%%%%% GROUPING
+
+\newcommand{\G}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-10)
+\end{picture}
+}
+
+\newcommand{\E}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-2)(4,-2)
+\end{picture}
+}
+
+%\newcommand{\C}{
+%\setlength{\unitlength}{1pt}
+%\begin{picture}(4,10)(0,0)
+%\path(4,8)(2,8)(2,-2)(4,-2)
+%\end{picture}
+%}
+
+\newcommand{\M}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-2)(6,-2)
+\end{picture}
+}
+
+\newcommand{\F}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(4,8)(2,8)(2,-6)
+\end{picture}
+}
+
+\newcommand{\K}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(0,8)(4,8)
+\end{picture}
+}
+
+\newcommand{\J}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(0,-2)(4,-2)
+\end{picture}
+}
+
+\newcommand{\W}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\end{picture}
+}
+
+
+
+%%%%%%%%%%%% GUBBINS
+
+\newcommand{\mathskip}{\medskip}
+
+\newcommand{\fbx}[1]{\fbox{$#1$}}
+\newcommand{\stk}[1]{\begin{array}{c}#1\end{array}}
+%\newcommand{\DM}[1]{\hg\mbox{$#1$}}
+\newcommand{\DM}[1]{\mathskip\par\(#1\)\mathskip}
+\newcommand{\mbx}[1]{\mathskip\par\noindent\(#1\)\mathskip}
+\newcommand{\AR}[1]{\begin{array}[t]{@{}l}#1\end{array}}
+\newcommand{\ARt}[1]{\begin{array}[t]{@{}l@{}cl}#1\end{array}}
+\newcommand{\ARc}[1]{\begin{array}{@{}l}#1\end{array}}
+\newcommand{\ARd}[1]{\begin{array}[t]{cl}#1\end{array}}
+\newcommand{\EA}[1]{\begin{array}[t]{r@{}c@{}l}#1\end{array}}
+\newcommand{\A}{@{\:}c}
+%\newcommand{\R}{@{\:}r}
+\newcommand{\CA}{c}
+\newcommand{\LA}{l}
+\newcommand{\PAc}[2]{\begin{array}{l#1@{}r@{}l}#2\end{array}}
+\newcommand{\PA}[2]{\begin{array}[t]{l@{\:}l#1@{}r@{\:}l}#2\end{array}}
+\newcommand{\DTREE}[3]{\begin{array}[t]{l#1@{}r@{\:}l#2}#3\end{array}}
+\newcommand{\IDTREE}[2]{%
+  \begin{array}[t]{l@{\:}c@{\:}l@{\:}r@{\:}l#1}#2\end{array}}
+\newcommand{\IA}[2]
+   {\begin{array}[t]{l@{\:}r@{\:}c@{\:}l@{\:}#1@{\:}r@{\:}l}#2\end{array}}
+\newcommand{\IAc}[2]
+   {\begin{array}[c]{r@{\:}c@{\:}l@{\:}#1@{}r@{}l}#2\end{array}}
+\newcommand{\CS}[1]{\left\lfloor\begin{array}{@{}l}#1\end{array}\right.}
+\newcommand{\BY}[3]{\multicolumn{2}{l}{\;\RW{by}\; #1} \\ %
+    \multicolumn{#2}{l}{\CS{#3}} }
+\newcommand{\WITH}[3]{\multicolumn{2}{l}{\;\RW{with}\; #1} \\ %
+    \multicolumn{#2}{l}{\CS{#3}} }
+\newcommand{\WithBy}{\RW{with-by}}
+\newcommand{\Wb}[1]{\WithBy& #1}
+\newcommand{\By}[1]{\multicolumn{2}{l}{\Leftarrow #1}}
+\newcommand{\andby}{\Leftarrow}
+\newcommand{\MyWith}[1]{\multicolumn{2}{l}{|\;#1}}
+\newcommand{\Byr}[1]{\;\RW{by}\; #1}
+
+\renewcommand{\Bar}{|}
+\newcommand{\Bart}{\settowidth{\GapLength}{$\Bar$}%
+                   \raisebox{6pt}[0pt][0pt]{$\Bar$}%
+                   \hspace*{-1\GapLength}%
+                   \Bar}
+\newcommand{\With}[1]{\Bar & #1}
+\newcommand{\Witt}[1]{\Bart & #1}
+
+\newcommand{\B}{@{\:}r@{\:}c}
+\newcommand{\Ret}[1]{\multicolumn{2}{l}{\cq #1}}
+\newcommand{\MRet}[2]{\multicolumn{#1}{l}{\cq #2}}
+\newcommand{\HRet}[1]{\multicolumn{2}{l}{\hq #1}}
+\newcommand{\MHRet}[2]{\multicolumn{#1}{l}{\hq #2}}
+\newcommand{\IRet}[1]{\multicolumn{2}{l}{\iq #1}}
+\newcommand{\IMRet}[2]{\multicolumn{#1}{l}{\iq #2}}
+\newcommand{\MoRet}[1]{\multicolumn{2}{l}{\mq #1}}
+\newcommand{\MMoRet}[2]{\multicolumn{#1}{l}{\mq #2}}
+\newcommand{\Data}{\RW{data}}
+\newcommand{\Where}{\RW{where}}
+\newcommand{\Let}{\RW{let}}
+\newcommand{\Fact}{\RW{fact}}
+\newcommand{\Rec}[1]{#1\textbf{-Rec}}
+\newcommand{\Memo}[1]{#1\textbf{-Memo}}
+\newcommand{\Elim}[1]{#1\textbf{-Elim}}
+\newcommand{\Cases}[1]{#1\textbf{-Case}}
+\newcommand{\View}[1]{#1\textbf{-View}}
+\newcommand{\As}[2]{#1 \:\RW{as}\: #2}
+\newcommand{\nhole}{\Box}
+\newcommand{\turq}{\:\vdash_?\:}
+\renewcommand{\split}{\;\lhd\;}
+\newcommand{\CType}[2]{\{#1 \split\; #2\}}
+\newcommand{\CC}[2]{(#1)\:#2}
+\newcommand{\UP}[2]{#1 | \{#2\}}
+\newcommand{\Ured}{\:\Downarrow\:}
+\newcommand{\gdd}{\prec}
+\newcommand{\HC}[1]{\left<#1\right>}
+\newcommand{\HT}[2]{\left<#1 \hab #2\right>}
+
+\newcommand{\view}{\RW{view}}
+\newcommand{\ecase}{\RW{case}}
+\newcommand{\rec}{\RW{rec}}
+
+\newcommand{\If}{\mathsf{if}}
+\newcommand{\Then}{\mathsf{then}}
+\newcommand{\Else}{\mathsf{else}}
+\newcommand{\elim}{\RW{elim}}
+
+\newcommand{\Payload}{\mathsf{type}}
+\newcommand{\Any}{\mathsf{Some}}
+
+\newcommand{\lbl}[2]{\langle #1 \Hab #2 \rangle}
+\newcommand{\call}[2]{\RW{call}\:\langle#1\rangle\:#2}
+\newcommand{\return}[1]{\RW{return}\:#1}
+
+\newcommand{\Remark}[1]{\noindent\textbf{Remark:} #1}
+
+\newcommand{\DBOX}[2]{\fbox{\parbox{#1}{\textbf{Definition:}#2}}}
+
+\newcommand{\FIG}[3]{\begin{figure}[h]\DM{#1}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\FFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\FFIGTC}[3]{\begin{figure*}[t]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure*}}
+\newcommand{\VFIG}[3]{\begin{figure}[h]\begin{boxedverbatim}#1\end{boxedverbatim}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\PFIG}[3]{\begin{figure}[p]\begin{center}\fbox{\DM{#1}}\end{center}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\CFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
+
+\newcommand{\TFIG}[4]{\begin{figure}[h]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure}}
+\newcommand{\TFIGTC}[4]{\begin{figure*}[t]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure*}}
+
+\newcommand{\RESFIG}[3]{
+\TFIG{|l|c|c|c|c|c|c|c|c|}{
+\hline
+    & \multicolumn{4}{c|}{\Naive{} compilation} &
+          \multicolumn{4}{|c|}{Optimised compilation} \\
+\cline{2-9}
+\raisebox{1.5ex}[0pt]{Program} & Instrs & Thunks & Cells &
+Accesses & Instructions & Thunks & Cells & Accesses \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+\hline
+}{#2}{#3}}
+
+\newcommand{\NEWRESFIG}[3]{
+\TFIG{|l|l|c|c|c|c|}{
+\hline
+%    & \multicolumn{4}{c|}{\Naive{} compilation} &
+%          \multicolumn{4}{|c|}{Optimised compilation} \\
+%\cline{2-9}
+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+}{#2}{#3}}
+
+\newcommand{\NEWRESFIGTC}[3]{
+\TFIGTC{|l|l|c|c|c|c|}{
+\hline
+%    & \multicolumn{4}{c|}{\Naive{} compilation} &
+%          \multicolumn{4}{|c|}{Optimised compilation} \\
+%\cline{2-9}
+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+}{#2}{#3}}
+
+\newcommand{\RESLINE}[9]{
+& \Naive{} & #2 & #3 & #5 & #4 \\
+#1
+& Optimised & #6 & #7 & #9 & #8 \\
+}
+\newcommand{\RESCHANGE}[4]{
+& Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
+\hline
+}
+\newcommand{\RESCHANGEa}[5]{
+#5 & Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
+\hline
+}
+
+%%%%%%%%%%%% PUNCTUATION
+
+\newcommand{\pad}[2]{#1#2#1}
+
+\newcommand{\hab}{\pad{\,}{:}}
+\newcommand{\Hab}{\pad{\;}{:}}
+\newcommand{\HHab}{\pad{\;}{::}}
+
+%%%%%%%%%%%% TYPE
+
+\newcommand{\Type}{\star}
+
+
+%%%%%%%%%%%%% ARROWS
+
+\newcommand{\To}{\pad{\:}{\rightarrow}}
+%\newcommand{\car}{\vartriangleright}
+
+%%%%%%%%%%%%% QUANTIFIERS
+
+\newcommand{\lam}[2]{\lambda#1\pad{\!}{:}#2}
+\newcommand{\fbind}[3]{(#1\Hab#2)\to#3}
+\newcommand{\all}[2]{\forall#1\pad{\!}{:}#2}
+\newcommand{\hole}[2]{?#1\pad{\!}{:}#2}
+\newcommand{\guess}[3]{?#1\pad{\!}{:}#2\approx#3}
+\newcommand{\remlam}[2]{\lambda\{#1\pad{\!}{:}#2\}}
+\newcommand{\remall}[2]{\forall\{#1\pad{\!}{:}#2\}}
+\newcommand{\allpi}[2]{\Pi#1\pad{\!}{:}#2}
+\newcommand{\ali}[2]{\forall#1|#2}
+\newcommand{\exi}[2]{\exists#1\pad{\!}{:}#2}
+\newcommand{\wit}[2]{\ang{#1,#2}}
+\newcommand{\X}{\times}
+\newcommand{\sig}[2]{\Sigma#1\pad{\!}{:}#2}
+
+\newcommand{\SC}{.\:}
+
+\newcommand{\letbind}[3]{\mathsf{let}\:#1{:}#2\:=\:#3\:\mathsf{in}}
+\newcommand{\ifthen}[3]{\mathsf{if}\:#1\:\mathsf{then}\:#2\:\mathsf{else}\:#3}
+
+%%%%%%%%%%%%% EQUALITIES
+
+\newcommand{\cq}{\pad{\:}{\mapsto}}
+\newcommand{\xq}{\pad{}{\doteq}}
+\newcommand{\pq}{\pad{\:}{=}}
+\newcommand{\dq}{\pad{\:}{:=}}
+\newcommand{\iq}{\pad{\:}{\leadsto}}
+\newcommand{\mq}{\Longrightarrow}
+\newcommand{\retq}{\Rightarrow}
+\newcommand{\hq}{\pad{\:}{=}}
+\newcommand{\defq}{\mapsto}
+
+\newcommand{\refl}{\TC{refl}}
+
+
+
+
+%%%%%%%%%%%%% CATSTUFF
+
+\newlength{\Lwibrs}
+\newlength{\Lwobrs}
+\newsavebox{\Bwibrs}
+\newsavebox{\Bwobrs}
+\newcommand{\Db}[5]{%
+  \savebox{\Bwobrs}[\width][b]{$#5$}%
+  \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right#3$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left#1\pad{\hspace*{-0.25\Lwibrs}}{\usebox{\Bwibrs}}\right#4}
+\newcommand{\LDb}[3]{%
+  \savebox{\Bwobrs}[\width][b]{$#3$}%
+  \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right.$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left#1\hspace*{-0.4\Lwibrs}\usebox{\Bwibrs}\right.}
+\newcommand{\RDb}[3]{%
+  \savebox{\Bwobrs}[\width][b]{$#3$}%
+  \savebox{\Bwibrs}[\width][b]{$\left.\usebox{\Bwobrs}\right#1$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left.\usebox{\Bwibrs}\hspace*{-0.4\Lwibrs}\right#2}
+\newcommand{\Sc}{\Db{[}{[}{]}{]}}
+\newcommand{\Mo}{\Db{|}{>}{<}{|}}
+\newcommand{\MoL}{\LDb{|}{>}}
+\newcommand{\MoR}{\RDb{<}{|}}
+
+\newcommand{\car}{\mbox{$-\!\triangleright$}}
+\newcommand{\io}[1]{\iota_{#1}}
+\newcommand{\cc}{\diamond}
+
+
+%%%%%%%%%%%%% FNS
+
+\newcommand{\Wk}{\Uparrow}
+
+%%%%%%%%%%%%% Transformation
+
+\newcommand{\Transform}[3]{\textsc{Trans}\:_{\Name{#1}}
+   \interp{#2}\:\mq\:#3}
+%\:[\:#2\:\Longrightarrow\:#3\:]}
+\newcommand{\Morphism}[2]{\textsc{Morphism}\:#1\:\Longrightarrow\:#2}
+\newcommand{\MI}[1]{\begin{array}{ll} #1 \end{array}\\}
+\newcommand{\MorphItem}[2]{& #1 \:\Longrightarrow\: #2}
+
+%%%%%%%%%%%%% Stuff
+
+% Motive and methods
+
+\newcommand{\motive}{\vP}
+\newcommand{\meth}[1]{\vm_{#1}}
+
+% Tuples
+\newcommand{\tuple}[1]{\langle#1\rangle}
+\newcommand{\Tuple}[1]{\mathsf{Tuple}}
+\newcommand{\proj}{\mathsf{proj}}
+\newcommand{\app}{\mathrm{+\!+}}
+
+% Commenting out
+\newcommand{\ig}[1]{[#1]}
+\newcommand{\rem}[1]{\{\!#1\!\}}
+\newcommand{\igc}[1]{[#1]}
+\newcommand{\remc}[1]{\{\!#1\!\}}
+
+
+\newcommand{\ind}{\hspace*{0.1cm}}
+
+% Content free type
+\newcommand{\CF}{\TC{CF}}
+\newcommand{\cf}{\DC{cf}}
+
+% Error token
+\newcommand{\error}{\DC{error}}
+\newcommand{\fail}{\perp}
+
+% Constructor stripping
+\newcommand{\conarg}[2]{#1!#2}
+
+\newcommand{\Vect}{\TC{Vect}}
+\newcommand{\VectM}{\TC{Vect^-}}
+\newcommand{\Vnil}{\DC{\epsilon}}
+\newcommand{\Vcons}{\DC{::}}
+
+\newcommand{\Vsnoc}{\DC{::}}
+
+\newcommand{\VnilM}{\DC{\epsilon^-}}
+\newcommand{\VconsM}{\DC{::^-}}
+
+\newcommand{\Vnilcase}{\VV{vNilCase}}
+\newcommand{\Vconscase}{\VV{vConsCase}}
+
+\newcommand{\DSigma}{\TC{Sigma}}
+\newcommand{\Exists}{\DC{Exists}}
+
+\newcommand{\ListPair}[2]{\sig{#1}{\List\:\vA}.#2 = \FN{length}\:#1}
+\newcommand{\lpNilDef}{\lpNil{\FN{refl}\:\Z}}
+\newcommand{\lpNil}[1]{(\nil\:\vA,#1)}
+\newcommand{\lpConsDef}[3]{\lpCons{#1}{(\FN{fst\:#2})}{\FN{resp}\:(\FN{snd}\:#2)}}
+\newcommand{\lpCons}[3]{(\cons\:#1\:#2,#3)}
+\newcommand{\lp}[2]{(#1, #2)}
+
+\newcommand{\VnilTop}{\DC{vNil}^\ast}
+\newcommand{\VconsTop}{\DC{vCons}^\ast}
+
+\newcommand{\VnilBot}{\DC{\epsilon}^-}
+\newcommand{\VconsBot}{\DC{::}^-}
+
+\newcommand{\VectTop}{\TC{Vect}^\ast}
+\newcommand{\VectBot}{\TC{Vect}^-}
+
+\newcommand{\VectDrop}{\FN{vectDropIdx}}
+\newcommand{\VectRebuild}{\FN{vectRebuild}}
+
+\newcommand{\Prop}{\TC{Prop}}
+\newcommand{\Set}{\TC{Set}}
+\newcommand{\CoqType}{\TC{Type}}
+
+\newcommand{\List}{\TC{List}}
+\newcommand{\nil}{\DC{nil}}
+\newcommand{\cons}{\DC{cons}}
+
+\newcommand{\Zip}{\TC{Tsil}}
+\newcommand{\zip}{\FN{tsil}}
+\newcommand{\zipcons}{\FN{tsilcons}}
+\newcommand{\snoc}{\DC{Snoc}}
+\newcommand{\lin}{\DC{Empty}}
+
+\newcommand{\BigInt}{\TC{BigInt}}
+\newcommand{\False}{\TC{False}}
+\newcommand{\Unit}{\TC{True}}
+\newcommand{\UnitI}{\DC{()}}
+
+\newcommand{\genType}{\TC{X}}
+\newcommand{\genIndicesDec}{\tb\Hab\tB}
+\newcommand{\genIndices}{\tb}
+\newcommand{\genConArgsDec}[1]{\vec{\VV{a_#1}}\Hab\vec{\VV{A_#1}}}
+\newcommand{\genConArgs}[1]{\vec{\VV{a_#1}}}
+\newcommand{\genConIndicesDec}[1]{\vec{\VV{b_#1}}\Hab\vec{\VV{B_#1}}}
+\newcommand{\genConIndices}[1]{\vec{\VV{b_#1}}}
+\newcommand{\genCon}[1]{\DC{x}_#1}
+
+\newcommand{\genTypeTop}{\TC{X^\ast}}
+\newcommand{\genTypeBot}{\TC{X^-}}
+
+\newcommand{\genTypeDrop}{\FN{XDropIdx}}
+\newcommand{\genTypeRebuild}{\FN{XRebuild}}
+
+\newcommand{\HTerm}{\texttt{Term}}
+\newcommand{\Term}{\TC{Term}}
+\newcommand{\Var}{\DC{var}}
+\newcommand{\Lam}{\DC{lam}}
+\newcommand{\App}{\DC{app}}
+\newcommand{\TermM}{\TC{Term^-}}
+\newcommand{\VarM}{\DC{var^-}}
+\newcommand{\LamM}{\DC{lam^-}}
+\newcommand{\AppM}{\DC{app^-}}
+\newcommand{\Env}{\TC{Env}}
+\newcommand{\SType}{\TC{STy}}
+\newcommand{\farrow}{\Rightarrow}
+\newcommand{\lookup}{\FN{lookup}}
+
+\newcommand{\source}{\Lang{TT}}
+\newcommand{\target}{\Lang{ExTT}}
+\newcommand{\runtime}{\Lang{RunTT}}
+
+\newcommand{\lt}{\TC{<}}
+\newcommand{\ltO}{\DC{ltO}}
+\newcommand{\ltS}{\DC{ltS}}
+
+\newcommand{\interp}[1]{\llbracket #1 \rrbracket}
+\newcommand{\inferrable}[2]{\FN{inferrable}(#1,#2)}
+\newcommand{\mkPat}{\FN{mkPat}}
+
+\newcommand{\FinM}{\TC{Fin^-}}
+\newcommand{\fzM}{\DC{f0^-}}
+\newcommand{\fsM}{\DC{fs^-}}
+
+\newcommand{\concat}{\mathrm{++}}
+
+%\newcommand{\bottom}{\perp}
+
+% Reductions
+
+\newcommand{\reduces}{\rhd}
+\newcommand{\translation}{\Rightarrow}
+%\newcommand{\reducesn}[1]{\reduces\hspace*{-0.15cm}_{#1}}
+%\newcommand{\reducesto}{\reduces\hspace*{-0.15cm}^{*}}
+\newcommand{\reducesn}[1]{\reduces_{#1}}
+\newcommand{\reducesto}{\reduces^{*}}
+
+% Equality
+
+\newcommand{\Refl}{\DC{refl}}
+\newcommand{\leZ}{\DC{O_{\le}}}
+\newcommand{\leS}{\DC{S_{\le}}}
+
+% Random elimination things
+
+\newcommand{\lte}{\TC{\leq}}
+\newcommand{\lten}{\DC{leN}}
+\newcommand{\lteO}{\DC{leO}}
+\newcommand{\lteS}{\DC{leS}}
+
+\newcommand{\ltelim}{\Elim{\lt}}
+\newcommand{\leelim}{\Elim{\lte}}
+
+\newcommand{\dD}{\TC{D}}
+\newcommand{\delim}{\Elim{\TC{D}}}
+\newcommand{\drec}{\Rec{\TC{D}}}
+\newcommand{\dcase}{\Cases{\TC{D}}}
+\newcommand{\dview}{\View{\TC{D}}}
+\newcommand{\dmemo}{\Memo{\TC{D}}}
+\newcommand{\natrec}{\Rec{\Nat}}
+\newcommand{\natmemo}{\Memo{\Nat}}
+\newcommand{\natmemogen}{\Nat\textbf{-MemoGen}}
+\newcommand{\natelim}{\Elim{\Nat}}
+\newcommand{\boolcase}{\Cases{\Bool}}
+\newcommand{\vectrec}{\Rec{\Vect}}
+\newcommand{\vectelim}{\Elim{\Vect}}
+\newcommand{\listrec}{\Rec{\List}}
+\newcommand{\listelim}{\Elim{\List}}
+\newcommand{\finrec}{\Rec{\Fin}}
+\newcommand{\finelim}{\Elim{\Fin}}
+\newcommand{\natcase}{\Cases{\Nat}}
+\newcommand{\vectcase}{\Cases{\Vect}}
+\newcommand{\natdoublerec}{\Nat\textbf{-double-elim}}
+\newcommand{\eqelim}{=\textbf{-elim}}
+\newcommand{\falsecase}{\Cases{\False}}
+
+% Code
+\newcommand{\Haskell}[1]{\begin{quotation}\begin{verbatim}#1\end{verbatim}\end{quotation}}
+
+% Quicksort
+
+\newcommand{\QSView}{\TC{QuickSort}}
+\newcommand{\qsempty}{\DC{empty}}
+\newcommand{\partition}{\DC{partition}}
+\newcommand{\qsview}{\FN{mkQuickSort}}
+
+% More gubbins
+
+\newcommand{\converts}{\simeq}
+\newcommand{\cumul}{\preceq}
+\newcommand{\whnf}{\Downarrow}
+\newcommand{\elem}{\in}
+\newcommand{\proves}{\vdash}
+\newcommand{\biimplies}{\Longleftrightarrow}
+
+\newcommand{\lc}{\lambda_{\mathsf{AC}}}
+\newcommand{\zed}{\mathbb{Z}}
+
+% Haskell keywords
+
+\newcommand{\hdata}{\mathtt{data}}
+\newcommand{\newtype}{\mathtt{newtype}}
+%\newcommand{\htype}{\mathtt{type}}
+
+\newcommand{\HTC}[1]{\mathtt{#1}}
+\newcommand{\HDC}[1]{\mathtt{#1}}
+
+% Nobby
+
+\newcommand{\Value}{\HTC{Value}}
+\newcommand{\VGamma}{\HTC{Env}}
+\newcommand{\Ctxt}{\HTC{Ctxt}}
+\newcommand{\Defs}{\HTC{Defs}}
+\newcommand{\ECtxt}{\HTC{ECtxt}}
+\newcommand{\TCtxt}{\HTC{TCtxt}}
+\newcommand{\VG}{\HDC{Env}}
+\newcommand{\Model}{\HTC{Model}}
+\newcommand{\Const}{\HTC{Const}}
+\newcommand{\Normal}{\HTC{Normal}}
+\newcommand{\Scope}{\HTC{Scope}}
+\newcommand{\Kripke}{\HTC{Kripke}}
+\newcommand{\Weakening}{\HTC{Weakening}}
+\newcommand{\Ready}{\HTC{Ready}}
+\newcommand{\Blocked}{\HTC{Blocked}}
+\newcommand{\Spine}{\HTC{Spine}}
+
+\newcommand{\BV}{\HDC{BV}}
+\newcommand{\BCon}{\HDC{BCon}}
+\newcommand{\BTyCon}{\HDC{BTyCon}}
+\newcommand{\RCon}{\HDC{RCon}}
+\newcommand{\RTyCon}{\HDC{RTyCon}}
+\newcommand{\BElim}{\HDC{BElim}}
+\newcommand{\DV}{\HDC{V}}
+\newcommand{\DP}{\HDC{P}}
+
+\newcommand{\MR}{\HDC{R}}
+\newcommand{\MB}{\HDC{B}}
+\newcommand{\DSc}{\HDC{Sc}}
+\newcommand{\DKr}{\HDC{Kr}}
+\newcommand{\DWk}{\HDC{Wk}}
+\newcommand{\DSnoc}{\HDC{;}}
+\newcommand{\DType}{\HDC{Type}}
+\newcommand{\DName}{\HDC{Name}}
+\newcommand{\DInt}{\HDC{Int}}
+\newcommand{\DString}{\HDC{String}}
+\newcommand{\DElim}{\HDC{Elim}}
+\newcommand{\Empty}{\HDC{\emptyset}}
+
+\newcommand{\ConCode}{\HTC{ConCode}}
+\newcommand{\ElimRule}{\HTC{ElimRule}}
+
+\newcommand{\DConst}{\HDC{Const}}
+\newcommand{\DCon}{\HDC{Con}}
+\newcommand{\DTyCon}{\HDC{TyCon}}
+\newcommand{\RConst}{\HDC{RConst}}
+\newcommand{\RLam}{\HDC{RLam}}
+\newcommand{\RPi}{\HDC{RPi}}
+\newcommand{\DLam}{\HDC{Lam}}
+\newcommand{\DLet}{\HDC{Let}}
+\newcommand{\DPi}{\HDC{Pi}}
+\newcommand{\DApp}{\HDC{App}}
+
+\newcommand{\TMaybe}{\HTC{Maybe}}
+\newcommand{\DNothing}{\HDC{Nothing}}
+\newcommand{\DJust}{\HDC{Just}}
+
+
+% G-machine and heap
+
+\newcommand{\PUSH}{\mathsf{PUSH}}
+\newcommand{\PUSHNAME}{\mathsf{PUSHNAME}}
+\newcommand{\POP}{\mathsf{DISCARD}}
+\newcommand{\PUSHFUN}{\mathsf{PUSHFUN}}
+\newcommand{\APPLY}{\mathsf{MKAP}}
+\newcommand{\EVAL}{\mathsf{EVAL}}
+\newcommand{\GCON}{\mathsf{MKCON}}
+\newcommand{\GTUP}{\mathsf{MKTUP}}
+\newcommand{\GTYPE}{\mathsf{MKTYPE}}
+\newcommand{\UPDATE}{\mathsf{UPDATE}}
+\newcommand{\RET}{\mathsf{RET}}
+\newcommand{\UNWIND}{\mathsf{UNWIND}}
+\newcommand{\CASEJUMP}{\mathsf{CASEJUMP}}
+\newcommand{\LABEL}{\mathsf{LABEL}}
+\newcommand{\MOVE}{\mathsf{MOVE}}
+\newcommand{\JUMP}{\mathsf{JUMP}}
+\newcommand{\SPLIT}{\mathsf{SPLIT}}
+\newcommand{\SQUEEZE}{\mathsf{SQUEEZE}}
+\newcommand{\JFUN}{\mathsf{JFUN}}
+\newcommand{\PROJ}{\mathsf{PROJ}}
+\newcommand{\ERROR}{\mathsf{ERROR}}
+\newcommand{\SLIDE}{\mathsf{SLIDE}}
+\newcommand{\ALLOC}{\mathsf{ALLOC}}
+
+\newcommand{\PUSHBIG}{\mathsf{PUSHBIG}}
+\newcommand{\PUSHBASIC}{\mathsf{PUSHBASIC}}
+\newcommand{\PUSHINT}{\mathsf{PUSHINT}}
+\newcommand{\PUSHBOOL}{\mathsf{PUSHBOOL}}
+\newcommand{\GET}{\mathsf{GET}}
+\newcommand{\MKINT}{\mathsf{MKINT}}
+\newcommand{\MKBOOL}{\mathsf{MKBOOL}}
+\newcommand{\ADD}{\mathsf{ADD}}
+\newcommand{\SUB}{\mathsf{SUB}}
+\newcommand{\MULT}{\mathsf{MULT}}
+\newcommand{\LT}{\mathsf{LT}}
+\newcommand{\EQ}{\mathsf{EQ}}
+\newcommand{\GT}{\mathsf{GT}}
+\newcommand{\JTRUE}{\mathsf{JTRUE}}
+
+\newcommand{\APP}{\mathsf{APP}}
+\newcommand{\FUN}{\mathsf{FUN}}
+\newcommand{\CON}{\mathsf{CON}}
+\newcommand{\TYCON}{\mathsf{TYCON}}
+\newcommand{\TUP}{\mathsf{TUP}}
+\newcommand{\TYPE}{\mathsf{TYPE}}
+\newcommand{\INT}{\mathsf{INT}}
+\newcommand{\BIGINT}{\mathsf{BIGINT}}
+\newcommand{\BOOL}{\mathsf{BOOL}}
+\newcommand{\HOLE}{\mathsf{HOLE}}
+
+% G machine translation scheme
+
+\newcommand{\sinterp}[1]{\mathcal{S}\interp{#1}}
+\newcommand{\sinterpm}[1]{\mathcal{S}\AR{\interp{#1}}}
+\newcommand{\einterp}[3]{\mathcal{E}\interp{#1}\:#2\:#3}
+\newcommand{\cinterp}[3]{\mathcal{C}\interp{#1}\:#2\:#3}
+\newcommand{\binterp}[3]{\mathcal{B}\interp{#1}\:#2\:#3}
+\newcommand{\rinterp}[3]{\mathcal{R}\interp{#1}\:#2\:#3}
+\newcommand{\iinterp}[3]{\mathcal{I}\interp{#1}\:#2\:#3}
+\newcommand{\len}[1]{\MO{length}(#1)}
+
+\newcommand{\casecomp}[2]{\mathcal{I}(#1,\left\{\ARc{#2}\right\})}
+\newcommand{\casecompA}[3]{\mathcal{I}(#1,\left\{\ARc{#2}\right\}[#3])}
+\newcommand{\ischeme}{\mathcal{I}}
+
+% tail call markup
+
+\newcommand{\tailcall}{\mathsf{tail}}
+
+% Trees
+
+\newcommand{\Tree}{\TC{Tree}}
+\newcommand{\Leaf}{\DC{Leaf}}
+\newcommand{\Node}{\DC{Node}}
+\newcommand{\treecase}{\Cases{\Tree}}
+
+% Languages
+
+\newcommand{\Coq}{\textsc{Coq}}
+\newcommand{\Lego}{\textsc{Lego}}
+\newcommand{\Oleg}{\textsc{Oleg}}
+\newcommand{\Alf}{\textsc{Alf}}
+\newcommand{\Epigram}{\textsc{Epigram}}
+\newcommand{\SystemF}{System $\mathcal{F}$}
+\newcommand{\Iswim}{\textsc{Iswim}}
+\newcommand{\Cynthia}{\textit{C$^Y$\hspace*{-0.1cm}NTHIA}}
+
+% Accessibility
+
+\newcommand{\Acc}{\TC{Acc}}
+\newcommand{\acc}{\DC{acc}}
+\newcommand{\qsAcc}{\TC{qsAcc}}
+\newcommand{\qsNil}{\DC{qsNil}}
+\newcommand{\qsCons}{\DC{qsCons}}
+\newcommand{\allQsAcc}{\FN{allQsAcc}}
+
+% Lazy shortcuts
+
+\newcommand{\naive}{na\"{\i}ve}
+\newcommand{\Naive}{Na\"{\i}ve}
+
+% Conor's bits
+
+\newcommand{\remem}[1]{\left|#1\right|}
+\newcommand{\idsb}{\MO{id}}
+\newcommand{\ang}[1]{\langle#1\rangle}
+
+\newcommand{\vePm}[1]{\vP #1 \vm_{\Vnil} #1 \vm_{\Vcons}}%
+\newcommand{\vcrhs}{\vm_{\Vcons}\:\vk\:\va\:\vv\:%
+                     (\vectelim\:\vA\:\vk\:\vv\:\vePm{\:})}%
+
+\newcommand{\igV}[2]{#1^{\ig{#2}}}
+\newcommand{\remV}[2]{#1^{\rem{#2}}}
+
+\newcommand{\FIXME}[1]{[\textbf{FIXME}: #1]}
+%\newcommand{\FIXME}[1]{\wibble}
+
+% More gubbins
+
+\newcommand{\Between}{\TC{between}}
+\newcommand{\bZ}{\DC{bO}}
+\newcommand{\bZZS}{\DC{bOOs}}
+\newcommand{\bZSS}{\DC{b0ss}}
+\newcommand{\bSSS}{\DC{bsss}}
+\newcommand{\betelim}{\Elim{\Between}}
+\newcommand{\betrhs}[1]{\motive#1\meth{\bZ}#1\meth{\bZZS}#1\meth{\bZSS}#1\meth{\bSSS}}
+
+
+\newcommand{\valenv}{\TC{ValEnv}}
+\newcommand{\vempty}{\DC{empty}}
+\newcommand{\vextend}{\DC{extend}}
+
+\newcommand{\EpiVal}{\TC{Epigram}}
+\newcommand{\unsafeCoerce}{\HF{unsafeCoerce\mbox{\texttt{\#}}}}
+
+\newcommand{\qq}{\mbox{\texttt{"}}}
+\newcommand{\impossible}{\RW{Impossible}}
+
+\newcommand{\Real}{\mathbb{R}}
+
+\newcommand{\DoubleRec}{\TC{DoubleElim}}
+\newcommand{\DoubleOn}{\DC{Double_{\Z\vn}}}
+\newcommand{\DoubleSO}{\DC{Double_{\suc\Z}}}
+\newcommand{\DoubleSS}{\DC{Double_{\suc\suc}}}
+
+\newcommand{\doublerec}{\textbf{double-elim}}
+
+\newcommand{\set}{\TC{DList}}
+\newcommand{\setuser}{\TC{DListTop}}
+\newcommand{\setempty}{\emptyset}
+\newcommand{\setinsert}{\DC{insert}}
+
+
+%%%% Type systems
+
+\newcommand{\stlc}{\lambda\hspace*{-0.15cm}\to}
+\newcommand{\plc}{\lambda2}
+\newcommand{\dlc}{\lambda{}P}
+
+\newcommand{\EC}{\mathcal{E}}
+
+%%%% reductions
+
+\newcommand{\betared}{\iq\hspace*{-0.15cm}_{\beta}}
+\newcommand{\deltared}{\iq\hspace*{-0.15cm}_{\delta}}
+\newcommand{\gammared}{\iq\hspace*{-0.15cm}_{\gamma}}
+\newcommand{\etared}{\iq\hspace*{-0.15cm}_{\eta}}
+\newcommand{\iotared}{\iq\hspace*{-0.15cm}_{\iota}}
+\newcommand{\rhored}{\iq\hspace*{-0.15cm}_{\rho}}
+
+%%%% ExTT rules
+
+\newcommand{\exconverts}{\stackrel{\mathsf{Ex}}{\converts}}
+\newcommand{\excumul}{\stackrel{\mathsf{Ex}}{\cumul}}
+\newcommand{\exequiv}{\stackrel{\mathsf{Ex}}{\equiv}}
+\newcommand{\exreduces}{\stackrel{\mathsf{Ex}}\reduces}
+\newcommand{\exreducesto}{\stackrel{\mathsf{Ex}}{\reducesto}}
+\newcommand{\exreducesn}[1]{\exreduces_{#1}}
+
+\newcommand{\ttequiv}{\stackrel{\mathsf{TT}}{\equiv}}
+\newcommand{\ttreduces}{\stackrel{\mathsf{TT}}\reduces}
+\newcommand{\ttreducesn}[1]{\ttreduces_{#1}}
+
+%%% Type synthesis
+
+\newcommand{\hastype}{\Longrightarrow}
+\newcommand{\whnfs}{\twoheadrightarrow}
+\newcommand{\conv}{\converts}
+
+\newcommand{\exhastype}{\stackrel{\mathsf{Ex}}{\hastype}}
+\newcommand{\exwhnfs}{\stackrel{\mathsf{Ex}}{\whnfs}}
+\newcommand{\exconv}{\stackrel{\mathsf{Ex}}{\conv}}
+\newcommand{\exproves}{\stackrel{\mathsf{Ex}}{\proves}}
+
+\newcommand{\tthastype}{\stackrel{\mathsf{TT}}{\hastype}}
+\newcommand{\ttwhnfs}{\stackrel{\mathsf{TT}}{\whnfs}}
+\newcommand{\ttconv}{\stackrel{\mathsf{TT}}{\conv}}
+\newcommand{\ttproves}{\stackrel{\mathsf{TT}}{\proves}}
+
+%%% Lightning
+
+\newcommand{\light}[1]{\lightning^{#1}}
+\newcommand{\LHab}[1]{\pad{\;}{:^{#1}}}
+\newcommand{\llam}[3]{\lambda#1\pad{\!}{:}^{#2}#3}
+\newcommand{\lall}[3]{\forall#1\pad{\!}{:}^{#2}#3}
+\newcommand{\lapp}[3]{#1(#2)^{#3}}
+\newcommand{\larg}[2]{(#1)^{#2}}
+
+\newcommand{\RName}[1]{\hspace*{0.1in}\mathsf{#1}}
diff --git a/papers/ivor/tactics.tex b/papers/ivor/tactics.tex
new file mode 100644
--- /dev/null
+++ b/papers/ivor/tactics.tex
@@ -0,0 +1,489 @@
+\section{The \Ivor{} Library}
+
+%Given the basic operations defined in section \ref{holeops}, we can
+%create a library of tactics. 
+
+The \Ivor{} library allows the incremental, type directed development
+of $\source$ terms.  In this section, I will introduce the basic
+tactics available to the library user, along with the Haskell
+interface for constructing and manipulating $\source$ terms. This
+section includes only the most basic operations; the API is however
+fully documented on the
+web\footnote{\url{http://www.cs.st-andrews.ac.uk/~eb/Ivor/doc/}}.
+
+\subsection{Definitions and Context}
+
+The central data type is \hdecl{Context} (representing $\Gamma$ in the
+typing rules), which is an abstract type holding information about
+inductive types and function definitions as well as the current proof
+state. All operations are defined with respect to the context. An
+empty context is contructed with \hdecl{emptyContext :: Context}.
+
+Terms may be represented several ways; either as concrete syntax (a
+\texttt{String}), an abstract internal representation (\texttt{Term})
+or as a Haskell data structure (\texttt{ViewTerm}). A typeclass
+\hdecl{IsTerm} is defined, which allows each of these to be converted
+into the internal representation. This typeclass has one method:
+
+\begin{verbatim}
+class IsTerm a where
+    check :: Monad m => Context -> a -> m Term
+\end{verbatim}
+
+The \texttt{check} method parses and typechecks the given term, as
+appropriate, and if successful returns the internal representation. 
+Constructing a term in this way may fail (e.g. due to a syntax or
+type error) so \texttt{check} is generalised over a monad
+\hdecl{m} --- it may help to read \hdecl{m} as \hdecl{Maybe}.
+In this paper, for the sake of readability we will use the syntax
+described in section \ref{corett}, and assume an instance of
+\hdecl{IsTerm} for this syntax.
+
+Similarly, there is a typeclass for inductive families,
+which may be represented either as concrete syntax or a Haskell data
+structure.
+
+\begin{verbatim}
+class IsData a where
+    addData :: Monad m => Context -> a -> m Context
+\end{verbatim}
+
+The \hdecl{addData} method adds the constructors and elimination
+rules for the data type to the context. Again, we assume an instance
+for the syntax presented in section \ref{indfamilies}.
+
+The simplest way to add new function definitions to the context is
+with the \hdecl{addDef} function. Such definitions may not be recursive,
+other than via the automatically generated elimination rules, ensuring
+termination:
+
+\begin{verbatim}
+addDef :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+\end{verbatim}
+
+However, \Ivor{} is primarily a library for constructing proofs; the
+Curry-Howard correspondence~\cite{curry-feys,howard} identifies
+programs and proofs, and therefore such definitions can be viewed as
+proofs; to prove a theorem is to add a well-typed definition to the
+context.  We would like to be able to construct more complex proofs
+(and indeed programs) interactively --- and so at the heart of \Ivor{}
+is a theorem proving engine.
+
+\subsection{Theorems}
+
+In the \hdecl{emptyContext}, there is no proof in progress, so no
+proof state --- the \hdecl{theorem} function creates a proof state in
+a context. This will fail if there is already a proof in progress, or
+the goal is not well typed.
+
+\begin{verbatim}
+theorem :: (IsTerm a, Monad m) => Context -> Name -> a -> m Context
+\end{verbatim}
+
+A proof state can be thought of as an incomplete term, i.e. a
+term in the development calculus. 
+For example, calling \hdecl{theorem}
+with the name $\FN{plus}$ and type $\Nat\to\Nat\to\Nat$, an initial
+proof state would be:
+
+\DM{
+\FN{plus}\:=\:\hole{\VV{plus}}{\Nat\to\Nat\to\Nat}
+}
+
+This theorem is, in fact, a specification (albeit imprecise) of a
+program for adding two unary natural numbers, exploiting the
+Curry-Howard isomorphism.  Proving a theorem (i.e. also writing a
+program interactively) proceeds by applying tactics to each unsolved
+hole in the proof state. The system keeps track of which subgoals are
+still to be solved, and a default subgoal, which is the next subgoal
+to be solved. I will write proof states in the following form:
+
+\DM{
+\Rule{
+\AR{
+\mbox{\textit{bindings in the context of the subgoal $\vx_0$}} \\
+\ldots\\
+}
+}
+{
+\AR{
+\hole{\vx_0}{\mbox{\textit{default subgoal type}}} \\
+\ldots \\
+\hole{\vx_i}{\mbox{\textit{other subgoal types}}} \\
+\ldots
+}
+}
+}
+
+Functions are available for querying the bindings in the context of
+any subgoal. A tactic typically works on the bindings in scope and the
+type of the subgoal it is solving.
+
+When there are no remaining subgoals, a proof can be lifted into the
+context, to be used as a complete definition, with the \texttt{qed}
+function:
+
+\begin{verbatim}
+qed :: Monad m => Context -> m Context
+\end{verbatim}
+
+This function typechecks the entire proof. In practice, this check
+should never fail --- the development calculus itself ensures that
+partial constructions as well as complete terms are well-typed, so it
+is impossible to build ill-typed partial constructions. However, doing
+a final typecheck of a complete term means that the soundness of the
+system relies only on the soundness of the typechecker for the core
+language, e.g.~\cite{coq-in-coq}.  We are free to implement tactics in
+any way we like, knowing that any ill-typed constructions will be
+caught by the typechecker.
+
+%% but if the tactics are correctly implemented this check will always succeed.
+
+\subsection{Basic Tactics}
+
+A tactic is an operation on a goal in the current system state; we
+define a type synonym \hdecl{Tactic} for functions which operate as
+tactics. Tactics modify system state and may fail, hence a tactic
+function returns a monad:
+%
+\begin{verbatim}
+type Tactic = forall m . Monad m => Goal -> Context -> m Context
+\end{verbatim}
+%
+A tactic operates on a hole binding, specified by the \texttt{Goal}
+argument. This can be a named binding, \texttt{goal :: Name -> Goal},
+or the default goal \texttt{defaultGoal :: Goal}. The default goal is
+the first goal generated by the most recent tactic application.
+
+\subsubsection{Hole Manipulations}
+There are three basic operations on holes, \demph{claim}, \demph{fill},
+and \demph{abandon}; these are given the following types:
+%
+\begin{verbatim}
+claim :: IsTerm a => Name -> a -> Tactic
+fill :: IsTerm a => a -> Tactic
+abandon :: Tactic
+\end{verbatim}
+%
+The \hdecl{claim} function takes a name and a type and creates a new
+hole. The \hdecl{fill} function takes a guess to attach to the current
+goal. In addition, \hdecl{fill} attempts to solve other goals by
+unification. Attaching a guess does not necessarily solve the goal
+completely; if the guess contains further hole bindings, it cannot yet
+have any computational force. 
+%% The \hdecl{solve} tactic is provided to
+%% check whether a guess is \demph{pure} (i.e. does not contain any hole
+%% bindings or guesses itself) and converts it to a $\RW{let}$ binding if
+%% so.  
+A guess can be removed from a goal with the \hdecl{abandon}
+tactic.
+
+%% It can be inconvenient to have to \texttt{solve} every goal after a
+%% \texttt{fill} (although sometimes this level of control is
+%% useful). For this reason, \texttt{fill} and other tactics will
+%% automatically solve all goals with hole-free guesses attached. More
+%% fine-grained tactics are available, but are beyond the scope of this paper.
+
+\subsubsection{Introductions}
+A basic operation on terms is to introduce $\lambda$ bindings into the
+context. The \texttt{intro} and \texttt{introName} tactics operate on
+a goal of the form $\fbind{\vx}{\vS}{\vT}$, introducing
+$\lam{\vx}{\vS}$ into the context and updating the goal to
+$\vT$. That is, a goal of this form is solved by a $\lambda$-binding.
+\texttt{introName} allows a user specified name choice,
+otherwise \Ivor{} chooses the name.
+%
+\begin{verbatim}
+intro :: Tactic
+introName :: Name -> Tactic
+\end{verbatim}
+%
+For example, to define our addition function, we might begin with
+
+\DM{
+\Axiom{
+\hole{\VV{plus}}{\Nat\to\Nat\to\Nat}
+}
+}
+
+Applying \texttt{introName} twice with the names $\vx$ and $\vy$ gives
+the following proof state, with $\vx$ and $\vy$ introduced into the
+local context:
+\DM{
+\Rule{
+\AR{
+\lam{\vx}{\Nat}\\
+\lam{\vy}{\Nat}
+}
+}
+{\hole{\VV{plus\_H}}{\Nat}}
+}
+
+\subsubsection{Refinement}
+The \texttt{refine} tactic solves a goal by an application of a
+function to arguments. Refining attempts to solve a goal of type
+$\vT$, when given a term of the form $\vt\Hab\fbind{\tx}{\tS}{\vT}$. The tactic
+creates a subgoal for each argument $\vx_i$, attempting to solve it by
+unification.
+%
+\begin{verbatim}
+refine :: IsTerm a => a -> Tactic
+\end{verbatim}
+%
+For example, given a goal
+\DM{
+\Axiom{
+\hole{\vv}{\Vect\:\Nat\:(\suc\:\vn)}}
+}
+
+\noindent
+Refining by $\Vcons$ creates subgoals for each argument, attaching
+a guess to $\vv$:
+\DM{
+\Axiom{
+\AR{
+\hole{\vA}{\Type}\\
+\hole{\vk}{\Nat}\\
+\hole{\vx}{\vA}\\
+\hole{\vxs}{\Vect\:\vA\:\vk}\\
+\guess{\vv}{\Vect\:\Nat\:(\suc\:\vn)}{\Vcons\:\vA\:\vk\:\vx\:\vxs}
+}
+}
+}
+
+\noindent
+However, for $\Vcons\:\vA\:\vk\:\vx\:\vxs$ to have type
+$\Vect\:\Nat\:(\suc\:\vn)$ requires that $\vA=\Nat$ and $\vk=\vn$.
+Refinement unifies these, leaving the
+following goals:
+\DM{
+\Axiom{
+\AR{
+\hole{\vx}{\Nat}\\
+\hole{\vxs}{\Vect\:\Nat\:\vn}\\
+\guess{\vv}{\Vect\:\Nat\:(\suc\:\vn)}{\Vcons\:\Nat\:\vn\:\vx\:\vxs}
+}
+}
+}
+
+
+\subsubsection{Elimination}
+Refinement solves goals by constructing new values; we may also solve
+goals by deconstructing values in the context, using an elimination
+operator as described in section \ref{elimops}. The \texttt{induction}
+and \texttt{cases} tactics apply the $\delim$ and $\dcase$ operators
+respectively to the given target:
+%
+\begin{verbatim}
+induction, cases :: IsTerm a => a -> Tactic
+\end{verbatim}
+%
+These tactics proceed by refinement by the appropriate elimination
+operator. The motive for the elimination is calculated automatically
+from the goal to be solved. Each tactic generates subgoals for each
+method of the appropriate elimination rule.
+
+%% A more general elimination tactic is \texttt{by}, which takes an
+%% application of an elimination operator to a target.
+
+%% \begin{verbatim}
+%% by :: IsTerm a => a -> Tactic
+%% \end{verbatim}
+
+%% The type of the term given to \texttt{by} must be a function expecting
+%% a motive and methods.
+
+An example of \texttt{induction} is in continuing the definition of
+our addition function. This can be defined by induction over the first
+argument. We have the proof state
+
+\DM{
+\Rule{
+\AR{
+\lam{\vx}{\Nat}\\
+\lam{\vy}{\Nat}
+}
+}
+{\hole{\VV{plus\_H}}{\Nat}}
+}
+
+Applying \texttt{induction} to $\vx$ leaves two subgoals, one for the
+case where $\vx$ is zero, and one for the inductive
+case\footnote{c.f. the Haskell function \texttt{natElim
+    :: Nat -> a -> (Nat -> a -> a) -> a)}}:
+
+\DM{
+\Rule{
+\AR{
+\lam{\vx}{\Nat}\\
+\lam{\vy}{\Nat}
+}
+}
+{
+\AR{
+\hole{\VV{plus\_O}}{\Nat}\\
+\hole{\VV{plus\_S}}{\fbind{\vk}{\Nat}{\fbind{\VV{k\_H}}{\Nat}{\Nat}}}
+}
+}
+}
+
+By default, the next goal to solve is $\VV{plus\_O}$. However, the
+\hdecl{focus} tactic can be used to change the default goal.
+The $\VV{k\_H}$ argument to the $\VV{plus\_S}$ goal is the result of a
+recursive call on $\vk$.
+
+\subsubsection{Rewriting}
+It is often desirable to rewrite a goal given an equality proof, to
+perform equational reasoning. The \texttt{replace} tactic replaces
+occurrences of the left hand side of an equality with the right hand
+side. To do this, it requires:
+
+\begin{enumerate}
+\item The equality type; for example
+  $\TC{Eq}\Hab\fbind{\vA}{\Type}{\vA\to\vA\to\Type}$.
+\item A replacement lemma, which explains how to substitute one term
+  for another; for example\\
+  $\FN{repl}\Hab\fbind{\vA}{\Type}{
+    \fbind{\va,\vb}{\vA}{
+	\TC{Eq}\:\_\:\va\:\vb\to\fbind{\vP}{\vA\to\Type}{
+	  \vP\:\va\to\vP\:\vb}}}$
+\item A symmetry lemma, proving that equality is symmetric; for
+  example\\
+  $\FN{sym}\Hab\fbind{\vA}{\Type}{
+      \fbind{\va,\vb}{\vA}{\TC{Eq}\:\_\:\va\:\vb\to\TC{Eq}\:\_\:\vb\:\va}}$
+\item An equality proof.
+\end{enumerate}
+
+The \Ivor{} distribution contains a library of $\source$ code with the
+appropriate definitions and lemmas. Requiring the lemmas to be
+supplied as arguments makes the library more flexible --- for example,
+heterogeneous equality~\cite{mcbride-thesis} may be preferred. The
+tactic will fail if terms of inappropriate types are given; recall
+from sec. \ref{sec:devcalc} that the development calculus requires
+that incomplete terms are also well-typed, so that all tactic
+applications can be typechecked. The type is:
+\begin{verbatim}
+replace :: (IsTerm a, IsTerm b, IsTerm c, IsTerm d) =>
+               a -> b -> c -> d -> Bool -> Tactic
+\end{verbatim}
+The \texttt{Bool} argument determines whether to apply the symmetry
+lemma to the equality proof first, which allows rewriting from right
+to left.
+This \hdecl{replace} tactic is
+similar to \Lego{}'s \texttt{Qrepl} tactic \cite{lego-manual}.
+
+For example, consider the following fragment of proof state:
+
+\DM{
+\Rule{
+\AR{
+\ldots\\
+\lam{\vx}{\Vect\:\vA\:(\FN{plus}\:\vx\:\vy)}
+}
+}
+{
+\hole{\VV{vect\_H}}{\Vect\:\vA\:(\FN{plus}\:\vy\:\vx)}
+}
+}
+
+Since $\FN{plus}$ is commutative, $\vx$ ought to be a vector of the
+correct length. However, the type of $\vx$ is not convertible to the
+type of $\VV{vect\_H}$. Given a lemma $\FN{plus\_commutes}\Hab
+\fbind{\vn,\vm}{\Nat}{\TC{Eq}\:\_\:(\FN{plus}\:\vn\:\vm)\:(\FN{plus}\:\vm\:\vn)}$,
+we can use the \texttt{replace} tactic to rewrite the goal to the
+correct form. Applying \texttt{replace} to $\TC{Eq}$, $\FN{repl}$,
+$\FN{sym}$ and $\FN{plus\_commutes}\:\vy\:\vx$ yields the following
+proof state, which is easy to solve using the \texttt{fill} tactic
+with $\vx$.
+
+
+
+\DM{
+\Rule{
+\AR{
+\ldots\\
+\lam{\vx}{\Vect\:\vA\:(\FN{plus}\:\vx\:\vy)}
+}
+}
+{
+\hole{\VV{vect\_H}}{\Vect\:\vA\:(\FN{plus}\:\vx\:\vy)}
+}
+}
+
+\subsection{Tactic Combinators}
+
+\label{combinators}
+
+\Ivor{} provides an embedded domain specific language for
+building tactics, in the form of a number of
+combinators for building more complex tactics from the basic tactics
+previously described. By providing an API for basic tactics and a
+collection of combinators, it becomes easy to extend the library with
+more complex domain specific tactics. We will see examples in
+sections \ref{example1} and \ref{example2}.
+
+\subsubsection{Sequencing Tactics}
+There are three basic operators for combining two tactics to create a 
+new tactic:
+
+\begin{verbatim}
+(>->), (>+>), (>=>) :: Tactic -> Tactic -> Tactic
+\end{verbatim}
+
+\begin{enumerate}
+\item The \hdecl{>->} operator constructs a new tactic by sequencing two
+tactic applications to the \remph{same} goal.
+
+\item The \hdecl{>+>} operator constructs a new tactic by applying the
+  first, then applying the second to the next \remph{default} goal.
+
+\item The \hdecl{>=>} operator constructs a new tactic by applying the first
+tactic, then applying the second to every subgoal generated by the first.
+
+\end{enumerate}
+
+\noindent
+Finally, \hdecl{tacs} takes a list of tactics and applies
+them in turn to the default goal:
+
+\begin{verbatim}
+tacs :: Monad m => [Goal -> Context -> m Context] ->
+                   Goal -> Context -> m Context
+\end{verbatim}
+
+Note that the type of this is better understood as \hdecl{[Tactic] ->
+  Tactic}, but the Haskell typechecker requires that the same monad be
+abstracted over all of the combined tactics.
+
+\subsubsection{Handling Failure}
+Tactics may fail (for example a refinement may be ill-typed). 
+Recovering gracefully from a failure may be needed, for
+example to try a number of possible ways of rewriting a term.
+The \hdecl{try} combinator is an exception handling combinator.
+The identity tactic, \hdecl{idTac}, is often appropriate on success.
+
+% which
+%tries a tactic, and chooses a second tactic to apply to the same goal
+%if the first tactic succeeds, or an alternative tactic if the first
+%tactic fails.
+
+\begin{verbatim}
+try :: Tactic -> -- apply this tactic
+       Tactic -> -- apply if the tactic succeeds
+       Tactic -> -- apply if the tactic fails
+       Tactic
+\end{verbatim}
+
+%% \subsection{The Shell}
+
+%% The \texttt{Ivor.Shell} module provides a command driven interface to
+%% the library, which can be used for experimental purposes or for
+%% developing a library of core lemmas for a domain specific task. It is
+%% written entirely with the \texttt{Ivor.TT} interface but provides a
+%% textual interface to the tactics. This gives, among other things, a
+%% convenient method for loading proof scripts or libraries, or allowing
+%% user directed proofs in the style of other proof assistants such as
+%% \Coq{}.
+
+%% A small driver program is provided (\texttt{jones}), which gives a
+%% simple interface to the \Ivor{} shell.
diff --git a/papers/tutorial/Makefile b/papers/tutorial/Makefile
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/Makefile
@@ -0,0 +1,20 @@
+all: tutorial.pdf
+
+SOURCES = tutorial.tex introduction.tex programming.tex theoremproving.tex \
+          hslibrary.tex
+
+tutorial.pdf: $(SOURCES)
+	pdflatex tutorial
+	-bibtex tutorial
+	-pdflatex tutorial
+
+tutorial.ps: tutorial.dvi
+	dvips -o tutorial.ps tutorial
+
+tutorial.dvi: $(SOURCES)
+	-latex tutorial
+	-bibtex tutorial
+	-latex tutorial
+	-latex tutorial
+
+.PHONY:
diff --git a/papers/tutorial/hslibrary.tex b/papers/tutorial/hslibrary.tex
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/hslibrary.tex
@@ -0,0 +1,8 @@
+\section{Haskell Library}
+
+% Shell, loading files
+% Terms, types and data structures
+% Adding definitions, pattern matching
+% Theorem proving
+% Defining tactics
+
diff --git a/papers/tutorial/introduction.tex b/papers/tutorial/introduction.tex
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/introduction.tex
@@ -0,0 +1,4 @@
+\section{Introduction}
+
+\Ivor{}~\cite{ivor} is a dependently typed theorem proving library for
+Haskell. 
diff --git a/papers/tutorial/library.ltx b/papers/tutorial/library.ltx
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/library.ltx
@@ -0,0 +1,325 @@
+%%%%%%%%%%%%%%% library file for datatypes etc.
+
+%%% Identifiers
+
+\newcommand{\va}{\VV{a}}
+\newcommand{\vb}{\VV{b}}
+\newcommand{\vc}{\VV{c}}
+\newcommand{\vd}{\VV{d}}
+\newcommand{\ve}{\VV{e}}
+\newcommand{\vf}{\VV{f}}
+\newcommand{\vg}{\VV{g}}
+\newcommand{\vh}{\VV{h}}
+\newcommand{\vi}{\VV{i}}
+\newcommand{\vj}{\VV{j}}
+\newcommand{\vk}{\VV{k}}
+\newcommand{\vl}{\VV{l}}
+\newcommand{\vm}{\VV{m}}
+\newcommand{\vn}{\VV{n}}
+\newcommand{\vo}{\VV{o}}
+\newcommand{\vp}{\VV{p}}
+\newcommand{\vq}{\VV{q}}
+\newcommand{\vr}{\VV{r}}
+\newcommand{\vs}{\VV{s}}
+\newcommand{\vt}{\VV{t}}
+\newcommand{\vu}{\VV{u}}
+\newcommand{\vv}{\VV{v}}
+\newcommand{\vw}{\VV{w}}
+\newcommand{\vx}{\VV{x}}
+\newcommand{\vy}{\VV{y}}
+\newcommand{\vz}{\VV{z}}
+\newcommand{\vA}{\VV{A}}
+\newcommand{\vB}{\VV{B}}
+\newcommand{\vC}{\VV{C}}
+\newcommand{\vD}{\VV{D}}
+\newcommand{\vE}{\VV{E}}
+\newcommand{\vF}{\VV{F}}
+\newcommand{\vG}{\VV{G}}
+\newcommand{\vH}{\VV{H}}
+\newcommand{\vI}{\VV{I}}
+\newcommand{\vJ}{\VV{J}}
+\newcommand{\vK}{\VV{K}}
+\newcommand{\vL}{\VV{L}}
+\newcommand{\vM}{\VV{M}}
+\newcommand{\vN}{\VV{N}}
+\newcommand{\vO}{\VV{O}}
+\newcommand{\vP}{\VV{P}}
+\newcommand{\vQ}{\VV{Q}}
+\newcommand{\vR}{\VV{R}}
+\newcommand{\vS}{\VV{S}}
+\newcommand{\vT}{\VV{T}}
+\newcommand{\vU}{\VV{U}}
+\newcommand{\vV}{\VV{V}}
+\newcommand{\vW}{\VV{W}}
+\newcommand{\vX}{\VV{X}}
+\newcommand{\vY}{\VV{Y}}
+\newcommand{\vZ}{\VV{Z}}
+\newcommand{\vas}{\VV{as}}
+\newcommand{\vbs}{\VV{bs}}
+\newcommand{\vcs}{\VV{cs}}
+\newcommand{\vds}{\VV{ds}}
+\newcommand{\ves}{\VV{es}}
+\newcommand{\vfs}{\VV{fs}}
+\newcommand{\vgs}{\VV{gs}}
+\newcommand{\vhs}{\VV{hs}}
+\newcommand{\vis}{\VV{is}}
+\newcommand{\vjs}{\VV{js}}
+\newcommand{\vks}{\VV{ks}}
+\newcommand{\vls}{\VV{ls}}
+\newcommand{\vms}{\VV{ms}}
+\newcommand{\vns}{\VV{ns}}
+\newcommand{\vos}{\VV{os}}
+\newcommand{\vps}{\VV{ps}}
+\newcommand{\vqs}{\VV{qs}}
+\newcommand{\vrs}{\VV{rs}}
+%\newcommand{\vss}{\VV{ss}}
+\newcommand{\vts}{\VV{ts}}
+\newcommand{\vus}{\VV{us}}
+\newcommand{\vvs}{\VV{vs}}
+\newcommand{\vws}{\VV{ws}}
+\newcommand{\vxs}{\VV{xs}}
+\newcommand{\vys}{\VV{ys}}
+\newcommand{\vzs}{\VV{zs}}
+
+%%% Telescope Identifiers
+
+\newcommand{\ta}{\vec{\VV{a}}}
+\newcommand{\tb}{\vec{\VV{b}}}
+\newcommand{\tc}{\vec{\VV{c}}}
+\newcommand{\td}{\vec{\VV{d}}}
+\newcommand{\te}{\vec{\VV{e}}}
+\newcommand{\tf}{\vec{\VV{f}}}
+\newcommand{\tg}{\vec{\VV{g}}}
+%\newcommand{\th}{\vec{\VV{h}}}
+\newcommand{\ti}{\vec{\VV{i}}}
+\newcommand{\tj}{\vec{\VV{j}}}
+\newcommand{\tk}{\vec{\VV{k}}}
+\newcommand{\tl}{\vec{\VV{l}}}
+\newcommand{\tm}{\vec{\VV{m}}}
+\newcommand{\tn}{\vec{\VV{n}}}
+%\newcommand{\to}{\vec{\VV{o}}}
+\newcommand{\tp}{\vec{\VV{p}}}
+\newcommand{\tq}{\vec{\VV{q}}}
+\newcommand{\tr}{\vec{\VV{r}}}
+\newcommand{\tts}{\vec{\VV{s}}}
+\newcommand{\ttt}{\vec{\VV{t}}}
+\newcommand{\tu}{\vec{\VV{u}}}
+%\newcommand{\tv}{\vec{\VV{v}}}
+\newcommand{\tw}{\vec{\VV{w}}}
+\newcommand{\tx}{\vec{\VV{x}}}
+\newcommand{\ty}{\vec{\VV{y}}}
+\newcommand{\tz}{\vec{\VV{z}}}
+\newcommand{\tA}{\vec{\VV{A}}}
+\newcommand{\tB}{\vec{\VV{B}}}
+\newcommand{\tC}{\vec{\VV{C}}}
+\newcommand{\tD}{\vec{\VV{D}}}
+\newcommand{\tE}{\vec{\VV{E}}}
+\newcommand{\tF}{\vec{\VV{F}}}
+\newcommand{\tG}{\vec{\VV{G}}}
+\newcommand{\tH}{\vec{\VV{H}}}
+\newcommand{\tI}{\vec{\VV{I}}}
+\newcommand{\tJ}{\vec{\VV{J}}}
+\newcommand{\tK}{\vec{\VV{K}}}
+\newcommand{\tL}{\vec{\VV{L}}}
+\newcommand{\tM}{\vec{\VV{M}}}
+\newcommand{\tN}{\vec{\VV{N}}}
+\newcommand{\tO}{\vec{\VV{O}}}
+\newcommand{\tP}{\vec{\VV{P}}}
+\newcommand{\tQ}{\vec{\VV{Q}}}
+\newcommand{\tR}{\vec{\VV{R}}}
+\newcommand{\tS}{\vec{\VV{S}}}
+\newcommand{\tT}{\vec{\VV{T}}}
+\newcommand{\tU}{\vec{\VV{U}}}
+\newcommand{\tV}{\vec{\VV{V}}}
+\newcommand{\tW}{\vec{\VV{W}}}
+\newcommand{\tX}{\vec{\VV{X}}}
+\newcommand{\tY}{\vec{\VV{Y}}}
+\newcommand{\tZ}{\vec{\VV{Z}}}
+
+
+
+%%% Nat
+
+\newcommand{\NatPackage}{
+  \newcommand{\Nat}{\TC{\mathbb{N}}}
+  \newcommand{\Z}{\DC{0}}
+  \newcommand{\suc}{\DC{s}}
+  \newcommand{\NatDecl}{
+    \Data \hg
+    \Axiom{\Nat\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\Z\Hab\Nat} \hg
+    \Rule{\vn\Hab\Nat}
+         {\suc\:\vn\Hab\Nat}
+}}
+
+%%% Bool
+
+\newcommand{\BoolPackage}{
+  \newcommand{\Bool}{\TC{Bool}}
+  \newcommand{\true}{\DC{true}}
+  \newcommand{\false}{\DC{false}}
+  \newcommand{\BoolDecl}{
+    \Data \hg
+    \Axiom{\Bool\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\true\Hab\Bool} \hg
+    \Axiom{\false\Hab\Bool}
+}}
+
+%%% So
+
+\newcommand{\SoPackage}{
+  \newcommand{\So}{\TC{So}}
+  \newcommand{\oh}{\DC{oh}}
+  \newcommand{\SoDecl}{
+    \Data \hg
+    \Rule{\vb\Hab\Bool}
+         {\So\:\vb\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\oh\Hab\So\:\true}
+}}
+
+%%% Unit
+
+\newcommand{\UnitPackage}{
+  \newcommand{\Unit}{\TC{Unit}}
+  \newcommand{\void}{\DC{void}}
+  \newcommand{\UnitDecl}{
+    \Data \hg
+    \Axiom{\Unit\Hab\Type} \hg
+    \Where \hg
+    \Axiom{\void\Hab\Unit}
+}}
+
+%%% Maybe
+
+\newcommand{\MaybePackage}{
+  \newcommand{\Maybe}{\TC{Maybe}}
+  \newcommand{\yes}{\DC{yes}}
+  \newcommand{\no}{\DC{no}}
+  \newcommand{\MaybeDecl}{
+    \Data \hg
+    \Rule{\vA\Hab\Type}
+         {\Maybe\:\vA\Hab\Type} \hg
+    \Where \hg
+    \Rule{\va \Hab \vA}
+         {\yes\:\va\Hab\Maybe\:\vA} \hg
+    \Axiom{\no\Hab\Maybe\:\vA}
+}}
+
+%%% Cross
+
+\newcommand{\pr}[2]{(#1\DC{,}#2)}  %grrrr
+\newcommand{\CrossPackage}{
+  \newcommand{\Cross}{\times}
+  \newcommand{\CrossDecl}{
+    \Data \hg
+    \Rule{\vA,\vB\Hab\Type}
+         {\vA\Cross\vB\Hab\Type} \hg
+    \Where \hg
+    \Rule{\va \Hab \vA \hg \vb\Hab\vB}
+         {\pr{\va}{\vb}\Hab\vA\Cross\vB}
+}}
+
+%%% Fin
+
+\newcommand{\FinPackage}{
+  \newcommand{\Fin}{\TC{Fin}}
+  \newcommand{\fz}{\DC{f0}}
+  \newcommand{\fs}{\DC{fs}}
+  \newcommand{\FinDecl}{
+    \AR{
+    \Data \hg
+    \Rule{\vn\Hab\Nat}
+         {\Fin\:\vn\Hab\Type} \hg \\
+    \Where \hg
+    \begin{array}[t]{c}
+    \Axiom{\fz\Hab\Fin\:(\suc\:\vn)} \hg
+    \Rule{\vi\Hab\Fin\:\vn}
+         {\fs\:\vi\Hab\Fin\:(\suc\:\vn)}
+    \end{array}
+    }
+}}
+
+%%% Vect
+
+\newcommand{\VectPackage}{
+  \newcommand{\Vect}{\TC{Vect}}
+  \newcommand{\vnil}{\varepsilon}
+  \newcommand{\vcons}{\,\dcolon\,}
+  \newcommand{\vsnoc}{\,\dcolon\,}
+  \newcommand{\VectConsDecl}{
+    \Data \hg
+    \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
+         {\Vect\:\vA\:\vn\Hab\Type} \hg
+    \Where \hg \begin{array}[t]{c}
+    \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
+    \Rule{\vx\Hab\vA \hg \vxs\Hab \Vect\:\vA\:\vn }
+         {\vx\vcons\vxs\Hab\Vect\:\vA\:(\suc\vn)}
+    \end{array}
+}
+  \newcommand{\VectSnocDecl}{
+    \Data \hg
+    \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
+         {\Vect\:\vA\:\vn\Hab\Type} \hg
+    \Where \hg \begin{array}[t]{c}
+    \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
+    \Rule{\vxs\Hab \Vect\:\vA\:\vn \hg \vx\Hab\vA}
+         {\vxs\vsnoc\vx\Hab\Vect\:\vA\:(\suc\vn)}
+    \end{array}
+}
+}
+
+%%% Compare
+
+%Data Compare : (x:nat)(y:nat)Type
+%  = lt : (x:nat)(y:nat)(Compare x (plus (S y) x))
+%  | eq : (x:nat)(Compare x x)
+%  | gt : (x:nat)(y:nat)(Compare (plus (S x) y) y);
+
+
+\newcommand{\ComparePackage}{
+  \newcommand{\Compare}{\TC{Compare}}
+  \newcommand{\ltComp}{\DC{lt}}
+  \newcommand{\eqComp}{\DC{eq}}
+  \newcommand{\gtComp}{\DC{gt}}
+  \newcommand{\CompareDecl}{
+    \Data \hg
+    \Rule{\vm\Hab\Nat\hg\vn\Hab\Nat}
+         {\Compare\:\vm\:\vn\Hab\Type} \\
+    \Where \hg\begin{array}[t]{c}
+    \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
+         {\ltComp_{\vx}\:\vy\Hab\Compare\:\vx\:(\FN{plus}\:\vx\:(\suc\:\vy))} \\
+    \Rule{\vx\Hab\Nat}
+         {\eqComp_{\vx}\Hab\Compare\:\vx\:\vx}\\
+    \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
+         {\gtComp_{\vy}\:\vx\Hab\Compare\:(\FN{plus}\:\vy\:(\suc\:\vx))\:\vy} \\
+    \end{array}	 
+  }
+
+%Data CompareM : Type
+%  = ltM : (ydiff:nat)CompareM
+%  | eqM : CompareM
+%  | gtM : (xdiff:nat)CompareM;
+
+  \newcommand{\CompareM}{\TC{Compare^-}}
+  \newcommand{\ltCompM}{\DC{lt^-}}
+  \newcommand{\eqCompM}{\DC{eq^-}}
+  \newcommand{\gtCompM}{\DC{gt^-}}
+  \newcommand{\CompareMDecl}{
+
+     \Data \hg
+     \Axiom{\CompareM\Hab\Type} \\
+     \Where \hg\begin{array}[t]{c}
+     \Rule{\vy\Hab\Nat}
+          {\ltCompM\:\vy\Hab\CompareM} \\
+     \Axiom{\eqCompM\Hab\CompareM}\\
+     \Rule{\vx\Hab\Nat}
+          {\gtCompM\:\vx\Hab\CompareM} \\
+     \end{array}	
+  }
+  \newcommand{\CompareRec}{\FN{CompareRec}}
+  \newcommand{\CompareRecM}{\FN{CompareRec^-}}
+
+}
diff --git a/papers/tutorial/macros.ltx b/papers/tutorial/macros.ltx
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/macros.ltx
@@ -0,0 +1,954 @@
+%\usepackage{amstex}
+\usepackage{amssymb}
+\usepackage{latexsym}
+\usepackage{eepic}
+
+
+%%%%%%%%% INFERENCE RULES
+
+\newlength{\rulevgap}
+\setlength{\rulevgap}{0.05in}
+\newlength{\ruleheight}
+\newlength{\ruledepth}
+\newsavebox{\rulebox}
+\newlength{\GapLength}
+\newcommand{\gap}[1]{\settowidth{\GapLength}{#1} \hspace*{\GapLength}}
+\newcommand{\dotstep}[2]{\begin{tabular}[b]{@{}c@{}}
+                         #1\\$\vdots$\\#2
+                         \end{tabular}}
+\newlength{\fracwid}
+\newcommand{\dotfrac}[2]{\settowidth{\fracwid}{$\frac{#1}{#2}$}
+                         \addtolength{\fracwid}{0.1in}
+                         \begin{tabular}[b]{@{}c@{}}
+                         $#1$\\
+                         \parbox[c][0.02in][t]{\fracwid}{\dotfill} \\
+                         $#2$\\
+                         \end{tabular}}
+\newcommand{\Rule}[2]{\savebox{\rulebox}[\width][b]                         %
+                              {\( \frac{\raisebox{0in} {\( #1 \)}}       %
+                                       {\raisebox{-0.03in}{\( #2 \)}} \)}   %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\Case}[2]{\savebox{\rulebox}[\width][b]                         %
+                              {\( \dotfrac{\raisebox{0in} {\( #1 \)}}       %
+                                       {\raisebox{-0.03in}{\( #2 \)}} \)}   %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\Axiom}[1]{\savebox{\rulebox}[\width][b]                        %
+                               {$\frac{}{\raisebox{-0.03in}{$#1$}}$}        %
+                      \settoheight{\ruleheight}{\usebox{\rulebox}}          %
+                      \addtolength{\ruleheight}{\rulevgap}                  %
+                      \settodepth{\ruledepth}{\usebox{\rulebox}}            %
+                      \addtolength{\ruledepth}{\rulevgap}                   %
+                      \raisebox{0in}[\ruleheight][\ruledepth]               %
+                               {\usebox{\rulebox}}}
+\newcommand{\RuleSide}[3]{\gap{$#2$} \hspace*{0.1in}               %
+                            \Rule{#1}{#3}                          %
+                          \hspace*{0.1in}$#2$}
+\newcommand{\AxiomSide}[2]{\gap{$#1$} \hspace*{0.1in}              %
+                             \Axiom{#2}                            %
+                           \hspace*{0.1in}$#1$}
+\newcommand{\RULE}[1]{\textbf{#1}}
+\newcommand{\hg}{\hspace{0.2in}}
+
+\newcommand{\ProofState}
+                      [2]{\parbox{10cm}{\AR{\hg\AR{#1}\\\Axiom{\hg#2\hg}}}}
+
+%%%%%%%%%%%% TRISTUFF
+
+\newcommand{\btr}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+\blacken\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\end{picture}
+}
+
+\newcommand{\btl}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+\blacken\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\end{picture}
+}
+
+\newcommand{\wtr}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+%\blacken\path(57,192)(57,12)(12,102)
+%	(57,192)(57,192)
+\path(57,192)(57,12)(12,102)
+	(57,192)(57,192)
+\end{picture}
+}
+
+\newcommand{\wtl}{
+\setlength{\unitlength}{0.0005in}
+\begin{picture}(69,180)(0,12)
+%\blacken\path(12,192)(12,12)(57,102)
+%	(12,192)(12,192)
+\path(12,192)(12,12)(57,102)
+	(12,192)(12,192)
+\end{picture}
+}
+
+
+
+%%%%%%%%%%%% FONTS
+
+\newcommand{\TC}[1]{\mathsf{#1}}
+\newcommand{\DC}[1]{\mathsf{#1}}
+\newcommand{\VV}[1]{\mathit{#1}}
+\newcommand{\FN}[1]{\mathbf{#1}}
+\newcommand{\HFN}[1]{\mathtt{#1}}
+\newcommand{\RW}[1]{\underline{\textrm{#1}}}
+\newcommand{\MO}[1]{\mbox{\textsc{#1}}}
+
+\newcommand{\HF}[1]{\mathtt{#1}}
+
+\newcommand{\MV}[1]{\nhole\mathit{#1}}
+\newcommand{\Lang}[1]{\mathsf{#1}}
+\newcommand{\Name}[1]{\mathit{#1}}
+
+\newcommand{\demph}[1]{\textbf{#1}}
+\newcommand{\remph}[1]{\emph{#1}}
+
+%%%% Keywords for meta operations
+\newcommand{\IF}{\;\RW{if}\;\;}
+\newcommand{\THEN}{\RW{then}}
+\newcommand{\ELSE}{\RW{else}}
+\newcommand{\AND}{\RW{and}}
+\newcommand{\Otherwise}{\RW{otherwise}}
+\newcommand{\Do}{\RW{do}}
+\newcommand{\Return}{\RW{return}}
+
+\newcommand{\CASE}{\RW{case}}
+\newcommand{\LET}{\RW{let}}
+\newcommand{\IN}{\RW{in}}
+\newcommand{\of}{\RW{of}}
+
+\newcommand{\CLASS}{\mathtt{class}}
+\newcommand{\INSTANCE}{\mathtt{instance}}
+
+%%%%%%%%%%%% GROUPING
+
+\newcommand{\G}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-10)
+\end{picture}
+}
+
+\newcommand{\E}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-2)(4,-2)
+\end{picture}
+}
+
+%\newcommand{\C}{
+%\setlength{\unitlength}{1pt}
+%\begin{picture}(4,10)(0,0)
+%\path(4,8)(2,8)(2,-2)(4,-2)
+%\end{picture}
+%}
+
+\newcommand{\M}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(2,10)(2,-2)(6,-2)
+\end{picture}
+}
+
+\newcommand{\F}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(4,8)(2,8)(2,-6)
+\end{picture}
+}
+
+\newcommand{\K}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(0,8)(4,8)
+\end{picture}
+}
+
+\newcommand{\J}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\path(0,-2)(4,-2)
+\end{picture}
+}
+
+\newcommand{\W}{
+\setlength{\unitlength}{1pt}
+\begin{picture}(4,10)(0,0)
+\end{picture}
+}
+
+
+
+%%%%%%%%%%%% GUBBINS
+
+\newcommand{\mathskip}{\medskip}
+
+\newcommand{\fbx}[1]{\fbox{$#1$}}
+\newcommand{\stk}[1]{\begin{array}{c}#1\end{array}}
+%\newcommand{\DM}[1]{\hg\mbox{$#1$}}
+\newcommand{\DM}[1]{\mathskip\par\(#1\)\mathskip}
+\newcommand{\mbx}[1]{\mathskip\par\noindent\(#1\)\mathskip}
+\newcommand{\AR}[1]{\begin{array}[t]{@{}l}#1\end{array}}
+\newcommand{\ARt}[1]{\begin{array}[t]{@{}l@{}cl}#1\end{array}}
+\newcommand{\ARc}[1]{\begin{array}{@{}l}#1\end{array}}
+\newcommand{\ARd}[1]{\begin{array}[t]{cl}#1\end{array}}
+\newcommand{\EA}[1]{\begin{array}[t]{r@{}c@{}l}#1\end{array}}
+\newcommand{\A}{@{\:}c}
+%\newcommand{\R}{@{\:}r}
+\newcommand{\CA}{c}
+\newcommand{\LA}{l}
+\newcommand{\PAc}[2]{\begin{array}{l#1@{}r@{}l}#2\end{array}}
+\newcommand{\PA}[2]{\begin{array}[t]{l@{\:}l#1@{}r@{\:}l}#2\end{array}}
+\newcommand{\DTREE}[3]{\begin{array}[t]{l#1@{}r@{\:}l#2}#3\end{array}}
+\newcommand{\IDTREE}[2]{%
+  \begin{array}[t]{l@{\:}c@{\:}l@{\:}r@{\:}l#1}#2\end{array}}
+\newcommand{\IA}[2]
+   {\begin{array}[t]{l@{\:}r@{\:}c@{\:}l@{\:}#1@{\:}r@{\:}l}#2\end{array}}
+\newcommand{\IAc}[2]
+   {\begin{array}[c]{r@{\:}c@{\:}l@{\:}#1@{}r@{}l}#2\end{array}}
+\newcommand{\CS}[1]{\left\lfloor\begin{array}{@{}l}#1\end{array}\right.}
+\newcommand{\BY}[3]{\multicolumn{2}{l}{\;\RW{by}\; #1} \\ %
+    \multicolumn{#2}{l}{\CS{#3}} }
+\newcommand{\WITH}[3]{\multicolumn{2}{l}{\;\RW{with}\; #1} \\ %
+    \multicolumn{#2}{l}{\CS{#3}} }
+\newcommand{\WithBy}{\RW{with-by}}
+\newcommand{\Wb}[1]{\WithBy& #1}
+\newcommand{\By}[1]{\multicolumn{2}{l}{\Leftarrow #1}}
+\newcommand{\andby}{\Leftarrow}
+\newcommand{\MyWith}[1]{\multicolumn{2}{l}{|\;#1}}
+\newcommand{\Byr}[1]{\;\RW{by}\; #1}
+
+\renewcommand{\Bar}{|}
+\newcommand{\Bart}{\settowidth{\GapLength}{$\Bar$}%
+                   \raisebox{6pt}[0pt][0pt]{$\Bar$}%
+                   \hspace*{-1\GapLength}%
+                   \Bar}
+\newcommand{\With}[1]{\Bar & #1}
+\newcommand{\Witt}[1]{\Bart & #1}
+
+\newcommand{\B}{@{\:}r@{\:}c}
+\newcommand{\Ret}[1]{\multicolumn{2}{l}{\cq #1}}
+\newcommand{\MRet}[2]{\multicolumn{#1}{l}{\cq #2}}
+\newcommand{\HRet}[1]{\multicolumn{2}{l}{\hq #1}}
+\newcommand{\MHRet}[2]{\multicolumn{#1}{l}{\hq #2}}
+\newcommand{\IRet}[1]{\multicolumn{2}{l}{\iq #1}}
+\newcommand{\IMRet}[2]{\multicolumn{#1}{l}{\iq #2}}
+\newcommand{\MoRet}[1]{\multicolumn{2}{l}{\mq #1}}
+\newcommand{\MMoRet}[2]{\multicolumn{#1}{l}{\mq #2}}
+\newcommand{\Data}{\RW{data}}
+\newcommand{\Where}{\RW{where}}
+\newcommand{\Let}{\RW{let}}
+\newcommand{\Fact}{\RW{fact}}
+\newcommand{\Rec}[1]{#1\textbf{-Rec}}
+\newcommand{\Memo}[1]{#1\textbf{-Memo}}
+\newcommand{\Elim}[1]{#1\textbf{-Elim}}
+\newcommand{\Cases}[1]{#1\textbf{-Case}}
+\newcommand{\View}[1]{#1\textbf{-View}}
+\newcommand{\As}[2]{#1 \:\RW{as}\: #2}
+\newcommand{\nhole}{\Box}
+\newcommand{\turq}{\:\vdash_?\:}
+\renewcommand{\split}{\;\lhd\;}
+\newcommand{\CType}[2]{\{#1 \split\; #2\}}
+\newcommand{\CC}[2]{(#1)\:#2}
+\newcommand{\UP}[2]{#1 | \{#2\}}
+\newcommand{\Ured}{\:\Downarrow\:}
+\newcommand{\gdd}{\prec}
+\newcommand{\HC}[1]{\left<#1\right>}
+\newcommand{\HT}[2]{\left<#1 \hab #2\right>}
+
+\newcommand{\view}{\RW{view}}
+\newcommand{\ecase}{\RW{case}}
+\newcommand{\rec}{\RW{rec}}
+
+\newcommand{\If}{\mathsf{if}}
+\newcommand{\Then}{\mathsf{then}}
+\newcommand{\Else}{\mathsf{else}}
+\newcommand{\elim}{\RW{elim}}
+
+\newcommand{\Payload}{\mathsf{type}}
+\newcommand{\Any}{\mathsf{Some}}
+
+\newcommand{\lbl}[2]{\langle #1 \Hab #2 \rangle}
+\newcommand{\call}[2]{\RW{call}\:\langle#1\rangle\:#2}
+\newcommand{\return}[1]{\RW{return}\:#1}
+
+\newcommand{\Remark}[1]{\noindent\textbf{Remark:} #1}
+
+\newcommand{\DBOX}[2]{\fbox{\parbox{#1}{\textbf{Definition:}#2}}}
+
+\newcommand{\FIG}[3]{\begin{figure}[h]\DM{#1}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\FFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\FFIGTC}[3]{\begin{figure*}[t]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure*}}
+\newcommand{\VFIG}[3]{\begin{figure}[h]\begin{boxedverbatim}#1\end{boxedverbatim}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\PFIG}[3]{\begin{figure}[p]\begin{center}\fbox{\DM{#1}}\end{center}\caption{#2}\label{#3}\end{figure}}
+\newcommand{\CFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
+
+\newcommand{\TFIG}[4]{\begin{figure}[h]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure}}
+\newcommand{\TFIGTC}[4]{\begin{figure*}[t]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure*}}
+
+\newcommand{\RESFIG}[3]{
+\TFIG{|l|c|c|c|c|c|c|c|c|}{
+\hline
+    & \multicolumn{4}{c|}{\Naive{} compilation} &
+          \multicolumn{4}{|c|}{Optimised compilation} \\
+\cline{2-9}
+\raisebox{1.5ex}[0pt]{Program} & Instrs & Thunks & Cells &
+Accesses & Instructions & Thunks & Cells & Accesses \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+\hline
+}{#2}{#3}}
+
+\newcommand{\NEWRESFIG}[3]{
+\TFIG{|l|l|c|c|c|c|}{
+\hline
+%    & \multicolumn{4}{c|}{\Naive{} compilation} &
+%          \multicolumn{4}{|c|}{Optimised compilation} \\
+%\cline{2-9}
+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+}{#2}{#3}}
+
+\newcommand{\NEWRESFIGTC}[3]{
+\TFIGTC{|l|l|c|c|c|c|}{
+\hline
+%    & \multicolumn{4}{c|}{\Naive{} compilation} &
+%          \multicolumn{4}{|c|}{Optimised compilation} \\
+%\cline{2-9}
+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
+\hline
+#1
+}{#2}{#3}}
+
+\newcommand{\RESLINE}[9]{
+& \Naive{} & #2 & #3 & #5 & #4 \\
+#1
+& Optimised & #6 & #7 & #9 & #8 \\
+}
+\newcommand{\RESCHANGE}[4]{
+& Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
+\hline
+}
+\newcommand{\RESCHANGEa}[5]{
+#5 & Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
+\hline
+}
+
+%%%%%%%%%%%% PUNCTUATION
+
+\newcommand{\pad}[2]{#1#2#1}
+
+\newcommand{\hab}{\pad{\,}{:}}
+\newcommand{\Hab}{\pad{\;}{:}}
+\newcommand{\HHab}{\pad{\;}{::}}
+
+%%%%%%%%%%%% TYPE
+
+\newcommand{\Type}{\star}
+
+
+%%%%%%%%%%%%% ARROWS
+
+\newcommand{\To}{\pad{\:}{\rightarrow}}
+%\newcommand{\car}{\vartriangleright}
+
+%%%%%%%%%%%%% QUANTIFIERS
+
+\newcommand{\lam}[2]{\lambda#1\pad{\!}{:}#2}
+\newcommand{\fbind}[3]{(#1\Hab#2)\to#3}
+\newcommand{\all}[2]{\forall#1\pad{\!}{:}#2}
+\newcommand{\hole}[2]{?#1\pad{\!}{:}#2}
+\newcommand{\guess}[3]{?#1\pad{\!}{:}#2\approx#3}
+\newcommand{\remlam}[2]{\lambda\{#1\pad{\!}{:}#2\}}
+\newcommand{\remall}[2]{\forall\{#1\pad{\!}{:}#2\}}
+\newcommand{\allpi}[2]{\Pi#1\pad{\!}{:}#2}
+\newcommand{\ali}[2]{\forall#1|#2}
+\newcommand{\exi}[2]{\exists#1\pad{\!}{:}#2}
+\newcommand{\wit}[2]{\ang{#1,#2}}
+\newcommand{\X}{\times}
+\newcommand{\sig}[2]{\Sigma#1\pad{\!}{:}#2}
+
+\newcommand{\SC}{.\:}
+
+\newcommand{\letbind}[3]{\mathsf{let}\:#1{:}#2\:=\:#3\:\mathsf{in}}
+\newcommand{\ifthen}[3]{\mathsf{if}\:#1\:\mathsf{then}\:#2\:\mathsf{else}\:#3}
+
+%%%%%%%%%%%%% EQUALITIES
+
+\newcommand{\cq}{\pad{\:}{\mapsto}}
+\newcommand{\xq}{\pad{}{\doteq}}
+\newcommand{\pq}{\pad{\:}{=}}
+\newcommand{\dq}{\pad{\:}{:=}}
+\newcommand{\iq}{\pad{\:}{\leadsto}}
+\newcommand{\mq}{\Longrightarrow}
+\newcommand{\retq}{\Rightarrow}
+\newcommand{\hq}{\pad{\:}{=}}
+\newcommand{\defq}{\mapsto}
+
+\newcommand{\refl}{\TC{refl}}
+
+
+
+
+%%%%%%%%%%%%% CATSTUFF
+
+\newlength{\Lwibrs}
+\newlength{\Lwobrs}
+\newsavebox{\Bwibrs}
+\newsavebox{\Bwobrs}
+\newcommand{\Db}[5]{%
+  \savebox{\Bwobrs}[\width][b]{$#5$}%
+  \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right#3$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left#1\pad{\hspace*{-0.25\Lwibrs}}{\usebox{\Bwibrs}}\right#4}
+\newcommand{\LDb}[3]{%
+  \savebox{\Bwobrs}[\width][b]{$#3$}%
+  \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right.$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left#1\hspace*{-0.4\Lwibrs}\usebox{\Bwibrs}\right.}
+\newcommand{\RDb}[3]{%
+  \savebox{\Bwobrs}[\width][b]{$#3$}%
+  \savebox{\Bwibrs}[\width][b]{$\left.\usebox{\Bwobrs}\right#1$}%
+  \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
+  \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
+  \addtolength{\Lwibrs}{-\Lwobrs}%
+  \left.\usebox{\Bwibrs}\hspace*{-0.4\Lwibrs}\right#2}
+\newcommand{\Sc}{\Db{[}{[}{]}{]}}
+\newcommand{\Mo}{\Db{|}{>}{<}{|}}
+\newcommand{\MoL}{\LDb{|}{>}}
+\newcommand{\MoR}{\RDb{<}{|}}
+
+\newcommand{\car}{\mbox{$-\!\triangleright$}}
+\newcommand{\io}[1]{\iota_{#1}}
+\newcommand{\cc}{\diamond}
+
+
+%%%%%%%%%%%%% FNS
+
+\newcommand{\Wk}{\Uparrow}
+
+%%%%%%%%%%%%% Transformation
+
+\newcommand{\Transform}[3]{\textsc{Trans}\:_{\Name{#1}}
+   \interp{#2}\:\mq\:#3}
+%\:[\:#2\:\Longrightarrow\:#3\:]}
+\newcommand{\Morphism}[2]{\textsc{Morphism}\:#1\:\Longrightarrow\:#2}
+\newcommand{\MI}[1]{\begin{array}{ll} #1 \end{array}\\}
+\newcommand{\MorphItem}[2]{& #1 \:\Longrightarrow\: #2}
+
+%%%%%%%%%%%%% Stuff
+
+% Motive and methods
+
+\newcommand{\motive}{\vP}
+\newcommand{\meth}[1]{\vm_{#1}}
+
+% Tuples
+\newcommand{\tuple}[1]{\langle#1\rangle}
+\newcommand{\Tuple}[1]{\mathsf{Tuple}}
+\newcommand{\proj}{\mathsf{proj}}
+\newcommand{\app}{\mathrm{+\!+}}
+
+% Commenting out
+\newcommand{\ig}[1]{[#1]}
+\newcommand{\rem}[1]{\{\!#1\!\}}
+\newcommand{\igc}[1]{[#1]}
+\newcommand{\remc}[1]{\{\!#1\!\}}
+
+
+\newcommand{\ind}{\hspace*{0.1cm}}
+
+% Content free type
+\newcommand{\CF}{\TC{CF}}
+\newcommand{\cf}{\DC{cf}}
+
+% Error token
+\newcommand{\error}{\DC{error}}
+\newcommand{\fail}{\perp}
+
+% Constructor stripping
+\newcommand{\conarg}[2]{#1!#2}
+
+\newcommand{\Vect}{\TC{Vect}}
+\newcommand{\VectM}{\TC{Vect^-}}
+\newcommand{\Vnil}{\DC{\epsilon}}
+\newcommand{\Vcons}{\DC{::}}
+
+\newcommand{\Vsnoc}{\DC{::}}
+
+\newcommand{\VnilM}{\DC{\epsilon^-}}
+\newcommand{\VconsM}{\DC{::^-}}
+
+\newcommand{\Vnilcase}{\VV{vNilCase}}
+\newcommand{\Vconscase}{\VV{vConsCase}}
+
+\newcommand{\DSigma}{\TC{Sigma}}
+\newcommand{\Exists}{\DC{Exists}}
+
+\newcommand{\ListPair}[2]{\sig{#1}{\List\:\vA}.#2 = \FN{length}\:#1}
+\newcommand{\lpNilDef}{\lpNil{\FN{refl}\:\Z}}
+\newcommand{\lpNil}[1]{(\nil\:\vA,#1)}
+\newcommand{\lpConsDef}[3]{\lpCons{#1}{(\FN{fst\:#2})}{\FN{resp}\:(\FN{snd}\:#2)}}
+\newcommand{\lpCons}[3]{(\cons\:#1\:#2,#3)}
+\newcommand{\lp}[2]{(#1, #2)}
+
+\newcommand{\VnilTop}{\DC{vNil}^\ast}
+\newcommand{\VconsTop}{\DC{vCons}^\ast}
+
+\newcommand{\VnilBot}{\DC{\epsilon}^-}
+\newcommand{\VconsBot}{\DC{::}^-}
+
+\newcommand{\VectTop}{\TC{Vect}^\ast}
+\newcommand{\VectBot}{\TC{Vect}^-}
+
+\newcommand{\VectDrop}{\FN{vectDropIdx}}
+\newcommand{\VectRebuild}{\FN{vectRebuild}}
+
+\newcommand{\Prop}{\TC{Prop}}
+\newcommand{\Set}{\TC{Set}}
+\newcommand{\CoqType}{\TC{Type}}
+
+\newcommand{\List}{\TC{List}}
+\newcommand{\nil}{\DC{nil}}
+\newcommand{\cons}{\DC{cons}}
+
+\newcommand{\Zip}{\TC{Tsil}}
+\newcommand{\zip}{\FN{tsil}}
+\newcommand{\zipcons}{\FN{tsilcons}}
+\newcommand{\snoc}{\DC{Snoc}}
+\newcommand{\lin}{\DC{Empty}}
+
+\newcommand{\BigInt}{\TC{BigInt}}
+\newcommand{\False}{\TC{False}}
+\newcommand{\Unit}{\TC{True}}
+\newcommand{\UnitI}{\DC{()}}
+
+\newcommand{\genType}{\TC{X}}
+\newcommand{\genIndicesDec}{\tb\Hab\tB}
+\newcommand{\genIndices}{\tb}
+\newcommand{\genConArgsDec}[1]{\vec{\VV{a_#1}}\Hab\vec{\VV{A_#1}}}
+\newcommand{\genConArgs}[1]{\vec{\VV{a_#1}}}
+\newcommand{\genConIndicesDec}[1]{\vec{\VV{b_#1}}\Hab\vec{\VV{B_#1}}}
+\newcommand{\genConIndices}[1]{\vec{\VV{b_#1}}}
+\newcommand{\genCon}[1]{\DC{x}_#1}
+
+\newcommand{\genTypeTop}{\TC{X^\ast}}
+\newcommand{\genTypeBot}{\TC{X^-}}
+
+\newcommand{\genTypeDrop}{\FN{XDropIdx}}
+\newcommand{\genTypeRebuild}{\FN{XRebuild}}
+
+\newcommand{\HTerm}{\texttt{Term}}
+\newcommand{\Term}{\TC{Term}}
+\newcommand{\Var}{\DC{var}}
+\newcommand{\Lam}{\DC{lam}}
+\newcommand{\App}{\DC{app}}
+\newcommand{\TermM}{\TC{Term^-}}
+\newcommand{\VarM}{\DC{var^-}}
+\newcommand{\LamM}{\DC{lam^-}}
+\newcommand{\AppM}{\DC{app^-}}
+\newcommand{\Env}{\TC{Env}}
+\newcommand{\SType}{\TC{STy}}
+\newcommand{\farrow}{\Rightarrow}
+\newcommand{\lookup}{\FN{lookup}}
+
+\newcommand{\source}{\Lang{TT}}
+\newcommand{\target}{\Lang{ExTT}}
+\newcommand{\runtime}{\Lang{RunTT}}
+
+\newcommand{\lt}{\TC{<}}
+\newcommand{\ltO}{\DC{ltO}}
+\newcommand{\ltS}{\DC{ltS}}
+
+\newcommand{\interp}[1]{\llbracket #1 \rrbracket}
+\newcommand{\inferrable}[2]{\FN{inferrable}(#1,#2)}
+\newcommand{\mkPat}{\FN{mkPat}}
+
+\newcommand{\FinM}{\TC{Fin^-}}
+\newcommand{\fzM}{\DC{f0^-}}
+\newcommand{\fsM}{\DC{fs^-}}
+
+\newcommand{\concat}{\mathrm{++}}
+
+%\newcommand{\bottom}{\perp}
+
+% Reductions
+
+\newcommand{\reduces}{\rhd}
+\newcommand{\translation}{\Rightarrow}
+%\newcommand{\reducesn}[1]{\reduces\hspace*{-0.15cm}_{#1}}
+%\newcommand{\reducesto}{\reduces\hspace*{-0.15cm}^{*}}
+\newcommand{\reducesn}[1]{\reduces_{#1}}
+\newcommand{\reducesto}{\reduces^{*}}
+
+% Equality
+
+\newcommand{\Refl}{\DC{refl}}
+\newcommand{\leZ}{\DC{O_{\le}}}
+\newcommand{\leS}{\DC{S_{\le}}}
+
+% Random elimination things
+
+\newcommand{\lte}{\TC{\leq}}
+\newcommand{\lten}{\DC{leN}}
+\newcommand{\lteO}{\DC{leO}}
+\newcommand{\lteS}{\DC{leS}}
+
+\newcommand{\ltelim}{\Elim{\lt}}
+\newcommand{\leelim}{\Elim{\lte}}
+
+\newcommand{\dD}{\TC{D}}
+\newcommand{\delim}{\Elim{\TC{D}}}
+\newcommand{\drec}{\Rec{\TC{D}}}
+\newcommand{\dcase}{\Cases{\TC{D}}}
+\newcommand{\dview}{\View{\TC{D}}}
+\newcommand{\dmemo}{\Memo{\TC{D}}}
+\newcommand{\natrec}{\Rec{\Nat}}
+\newcommand{\natmemo}{\Memo{\Nat}}
+\newcommand{\natmemogen}{\Nat\textbf{-MemoGen}}
+\newcommand{\natelim}{\Elim{\Nat}}
+\newcommand{\boolcase}{\Cases{\Bool}}
+\newcommand{\vectrec}{\Rec{\Vect}}
+\newcommand{\vectelim}{\Elim{\Vect}}
+\newcommand{\listrec}{\Rec{\List}}
+\newcommand{\listelim}{\Elim{\List}}
+\newcommand{\finrec}{\Rec{\Fin}}
+\newcommand{\finelim}{\Elim{\Fin}}
+\newcommand{\natcase}{\Cases{\Nat}}
+\newcommand{\vectcase}{\Cases{\Vect}}
+\newcommand{\natdoublerec}{\Nat\textbf{-double-elim}}
+\newcommand{\eqelim}{=\textbf{-elim}}
+\newcommand{\falsecase}{\Cases{\False}}
+
+% Code
+\newcommand{\Haskell}[1]{\begin{quotation}\begin{verbatim}#1\end{verbatim}\end{quotation}}
+
+% Quicksort
+
+\newcommand{\QSView}{\TC{QuickSort}}
+\newcommand{\qsempty}{\DC{empty}}
+\newcommand{\partition}{\DC{partition}}
+\newcommand{\qsview}{\FN{mkQuickSort}}
+
+% More gubbins
+
+\newcommand{\converts}{\simeq}
+\newcommand{\cumul}{\preceq}
+\newcommand{\whnf}{\Downarrow}
+\newcommand{\elem}{\in}
+\newcommand{\proves}{\vdash}
+\newcommand{\biimplies}{\Longleftrightarrow}
+
+\newcommand{\lc}{\lambda_{\mathsf{AC}}}
+\newcommand{\zed}{\mathbb{Z}}
+
+% Haskell keywords
+
+\newcommand{\hdata}{\mathtt{data}}
+\newcommand{\newtype}{\mathtt{newtype}}
+%\newcommand{\htype}{\mathtt{type}}
+
+\newcommand{\HTC}[1]{\mathtt{#1}}
+\newcommand{\HDC}[1]{\mathtt{#1}}
+
+% Nobby
+
+\newcommand{\Value}{\HTC{Value}}
+\newcommand{\VGamma}{\HTC{Env}}
+\newcommand{\Ctxt}{\HTC{Ctxt}}
+\newcommand{\Defs}{\HTC{Defs}}
+\newcommand{\ECtxt}{\HTC{ECtxt}}
+\newcommand{\TCtxt}{\HTC{TCtxt}}
+\newcommand{\VG}{\HDC{Env}}
+\newcommand{\Model}{\HTC{Model}}
+\newcommand{\Const}{\HTC{Const}}
+\newcommand{\Normal}{\HTC{Normal}}
+\newcommand{\Scope}{\HTC{Scope}}
+\newcommand{\Kripke}{\HTC{Kripke}}
+\newcommand{\Weakening}{\HTC{Weakening}}
+\newcommand{\Ready}{\HTC{Ready}}
+\newcommand{\Blocked}{\HTC{Blocked}}
+\newcommand{\Spine}{\HTC{Spine}}
+
+\newcommand{\BV}{\HDC{BV}}
+\newcommand{\BCon}{\HDC{BCon}}
+\newcommand{\BTyCon}{\HDC{BTyCon}}
+\newcommand{\RCon}{\HDC{RCon}}
+\newcommand{\RTyCon}{\HDC{RTyCon}}
+\newcommand{\BElim}{\HDC{BElim}}
+\newcommand{\DV}{\HDC{V}}
+\newcommand{\DP}{\HDC{P}}
+
+\newcommand{\MR}{\HDC{R}}
+\newcommand{\MB}{\HDC{B}}
+\newcommand{\DSc}{\HDC{Sc}}
+\newcommand{\DKr}{\HDC{Kr}}
+\newcommand{\DWk}{\HDC{Wk}}
+\newcommand{\DSnoc}{\HDC{;}}
+\newcommand{\DType}{\HDC{Type}}
+\newcommand{\DName}{\HDC{Name}}
+\newcommand{\DInt}{\HDC{Int}}
+\newcommand{\DString}{\HDC{String}}
+\newcommand{\DElim}{\HDC{Elim}}
+\newcommand{\Empty}{\HDC{\emptyset}}
+
+\newcommand{\ConCode}{\HTC{ConCode}}
+\newcommand{\ElimRule}{\HTC{ElimRule}}
+
+\newcommand{\DConst}{\HDC{Const}}
+\newcommand{\DCon}{\HDC{Con}}
+\newcommand{\DTyCon}{\HDC{TyCon}}
+\newcommand{\RConst}{\HDC{RConst}}
+\newcommand{\RLam}{\HDC{RLam}}
+\newcommand{\RPi}{\HDC{RPi}}
+\newcommand{\DLam}{\HDC{Lam}}
+\newcommand{\DLet}{\HDC{Let}}
+\newcommand{\DPi}{\HDC{Pi}}
+\newcommand{\DApp}{\HDC{App}}
+
+\newcommand{\TMaybe}{\HTC{Maybe}}
+\newcommand{\DNothing}{\HDC{Nothing}}
+\newcommand{\DJust}{\HDC{Just}}
+
+
+% G-machine and heap
+
+\newcommand{\PUSH}{\mathsf{PUSH}}
+\newcommand{\PUSHNAME}{\mathsf{PUSHNAME}}
+\newcommand{\POP}{\mathsf{DISCARD}}
+\newcommand{\PUSHFUN}{\mathsf{PUSHFUN}}
+\newcommand{\APPLY}{\mathsf{MKAP}}
+\newcommand{\EVAL}{\mathsf{EVAL}}
+\newcommand{\GCON}{\mathsf{MKCON}}
+\newcommand{\GTUP}{\mathsf{MKTUP}}
+\newcommand{\GTYPE}{\mathsf{MKTYPE}}
+\newcommand{\UPDATE}{\mathsf{UPDATE}}
+\newcommand{\RET}{\mathsf{RET}}
+\newcommand{\UNWIND}{\mathsf{UNWIND}}
+\newcommand{\CASEJUMP}{\mathsf{CASEJUMP}}
+\newcommand{\LABEL}{\mathsf{LABEL}}
+\newcommand{\MOVE}{\mathsf{MOVE}}
+\newcommand{\JUMP}{\mathsf{JUMP}}
+\newcommand{\SPLIT}{\mathsf{SPLIT}}
+\newcommand{\SQUEEZE}{\mathsf{SQUEEZE}}
+\newcommand{\JFUN}{\mathsf{JFUN}}
+\newcommand{\PROJ}{\mathsf{PROJ}}
+\newcommand{\ERROR}{\mathsf{ERROR}}
+\newcommand{\SLIDE}{\mathsf{SLIDE}}
+\newcommand{\ALLOC}{\mathsf{ALLOC}}
+
+\newcommand{\PUSHBIG}{\mathsf{PUSHBIG}}
+\newcommand{\PUSHBASIC}{\mathsf{PUSHBASIC}}
+\newcommand{\PUSHINT}{\mathsf{PUSHINT}}
+\newcommand{\PUSHBOOL}{\mathsf{PUSHBOOL}}
+\newcommand{\GET}{\mathsf{GET}}
+\newcommand{\MKINT}{\mathsf{MKINT}}
+\newcommand{\MKBOOL}{\mathsf{MKBOOL}}
+\newcommand{\ADD}{\mathsf{ADD}}
+\newcommand{\SUB}{\mathsf{SUB}}
+\newcommand{\MULT}{\mathsf{MULT}}
+\newcommand{\LT}{\mathsf{LT}}
+\newcommand{\EQ}{\mathsf{EQ}}
+\newcommand{\GT}{\mathsf{GT}}
+\newcommand{\JTRUE}{\mathsf{JTRUE}}
+
+\newcommand{\APP}{\mathsf{APP}}
+\newcommand{\FUN}{\mathsf{FUN}}
+\newcommand{\CON}{\mathsf{CON}}
+\newcommand{\TYCON}{\mathsf{TYCON}}
+\newcommand{\TUP}{\mathsf{TUP}}
+\newcommand{\TYPE}{\mathsf{TYPE}}
+\newcommand{\INT}{\mathsf{INT}}
+\newcommand{\BIGINT}{\mathsf{BIGINT}}
+\newcommand{\BOOL}{\mathsf{BOOL}}
+\newcommand{\HOLE}{\mathsf{HOLE}}
+
+% G machine translation scheme
+
+\newcommand{\sinterp}[1]{\mathcal{S}\interp{#1}}
+\newcommand{\sinterpm}[1]{\mathcal{S}\AR{\interp{#1}}}
+\newcommand{\einterp}[3]{\mathcal{E}\interp{#1}\:#2\:#3}
+\newcommand{\cinterp}[3]{\mathcal{C}\interp{#1}\:#2\:#3}
+\newcommand{\binterp}[3]{\mathcal{B}\interp{#1}\:#2\:#3}
+\newcommand{\rinterp}[3]{\mathcal{R}\interp{#1}\:#2\:#3}
+\newcommand{\iinterp}[3]{\mathcal{I}\interp{#1}\:#2\:#3}
+\newcommand{\len}[1]{\MO{length}(#1)}
+
+\newcommand{\casecomp}[2]{\mathcal{I}(#1,\left\{\ARc{#2}\right\})}
+\newcommand{\casecompA}[3]{\mathcal{I}(#1,\left\{\ARc{#2}\right\}[#3])}
+\newcommand{\ischeme}{\mathcal{I}}
+
+% tail call markup
+
+\newcommand{\tailcall}{\mathsf{tail}}
+
+% Trees
+
+\newcommand{\Tree}{\TC{Tree}}
+\newcommand{\Leaf}{\DC{Leaf}}
+\newcommand{\Node}{\DC{Node}}
+\newcommand{\treecase}{\Cases{\Tree}}
+
+% Languages
+
+\newcommand{\Coq}{\textsc{Coq}}
+\newcommand{\Lego}{\textsc{Lego}}
+\newcommand{\Oleg}{\textsc{Oleg}}
+\newcommand{\Alf}{\textsc{Alf}}
+\newcommand{\Epigram}{\textsc{Epigram}}
+\newcommand{\SystemF}{System $\mathcal{F}$}
+\newcommand{\Iswim}{\textsc{Iswim}}
+\newcommand{\Cynthia}{\textit{C$^Y$\hspace*{-0.1cm}NTHIA}}
+
+% Accessibility
+
+\newcommand{\Acc}{\TC{Acc}}
+\newcommand{\acc}{\DC{acc}}
+\newcommand{\qsAcc}{\TC{qsAcc}}
+\newcommand{\qsNil}{\DC{qsNil}}
+\newcommand{\qsCons}{\DC{qsCons}}
+\newcommand{\allQsAcc}{\FN{allQsAcc}}
+
+% Lazy shortcuts
+
+\newcommand{\naive}{na\"{\i}ve}
+\newcommand{\Naive}{Na\"{\i}ve}
+
+% Conor's bits
+
+\newcommand{\remem}[1]{\left|#1\right|}
+\newcommand{\idsb}{\MO{id}}
+\newcommand{\ang}[1]{\langle#1\rangle}
+
+\newcommand{\vePm}[1]{\vP #1 \vm_{\Vnil} #1 \vm_{\Vcons}}%
+\newcommand{\vcrhs}{\vm_{\Vcons}\:\vk\:\va\:\vv\:%
+                     (\vectelim\:\vA\:\vk\:\vv\:\vePm{\:})}%
+
+\newcommand{\igV}[2]{#1^{\ig{#2}}}
+\newcommand{\remV}[2]{#1^{\rem{#2}}}
+
+\newcommand{\FIXME}[1]{[\textbf{FIXME}: #1]}
+%\newcommand{\FIXME}[1]{\wibble}
+
+% More gubbins
+
+\newcommand{\Between}{\TC{between}}
+\newcommand{\bZ}{\DC{bO}}
+\newcommand{\bZZS}{\DC{bOOs}}
+\newcommand{\bZSS}{\DC{b0ss}}
+\newcommand{\bSSS}{\DC{bsss}}
+\newcommand{\betelim}{\Elim{\Between}}
+\newcommand{\betrhs}[1]{\motive#1\meth{\bZ}#1\meth{\bZZS}#1\meth{\bZSS}#1\meth{\bSSS}}
+
+
+\newcommand{\valenv}{\TC{ValEnv}}
+\newcommand{\vempty}{\DC{empty}}
+\newcommand{\vextend}{\DC{extend}}
+
+\newcommand{\EpiVal}{\TC{Epigram}}
+\newcommand{\unsafeCoerce}{\HF{unsafeCoerce\mbox{\texttt{\#}}}}
+
+\newcommand{\qq}{\mbox{\texttt{"}}}
+\newcommand{\impossible}{\RW{Impossible}}
+
+\newcommand{\Real}{\mathbb{R}}
+
+\newcommand{\DoubleRec}{\TC{DoubleElim}}
+\newcommand{\DoubleOn}{\DC{Double_{\Z\vn}}}
+\newcommand{\DoubleSO}{\DC{Double_{\suc\Z}}}
+\newcommand{\DoubleSS}{\DC{Double_{\suc\suc}}}
+
+\newcommand{\doublerec}{\textbf{double-elim}}
+
+\newcommand{\set}{\TC{DList}}
+\newcommand{\setuser}{\TC{DListTop}}
+\newcommand{\setempty}{\emptyset}
+\newcommand{\setinsert}{\DC{insert}}
+
+
+%%%% Type systems
+
+\newcommand{\stlc}{\lambda\hspace*{-0.15cm}\to}
+\newcommand{\plc}{\lambda2}
+\newcommand{\dlc}{\lambda{}P}
+
+\newcommand{\EC}{\mathcal{E}}
+
+%%%% reductions
+
+\newcommand{\betared}{\iq\hspace*{-0.15cm}_{\beta}}
+\newcommand{\deltared}{\iq\hspace*{-0.15cm}_{\delta}}
+\newcommand{\gammared}{\iq\hspace*{-0.15cm}_{\gamma}}
+\newcommand{\etared}{\iq\hspace*{-0.15cm}_{\eta}}
+\newcommand{\iotared}{\iq\hspace*{-0.15cm}_{\iota}}
+\newcommand{\rhored}{\iq\hspace*{-0.15cm}_{\rho}}
+
+%%%% ExTT rules
+
+\newcommand{\exconverts}{\stackrel{\mathsf{Ex}}{\converts}}
+\newcommand{\excumul}{\stackrel{\mathsf{Ex}}{\cumul}}
+\newcommand{\exequiv}{\stackrel{\mathsf{Ex}}{\equiv}}
+\newcommand{\exreduces}{\stackrel{\mathsf{Ex}}\reduces}
+\newcommand{\exreducesto}{\stackrel{\mathsf{Ex}}{\reducesto}}
+\newcommand{\exreducesn}[1]{\exreduces_{#1}}
+
+\newcommand{\ttequiv}{\stackrel{\mathsf{TT}}{\equiv}}
+\newcommand{\ttreduces}{\stackrel{\mathsf{TT}}\reduces}
+\newcommand{\ttreducesn}[1]{\ttreduces_{#1}}
+
+%%% Type synthesis
+
+\newcommand{\hastype}{\Longrightarrow}
+\newcommand{\whnfs}{\twoheadrightarrow}
+\newcommand{\conv}{\converts}
+
+\newcommand{\exhastype}{\stackrel{\mathsf{Ex}}{\hastype}}
+\newcommand{\exwhnfs}{\stackrel{\mathsf{Ex}}{\whnfs}}
+\newcommand{\exconv}{\stackrel{\mathsf{Ex}}{\conv}}
+\newcommand{\exproves}{\stackrel{\mathsf{Ex}}{\proves}}
+
+\newcommand{\tthastype}{\stackrel{\mathsf{TT}}{\hastype}}
+\newcommand{\ttwhnfs}{\stackrel{\mathsf{TT}}{\whnfs}}
+\newcommand{\ttconv}{\stackrel{\mathsf{TT}}{\conv}}
+\newcommand{\ttproves}{\stackrel{\mathsf{TT}}{\proves}}
+
+%%% Lightning
+
+\newcommand{\light}[1]{\lightning^{#1}}
+\newcommand{\LHab}[1]{\pad{\;}{:^{#1}}}
+\newcommand{\llam}[3]{\lambda#1\pad{\!}{:}^{#2}#3}
+\newcommand{\lall}[3]{\forall#1\pad{\!}{:}^{#2}#3}
+\newcommand{\lapp}[3]{#1(#2)^{#3}}
+\newcommand{\larg}[2]{(#1)^{#2}}
+
+\newcommand{\RName}[1]{\hspace*{0.1in}\mathsf{#1}}
diff --git a/papers/tutorial/programming.tex b/papers/tutorial/programming.tex
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/programming.tex
@@ -0,0 +1,6 @@
+\section{Programming in $\source$}
+
+% Types, definitions
+% data structures, pattern matching, well founded definitions
+% parameters, indices, inductive families
+
diff --git a/papers/tutorial/theoremproving.tex b/papers/tutorial/theoremproving.tex
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/theoremproving.tex
@@ -0,0 +1,5 @@
+\section{Theorem Proving}
+
+% Elimination rules
+% Basic tactics
+
diff --git a/papers/tutorial/tutorial.tex b/papers/tutorial/tutorial.tex
new file mode 100644
--- /dev/null
+++ b/papers/tutorial/tutorial.tex
@@ -0,0 +1,63 @@
+\documentclass{article}
+%\documentclass[orivec,dvips,10pt]{llncs}
+
+\usepackage{epsfig}
+\usepackage{path}
+\usepackage{url}
+\usepackage{amsmath,amssymb} 
+
+\newenvironment{template}{\sffamily}
+
+\usepackage{graphics,epsfig}
+\usepackage{stmaryrd}
+
+\input{macros.ltx}
+\input{library.ltx}
+
+\NatPackage
+
+\newcommand{\Ivor}{\textsc{Ivor}}
+\newcommand{\Funl}{\textsc{Funl}}
+\newcommand{\Agda}{\textsc{Agda}}
+
+\newcommand{\mysubsubsection}[1]{
+\noindent
+\textbf{#1}
+}
+\newcommand{\hdecl}[1]{\texttt{#1}}
+
+\begin{document}
+
+\title{\Ivor{}, a Tutorial}
+\author{Edwin Brady}
+
+%\institute{School of Computer Science, \\
+% University of St Andrews, St Andrews, Scotland. \\ \texttt{Email: eb@cs.st-andrews.ac.uk}.\\
+%\texttt{Tel: +44-1334-463253}, \texttt{Fax: +44-1334-463278} \vspace{0.1in}
+%}
+ 
+\maketitle
+
+\input{introduction}
+
+% Structure:
+
+% Programming in TT
+\input{programming}
+
+% Theorem proving in TT
+\input{theoremproving}
+
+% Haskell library
+\input{hslibrary}
+
+\bibliographystyle{abbrv}
+\begin{small}
+\bibliography{../bib/literature.bib}
+
+%\appendix
+
+%\input{code}
+
+\end{small}
+\end{document}
